Lines Matching defs:base
49 /* a pointer to within the base module's avrule_block chain to
56 policydb_t *base;
107 /***** functions that copy identifiers from a module to base *****/
112 * a) perm is required and the class _and_ perm are declared in base: only add a mapping.
113 * b) perm is required and the class and perm are _not_ declared in base: simply add the permissions
116 * c) perm is required, the class is declared in base, but the perm is not present. Nothing we can do
145 /* If the object class was not declared in the base, add the perm
220 new_class = hashtab_search(state->base->p_classes.table, id);
221 /* If there is not an object class already in the base symtab that means
224 * not in the base.
270 ret = hashtab_insert(state->base->p_classes.table,
278 new_class->s.value = ++(state->base->p_classes.nprim);
314 base_role = hashtab_search(state->base->p_roles.table, id);
350 new_role->s.value = state->base->p_roles.nprim + 1;
352 ret = hashtab_insert(state->base->p_roles.table,
358 state->base->p_roles.nprim++;
391 /* Copy types and attributes from a module into the base module. The
409 base_type = hashtab_search(state->base->p_types.table, id);
428 /* permissive should pass to the base type */
448 new_type->s.value = state->base->p_types.nprim + 1;
450 ret = hashtab_insert(state->base->p_types.table,
456 state->base->p_types.nprim++;
499 base_user = hashtab_search(state->base->p_users.table, id);
516 new_user->s.value = state->base->p_users.nprim + 1;
518 ret = hashtab_insert(state->base->p_users.table,
524 state->base->p_users.nprim++;
567 base_bool = hashtab_search(state->base->p_bools.table, id);
580 new_bool->s.value = state->base->p_bools.nprim + 1;
582 ret = hashtab_insert(state->base->p_bools.table,
588 state->base->p_bools.nprim++;
634 base_level = hashtab_search(state->base->p_levels.table, id);
650 "%s: Sensitivity %s not declared by base.",
672 base_cat = hashtab_search(state->base->p_cats.table, id);
688 "%s: Category %s not declared by base.",
722 dest = hashtab_search(state->base->p_types.table, key);
751 dest = hashtab_search(state->base->p_roles.table, key);
780 dest = hashtab_search(state->base->p_users.table, key);
797 * certain that the base symbol table will have the type that the
829 target_type = hashtab_search(state->base->p_types.table, target_id);
844 base_type = hashtab_search(state->base->p_types.table, id);
857 new_type->s.value = state->base->p_types.nprim + 1;
862 (state->base->p_types.table, new_id, new_type)) {
865 state->base->p_types.nprim++;
869 /* if this already exists and isn't an alias it was required by another module (or base)
1055 role_tab = state->base->p_roles.table;
1124 typetab = &state->base->p_types;
1174 usertab = &state->base->p_users;
1555 /*********** functions that copy avrule_decls from module to base ***********/
1746 state->base->decl_val_to_struct[state->next_decl_id - 1] =
1781 /* check if the base already has a scope entry */
1782 base_scope = hashtab_search(state->base->scope[symbol_num].table, id);
1794 ret = hashtab_insert(state->base->scope[symbol_num].table,
1857 /* Copy a module over to a base, remapping all values within. After
1935 policydb_t *pol = state->base;
1951 /* check base's scope table */
1953 if (!is_id_enabled(id, state->base, i)) {
1980 hashtab_search(state->base->p_classes_scope.table,
2000 if (!is_perm_enabled(id, perm_id, state->base)) {
2030 cur->branch_list->module_name : "BASE";
2094 policydb_t *p = state->base;
2096 cur->branch_list->module_name : "BASE";
2169 decl->module_name : "BASE";
2296 avrule_block_t *cur = state->base->global;
2300 /* iterate through all of the declarations in the base, to
2315 /* allocate the table mapping from base's decl_id to its
2317 free(state->base->decl_val_to_struct);
2318 if ((state->base->decl_val_to_struct =
2320 sizeof(*(state->base->decl_val_to_struct)))) == NULL) {
2331 cur = state->base->global;
2335 state->base->decl_val_to_struct[decl->decl_id - 1] =
2337 state->decl_to_mod[decl->decl_id] = state->base;
2344 if (cond_normalize(state->base) < 0) {
2346 "Error while normalizing conditionals within the base module.");
2379 sub_attr = state->base->role_val_to_struct[i];
2409 * copy its roles ebitmap into its duplicate's in the base->p_roles.table.
2429 base_role = (role_datum_t *)hashtab_search(state->base->p_roles.table,
2468 /* Link a set of modules into a base module. This process is somewhat
2470 * steps. The base and every module must have been indexed prior to
2482 state.base = b;
2487 ERR(state.handle, "Target of link was not a base policy.");
2509 "Tried to link in a non-MLS module with an MLS base.");
2512 "Tried to link in an MLS module with a non-MLS base.");
2558 if (policydb_index_others(state.handle, state.base, 0)) {
2563 /* copy and remap the module's data over to base */
2573 /* re-index base, for symbols were added to symbol tables */
2574 if (policydb_index_classes(state.base)) {
2578 if (policydb_index_others(state.handle, state.base, 0)) {
2583 if (enable_avrules(&state, state.base)) {
2593 * populate them up to the base.p_roles table. */
2594 if (populate_roleattributes(&state, state.base)) {
2600 if (hashtab_map(state.base->p_roles.table, expand_role_attributes,