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: v6.6-pxa1908~53035 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=5b37696fda07b8acf37beba3853f83106397ccdf;p=linux.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 b3c88952465f..83a7e69e706c 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;