Lines Matching refs:sepol_class
114 …get_sepol_class_datum(policydb_t *pdb, struct cil_symtab_datum *datum, class_datum_t **sepol_class) in __cil_get_sepol_class_datum() argument
116 *sepol_class = hashtab_search(pdb->p_classes.table, datum->fqn); in __cil_get_sepol_class_datum()
117 if (*sepol_class == NULL) { in __cil_get_sepol_class_datum()
301 class_datum_t *sepol_class = cil_malloc(sizeof(*sepol_class)); in cil_classorder_to_policydb() local
302 memset(sepol_class, 0, sizeof(class_datum_t)); in cil_classorder_to_policydb()
305 rc = symtab_insert(pdb, SYM_CLASSES, key, sepol_class, SCOPE_DECL, 0, &value); in cil_classorder_to_policydb()
307 free(sepol_class); in cil_classorder_to_policydb()
311 sepol_class->s.value = value; in cil_classorder_to_policydb()
315 rc = symtab_init(&sepol_class->permissions, PERM_SYMTAB_SIZE); in cil_classorder_to_policydb()
332 sepol_class->comdatum = sepol_common; in cil_classorder_to_policydb()
333 sepol_class->comkey = cil_strdup(key); in cil_classorder_to_policydb()
334 sepol_class->permissions.nprim += sepol_common->permissions.nprim; in cil_classorder_to_policydb()
348 rc = hashtab_insert(sepol_class->permissions.table, key, sepol_perm); in cil_classorder_to_policydb()
354 sepol_perm->s.value = sepol_class->permissions.nprim + 1; in cil_classorder_to_policydb()
355 sepol_class->permissions.nprim++; in cil_classorder_to_policydb()
1221 int __perm_str_to_datum(char *perm_str, class_datum_t *sepol_class, uint32_t *datum) in __perm_str_to_datum() argument
1227 sepol_perm = hashtab_search(sepol_class->permissions.table, perm_str); in __perm_str_to_datum()
1229 sepol_common = sepol_class->comdatum; in __perm_str_to_datum()
1245 int __cil_perms_to_datum(struct cil_list *perms, class_datum_t *sepol_class, uint32_t *datum) in __cil_perms_to_datum() argument
1257 rc = __perm_str_to_datum(key, sepol_class, &data); in __cil_perms_to_datum()
1323 class_datum_t *sepol_class = NULL; in __cil_avrule_expand_helper() local
1326 rc = __cil_get_sepol_class_datum(pdb, DATUM(cp->class), &sepol_class); in __cil_avrule_expand_helper()
1329 rc = __cil_perms_to_datum(cp->perms, sepol_class, &data); in __cil_avrule_expand_helper()
1347 …rc = __cil_insert_avrule(pdb, kind, sepol_src->s.value, sepol_tgt->s.value, sepol_class->s.value, … in __cil_avrule_expand_helper()
2593 class_datum_t *sepol_class = NULL; in cil_constrain_to_policydb_helper() local
2598 rc = __cil_get_sepol_class_datum(pdb, class, &sepol_class); in cil_constrain_to_policydb_helper()
2601 rc = __cil_perms_to_datum(perms, sepol_class, &sepol_constrain->permissions); in cil_constrain_to_policydb_helper()
2612 sepol_constrain->next = sepol_class->constraints; in cil_constrain_to_policydb_helper()
2613 sepol_class->constraints = sepol_constrain; in cil_constrain_to_policydb_helper()
2680 class_datum_t *sepol_class = NULL; in cil_validatetrans_to_policydb() local
2689 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_validatetrans_to_policydb()
2702 sepol_validatetrans->next = sepol_class->validatetrans; in cil_validatetrans_to_policydb()
2703 sepol_class->validatetrans = sepol_validatetrans; in cil_validatetrans_to_policydb()
2937 class_datum_t *sepol_class = NULL; in cil_rangetransition_to_policydb() local
2968 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_rangetransition_to_policydb()
2975 new->target_class = sepol_class->s.value; in cil_rangetransition_to_policydb()
3320 class_datum_t *sepol_class; in cil_default_to_policydb() local
3329 int rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_default_to_policydb()
3334 if (!sepol_class->default_user) { in cil_default_to_policydb()
3335 sepol_class->default_user = def->object; in cil_default_to_policydb()
3336 } else if (sepol_class->default_user != (char)def->object) { in cil_default_to_policydb()
3342 if (!sepol_class->default_role) { in cil_default_to_policydb()
3343 sepol_class->default_role = def->object; in cil_default_to_policydb()
3344 } else if (sepol_class->default_role != (char)def->object) { in cil_default_to_policydb()
3350 if (!sepol_class->default_type) { in cil_default_to_policydb()
3351 sepol_class->default_type = def->object; in cil_default_to_policydb()
3352 } else if (sepol_class->default_type != (char)def->object) { in cil_default_to_policydb()
3375 class_datum_t *sepol_class; in cil_defaultrange_to_policydb() local
3384 int rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_defaultrange_to_policydb()
3387 if (!sepol_class->default_range) { in cil_defaultrange_to_policydb()
3388 sepol_class->default_range = def->object_range; in cil_defaultrange_to_policydb()
3389 } else if (sepol_class->default_range != (char)def->object_range) { in cil_defaultrange_to_policydb()
4104 class_datum_t *sepol_class = NULL; in __cil_rule_to_sepol_class_perms() local
4107 rc = __cil_get_sepol_class_datum(pdb, DATUM(cp->class), &sepol_class); in __cil_rule_to_sepol_class_perms()
4110 rc = __cil_perms_to_datum(cp->perms, sepol_class, &data); in __cil_rule_to_sepol_class_perms()
4117 cpn->tclass = sepol_class->s.value; in __cil_rule_to_sepol_class_perms()
4503 class_datum_t *sepol_class = pdb->class_val_to_struct[class - 1]; in cil_classperms_from_sepol() local
4512 for (i = 0; i < sepol_class->permissions.nprim; i++) { in cil_classperms_from_sepol()