]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/utimes.c
Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check
[net-next-2.6.git] / fs / utimes.c
index b3c88952465fa28cce7e0bb213fceaf59873fdf9..682eb63b20ad3c4c7452870c3d9e6e832aea21e0 100644 (file)
@@ -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 (!is_owner_or_cap(inode)) {
                        if (f) {
                                if (!(f->f_mode & FMODE_WRITE))
                                        goto dput_and_out;