Lines Matching refs:db
35 policydb_t *db = static_cast<policydb_t *>(policydbp); in init_genfs_iter() local
37 out->genfs = db->genfs; in init_genfs_iter()
38 out->ocon = db->genfs->head; in init_genfs_iter()
54 policydb_t *db = static_cast<policydb_t *>(policydbp); in get_genfs() local
59 db->p_user_val_to_name[i->ocon->context->user-1], in get_genfs()
60 db->p_role_val_to_name[i->ocon->context->role-1], in get_genfs()
61 db->p_type_val_to_name[i->ocon->context->type-1]); in get_genfs()
100 policydb_t *db = static_cast<policydb_t *>(policydbp); in init_type_iter() local
110 out->length = db->p_types.nprim; in init_type_iter()
118 out->d = static_cast<type_datum *>(hashtab_search(db->p_types.table, type)); in init_type_iter()
135 out->bit = ebitmap_start(&db->attr_type_map[out->d->s.value - 1], &out->n); in init_type_iter()
136 out->length = ebitmap_length(&db->attr_type_map[out->d->s.value - 1]); in init_type_iter()
138 out->bit = ebitmap_start(&db->type_attr_map[out->d->s.value - 1], &out->n); in init_type_iter()
139 out->length = ebitmap_length(&db->type_attr_map[out->d->s.value - 1]); in init_type_iter()
162 policydb_t *db = static_cast<policydb_t *>(policydbp); in get_type() local
175 && db->type_val_to_struct[i->bit]->flavor != TYPE_ATTRIB) in get_type()
177 && db->type_val_to_struct[i->bit]->flavor != TYPE_TYPE))) { in get_type()
182 len = snprintf(out, max_size, "%s", db->p_type_val_to_name[i->bit]); in get_type()
194 policydb_t *db; in load_policy() local
202 db = (policydb_t *) calloc(1, sizeof(policydb_t)); in load_policy()
203 if (!db) { in load_policy()
211 sepol_set_policydb(db); in load_policy()
216 free(db); in load_policy()
226 free(db); in load_policy()
236 if (policydb_init(db)) { in load_policy()
238 free(db); in load_policy()
243 if (policydb_read(db, &pf, 0)) { in load_policy()
245 policydb_destroy(db); in load_policy()
246 free(db); in load_policy()
251 return static_cast<void *>(db); in load_policy()
268 static int get_avtab_allow_rule(char *out, size_t max_size, policydb_t *db, in get_avtab_allow_rule() argument
281 db->p_type_val_to_name[(avtab_i->cur)->key.source_type - 1], in get_avtab_allow_rule()
282 db->p_type_val_to_name[(avtab_i->cur)->key.target_type - 1], in get_avtab_allow_rule()
283 db->p_class_val_to_name[(avtab_i->cur)->key.target_class - 1], in get_avtab_allow_rule()
284 … sepol_av_to_string(db, (avtab_i->cur)->key.target_class, (avtab_i->cur)->datum.data)); in get_avtab_allow_rule()
302 policydb_t *db = static_cast<policydb_t *>(policydbp); in get_allow_rule() local
305 return get_avtab_allow_rule(out, len, db, avtab_i); in get_allow_rule()