aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/group.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-07-29 01:29:55 -0400
committerJames Morris <jmorris@namei.org>2010-08-02 01:38:38 -0400
commit484ca79c653121d3c79fffb86e1deea724f2e20b (patch)
tree457aa73e37c9b5e5b4306430f40d1985b59ca226 /security/tomoyo/group.c
parent4d6ec10bb4461fdc9a9ab94ef32934e13564e873 (diff)
TOMOYO: Use pathname specified by policy rather than execve()
Commit c9e69318 "TOMOYO: Allow wildcard for execute permission." changed execute permission and domainname to accept wildcards. But tomoyo_find_next_domain() was using pathname passed to execve() rather than pathname specified by the execute permission. As a result, processes were not able to transit to domains which contain wildcards in their domainnames. This patch passes pathname specified by the execute permission back to tomoyo_find_next_domain() so that processes can transit to domains which contain wildcards in their domainnames. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/group.c')
-rw-r--r--security/tomoyo/group.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/security/tomoyo/group.c b/security/tomoyo/group.c
index 3f0a2abf65cc..e94352ce723f 100644
--- a/security/tomoyo/group.c
+++ b/security/tomoyo/group.c
@@ -80,24 +80,24 @@ int tomoyo_write_group(char *data, const bool is_delete, const u8 type)
80 * @pathname: The name of pathname. 80 * @pathname: The name of pathname.
81 * @group: Pointer to "struct tomoyo_path_group". 81 * @group: Pointer to "struct tomoyo_path_group".
82 * 82 *
83 * Returns true if @pathname matches pathnames in @group, false otherwise. 83 * Returns matched member's pathname if @pathname matches pathnames in @group,
84 * NULL otherwise.
84 * 85 *
85 * Caller holds tomoyo_read_lock(). 86 * Caller holds tomoyo_read_lock().
86 */ 87 */
87bool tomoyo_path_matches_group(const struct tomoyo_path_info *pathname, 88const struct tomoyo_path_info *
88 const struct tomoyo_group *group) 89tomoyo_path_matches_group(const struct tomoyo_path_info *pathname,
90 const struct tomoyo_group *group)
89{ 91{
90 struct tomoyo_path_group *member; 92 struct tomoyo_path_group *member;
91 bool matched = false;
92 list_for_each_entry_rcu(member, &group->member_list, head.list) { 93 list_for_each_entry_rcu(member, &group->member_list, head.list) {
93 if (member->head.is_deleted) 94 if (member->head.is_deleted)
94 continue; 95 continue;
95 if (!tomoyo_path_matches_pattern(pathname, member->member_name)) 96 if (!tomoyo_path_matches_pattern(pathname, member->member_name))
96 continue; 97 continue;
97 matched = true; 98 return member->member_name;
98 break;
99 } 99 }
100 return matched; 100 return NULL;
101} 101}
102 102
103/** 103/**