From 5a8f15c531ec85e942c016baf694cea97674c777 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Fri, 19 Jun 2009 14:13:27 +0900 Subject: [PATCH] --- yaml --- r: 157298 b: refs/heads/master c: 56f8c9bc410deb55f21698e6a0d59f559ae1d794 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/security/tomoyo/domain.c | 10 +++++----- trunk/security/tomoyo/tomoyo.c | 10 ++-------- trunk/security/tomoyo/tomoyo.h | 3 +-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 50df1abcbc9d..f6a9c3d06a55 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ccf135f509abdbf607e9a68f08ddeee2c66dc36e +refs/heads/master: 56f8c9bc410deb55f21698e6a0d59f559ae1d794 diff --git a/trunk/security/tomoyo/domain.c b/trunk/security/tomoyo/domain.c index e68b1052354b..fcf52accce2b 100644 --- a/trunk/security/tomoyo/domain.c +++ b/trunk/security/tomoyo/domain.c @@ -786,13 +786,11 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * /** * tomoyo_find_next_domain - Find a domain. * - * @bprm: Pointer to "struct linux_binprm". - * @next_domain: Pointer to pointer to "struct tomoyo_domain_info". + * @bprm: Pointer to "struct linux_binprm". * * Returns 0 on success, negative value otherwise. */ -int tomoyo_find_next_domain(struct linux_binprm *bprm, - struct tomoyo_domain_info **next_domain) +int tomoyo_find_next_domain(struct linux_binprm *bprm) { /* * This function assumes that the size of buffer returned by @@ -914,9 +912,11 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm, tomoyo_set_domain_flag(old_domain, false, TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED); out: + if (!domain) + domain = old_domain; + bprm->cred->security = domain; tomoyo_free(real_program_name); tomoyo_free(symlink_program_name); - *next_domain = domain ? domain : old_domain; tomoyo_free(tmp); return retval; } diff --git a/trunk/security/tomoyo/tomoyo.c b/trunk/security/tomoyo/tomoyo.c index 3194d09fe0f4..35a13e7915e4 100644 --- a/trunk/security/tomoyo/tomoyo.c +++ b/trunk/security/tomoyo/tomoyo.c @@ -61,14 +61,8 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm) * Execute permission is checked against pathname passed to do_execve() * using current domain. */ - if (!domain) { - struct tomoyo_domain_info *next_domain = NULL; - int retval = tomoyo_find_next_domain(bprm, &next_domain); - - if (!retval) - bprm->cred->security = next_domain; - return retval; - } + if (!domain) + 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). diff --git a/trunk/security/tomoyo/tomoyo.h b/trunk/security/tomoyo/tomoyo.h index 0fd588a629cf..cd6ba0bf7069 100644 --- a/trunk/security/tomoyo/tomoyo.h +++ b/trunk/security/tomoyo/tomoyo.h @@ -31,8 +31,7 @@ int tomoyo_check_2path_perm(struct tomoyo_domain_info *domain, struct path *path2); int tomoyo_check_rewrite_permission(struct tomoyo_domain_info *domain, struct file *filp); -int tomoyo_find_next_domain(struct linux_binprm *bprm, - struct tomoyo_domain_info **next_domain); +int tomoyo_find_next_domain(struct linux_binprm *bprm); /* Index numbers for Access Controls. */