/third_party/selinux/libsepol/src/ |
D | policydb_validate.c | 14 uint32_t nprim; member 24 static int create_gap_ebitmap(char **val_to_name, uint32_t nprim, ebitmap_t *gaps) in create_gap_ebitmap() argument 30 for (i = 0; i < nprim; i++) { in create_gap_ebitmap() 40 static int validate_init(validate_t *flavor, char **val_to_name, uint32_t nprim) in validate_init() argument 42 flavor->nprim = nprim; in validate_init() 43 if (create_gap_ebitmap(val_to_name, nprim, &flavor->gaps)) in validate_init() 51 if (validate_init(&flavors[SYM_COMMONS], p->p_common_val_to_name, p->p_commons.nprim)) in validate_array_init() 53 if (validate_init(&flavors[SYM_CLASSES], p->p_class_val_to_name, p->p_classes.nprim)) in validate_array_init() 55 if (validate_init(&flavors[SYM_ROLES], p->p_role_val_to_name, p->p_roles.nprim)) in validate_array_init() 58 if (validate_init(&flavors[SYM_TYPES], p->p_type_val_to_name, p->p_types.nprim)) in validate_array_init() [all …]
|
D | users.c | 230 policydb->p_users.nprim + 1, in sepol_user_modify() 235 policydb->user_val_to_struct[policydb->p_users.nprim] = NULL; in sepol_user_modify() 238 policydb->p_users.nprim + 1, in sepol_user_modify() 243 policydb->p_user_val_to_name[policydb->p_users.nprim] = NULL; in sepol_user_modify() 251 usrdatum->s.value = ++policydb->p_users.nprim; in sepol_user_modify() 307 *response = policydb->p_users.nprim; in sepol_user_count() 348 unsigned int nusers = policydb->p_users.nprim; in sepol_user_iterate()
|
D | kernel_to_conf.c | 370 for (i=0; i < pdb->p_classes.nprim; i++) { in constraint_rules_to_strs() 395 for (i=0; i < pdb->p_classes.nprim; i++) { in validatetrans_rules_to_strs() 442 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_decl_rules_to_conf() 527 rc = strs_init(&strs, permtab->nprim); in class_or_common_perms_to_str() 557 used = calloc(pdb->p_commons.nprim, sizeof(*used)); in write_class_and_common_rules_to_conf() 563 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_and_common_rules_to_conf() 590 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_and_common_rules_to_conf() 721 for (i=0; i < pdb->p_classes.nprim; i++) { in write_default_rules_to_conf() 733 for (i=0; i < pdb->p_classes.nprim; i++) { in write_default_rules_to_conf() 745 for (i=0; i < pdb->p_classes.nprim; i++) { in write_default_rules_to_conf() [all …]
|
D | policydb.c | 1010 if (!value_isvalid(comdatum->s.value, p->p_commons.nprim)) in common_index() 1026 if (!value_isvalid(cladatum->s.value, p->p_classes.nprim)) in class_index() 1043 if (!value_isvalid(role->s.value, p->p_roles.nprim)) in role_index() 1062 if (!value_isvalid(typdatum->s.value, p->p_types.nprim)) in type_index() 1081 if (!value_isvalid(usrdatum->s.value, p->p_users.nprim)) in user_index() 1100 if (!value_isvalid(levdatum->level->sens, p->p_levels.nprim)) in sens_index() 1119 if (!value_isvalid(catdatum->s.value, p->p_cats.nprim)) in cat_index() 1143 calloc(p->p_commons.nprim, sizeof(char *)); in policydb_index_classes() 1152 calloc(p->p_classes.nprim, sizeof(class_datum_t *)); in policydb_index_classes() 1158 calloc(p->p_classes.nprim, sizeof(char *)); in policydb_index_classes() [all …]
|
D | kernel_to_cil.c | 366 for (i=0; i < pdb->p_classes.nprim; i++) { in constraint_rules_to_strs() 392 for (i=0; i < pdb->p_classes.nprim; i++) { in validatetrans_rules_to_strs() 441 rc = strs_init(&strs, permtab->nprim); in class_or_common_perms_to_str() 471 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_decl_rules_to_cil() 487 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_decl_rules_to_cil() 499 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_decl_rules_to_cil() 509 used = calloc(pdb->p_commons.nprim, sizeof(*used)); in write_class_decl_rules_to_cil() 515 for (i=0; i < pdb->p_classes.nprim; i++) { in write_class_decl_rules_to_cil() 745 for (i=0; i < pdb->p_classes.nprim; i++) { in write_default_rules_to_cil() 757 for (i=0; i < pdb->p_classes.nprim; i++) { in write_default_rules_to_cil() [all …]
|
D | expand.c | 147 new_type->s.value = ++state->out->p_types.nprim; in type_copy_callback() 244 s->nprim++; in perm_copy_callback() 293 state->out->p_commons.nprim++; in common_copy_callback() 478 state->out->p_classes.nprim++; in class_copy_callback() 525 new_class->permissions.nprim += in class_copy_callback() 526 new_class->comdatum->permissions.nprim; in class_copy_callback() 872 state->out->p_roles.nprim++; in role_copy_callback() 874 new_role->s.value = state->out->p_roles.nprim; in role_copy_callback() 933 if (sl->sens > p->p_levels.nprim || !p->p_sens_val_to_name[sl->sens - 1]) in mls_semantic_level_expand() 1022 state->out->p_users.nprim++; in user_copy_callback() [all …]
|
D | link.c | 98 for (i = 0; mod->perm_map != NULL && i < mod->policy->p_classes.nprim; in policy_module_destroy() 171 new_perm->s.value = dest_class->permissions.nprim + 1; in permission_copy_callback() 317 new_class->s.value = ++(state->base->p_classes.nprim); in class_copy_callback() 394 new_role->s.value = state->base->p_roles.nprim + 1; in role_copy_callback() 402 state->base->p_roles.nprim++; in role_copy_callback() 421 state->dest_decl->p_roles.nprim++; in role_copy_callback() 492 new_type->s.value = state->base->p_types.nprim + 1; in type_copy_callback() 500 state->base->p_types.nprim++; in type_copy_callback() 520 state->dest_decl->p_types.nprim++; in type_copy_callback() 560 new_user->s.value = state->base->p_users.nprim + 1; in user_copy_callback() [all …]
|
D | optimize.c | 100 struct type_vec *map = calloc(p->p_types.nprim, sizeof(*map)); in build_type_map() 104 for (i = 0; i < p->p_types.nprim; i++) { in build_type_map() 120 for (k = 0; k < p->p_types.nprim; k++) { in build_type_map() 146 for (i = 0; i < p->p_types.nprim; i++) in destroy_type_map()
|
D | context.c | 44 if (!c->role || c->role > p->p_roles.nprim) in context_is_valid() 47 if (!c->user || c->user > p->p_users.nprim) in context_is_valid() 50 if (!c->type || c->type > p->p_types.nprim) in context_is_valid()
|
D | booleans.c | 111 *response = policydb->p_bools.nprim; in sepol_bool_count() 185 unsigned int nbools = policydb->p_bools.nprim; in sepol_bool_iterate()
|
D | policydb_validate.h | 6 int value_isvalid(uint32_t value, uint32_t nprim);
|
D | mls.c | 281 || c->range.level[l].sens > p->p_levels.nprim) in mls_context_isvalid() 293 if (i > p->p_cats.nprim) in mls_context_isvalid() 310 if (!c->user || c->user > p->p_users.nprim) in mls_context_isvalid() 627 if (tclass && tclass <= policydb->p_classes.nprim) { in mls_compute_sid()
|
D | symtab.c | 45 s->nprim = 0; in symtab_init()
|
D | conditional.c | 525 calloc(p->p_bools.nprim, sizeof(cond_bool_datum_t *)); in cond_init_bool_indexes() 548 if (!booldatum->s.value || booldatum->s.value > p->p_bools.nprim) in cond_index_bool() 740 if (expr->bool > p->p_bools.nprim) { in expr_isvalid()
|
D | util.c | 99 for (i = 0; i < cladatum->permissions.nprim; i++) { in sepol_av_to_string()
|
D | write.c | 960 buf[items++] = cpu_to_le32(comdatum->permissions.nprim); in common_write() 1054 buf[items++] = cpu_to_le32(cladatum->permissions.nprim); in class_write() 2078 buf[0] = cpu_to_le32(decl->symtab[i].nprim); in avrule_decl_write() 2322 buf[0] = cpu_to_le32(p->symtab[i].nprim); in policydb_write() 2361 if (p->p_bools.nprim) in policydb_write() 2410 for (i = 0; i < p->p_types.nprim; i++) { in policydb_write()
|
D | services.c | 923 if (!tclass || tclass > policydb->p_classes.nprim) { in context_struct_compute_av() 1044 if (!tclass || tclass > policydb->p_classes.nprim) { in sepol_validate_transition_reason_buffer() 1206 if (!tclass || tclass > policydb->p_classes.nprim) { in sepol_string_to_av_perm() 1355 if (tclass && tclass <= policydb->p_classes.nprim) in sepol_compute_sid()
|
/third_party/selinux/checkpolicy/ |
D | checkpolicy.c | 241 type_rules = malloc(sizeof(struct avtab_node) * policydb.p_types.nprim); in identify_equiv_types() 247 sizeof(struct avtab_node) * policydb.p_types.nprim); in identify_equiv_types() 254 for (i = 0; i < policydb.p_types.nprim - 1; i++) { in identify_equiv_types() 257 for (j = i + 1; j < policydb.p_types.nprim; j++) { in identify_equiv_types() 301 for (i = 0; i < policydbp->p_bools.nprim; i++) { in display_bools() 767 || tclass > policydb.p_classes.nprim) { in main() 787 if (!cladatum->comdatum && !cladatum->permissions.nprim) { in main() 883 || tclass > policydb.p_classes.nprim) { in main() 1088 || tclass > policydb.p_classes.nprim) { in main() 1183 || tclass > policydb.p_classes.nprim) { in main() [all …]
|
D | policy_define.c | 530 comdatum->s.value = policydbp->p_commons.nprim + 1; in define_common_perms() 535 policydbp->p_commons.nprim++; in define_common_perms() 543 perdatum->s.value = comdatum->permissions.nprim + 1; in define_common_perms() 563 comdatum->permissions.nprim++; in define_common_perms() 610 if (cladatum->comdatum || cladatum->permissions.nprim) { in define_av_perms() 641 cladatum->permissions.nprim += comdatum->permissions.nprim; in define_av_perms() 650 perdatum->s.value = ++cladatum->permissions.nprim; in define_av_perms() 873 if (order != policydbp->p_levels.nprim) { in define_dominance() 3518 #define PERMISSION_MASK(nprim) ((nprim) == PERM_SYMTAB_SIZE ? (~UINT32_C(0)) : ((UINT32_C(1) << (np… argument 3634 node->permissions = PERMISSION_MASK(cladatum->permissions.nprim); in define_constraint() [all …]
|
D | module_compiler.c | 854 if (datum->permissions.nprim >= PERM_SYMTAB_SIZE) { in require_class() 878 perm->s.value = datum->permissions.nprim + 1; in require_class() 888 datum->permissions.nprim++; in require_class()
|
/third_party/selinux/libsepol/cil/src/ |
D | cil_binary.c | 273 sepol_perm->s.value = sepol_common->permissions.nprim + 1; in cil_common_to_policydb() 274 sepol_common->permissions.nprim++; in cil_common_to_policydb() 332 sepol_class->permissions.nprim += sepol_common->permissions.nprim; in cil_classorder_to_policydb() 352 sepol_perm->s.value = sepol_class->permissions.nprim + 1; in cil_classorder_to_policydb() 353 sepol_class->permissions.nprim++; in cil_classorder_to_policydb() 595 pdb->type_attr_map = cil_malloc(pdb->p_types.nprim * sizeof(ebitmap_t)); in __cil_typeattr_bitmap_init() 596 pdb->attr_type_map = cil_malloc(pdb->p_types.nprim * sizeof(ebitmap_t)); in __cil_typeattr_bitmap_init() 598 for (i = 0; i < pdb->p_types.nprim; i++) { in __cil_typeattr_bitmap_init() 4106 if (common->s.value < 1 || common->s.value > pdb->p_commons.nprim) { in __cil_common_val_array_insert() 4119 if (class->s.value < 1 || class->s.value > pdb->p_classes.nprim) { in __cil_class_val_array_insert() [all …]
|
D | cil_symtab.c | 95 symtab->nprim++; in cil_symtab_insert() 115 symtab->nprim--; in cil_symtab_remove_datum()
|
D | cil_reset_ast.c | 27 int num_common_perms = class->num_perms - class->perms.nprim; in cil_reset_class() 31 class->num_perms = class->perms.nprim; in cil_reset_class()
|
/third_party/selinux/libsepol/include/sepol/policydb/ |
D | symtab.h | 35 uint32_t nprim; /* number of primary names in table */ member
|
/third_party/selinux/checkpolicy/test/ |
D | dismod.c | 369 for (i = 0; i < p->p_users.nprim; i++) { in display_users() 388 for (i = 0; i < p->p_bools.nprim; i++) { in display_bools()
|