]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
utime(s): Honour CAP_FOWNER when times==NULL
authorSatyam Sharma <ssatyam@cse.iitk.ac.in>
Mon, 16 Jul 2007 18:54:23 +0000 (00:24 +0530)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 19:14:08 +0000 (12:14 -0700)
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>
fs/utimes.c

index b3c88952465fa28cce7e0bb213fceaf59873fdf9..83a7e69e706caeaf576616eeae53d6d5bcfadac6 100644 (file)
@@ -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;