diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-17 03:52:29 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:40 -0400 |
commit | a98aa4debe2728abb3353e35fc5d110dcc0d7f0d (patch) | |
tree | 0334194761e26961339dd126e997c23e4060ce72 /security/tomoyo/common.h | |
parent | 5fb49870e6d48d81d8ca0e1ef979073dc9a820f7 (diff) |
TOMOYO: Merge tomoyo_path_group and tomoyo_number_group
"struct tomoyo_path_group" and "struct tomoyo_number_group" are identical.
Rename tomoyo_path_group/tomoyo_number_group to tomoyo_group and
tomoyo_path_group_member to tomoyo_path_group and
tomoyo_number_group_member to tomoyo_unmber_group.
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/common.h')
-rw-r--r-- | security/tomoyo/common.h | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h index e0c4ae11bf6c..9f289e412a63 100644 --- a/security/tomoyo/common.h +++ b/security/tomoyo/common.h | |||
@@ -291,28 +291,20 @@ struct tomoyo_name_entry { | |||
291 | 291 | ||
292 | struct tomoyo_name_union { | 292 | struct tomoyo_name_union { |
293 | const struct tomoyo_path_info *filename; | 293 | const struct tomoyo_path_info *filename; |
294 | struct tomoyo_path_group *group; | 294 | struct tomoyo_group *group; |
295 | u8 is_group; | 295 | u8 is_group; |
296 | }; | 296 | }; |
297 | 297 | ||
298 | struct tomoyo_number_union { | 298 | struct tomoyo_number_union { |
299 | unsigned long values[2]; | 299 | unsigned long values[2]; |
300 | struct tomoyo_number_group *group; | 300 | struct tomoyo_group *group; |
301 | u8 min_type; | 301 | u8 min_type; |
302 | u8 max_type; | 302 | u8 max_type; |
303 | u8 is_group; | 303 | u8 is_group; |
304 | }; | 304 | }; |
305 | 305 | ||
306 | /* Structure for "path_group" directive. */ | 306 | /* Structure for "path_group"/"number_group" directive. */ |
307 | struct tomoyo_path_group { | 307 | struct tomoyo_group { |
308 | struct list_head list; | ||
309 | const struct tomoyo_path_info *group_name; | ||
310 | struct list_head member_list; | ||
311 | atomic_t users; | ||
312 | }; | ||
313 | |||
314 | /* Structure for "number_group" directive. */ | ||
315 | struct tomoyo_number_group { | ||
316 | struct list_head list; | 308 | struct list_head list; |
317 | const struct tomoyo_path_info *group_name; | 309 | const struct tomoyo_path_info *group_name; |
318 | struct list_head member_list; | 310 | struct list_head member_list; |
@@ -320,13 +312,13 @@ struct tomoyo_number_group { | |||
320 | }; | 312 | }; |
321 | 313 | ||
322 | /* Structure for "path_group" directive. */ | 314 | /* Structure for "path_group" directive. */ |
323 | struct tomoyo_path_group_member { | 315 | struct tomoyo_path_group { |
324 | struct tomoyo_acl_head head; | 316 | struct tomoyo_acl_head head; |
325 | const struct tomoyo_path_info *member_name; | 317 | const struct tomoyo_path_info *member_name; |
326 | }; | 318 | }; |
327 | 319 | ||
328 | /* Structure for "number_group" directive. */ | 320 | /* Structure for "number_group" directive. */ |
329 | struct tomoyo_number_group_member { | 321 | struct tomoyo_number_group { |
330 | struct tomoyo_acl_head head; | 322 | struct tomoyo_acl_head head; |
331 | struct tomoyo_number_union number; | 323 | struct tomoyo_number_union number; |
332 | }; | 324 | }; |
@@ -766,11 +758,11 @@ bool tomoyo_parse_name_union(const char *filename, | |||
766 | struct tomoyo_name_union *ptr); | 758 | struct tomoyo_name_union *ptr); |
767 | /* Check whether the given filename matches the given path_group. */ | 759 | /* Check whether the given filename matches the given path_group. */ |
768 | bool tomoyo_path_matches_group(const struct tomoyo_path_info *pathname, | 760 | bool tomoyo_path_matches_group(const struct tomoyo_path_info *pathname, |
769 | const struct tomoyo_path_group *group); | 761 | const struct tomoyo_group *group); |
770 | /* Check whether the given value matches the given number_group. */ | 762 | /* Check whether the given value matches the given number_group. */ |
771 | bool tomoyo_number_matches_group(const unsigned long min, | 763 | bool tomoyo_number_matches_group(const unsigned long min, |
772 | const unsigned long max, | 764 | const unsigned long max, |
773 | const struct tomoyo_number_group *group); | 765 | const struct tomoyo_group *group); |
774 | /* Check whether the given filename matches the given pattern. */ | 766 | /* Check whether the given filename matches the given pattern. */ |
775 | bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename, | 767 | bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename, |
776 | const struct tomoyo_path_info *pattern); | 768 | const struct tomoyo_path_info *pattern); |
@@ -858,8 +850,8 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * | |||
858 | const u8 profile); | 850 | const u8 profile); |
859 | struct tomoyo_profile *tomoyo_profile(const u8 profile); | 851 | struct tomoyo_profile *tomoyo_profile(const u8 profile); |
860 | /* Allocate memory for "struct tomoyo_path_group". */ | 852 | /* Allocate memory for "struct tomoyo_path_group". */ |
861 | struct tomoyo_path_group *tomoyo_get_path_group(const char *group_name); | 853 | struct tomoyo_group *tomoyo_get_path_group(const char *group_name); |
862 | struct tomoyo_number_group *tomoyo_get_number_group(const char *group_name); | 854 | struct tomoyo_group *tomoyo_get_number_group(const char *group_name); |
863 | 855 | ||
864 | /* Check mode for specified functionality. */ | 856 | /* Check mode for specified functionality. */ |
865 | unsigned int tomoyo_check_flags(const struct tomoyo_domain_info *domain, | 857 | unsigned int tomoyo_check_flags(const struct tomoyo_domain_info *domain, |
@@ -1039,13 +1031,7 @@ static inline void tomoyo_put_name(const struct tomoyo_path_info *name) | |||
1039 | } | 1031 | } |
1040 | } | 1032 | } |
1041 | 1033 | ||
1042 | static inline void tomoyo_put_path_group(struct tomoyo_path_group *group) | 1034 | static inline void tomoyo_put_group(struct tomoyo_group *group) |
1043 | { | ||
1044 | if (group) | ||
1045 | atomic_dec(&group->users); | ||
1046 | } | ||
1047 | |||
1048 | static inline void tomoyo_put_number_group(struct tomoyo_number_group *group) | ||
1049 | { | 1035 | { |
1050 | if (group) | 1036 | if (group) |
1051 | atomic_dec(&group->users); | 1037 | atomic_dec(&group->users); |