aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.h
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-06-14 20:23:26 -0400
committerJames Morris <jmorris@namei.org>2010-08-02 01:34:29 -0400
commit36f5e1ffbf2bb951105ae4e261bcc1de3eaf510c (patch)
tree80e01278296477b4d30288081267d35ff771d720 /security/tomoyo/common.h
parent82e0f001a4c1112dcff9cafa9812a33889ad9b8a (diff)
TOMOYO: Use callback for updating entries.
Use common code for elements using "struct list_head" + "bool" structure. 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.h39
1 files changed, 6 insertions, 33 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 0ab6e86f90a..c8ab7553c48 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -913,6 +913,12 @@ int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size,
913 bool (*merge_duplicate) (struct tomoyo_acl_info *, 913 bool (*merge_duplicate) (struct tomoyo_acl_info *,
914 struct tomoyo_acl_info *, 914 struct tomoyo_acl_info *,
915 const bool)); 915 const bool));
916int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,
917 bool is_delete, struct list_head *list,
918 bool (*check_duplicate) (const struct tomoyo_acl_head
919 *,
920 const struct tomoyo_acl_head
921 *));
916 922
917/********** External variable definitions. **********/ 923/********** External variable definitions. **********/
918 924
@@ -1042,39 +1048,6 @@ static inline bool tomoyo_is_same_number_union
1042 p1->max_type == p2->max_type && p1->is_group == p2->is_group; 1048 p1->max_type == p2->max_type && p1->is_group == p2->is_group;
1043} 1049}
1044 1050
1045static inline bool tomoyo_is_same_domain_initializer_entry
1046(const struct tomoyo_domain_initializer_entry *p1,
1047 const struct tomoyo_domain_initializer_entry *p2)
1048{
1049 return p1->is_not == p2->is_not && p1->is_last_name == p2->is_last_name
1050 && p1->domainname == p2->domainname
1051 && p1->program == p2->program;
1052}
1053
1054static inline bool tomoyo_is_same_domain_keeper_entry
1055(const struct tomoyo_domain_keeper_entry *p1,
1056 const struct tomoyo_domain_keeper_entry *p2)
1057{
1058 return p1->is_not == p2->is_not && p1->is_last_name == p2->is_last_name
1059 && p1->domainname == p2->domainname
1060 && p1->program == p2->program;
1061}
1062
1063static inline bool tomoyo_is_same_aggregator_entry
1064(const struct tomoyo_aggregator_entry *p1,
1065 const struct tomoyo_aggregator_entry *p2)
1066{
1067 return p1->original_name == p2->original_name &&
1068 p1->aggregated_name == p2->aggregated_name;
1069}
1070
1071static inline bool tomoyo_is_same_alias_entry
1072(const struct tomoyo_alias_entry *p1, const struct tomoyo_alias_entry *p2)
1073{
1074 return p1->original_name == p2->original_name &&
1075 p1->aliased_name == p2->aliased_name;
1076}
1077
1078/** 1051/**
1079 * list_for_each_cookie - iterate over a list with cookie. 1052 * list_for_each_cookie - iterate over a list with cookie.
1080 * @pos: the &struct list_head to use as a loop cursor. 1053 * @pos: the &struct list_head to use as a loop cursor.