rename patch (v2.6.22.24-op1)
[linux-2.6.22.y-op-patches.git] / queue-2.6.22.y / 02-vfs-utimes-Honour-CAP_FOWNER-when-times-NULL.patch
blob5077511f10022f28787801265ea591e80094f0e5
1 From 5b37696fda07b8acf37beba3853f83106397ccdf Mon Sep 17 00:00:00 2001
2 From: Satyam Sharma <ssatyam@cse.iitk.ac.in>
3 Date: Tue, 17 Jul 2007 00:24:23 +0530
4 Subject: [PATCH] utime(s): Honour CAP_FOWNER when times==NULL
6 do_utimes() does not honour CAP_FOWNER when times==NULL.
7 Trivial and obvious one-line fix.
9 Signed-off-by: Satyam Sharma <ssatyam@cse.iitk.ac.in>
10 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 diff --git a/fs/utimes.c b/fs/utimes.c
13 index b3c8895..83a7e69 100644
14 --- a/fs/utimes.c
15 +++ b/fs/utimes.c
16 @@ -106,7 +106,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
17 if (IS_IMMUTABLE(inode))
18 goto dput_and_out;
20 - if (current->fsuid != inode->i_uid) {
21 + if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) {
22 if (f) {
23 if (!(f->f_mode & FMODE_WRITE))
24 goto dput_and_out;