From 5b37696fda07b8acf37beba3853f83106397ccdf Mon Sep 17 00:00:00 2001 From: Satyam Sharma Date: Tue, 17 Jul 2007 00:24:23 +0530 Subject: [PATCH] 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 --- fs/utimes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/utimes.c b/fs/utimes.c index b3c8895246..83a7e69e70 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; -- 2.39.5