From: Satyam Sharma Date: Mon, 16 Jul 2007 18:54:23 +0000 (+0530) Subject: utime(s): Honour CAP_FOWNER when times==NULL X-Git-Tag: v2.6.23-rc1~775 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b37696fda07b8acf37beba3853f83106397ccdf;p=thirdparty%2Fkernel%2Flinux.git utime(s): Honour CAP_FOWNER when times==NULL do_utimes() does not honour CAP_FOWNER when times==NULL. Trivial and obvious one-line fix. Signed-off-by: Satyam Sharma Signed-off-by: Linus Torvalds --- diff --git a/fs/utimes.c b/fs/utimes.c index b3c88952465fa..83a7e69e706ca 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -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;