Skip to content

Commit

Permalink
utime(s): Honour CAP_FOWNER when times==NULL
Browse files Browse the repository at this point in the history
do_utimes() does not honour CAP_FOWNER when times==NULL.
Trivial and obvious one-line fix.

Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Satyam Sharma authored and Linus Torvalds committed Jul 16, 2007
1 parent 9793c32 commit 5b37696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/utimes.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
if (IS_IMMUTABLE(inode))
goto dput_and_out;

if (current->fsuid != inode->i_uid) {
if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) {
if (f) {
if (!(f->f_mode & FMODE_WRITE))
goto dput_and_out;
Expand Down

0 comments on commit 5b37696

Please sign in to comment.