TOMOYO: Use common code for open and mkdir etc.
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Wed, 16 Jun 2010 07:20:24 +0000 (16:20 +0900)
committerJames Morris <jmorris@namei.org>
Mon, 2 Aug 2010 05:34:31 +0000 (15:34 +1000)
tomoyo_file_perm() and tomoyo_path_permission() are similar.
We can embed tomoyo_file_perm() into tomoyo_path_permission().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
security/tomoyo/common.h
security/tomoyo/domain.c
security/tomoyo/file.c

index c8ab755..2034540 100644 (file)
@@ -880,7 +880,7 @@ int tomoyo_write_memory_quota(struct tomoyo_io_buffer *head);
 
 /* Initialize mm related code. */
 void __init tomoyo_mm_init(void);
-int tomoyo_check_exec_perm(struct tomoyo_request_info *r,
+int tomoyo_path_permission(struct tomoyo_request_info *r, u8 operation,
                           const struct tomoyo_path_info *filename);
 int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
                                 struct path *path, const int flag);
index fe621af..35317e7 100644 (file)
@@ -960,7 +960,7 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm)
        }
 
        /* Check execute permission. */
-       retval = tomoyo_check_exec_perm(&r, &rn);
+       retval = tomoyo_path_permission(&r, TOMOYO_TYPE_EXECUTE, &rn);
        if (retval == TOMOYO_RETRY_REQUEST)
                goto retry;
        if (retval < 0)
Simple merge