/external/selinux/libsepol/src/ |
H A D | policydb_convert.c | 6 #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 D | roles.c | 4 #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 D | booleans.c | 9 #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 D | context.c | 5 #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 D | genbools.c | 6 #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 D | genusers.c | 8 #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 D | interfaces.c | 7 #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 D | nodes.c | 9 #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 D | ports.c | 8 #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 D | users.c | 9 #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 D | mls.c | 30 #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 D | services.c | 57 #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/selinux/libsepol/tests/ |
H A D | test-downgrade.c | 27 #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/selinux/libselinux/src/ |
H A D | load_policy.c | 15 #include <sepol/policydb.h> 60 sepol_policydb_t *policydb; local 208 if (policydb_create(&policydb)) { 213 if (policydb_read(policydb, pf)) { 215 policydb_free(policydb); 218 if (policydb_set_vers(policydb, kernvers) || 219 policydb_to_image(NULL, policydb, &data, &size)) { 225 policydb_free(policydb); 232 policydb_free(policydb);
|
H A D | audit2why.c | 14 #include <sepol/policydb.h> 15 #include <sepol/policydb/services.h> 42 sepol_policydb_t *policydb; member in struct:avc_t 88 avc->policydb, 101 avc->policydb, 127 avc->policydb, key, 177 sepol_policydb_free(avc->policydb); 238 /* Set up a policydb directly so that we can mutate it later 242 sepol_policydb_create(&avc->policydb)) { 250 if (sepol_policydb_read(avc->policydb, p [all...] |
/external/selinux/libsemanage/src/ |
H A D | fcontexts_local.c | 10 #include <sepol/policydb.h> 84 const sepol_policydb_t *policydb; member in struct:validate_handler_arg 95 const sepol_policydb_t *policydb = arg->policydb; local 104 && sepol_context_check(handle->sepolh, policydb, 122 const sepol_policydb_t * policydb) 127 arg.policydb = policydb; 121 semanage_fcontext_validate_local(semanage_handle_t * handle, const sepol_policydb_t * policydb) argument
|
H A D | database_policydb.c | 18 #include <sepol/policydb.h> 37 sepol_policydb_t *policydb; member in struct:dbase_policydb 48 sepol_policydb_free(dbase->policydb); 94 sepol_policydb_t *policydb = NULL; local 107 if (sepol_policydb_create(&policydb) < 0) { 108 ERR(handle, "could not create policydb object"); 113 * ENOENT is not fatal - we just create an empty policydb */ 121 /* If the file was opened successfully, read a policydb */ 132 if (sepol_policydb_read(policydb, pf) < 0) 144 /* Update the database policydb */ 224 dbase_policydb_attach(dbase_policydb_t * dbase, sepol_policydb_t * policydb) argument [all...] |
H A D | seusers_local.c | 9 #include <sepol/policydb.h> 234 const sepol_policydb_t *policydb; member in struct:validate_handler_arg 247 const sepol_policydb_t *policydb = arg->policydb; local 267 if (mls_range && sepol_policydb_mls_enabled(policydb)) { 273 if (sepol_mls_check(handle->sepolh, policydb, mls_range) < 0) 275 if (sepol_mls_contains(handle->sepolh, policydb, 319 const sepol_policydb_t * policydb) 324 arg.policydb = policydb; 318 semanage_seuser_validate_local(semanage_handle_t * handle, const sepol_policydb_t * policydb) argument [all...] |
H A D | genhomedircon.c | 94 sepol_policydb_t *policydb; member in struct:__anon16930 543 s->policydb, ctx_record); 1056 sepol_policydb_t * policydb, 1083 s.policydb = policydb; 1055 semanage_genhomedircon(semanage_handle_t * sh, sepol_policydb_t * policydb, int usepasswd, char *ignoredirs) argument
|
/external/selinux/checkpolicy/test/ |
H A D | dispol.c | 20 #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/util.h> 25 #include <sepol/policydb/polcaps.h> 37 static policydb_t policydb; variable 409 if (policydb_init(&policydb)) { 413 ret = policydb_read(&policydb, [all...] |
H A D | dismod.c | 30 #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/selinux/policycoreutils/sepolgen-ifgen/ |
H A D | sepolgen-ifgen-attr-helper.c | 25 #include <sepol/policydb/policydb.h> 26 #include <sepol/policydb/avtab.h> 27 #include <sepol/policydb/util.h> 147 policydb_t *policydb; local 163 policydb = malloc(sizeof(policydb_t)); 164 if (policydb == NULL) { 169 if (policydb_init(policydb)) { 171 free(policydb); 175 ret = policydb_read(policydb, [all...] |
/external/selinux/checkpolicy/ |
H A D | checkpolicy.c | 78 #include <sepol/policydb/policydb.h> 79 #include <sepol/policydb/services.h> 80 #include <sepol/policydb/conditional.h> 81 #include <sepol/policydb/hierarchy.h> 82 #include <sepol/policydb/flask.h> 83 #include <sepol/policydb/expand.h> 84 #include <sepol/policydb/link.h> 93 static policydb_t policydb; variable 235 type_rules = malloc(sizeof(struct avtab_node) * policydb [all...] |
/external/selinux/policycoreutils/sepolicy/ |
H A D | info.c | 89 * @param policydb Reference to a policy 93 static PyObject* get_sens(const char *name, const apol_policy_t * policydb) argument 105 qpol_policy_t *q = apol_policy_get_qpol(policydb); 110 if (apol_level_query_set_sens(policydb, query, name)) 112 if (apol_level_get_by_query(policydb, query, &v)) 121 ap_mls_lvl = (apol_mls_level_t *) apol_mls_level_create_from_qpol_level_datum(policydb, level); 122 tmp = apol_mls_level_render(policydb, ap_mls_lvl); 164 apol_policy_t *policydb = NULL; local 168 policydb = (apol_policy_t *) data; 169 q = apol_policy_get_qpol(policydb); 204 apol_policy_t *policydb = NULL; local 236 get_cat_sens(const qpol_cat_t * cat_datum, const apol_policy_t * policydb) argument 309 get_cats(const char *name, const apol_policy_t * policydb) argument 366 get_type_aliases(const qpol_type_t * type_datum, const apol_policy_t * policydb) argument 417 get_attr(const qpol_type_t * type_datum, const apol_policy_t * policydb) argument 487 get_attribs(const char *name, const apol_policy_t * policydb) argument 562 get_type_attrs(const qpol_type_t * type_datum, const apol_policy_t * policydb) argument 596 get_type(const qpol_type_t * type_datum, const apol_policy_t * policydb) argument 657 get_booleans(const char *name, const apol_policy_t * policydb) argument 733 get_user(const qpol_user_t * user_datum, const apol_policy_t * policydb) argument 817 get_class(const qpol_class_t * class_datum, const apol_policy_t * policydb) argument 895 get_classes(const char *name, const apol_policy_t * policydb) argument 955 get_users(const char *name, const apol_policy_t * policydb) argument 1010 get_role(const qpol_role_t * role_datum, const apol_policy_t * policydb) argument 1095 get_ports(const char *num, const apol_policy_t * policydb) argument 1209 get_roles(const char *name, const apol_policy_t * policydb) argument 1268 get_types(const char *name, const apol_policy_t * policydb) argument [all...] |
/external/selinux/libsepol/cil/src/ |
H A D | cil_binary.c | 35 #include <sepol/policydb/policydb.h> 36 #include <sepol/policydb/polcaps.h> 37 #include <sepol/policydb/conditional.h> 38 #include <sepol/policydb/constraint.h> 39 #include <sepol/policydb/flask.h> 40 #include <sepol/policydb/expand.h> 41 #include <sepol/policydb/hierarchy.h> 1555 struct policydb *pdb; 2672 cil_log(CIL_ERR, "Failed to insert constraint into policydb\ 3788 __cil_policydb_val_arrays_create(policydb_t *policydb) argument 4059 cil_binary_create(const struct cil_db *db, sepol_policydb_t **policydb) argument 4626 cil_binary_create_allocated_pdb(const struct cil_db *db, sepol_policydb_t *policydb) argument [all...] |