Searched defs:policydb (Results 1 - 24 of 24) sorted by relevance

/external/sepolicy/tools/sepolicy-analyze/
H A Dperm.c7 static int list_permissive(policydb_t * policydb) argument
15 ebitmap_for_each_bit(&policydb->permissive_map, n, bit)
18 printf("%s\n", policydb->p_type_val_to_name[bit -1]);
24 int permissive_func (int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) { argument
29 return list_permissive(policydb);
H A Dsepolicy-analyze.c18 int (*func) (int argc, char **argv, policydb_t *policydb);
42 policydb_t policydb; local
49 if(load_policy(policy, &policydb, &pf))
53 rc = analyze_components[i].func(argc - 2, argv + 2, &policydb);
H A Dutils.c2 #include <sepol/policydb/policydb.h>
3 #include <sepol/policydb/util.h>
12 void display_allow(policydb_t *policydb, avtab_key_t *key, int idx, uint32_t perms) argument
15 policydb->p_type_val_to_name[key->source_type
18 policydb->p_type_val_to_name[key->target_type
20 policydb->p_class_val_to_name[key->target_class - 1],
22 (policydb, key->target_class, perms));
25 int load_policy(char *filename, policydb_t * policydb, struct policy_file *pf) argument
53 if (policydb_init(policydb)) {
[all...]
H A Ddups.c15 policydb_t *policydb = args; local
33 sattr = &policydb->type_attr_map[k->source_type - 1];
34 tattr = &policydb->type_attr_map[k->target_type - 1];
35 stype = policydb->type_val_to_struct[k->source_type - 1];
36 ttype = policydb->type_val_to_struct[k->target_type - 1];
51 stype2 = policydb->type_val_to_struct[avkey.source_type - 1];
52 ttype2 = policydb->type_val_to_struct[avkey.target_type - 1];
56 for (node = avtab_search_node(&policydb->te_avtab, &avkey);
67 display_allow(policydb, k, i, d->data);
68 display_allow(policydb,
78 find_dups(policydb_t * policydb) argument
85 dups_func(int argc, __attribute__ ((unused)) char **argv, policydb_t *policydb) argument
[all...]
H A Dtypecmp.c2 #include <sepol/policydb/expand.h>
120 static int find_match(policydb_t *policydb, struct avtab_node *l1, argument
146 display_allow(policydb, &l1->key, idx1, perms1);
148 display_allow(policydb, &c->key, idx2, perms2);
157 static int analyze_types(policydb_t * policydb, char diff, char equiv) argument
168 type_rules = malloc(sizeof(struct avtab_node) * policydb->p_types.nprim);
173 memset(type_rules, 0, sizeof(struct avtab_node) * policydb->p_types.nprim);
180 if (expand_avtab(policydb, &policydb->te_avtab, &exp_avtab)) {
186 if (expand_avtab(policydb,
267 typecmp_func(int argc, char **argv, policydb_t *policydb) argument
[all...]
H A Dneverallow.c20 static int read_typeset(policydb_t *policydb, char **ptr, char *end, argument
113 type = hashtab_search(policydb->p_types.table, id);
124 rc = ebitmap_union(&typeset->negset, &policydb->attr_type_map[type->s.value - 1]);
126 rc = ebitmap_union(&typeset->types, &policydb->attr_type_map[type->s.value - 1]);
144 for (bit = 0; bit < policydb->p_types.nprim; bit++) {
147 if (policydb->type_val_to_struct[bit] &&
148 policydb->type_val_to_struct[bit]->flavor == TYPE_ATTRIB)
163 for (bit = 0; bit < policydb->p_types.nprim; bit++) {
164 if (policydb->type_val_to_struct[bit] &&
165 policydb
185 read_classperms(policydb_t *policydb, char **ptr, char *end, class_perm_node_t **perms) argument
370 check_neverallows(policydb_t *policydb, char *text, char *end) argument
439 check_neverallows_file(policydb_t *policydb, const char *filename) argument
466 check_neverallows_string(policydb_t *policydb, char *string, size_t len) argument
474 neverallow_func(int argc, char **argv, policydb_t *policydb) argument
[all...]
/external/libsepol/src/
H A Dpolicydb_convert.c6 #include <sepol/policydb/policydb.h>
8 /* Construct a policydb from the supplied (data, len) pair */
11 void *data, size_t len, policydb_t * policydb)
22 if (policydb_read(policydb, &pf, 0)) {
23 policydb_destroy(policydb);
32 /* Write a policydb to a memory region, and return the (data, len) pair. */
35 policydb_t * policydb, void **newdata, size_t * newlen)
41 struct policydb tmp_policydb;
47 if (policydb_write(policydb,
10 policydb_from_image(sepol_handle_t * handle, void *data, size_t len, policydb_t * policydb) argument
34 policydb_to_image(sepol_handle_t * handle, policydb_t * policydb, void **newdata, size_t * newlen) argument
[all...]
H A Droles.c4 #include <sepol/policydb/hashtab.h>
5 #include <sepol/policydb/policydb.h>
15 policydb_t *policydb = &p->p; local
16 *response = (hashtab_search(policydb->p_roles.table,
28 policydb_t *policydb = &p->p; local
29 unsigned int tmp_nroles = policydb->p_roles.nprim;
37 tmp_roles[i] = strdup(policydb->p_role_val_to_name[i]);
H A Dbooleans.c9 #include <sepol/policydb/hashtab.h>
10 #include <sepol/policydb/policydb.h>
11 #include <sepol/policydb/conditional.h>
15 policydb_t * policydb,
31 hashtab_search(policydb->p_bools.table, name);
55 const policydb_t * policydb,
59 const char *name = policydb->p_bool_val_to_name[bool_idx];
60 cond_bool_datum_t *booldatum = policydb->bool_val_to_struct[bool_idx];
90 policydb_t *policydb local
14 bool_update(sepol_handle_t * handle, policydb_t * policydb, const sepol_bool_key_t * key, const sepol_bool_t * data) argument
54 bool_to_record(sepol_handle_t * handle, const policydb_t * policydb, int bool_idx, sepol_bool_t ** record) argument
110 const policydb_t *policydb = &p->p; local
122 const policydb_t *policydb = &p->p; local
145 const policydb_t *policydb = &p->p; local
184 const policydb_t *policydb = &p->p; local
[all...]
H A Dcontext.c5 #include <sepol/policydb/policydb.h>
6 #include <sepol/policydb/services.h>
88 const policydb_t * policydb,
99 strlen(policydb->p_user_val_to_name[context->user - 1]) + 1;
101 strlen(policydb->p_role_val_to_name[context->role - 1]) + 1;
102 scontext_len += strlen(policydb->p_type_val_to_name[context->type - 1]);
103 scontext_len += mls_compute_context_len(policydb, context);
119 policydb->p_user_val_to_name[context->user - 1],
120 policydb
87 context_to_string(sepol_handle_t * handle, const policydb_t * policydb, const context_struct_t * context, char **result, size_t * result_len) argument
143 context_from_record(sepol_handle_t * handle, const policydb_t * policydb, context_struct_t ** cptr, const sepol_context_t * record) argument
242 context_to_record(sepol_handle_t * handle, const policydb_t * policydb, const context_struct_t * context, sepol_context_t ** record) argument
291 context_from_string(sepol_handle_t * handle, const policydb_t * policydb, context_struct_t ** cptr, const char *con_str, size_t con_str_len) argument
328 sepol_context_check(sepol_handle_t * handle, const sepol_policydb_t * policydb, const sepol_context_t * context) argument
[all...]
H A Dgenbools.c6 #include <sepol/policydb/policydb.h>
7 #include <sepol/policydb/conditional.h>
66 static int load_booleans(struct policydb *policydb, const char *path, argument
96 datum = hashtab_search(policydb->p_bools.table, name);
127 hashtab_search(policydb->p_bools.table,
151 struct policydb policydb; local
155 if (policydb_init(&policydb))
195 sepol_genbools_policydb(policydb_t * policydb, const char *booleans) argument
212 struct policydb policydb; local
[all...]
H A Dgenusers.c8 #include <sepol/policydb/policydb.h>
35 static int load_users(struct policydb *policydb, const char *path) argument
87 usrdatum = hashtab_search(policydb->p_users.table, q);
113 usrdatum->s.value = ++policydb->p_users.nprim;
114 if (hashtab_insert(policydb->p_users.table,
164 roldatum = hashtab_search(policydb->p_roles.table, q);
185 if (policydb->mls) {
228 if (mls_context_to_sid(policydb, old
295 struct policydb policydb; local
323 sepol_genusers_policydb(policydb_t * policydb, const char *usersdir) argument
[all...]
H A Dinterfaces.c7 #include <sepol/policydb/policydb.h>
13 const policydb_t * policydb,
30 if (context_from_record(handle, policydb,
39 if (context_from_record(handle, policydb,
67 const policydb_t * policydb,
84 if (context_to_record(handle, policydb, ifcon, &tmp_con) < 0)
91 if (context_to_record(handle, policydb, msgcon, &tmp_con) < 0)
114 const policydb_t *policydb = &p->p; local
120 head = policydb
12 iface_from_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t ** iface, const sepol_iface_t * record) argument
66 iface_to_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t * iface, sepol_iface_t ** record) argument
139 const policydb_t *policydb = &p->p; local
171 policydb_t *policydb = &p->p; local
225 const policydb_t *policydb = &p->p; local
243 const policydb_t *policydb = &p->p; local
[all...]
H A Dnodes.c9 #include <sepol/policydb/policydb.h>
15 const policydb_t * policydb,
56 if (context_from_record(handle, policydb, &tmp_con,
84 const policydb_t * policydb,
129 if (context_to_record(handle, policydb, con, &tmp_con) < 0)
153 const policydb_t *policydb = &p->p; local
155 head = policydb->ocontexts[OCON_NODE];
159 head = policydb->ocontexts[OCON_NODE6];
175 const policydb_t *policydb local
14 node_from_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t ** node, const sepol_node_t * data) argument
83 node_to_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t * node, int proto, sepol_node_t ** record) argument
235 const policydb_t *policydb = &p->p; local
301 policydb_t *policydb = &p->p; local
351 const policydb_t *policydb = &p->p; local
[all...]
H A Dports.c8 #include <sepol/policydb/policydb.h>
42 const policydb_t * policydb,
74 if (context_from_record(handle, policydb, &tmp_con,
101 const policydb_t * policydb,
124 if (context_to_record(handle, policydb, con, &tmp_con) < 0)
149 const policydb_t *policydb = &p->p; local
151 head = policydb->ocontexts[OCON_PORT];
167 const policydb_t *policydb = &p->p; local
178 head = policydb
41 port_from_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t ** port, const sepol_port_t * data) argument
100 port_to_record(sepol_handle_t * handle, const policydb_t * policydb, ocontext_t * port, sepol_port_t ** record) argument
205 const policydb_t *policydb = &p->p; local
245 policydb_t *policydb = &p->p; local
282 const policydb_t *policydb = &p->p; local
[all...]
H A Dusers.c9 #include <sepol/policydb/policydb.h>
10 #include <sepol/policydb/hashtab.h>
11 #include <sepol/policydb/expand.h>
16 const policydb_t * policydb,
20 const char *name = policydb->p_user_val_to_name[user_idx];
21 user_datum_t *usrdatum = policydb->user_val_to_struct[user_idx];
37 char *role = policydb->p_role_val_to_name[bit];
44 if (policydb->mls) {
61 if (mls_to_string(handle, policydb,
15 user_to_record(sepol_handle_t * handle, const policydb_t * policydb, int user_idx, sepol_user_t ** record) argument
106 policydb_t *policydb = &p->p; local
292 const policydb_t *policydb = &p->p; local
308 const policydb_t *policydb = &p->p; local
320 const policydb_t *policydb = &p->p; local
351 const policydb_t *policydb = &p->p; local
[all...]
H A Dmls.c30 #include <sepol/policydb/policydb.h>
31 #include <sepol/policydb/services.h>
32 #include <sepol/policydb/flask.h>
33 #include <sepol/policydb/context.h>
43 const policydb_t * policydb,
50 int len = mls_compute_context_len(policydb, mls) + 1;
61 mls_sid_to_context(policydb, mls, &ptr);
79 const policydb_t * policydb,
88 if (mls_context_to_sid(policydb, '
42 mls_to_string(sepol_handle_t * handle, const policydb_t * policydb, const context_struct_t * mls, char **str) argument
78 mls_from_string(sepol_handle_t * handle, const policydb_t * policydb, const char *str, context_struct_t * mls) argument
109 mls_compute_context_len(const policydb_t * policydb, const context_struct_t * context) argument
167 mls_sid_to_context(const policydb_t * policydb, const context_struct_t * context, char **scontext) argument
329 mls_context_to_sid(const policydb_t * policydb, char oldc, char **scontext, context_struct_t * context) argument
605 mls_compute_sid(policydb_t * policydb, context_struct_t * scontext, context_struct_t * tcontext, sepol_security_class_t tclass, uint32_t specified, context_struct_t * newcontext) argument
651 sepol_mls_contains(sepol_handle_t * handle, sepol_policydb_t * policydb, const char *mls1, const char *mls2, int *response) argument
690 sepol_mls_check(sepol_handle_t * handle, sepol_policydb_t * policydb, const char *mls) argument
[all...]
H A Dservices.c57 #include <sepol/policydb/policydb.h>
58 #include <sepol/policydb/sidtab.h>
59 #include <sepol/policydb/services.h>
60 #include <sepol/policydb/conditional.h>
61 #include <sepol/policydb/flask.h>
62 #include <sepol/policydb/util.h>
77 static policydb_t mypolicydb, *policydb = &mypolicydb; variable
131 policydb = p;
153 policydb
[all...]
/external/libsepol/tests/
H A Dtest-downgrade.c27 #include <sepol/policydb/policydb.h>
28 #include <sepol/policydb/link.h>
29 #include <sepol/policydb/expand.h>
30 #include <sepol/policydb/conditional.h>
37 static policydb_t policydb; variable
46 * Description: Initialize the policydb (policy data base structure)
51 if (policydb_init(&policydb)) {
66 * Description: Destroys policydb structure
70 policydb_destroy(&policydb);
[all...]
/external/checkpolicy/test/
H A Ddispol.c20 #include <sepol/policydb/policydb.h>
21 #include <sepol/policydb/avtab.h>
22 #include <sepol/policydb/services.h>
23 #include <sepol/policydb/conditional.h>
24 #include <sepol/policydb/expand.h>
25 #include <sepol/policydb/util.h>
26 #include <sepol/policydb/polcaps.h>
38 static policydb_t policydb; variable
434 if (policydb_init(&policydb)) {
[all...]
H A Ddismod.c30 #include <sepol/policydb/policydb.h>
31 #include <sepol/policydb/services.h>
32 #include <sepol/policydb/conditional.h>
33 #include <sepol/policydb/flask.h>
34 #include <sepol/policydb/link.h>
35 #include <sepol/policydb/module.h>
36 #include <sepol/policydb/util.h>
37 #include <sepol/policydb/polcaps.h>
57 static policydb_t policydb; variable
[all...]
/external/sepolicy/tools/
H A Dsepolicy-check.c9 #include <sepol/policydb/policydb.h>
10 #include <sepol/policydb/services.h>
11 #include <sepol/policydb/expand.h>
188 int load_policy(char *filename, policydb_t *policydb, struct policy_file *pf) { argument
215 if (policydb_init(policydb)) {
216 fprintf(stderr, "Could not initialize policydb!\n");
221 ret = policydb_read(policydb, pf, 0);
236 policydb_t policydb; local
276 sepol_set_policydb(&policydb);
[all...]
/external/checkpolicy/
H A Dcheckpolicy.c77 #include <sepol/policydb/policydb.h>
78 #include <sepol/policydb/services.h>
79 #include <sepol/policydb/conditional.h>
80 #include <sepol/policydb/hierarchy.h>
81 #include <sepol/policydb/flask.h>
82 #include <sepol/policydb/expand.h>
83 #include <sepol/policydb/link.h>
92 static policydb_t policydb; variable
234 type_rules = malloc(sizeof(struct avtab_node) * policydb
[all...]
/external/libsepol/include/sepol/policydb/
H A Dpolicydb.h47 * A policy database (policydb) specifies the
57 #include <sepol/policydb.h>
59 #include <sepol/policydb/flask_types.h>
60 #include <sepol/policydb/symtab.h>
61 #include <sepol/policydb/avtab.h>
62 #include <sepol/policydb/context.h>
63 #include <sepol/policydb/constraint.h>
64 #include <sepol/policydb/sidtab.h>
384 * subtract one) into the global policydb->scope array. */
463 typedef struct policydb { struct
[all...]

Completed in 520 milliseconds