Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42843
b: refs/heads/master
c: 93f210d
h: refs/heads/master
i:
  42841: 13d518b
  42839: 8389d7a
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 7, 2006
1 parent c0c54d3 commit a70452e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5738ceed46782aea7663d62cb6398eb05fc4ce0
refs/heads/master: 93f210dd9e614ddab7ecef0b4c9ba6ad3720d860
6 changes: 5 additions & 1 deletion trunk/fs/ext2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
if (!S_ISDIR(inode->i_mode))
flags &= ~EXT2_DIRSYNC_FL;

mutex_lock(&inode->i_mutex);
oldflags = ei->i_flags;

/*
Expand All @@ -53,13 +54,16 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
* This test looks nicer. Thanks to Pauline Middelink
*/
if ((flags ^ oldflags) & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) {
if (!capable(CAP_LINUX_IMMUTABLE))
if (!capable(CAP_LINUX_IMMUTABLE)) {
mutex_unlock(&inode->i_mutex);
return -EPERM;
}
}

flags = flags & EXT2_FL_USER_MODIFIABLE;
flags |= oldflags & ~EXT2_FL_USER_MODIFIABLE;
ei->i_flags = flags;
mutex_unlock(&inode->i_mutex);

ext2_set_inode_flags(inode);
inode->i_ctime = CURRENT_TIME_SEC;
Expand Down

0 comments on commit a70452e

Please sign in to comment.