Home
last modified time | relevance | path

Searched refs:policydb (Results 1 – 17 of 17) sorted by relevance

/system/sepolicy/tools/sepolicy-analyze/
Ddups.c15 policydb_t *policydb = args; in find_dups_helper() local
33 sattr = &policydb->type_attr_map[k->source_type - 1]; in find_dups_helper()
34 tattr = &policydb->type_attr_map[k->target_type - 1]; in find_dups_helper()
35 stype = policydb->type_val_to_struct[k->source_type - 1]; in find_dups_helper()
36 ttype = policydb->type_val_to_struct[k->target_type - 1]; in find_dups_helper()
51 stype2 = policydb->type_val_to_struct[avkey.source_type - 1]; in find_dups_helper()
52 ttype2 = policydb->type_val_to_struct[avkey.target_type - 1]; in find_dups_helper()
56 for (node = avtab_search_node(&policydb->te_avtab, &avkey); in find_dups_helper()
67 display_allow(policydb, k, i, d->data); in find_dups_helper()
68 display_allow(policydb, &node->key, i, node->datum.data); in find_dups_helper()
[all …]
Dattribute.c9 static void retrieve_mapping(policydb_t *policydb, struct type_datum *dat, char *name, int reverse)… in retrieve_mapping() argument
14 ebitmap_for_each_bit(&policydb->type_attr_map[dat->s.value - 1], n, bit) { in retrieve_mapping()
17 if (!strcmp(policydb->p_type_val_to_name[bit], name)) in retrieve_mapping()
19 printf("%s\n", policydb->p_type_val_to_name[bit]); in retrieve_mapping()
22 ebitmap_for_each_bit(&policydb->attr_type_map[dat->s.value - 1], n, bit) { in retrieve_mapping()
25 printf("%s\n", policydb->p_type_val_to_name[bit]); in retrieve_mapping()
30 static int list_attribute(policydb_t *policydb, char *name, int reverse) in list_attribute() argument
34 dat = hashtab_search(policydb->p_types.table, name); in list_attribute()
51 retrieve_mapping(policydb, dat, name, reverse); in list_attribute()
70 static int list_all_attributes(policydb_t *policydb) { in list_all_attributes() argument
[all …]
Dtypecmp.c120 static int find_match(policydb_t *policydb, struct avtab_node *l1, in find_match() argument
146 display_allow(policydb, &l1->key, idx1, perms1); in find_match()
148 display_allow(policydb, &c->key, idx2, perms2); in find_match()
157 static int analyze_types(policydb_t * policydb, char diff, char equiv) in analyze_types() argument
168 type_rules = malloc(sizeof(struct avtab_node) * policydb->p_types.nprim); in analyze_types()
173 memset(type_rules, 0, sizeof(struct avtab_node) * policydb->p_types.nprim); in analyze_types()
181 if (expand_avtab(policydb, &policydb->te_avtab, &exp_avtab)) { in analyze_types()
188 if (expand_avtab(policydb, &policydb->te_cond_avtab, &exp_cond_avtab)) { in analyze_types()
211 for (i = 0; i < policydb->p_types.nprim - 1; i++) { in analyze_types()
214 type = policydb->type_val_to_struct[i]; in analyze_types()
[all …]
Dperm.c7 static int list_permissive(policydb_t * policydb) in list_permissive() argument
15 ebitmap_for_each_bit(&policydb->permissive_map, n, bit) in list_permissive()
18 printf("%s\n", policydb->p_type_val_to_name[bit -1]); in list_permissive()
24 int permissive_func (int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) { in permissive_func() argument
29 return list_permissive(policydb); in permissive_func()
Dutils.c12 void display_allow(policydb_t *policydb, avtab_key_t *key, int idx, uint32_t perms) in display_allow() argument
15 policydb->p_type_val_to_name[key->source_type in display_allow()
18 policydb->p_type_val_to_name[key->target_type in display_allow()
20 policydb->p_class_val_to_name[key->target_class - 1], in display_allow()
22 (policydb, key->target_class, perms)); in display_allow()
25 bool load_policy(char *filename, policydb_t * policydb, struct policy_file *pf) in load_policy() argument
51 if (policydb_init(policydb)) { in load_policy()
55 if (policydb_read(policydb, pf, 0)) { in load_policy()
Dneverallow.c20 static int read_typeset(policydb_t *policydb, char **ptr, char *end, in read_typeset() argument
113 type = hashtab_search(policydb->p_types.table, id); in read_typeset()
124 rc = ebitmap_union(&typeset->negset, &policydb->attr_type_map[type->s.value - 1]); in read_typeset()
126 rc = ebitmap_union(&typeset->types, &policydb->attr_type_map[type->s.value - 1]); in read_typeset()
144 for (bit = 0; bit < policydb->p_types.nprim; bit++) { in read_typeset()
147 if (policydb->type_val_to_struct[bit] && in read_typeset()
148 policydb->type_val_to_struct[bit]->flavor == TYPE_ATTRIB) in read_typeset()
163 for (bit = 0; bit < policydb->p_types.nprim; bit++) { in read_typeset()
164 if (policydb->type_val_to_struct[bit] && in read_typeset()
165 policydb->type_val_to_struct[bit]->flavor == TYPE_ATTRIB) in read_typeset()
[all …]
Dsepolicy-analyze.c20 int (*func) (int argc, char **argv, policydb_t *policydb);
46 policydb_t policydb; in main() local
53 if(!load_policy(policy, &policydb, &pf)) in main()
57 rc = analyze_components[i].func(argc - 2, argv + 2, &policydb); in main()
60 policydb_destroy(&policydb); in main()
Dutils.h12 void display_allow(policydb_t *policydb, avtab_key_t *key, int idx, uint32_t perms);
14 bool load_policy(char *filename, policydb_t * policydb, struct policy_file *pf);
Dbooleans.c16 int booleans_func (int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) { in booleans_func() argument
21 return hashtab_map(policydb->p_bools.table, list_booleans, NULL); in booleans_func()
Dattribute.h9 int attribute_func(int argc, char **argv, policydb_t *policydb);
Dbooleans.h9 int booleans_func(int argc, char **argv, policydb_t *policydb);
Dtypecmp.h9 int typecmp_func(int argc, char **argv, policydb_t *policydb);
Dneverallow.h9 int neverallow_func(int argc, char **argv, policydb_t *policydb);
Dperm.h9 int permissive_func(int argc, char **argv, policydb_t *policydb);
Ddups.h9 int dups_func(int argc, char **argv, policydb_t *policydb);
/system/sepolicy/tools/
Dsepolicy-check.c188 int load_policy(char *filename, policydb_t *policydb, struct policy_file *pf) { in load_policy() argument
215 if (policydb_init(policydb)) { in load_policy()
221 ret = policydb_read(policydb, pf, 0); in load_policy()
236 policydb_t policydb; in main() local
276 sepol_set_policydb(&policydb); in main()
279 if (load_policy(policy, &policydb, &pf)) in main()
282 match = check_rule(source, target, class, perm, &policydb); in main()
294 policydb_destroy(&policydb); in main()
Dcheckfc.c72 static int get_attr_bit(policydb_t *policydb, const char *attr_name) in get_attr_bit() argument
74 struct type_datum *attr = hashtab_search(policydb->p_types.table, (char *)attr_name); in get_attr_bit()
109 static bool is_type_of_attribute_set(policydb_t *policydb, const char *type_name, in is_type_of_attribute_set() argument
112 struct type_datum *type = hashtab_search(policydb->p_types.table, (char *)type_name); in is_type_of_attribute_set()
127 int rc = ebitmap_and(&dst, attr_set, &policydb->type_attr_map[type->s.value - 1]); in is_type_of_attribute_set()