Skip to content
Snippets Groups Projects
Commit 5b37696f authored by Satyam Sharma's avatar Satyam Sharma Committed by Linus Torvalds
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment