提交 173c8401 编写于 作者: A Al Viro

switch fchmod() to fdget

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 7e3fb584
......@@ -485,14 +485,13 @@ static int chmod_common(struct path *path, umode_t mode)
SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
{
struct file * file;
struct fd f = fdget(fd);
int err = -EBADF;
file = fget(fd);
if (file) {
audit_inode(NULL, file->f_path.dentry, 0);
err = chmod_common(&file->f_path, mode);
fput(file);
if (f.file) {
audit_inode(NULL, f.file->f_path.dentry, 0);
err = chmod_common(&f.file->f_path, mode);
fdput(f);
}
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册