Commit 5b37696f authored by Satyam Sharma's avatar Satyam Sharma Committed by Linus Torvalds

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: default avatarSatyam Sharma <ssatyam@cse.iitk.ac.in>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9793c326
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment