Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -106,7 +106,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
                if (IS_IMMUTABLE(inode))
                if (IS_IMMUTABLE(inode))
                        goto dput_and_out;
                        goto dput_and_out;


		if (current->fsuid != inode->i_uid) {
		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) {
			if (f) {
			if (f) {
				if (!(f->f_mode & FMODE_WRITE))
				if (!(f->f_mode & FMODE_WRITE))
					goto dput_and_out;
					goto dput_and_out;