diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-24 06:58:56 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-01-14 09:05:26 -0500 |
commit | 6d125529c6cbfe570ce3bf9a0728548f087499da (patch) | |
tree | 89ba434f76d224741bd0e0b0ef02b10a4ff95136 /security | |
parent | 4ecf09fd3a7c8858198875171b684c73338fad83 (diff) | |
download | linux-stable-6d125529c6cbfe570ce3bf9a0728548f087499da.tar.gz linux-stable-6d125529c6cbfe570ce3bf9a0728548f087499da.tar.bz2 linux-stable-6d125529c6cbfe570ce3bf9a0728548f087499da.zip |
Fix ACC_MODE() for real
commit 5300990c0370e804e49d9a59d928c5d53fb73487 had stepped on a rather
nasty mess: definitions of ACC_MODE used to be different. Fixed the
resulting breakage, converting them to variant that takes O_... value;
all callers have that and it actually simplifies life (see tomoyo part
of changes).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r-- | security/tomoyo/tomoyo.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c index 8a00ade85166..2aceebf5f354 100644 --- a/security/tomoyo/tomoyo.c +++ b/security/tomoyo/tomoyo.c @@ -80,9 +80,8 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm) return tomoyo_find_next_domain(bprm); /* * Read permission is checked against interpreters using next domain. - * '1' is the result of open_to_namei_flags(O_RDONLY). */ - return tomoyo_check_open_permission(domain, &bprm->file->f_path, 1); + return tomoyo_check_open_permission(domain, &bprm->file->f_path, O_RDONLY); } static int tomoyo_path_truncate(struct path *path, loff_t length, @@ -184,10 +183,6 @@ static int tomoyo_file_fcntl(struct file *file, unsigned int cmd, static int tomoyo_dentry_open(struct file *f, const struct cred *cred) { int flags = f->f_flags; - - if ((flags + 1) & O_ACCMODE) - flags++; - flags |= f->f_flags & (O_APPEND | O_TRUNC); /* Don't check read permission here if called from do_execve(). */ if (current->in_execve) return 0; |