diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -111,7 +111,7 @@ static long do_sys_truncate(const char __user *pathname, loff_t length) | |||
111 | 111 | ||
112 | error = locks_verify_truncate(inode, NULL, length); | 112 | error = locks_verify_truncate(inode, NULL, length); |
113 | if (!error) | 113 | if (!error) |
114 | error = security_path_truncate(&path, length, 0); | 114 | error = security_path_truncate(&path); |
115 | if (!error) | 115 | if (!error) |
116 | error = do_truncate(path.dentry, length, 0, NULL); | 116 | error = do_truncate(path.dentry, length, 0, NULL); |
117 | 117 | ||
@@ -166,8 +166,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) | |||
166 | 166 | ||
167 | error = locks_verify_truncate(inode, file, length); | 167 | error = locks_verify_truncate(inode, file, length); |
168 | if (!error) | 168 | if (!error) |
169 | error = security_path_truncate(&file->f_path, length, | 169 | error = security_path_truncate(&file->f_path); |
170 | ATTR_MTIME|ATTR_CTIME); | ||
171 | if (!error) | 170 | if (!error) |
172 | error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); | 171 | error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); |
173 | out_putf: | 172 | out_putf: |
@@ -368,7 +367,7 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) | |||
368 | if (error) | 367 | if (error) |
369 | goto out; | 368 | goto out; |
370 | 369 | ||
371 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); | 370 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR); |
372 | if (error) | 371 | if (error) |
373 | goto dput_and_out; | 372 | goto dput_and_out; |
374 | 373 | ||
@@ -397,7 +396,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) | |||
397 | if (!S_ISDIR(inode->i_mode)) | 396 | if (!S_ISDIR(inode->i_mode)) |
398 | goto out_putf; | 397 | goto out_putf; |
399 | 398 | ||
400 | error = inode_permission(inode, MAY_EXEC | MAY_ACCESS); | 399 | error = inode_permission(inode, MAY_EXEC | MAY_CHDIR); |
401 | if (!error) | 400 | if (!error) |
402 | set_fs_pwd(current->fs, &file->f_path); | 401 | set_fs_pwd(current->fs, &file->f_path); |
403 | out_putf: | 402 | out_putf: |
@@ -415,7 +414,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) | |||
415 | if (error) | 414 | if (error) |
416 | goto out; | 415 | goto out; |
417 | 416 | ||
418 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); | 417 | error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR); |
419 | if (error) | 418 | if (error) |
420 | goto dput_and_out; | 419 | goto dput_and_out; |
421 | 420 | ||