提交 5b37696f 编写于 作者: S Satyam Sharma 提交者: Linus Torvalds

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: NSatyam Sharma <ssatyam@cse.iitk.ac.in>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 9793c326
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册