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