Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58254
b: refs/heads/master
c: 1e5de28
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jul 8, 2007
1 parent 0c37c0f commit b05bb4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e99325b462ba18075768582621af74a6b79d2a5
refs/heads/master: 1e5de2837c166535f9bb4232bfe97ea1f9fc7a1c
13 changes: 10 additions & 3 deletions trunk/fs/utimes.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,16 @@ 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 &&
(error = vfs_permission(&nd, MAY_WRITE)) != 0)
goto dput_and_out;
if (current->fsuid != inode->i_uid) {
if (f) {
if (!(f->f_mode & FMODE_WRITE))
goto dput_and_out;
} else {
error = vfs_permission(&nd, MAY_WRITE);
if (error)
goto dput_and_out;
}
}
}
mutex_lock(&inode->i_mutex);
error = notify_change(dentry, &newattrs);
Expand Down

0 comments on commit b05bb4d

Please sign in to comment.