• Home
  • Raw
  • Download

Lines Matching full:rc

242 	int rc = SEPOL_ERR;  in cil_common_to_policydb()  local
251 rc = symtab_insert(pdb, SYM_COMMONS, key, sepol_common, SCOPE_DECL, 0, &value); in cil_common_to_policydb()
252 if (rc != SEPOL_OK) { in cil_common_to_policydb()
258 rc = symtab_init(&sepol_common->permissions, PERM_SYMTAB_SIZE); in cil_common_to_policydb()
259 if (rc != SEPOL_OK) { in cil_common_to_policydb()
269 rc = hashtab_insert(sepol_common->permissions.table, key, sepol_perm); in cil_common_to_policydb()
270 if (rc != SEPOL_OK) { in cil_common_to_policydb()
285 return rc; in cil_common_to_policydb()
290 int rc = SEPOL_ERR; in cil_classorder_to_policydb() local
304 rc = symtab_insert(pdb, SYM_CLASSES, key, sepol_class, SCOPE_DECL, 0, &value); in cil_classorder_to_policydb()
305 if (rc != SEPOL_OK) { in cil_classorder_to_policydb()
314 rc = symtab_init(&sepol_class->permissions, PERM_SYMTAB_SIZE); in cil_classorder_to_policydb()
315 if (rc != SEPOL_OK) { in cil_classorder_to_policydb()
326 rc = cil_common_to_policydb(pdb, cil_common, &sepol_common); in cil_classorder_to_policydb()
327 if (rc != SEPOL_OK) { in cil_classorder_to_policydb()
347 rc = hashtab_insert(sepol_class->permissions.table, key, sepol_perm); in cil_classorder_to_policydb()
348 if (rc != SEPOL_OK) { in cil_classorder_to_policydb()
362 return rc; in cil_classorder_to_policydb()
367 int rc = SEPOL_ERR; in cil_role_to_policydb() local
376 rc = SEPOL_OK; in cil_role_to_policydb()
381 rc = symtab_insert(pdb, SYM_ROLES, (hashtab_key_t)key, sepol_role, SCOPE_DECL, 0, &value); in cil_role_to_policydb()
382 if (rc != SEPOL_OK) { in cil_role_to_policydb()
387 rc = SEPOL_ERR; in cil_role_to_policydb()
397 return rc; in cil_role_to_policydb()
402 int rc = SEPOL_ERR; in cil_role_bounds_to_policydb() local
407 rc = __cil_get_sepol_role_datum(pdb, DATUM(cil_role), &sepol_role); in cil_role_bounds_to_policydb()
408 if (rc != SEPOL_OK) goto exit; in cil_role_bounds_to_policydb()
410 rc = __cil_get_sepol_role_datum(pdb, DATUM(cil_role->bounds), &sepol_parent); in cil_role_bounds_to_policydb()
411 if (rc != SEPOL_OK) goto exit; in cil_role_bounds_to_policydb()
425 int rc = SEPOL_ERR; in cil_roletype_to_policydb() local
433 rc = __cil_get_sepol_role_datum(pdb, DATUM(role), &sepol_role); in cil_roletype_to_policydb()
434 if (rc != SEPOL_OK) goto exit; in cil_roletype_to_policydb()
437 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_type); in cil_roletype_to_policydb()
438 if (rc != SEPOL_OK) goto exit; in cil_roletype_to_policydb()
442 rc = SEPOL_ERR; in cil_roletype_to_policydb()
451 return rc; in cil_roletype_to_policydb()
456 int rc = SEPOL_ERR; in cil_type_to_policydb() local
465 rc = symtab_insert(pdb, SYM_TYPES, key, sepol_type, SCOPE_DECL, 0, &value); in cil_type_to_policydb()
466 if (rc != SEPOL_OK) { in cil_type_to_policydb()
480 return rc; in cil_type_to_policydb()
485 int rc = SEPOL_ERR; in cil_type_bounds_to_policydb() local
490 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_type), &sepol_type); in cil_type_bounds_to_policydb()
491 if (rc != SEPOL_OK) goto exit; in cil_type_bounds_to_policydb()
493 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_type->bounds), &sepol_parent); in cil_type_bounds_to_policydb()
494 if (rc != SEPOL_OK) goto exit; in cil_type_bounds_to_policydb()
508 int rc = SEPOL_ERR; in cil_typealias_to_policydb() local
514 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_alias->actual), &sepol_type); in cil_typealias_to_policydb()
515 if (rc != SEPOL_OK) goto exit; in cil_typealias_to_policydb()
520 rc = symtab_insert(pdb, SYM_TYPES, key, sepol_alias, SCOPE_DECL, 0, NULL); in cil_typealias_to_policydb()
521 if (rc != SEPOL_OK) { in cil_typealias_to_policydb()
533 return rc; in cil_typealias_to_policydb()
538 int rc = SEPOL_ERR; in cil_typepermissive_to_policydb() local
541 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_typeperm->type), &sepol_type); in cil_typepermissive_to_policydb()
542 if (rc != SEPOL_OK) goto exit; in cil_typepermissive_to_policydb()
553 return rc; in cil_typepermissive_to_policydb()
559 int rc = SEPOL_ERR; in cil_typeattribute_to_policydb() local
574 rc = symtab_insert(pdb, SYM_TYPES, key, sepol_attr, SCOPE_DECL, 0, &value); in cil_typeattribute_to_policydb()
575 if (rc != SEPOL_OK) { in cil_typeattribute_to_policydb()
588 return rc; in cil_typeattribute_to_policydb()
593 int rc = SEPOL_ERR; in __cil_typeattr_bitmap_init() local
603 rc = SEPOL_ERR; in __cil_typeattr_bitmap_init()
608 rc = SEPOL_ERR; in __cil_typeattr_bitmap_init()
618 return rc; in __cil_typeattr_bitmap_init()
623 int rc = SEPOL_ERR; in cil_typeattribute_to_bitmap() local
634 rc = __cil_typeattr_bitmap_init(pdb); in cil_typeattribute_to_bitmap()
635 if (rc != SEPOL_OK) { in cil_typeattribute_to_bitmap()
640 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_attr), &sepol_type); in cil_typeattribute_to_bitmap()
641 if (rc != SEPOL_OK) goto exit; in cil_typeattribute_to_bitmap()
646 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_type); in cil_typeattribute_to_bitmap()
647 if (rc != SEPOL_OK) goto exit; in cil_typeattribute_to_bitmap()
653 rc = SEPOL_OK; in cil_typeattribute_to_bitmap()
655 return rc; in cil_typeattribute_to_bitmap()
660 int rc = SEPOL_ERR; in cil_policycap_to_policydb() local
675 return rc; in cil_policycap_to_policydb()
680 int rc = SEPOL_ERR; in cil_user_to_policydb() local
687 rc = symtab_insert(pdb, SYM_USERS, key, sepol_user, SCOPE_DECL, 0, &value); in cil_user_to_policydb()
688 if (rc != SEPOL_OK) { in cil_user_to_policydb()
699 return rc; in cil_user_to_policydb()
704 int rc = SEPOL_ERR; in cil_user_bounds_to_policydb() local
709 rc = __cil_get_sepol_user_datum(pdb, DATUM(cil_user), &sepol_user); in cil_user_bounds_to_policydb()
710 if (rc != SEPOL_OK) goto exit; in cil_user_bounds_to_policydb()
712 rc = __cil_get_sepol_user_datum(pdb, DATUM(cil_user->bounds), &sepol_parent); in cil_user_bounds_to_policydb()
713 if (rc != SEPOL_OK) goto exit; in cil_user_bounds_to_policydb()
727 int rc = SEPOL_ERR; in cil_userrole_to_policydb() local
734 rc = __cil_get_sepol_user_datum(pdb, DATUM(user), &sepol_user); in cil_userrole_to_policydb()
735 if (rc != SEPOL_OK) { in cil_userrole_to_policydb()
740 rc = __cil_get_sepol_role_datum(pdb, DATUM(db->val_to_role[i]), &sepol_role); in cil_userrole_to_policydb()
741 if (rc != SEPOL_OK) { in cil_userrole_to_policydb()
753 rc = SEPOL_ERR; in cil_userrole_to_policydb()
759 rc = SEPOL_OK; in cil_userrole_to_policydb()
762 return rc; in cil_userrole_to_policydb()
767 int rc = SEPOL_ERR; in cil_bool_to_policydb() local
774 rc = symtab_insert(pdb, SYM_BOOLS, key, sepol_bool, SCOPE_DECL, 0, &value); in cil_bool_to_policydb()
775 if (rc != SEPOL_OK) { in cil_bool_to_policydb()
786 return rc; in cil_bool_to_policydb()
791 int rc = SEPOL_ERR; in cil_catorder_to_policydb() local
804 rc = symtab_insert(pdb, SYM_CATS, key, sepol_cat, SCOPE_DECL, 0, &value); in cil_catorder_to_policydb()
805 if (rc != SEPOL_OK) { in cil_catorder_to_policydb()
817 return rc; in cil_catorder_to_policydb()
822 int rc = SEPOL_ERR; in cil_catalias_to_policydb() local
828 rc = __cil_get_sepol_cat_datum(pdb, DATUM(cil_alias->actual), &sepol_cat); in cil_catalias_to_policydb()
829 if (rc != SEPOL_OK) goto exit; in cil_catalias_to_policydb()
832 rc = symtab_insert(pdb, SYM_CATS, key, sepol_alias, SCOPE_DECL, 0, NULL); in cil_catalias_to_policydb()
833 if (rc != SEPOL_OK) { in cil_catalias_to_policydb()
845 return rc; in cil_catalias_to_policydb()
850 int rc = SEPOL_ERR; in cil_sensitivityorder_to_policydb() local
866 rc = symtab_insert(pdb, SYM_LEVELS, key, sepol_level, SCOPE_DECL, 0, &value); in cil_sensitivityorder_to_policydb()
867 if (rc != SEPOL_OK) { in cil_sensitivityorder_to_policydb()
882 return rc; in cil_sensitivityorder_to_policydb()
887 int rc = SEPOL_ERR; in cil_sensalias_to_policydb() local
894 rc = __cil_get_sepol_level_datum(pdb, DATUM(cil_alias->actual), &sepol_level); in cil_sensalias_to_policydb()
895 if (rc != SEPOL_OK) goto exit; in cil_sensalias_to_policydb()
898 rc = symtab_insert(pdb, SYM_LEVELS, key, sepol_alias, SCOPE_DECL, 0, NULL); in cil_sensalias_to_policydb()
899 if (rc != SEPOL_OK) { in cil_sensalias_to_policydb()
906 rc = mls_level_cpy(mls_level, sepol_level->level); in cil_sensalias_to_policydb()
907 if (rc != SEPOL_OK) { in cil_sensalias_to_policydb()
920 return rc; in cil_sensalias_to_policydb()
925 int rc = SEPOL_OK; in __cil_cond_insert_rule() local
931 rc = SEPOL_ERR; in __cil_cond_insert_rule()
955 return rc; in __cil_cond_insert_rule()
976 int rc = SEPOL_OK; in __cil_insert_type_rule() local
996 rc = SEPOL_ERR; in __cil_insert_type_rule()
1015 rc = SEPOL_ERR; in __cil_insert_type_rule()
1021 rc = avtab_insert(&pdb->te_avtab, &avtab_key, &avtab_datum); in __cil_insert_type_rule()
1048 rc = SEPOL_ERR; in __cil_insert_type_rule()
1058rc = __cil_cond_insert_rule(&pdb->te_cond_avtab, &avtab_key, &avtab_datum, cond_node, cond_flavor); in __cil_insert_type_rule()
1062 return rc; in __cil_insert_type_rule()
1074 int rc; in __cil_type_rule_to_avtab_helper() local
1079 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_obj); in __cil_type_rule_to_avtab_helper()
1080 if (rc != SEPOL_OK) return rc; in __cil_type_rule_to_avtab_helper()
1082 rc = __cil_insert_type_rule( in __cil_type_rule_to_avtab_helper()
1087 if (rc != SEPOL_OK) return rc; in __cil_type_rule_to_avtab_helper()
1094 int rc = SEPOL_ERR; in __cil_type_rule_to_avtab() local
1111 rc = __cil_expand_type(src, &src_bitmap); in __cil_type_rule_to_avtab()
1112 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1116 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_rule->result), &sepol_result); in __cil_type_rule_to_avtab()
1117 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1121 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_src); in __cil_type_rule_to_avtab()
1122 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1124 rc = __cil_type_rule_to_avtab_helper( in __cil_type_rule_to_avtab()
1128 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1131 rc = __cil_expand_type(tgt, &tgt_bitmap); in __cil_type_rule_to_avtab()
1132 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1135 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_src); in __cil_type_rule_to_avtab()
1136 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1139 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[j]), &sepol_tgt); in __cil_type_rule_to_avtab()
1140 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1142 rc = __cil_type_rule_to_avtab_helper( in __cil_type_rule_to_avtab()
1147 if (rc != SEPOL_OK) goto exit; in __cil_type_rule_to_avtab()
1152 rc = SEPOL_OK; in __cil_type_rule_to_avtab()
1158 return rc; in __cil_type_rule_to_avtab()
1173 int rc; in __cil_typetransition_to_avtab_helper() local
1179 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_obj); in __cil_typetransition_to_avtab_helper()
1180 if (rc != SEPOL_OK) return rc; in __cil_typetransition_to_avtab_helper()
1182 rc = policydb_filetrans_insert( in __cil_typetransition_to_avtab_helper()
1187 if (rc != SEPOL_OK) { in __cil_typetransition_to_avtab_helper()
1188 if (rc == SEPOL_EEXIST) { in __cil_typetransition_to_avtab_helper()
1192 rc = SEPOL_OK; in __cil_typetransition_to_avtab_helper()
1197 if (rc != SEPOL_OK) { in __cil_typetransition_to_avtab_helper()
1198 return rc; in __cil_typetransition_to_avtab_helper()
1207 int rc = SEPOL_ERR; in __cil_typetransition_to_avtab() local
1239 rc = __cil_expand_type(src, &src_bitmap); in __cil_typetransition_to_avtab()
1240 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1244 rc = __cil_get_sepol_type_datum(pdb, DATUM(typetrans->result), &sepol_result); in __cil_typetransition_to_avtab()
1245 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1249 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_src); in __cil_typetransition_to_avtab()
1250 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1252 rc = __cil_typetransition_to_avtab_helper( in __cil_typetransition_to_avtab()
1256 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1259 rc = __cil_expand_type(tgt, &tgt_bitmap); in __cil_typetransition_to_avtab()
1260 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1263 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_src); in __cil_typetransition_to_avtab()
1264 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1267 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[j]), &sepol_tgt); in __cil_typetransition_to_avtab()
1268 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1270 rc = __cil_typetransition_to_avtab_helper( in __cil_typetransition_to_avtab()
1274 if (rc != SEPOL_OK) goto exit; in __cil_typetransition_to_avtab()
1279 rc = SEPOL_OK; in __cil_typetransition_to_avtab()
1285 return rc; in __cil_typetransition_to_avtab()
1295 int rc; in __perm_str_to_datum() local
1305 rc = SEPOL_ERR; in __perm_str_to_datum()
1314 return rc; in __perm_str_to_datum()
1319 int rc = SEPOL_ERR; in __cil_perms_to_datum() local
1329 rc = __perm_str_to_datum(key, sepol_class, &data); in __cil_perms_to_datum()
1330 if (rc != SEPOL_OK) { in __cil_perms_to_datum()
1340 return rc; in __cil_perms_to_datum()
1345 int rc = SEPOL_OK; in __cil_insert_avrule() local
1365 rc = SEPOL_ERR; in __cil_insert_avrule()
1373 rc = avtab_insert(&pdb->te_avtab, &avtab_key, &avtab_datum); in __cil_insert_avrule()
1381rc = __cil_cond_insert_rule(&pdb->te_cond_avtab, &avtab_key, &avtab_datum, cond_node, cond_flavor); in __cil_insert_avrule()
1385 return rc; in __cil_insert_avrule()
1390 int rc = SEPOL_ERR; in __cil_avrule_expand_helper() local
1396 rc = __cil_get_sepol_class_datum(pdb, DATUM(cp->class), &sepol_class); in __cil_avrule_expand_helper()
1397 if (rc != SEPOL_OK) goto exit; in __cil_avrule_expand_helper()
1399 rc = __cil_perms_to_datum(cp->perms, sepol_class, &data); in __cil_avrule_expand_helper()
1400 if (rc != SEPOL_OK) goto exit; in __cil_avrule_expand_helper()
1411 rc = __cil_get_sepol_type_datum(pdb, src, &sepol_src); in __cil_avrule_expand_helper()
1412 if (rc != SEPOL_OK) goto exit; in __cil_avrule_expand_helper()
1414 rc = __cil_get_sepol_type_datum(pdb, tgt, &sepol_tgt); in __cil_avrule_expand_helper()
1415 if (rc != SEPOL_OK) goto exit; in __cil_avrule_expand_helper()
1417rc = __cil_insert_avrule(pdb, kind, sepol_src->s.value, sepol_tgt->s.value, sepol_class->s.value, … in __cil_avrule_expand_helper()
1418 if (rc != SEPOL_OK) { in __cil_avrule_expand_helper()
1425 return rc; in __cil_avrule_expand_helper()
1431 int rc = SEPOL_ERR; in __cil_avrule_expand() local
1438 rc = __cil_avrule_expand_helper(pdb, kind, src, tgt, cp, cond_node, cond_flavor); in __cil_avrule_expand()
1439 if (rc != SEPOL_OK) { in __cil_avrule_expand()
1446 rc = __cil_avrule_expand(pdb, kind, src, tgt, cmp->classperms, cond_node, cond_flavor); in __cil_avrule_expand()
1447 if (rc != SEPOL_OK) { in __cil_avrule_expand()
1455 rc = __cil_avrule_expand(pdb, kind, src, tgt, cp->classperms, cond_node, cond_flavor); in __cil_avrule_expand()
1456 if (rc != SEPOL_OK) { in __cil_avrule_expand()
1465 return rc; in __cil_avrule_expand()
1486 int rc = SEPOL_ERR; in __cil_avrule_to_avtab() local
1497 rc = SEPOL_OK; in __cil_avrule_to_avtab()
1505 rc = __cil_expand_type(src, &src_bitmap); in __cil_avrule_to_avtab()
1506 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1512 rc = __cil_avrule_expand(pdb, kind, src, src, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1513 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1520 rc = __cil_expand_type(src, &src_bitmap); in __cil_avrule_to_avtab()
1521 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1530 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1531 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1540 rc = __cil_expand_type(src, &src_bitmap); in __cil_avrule_to_avtab()
1541 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1550 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1551 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1563 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1564 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1568 rc = __cil_expand_type(src, &src_bitmap); in __cil_avrule_to_avtab()
1569 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1573 rc = __cil_expand_type(tgt, &tgt_bitmap); in __cil_avrule_to_avtab()
1574 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1584 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1585 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1595 rc = __cil_expand_type(src, &src_bitmap); in __cil_avrule_to_avtab()
1596 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1603 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1604 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1611 rc = __cil_expand_type(tgt, &tgt_bitmap); in __cil_avrule_to_avtab()
1612 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1619 rc = __cil_avrule_expand(pdb, kind, src, tgt, classperms, cond_node, cond_flavor); in __cil_avrule_to_avtab()
1620 if (rc != SEPOL_OK) { in __cil_avrule_to_avtab()
1632 return rc; in __cil_avrule_to_avtab()
1760 int rc = SEPOL_OK; in __cil_avrulex_xperm_to_policydb() local
1779 rc = __perm_str_to_datum(kind, sepol_obj, &data); in __cil_avrulex_xperm_to_policydb()
1780 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_policydb()
1785 rc = __cil_permx_bitmap_to_sepol_xperms_list(xperm_kind, datum, &xperms_list); in __cil_avrulex_xperm_to_policydb()
1786 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_policydb()
1792 rc = avtab_insert(&pdb->te_avtab, avtab_key, &avtab_datum); in __cil_avrulex_xperm_to_policydb()
1793 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_policydb()
1798 rc = SEPOL_OK; in __cil_avrulex_xperm_to_policydb()
1807 return rc; in __cil_avrulex_xperm_to_policydb()
1823 int rc = SEPOL_ERR; in __cil_avrulex_xperm_to_hashtable() local
1836 rc = SEPOL_ERR; in __cil_avrulex_xperm_to_hashtable()
1849 rc = ebitmap_cpy(hashtab_xperms, xperms); in __cil_avrulex_xperm_to_hashtable()
1850 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_hashtable()
1855 rc = hashtab_insert(h, (hashtab_key_t)avtab_key, hashtab_xperms); in __cil_avrulex_xperm_to_hashtable()
1856 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_hashtable()
1863 rc = ebitmap_union(hashtab_xperms, xperms); in __cil_avrulex_xperm_to_hashtable()
1864 if (rc != SEPOL_OK) { in __cil_avrulex_xperm_to_hashtable()
1872 return rc; in __cil_avrulex_xperm_to_hashtable()
1877 int rc = SEPOL_ERR; in __cil_avrulex_to_hashtable_helper() local
1884 rc = __cil_get_sepol_type_datum(pdb, src, &sepol_src); in __cil_avrulex_to_hashtable_helper()
1885 if (rc != SEPOL_OK) goto exit; in __cil_avrulex_to_hashtable_helper()
1887 rc = __cil_get_sepol_type_datum(pdb, tgt, &sepol_tgt); in __cil_avrulex_to_hashtable_helper()
1888 if (rc != SEPOL_OK) goto exit; in __cil_avrulex_to_hashtable_helper()
1893 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_obj); in __cil_avrulex_to_hashtable_helper()
1894 if (rc != SEPOL_OK) goto exit; in __cil_avrulex_to_hashtable_helper()
1898rc = __cil_avrulex_xperm_to_hashtable(args->avrulex_ioctl_table, kind, sepol_src->s.value, sepol_t… in __cil_avrulex_to_hashtable_helper()
1899 if (rc != SEPOL_OK) goto exit; in __cil_avrulex_to_hashtable_helper()
1902rc = __cil_avrulex_xperm_to_hashtable(args->avrulex_nlmsg_table, kind, sepol_src->s.value, sepol_t… in __cil_avrulex_to_hashtable_helper()
1903 if (rc != SEPOL_OK) goto exit; in __cil_avrulex_to_hashtable_helper()
1906 rc = SEPOL_ERR; in __cil_avrulex_to_hashtable_helper()
1911 rc = SEPOL_OK; in __cil_avrulex_to_hashtable_helper()
1916 return rc; in __cil_avrulex_to_hashtable_helper()
1921 int rc = SEPOL_ERR; in cil_avrulex_to_hashtable() local
1931 rc = SEPOL_OK; in cil_avrulex_to_hashtable()
1940 rc = __cil_expand_type(src, &src_bitmap); in cil_avrulex_to_hashtable()
1941 if (rc != SEPOL_OK) goto exit; in cil_avrulex_to_hashtable()
1945 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, src, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1946 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
1953 rc = __cil_expand_type(src, &src_bitmap); in cil_avrulex_to_hashtable()
1954 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
1963 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1964 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
1973 rc = __cil_expand_type(src, &src_bitmap); in cil_avrulex_to_hashtable()
1974 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
1983 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1984 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
1997 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1998 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2002 rc = __cil_expand_type(src, &src_bitmap); in cil_avrulex_to_hashtable()
2003 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2007 rc = __cil_expand_type(tgt, &tgt_bitmap); in cil_avrulex_to_hashtable()
2008 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2018 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
2019 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2029 rc = __cil_expand_type(src, &src_bitmap); in cil_avrulex_to_hashtable()
2030 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2037 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
2038 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2045 rc = __cil_expand_type(tgt, &tgt_bitmap); in cil_avrulex_to_hashtable()
2046 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2053 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
2054 if (rc != SEPOL_OK) { in cil_avrulex_to_hashtable()
2066 return rc; in cil_avrulex_to_hashtable()
2080 int rc; in __cil_cond_to_policydb_helper() local
2100 rc = __cil_typetransition_to_avtab(pdb, db, cil_typetrans, cond_node, cond_flavor); in __cil_cond_to_policydb_helper()
2101 if (rc != SEPOL_OK) { in __cil_cond_to_policydb_helper()
2108 rc = __cil_type_rule_to_avtab(pdb, db, cil_type_rule, cond_node, cond_flavor); in __cil_cond_to_policydb_helper()
2109 if (rc != SEPOL_OK) { in __cil_cond_to_policydb_helper()
2116 rc = __cil_avrule_to_avtab(pdb, db, cil_avrule, cond_node, cond_flavor); in __cil_cond_to_policydb_helper()
2117 if (rc != SEPOL_OK) { in __cil_cond_to_policydb_helper()
2240 int rc = __cil_cond_expr_to_sepol_expr_helper(pdb, l, head, tail); in __cil_cond_item_to_sepol_expr() local
2241 if (rc != SEPOL_OK) { in __cil_cond_item_to_sepol_expr()
2256 int rc = SEPOL_ERR; in __cil_cond_expr_to_sepol_expr_helper() local
2299 rc = __cil_cond_item_to_sepol_expr(pdb, item->next, &h1, &t1); in __cil_cond_expr_to_sepol_expr_helper()
2300 if (rc != SEPOL_OK) { in __cil_cond_expr_to_sepol_expr_helper()
2311 rc = __cil_cond_item_to_sepol_expr(pdb, item->next->next, &h2, &t2); in __cil_cond_expr_to_sepol_expr_helper()
2312 if (rc != SEPOL_OK) { in __cil_cond_expr_to_sepol_expr_helper()
2325 rc = __cil_cond_item_to_sepol_expr(pdb, item, &h1, &t1); in __cil_cond_expr_to_sepol_expr_helper()
2326 if (rc != SEPOL_OK) { in __cil_cond_expr_to_sepol_expr_helper()
2332 rc = __cil_cond_item_to_sepol_expr(pdb, item, &h2, &t2); in __cil_cond_expr_to_sepol_expr_helper()
2333 if (rc != SEPOL_OK) { in __cil_cond_expr_to_sepol_expr_helper()
2357 int rc; in __cil_cond_expr_to_sepol_expr() local
2360 rc = __cil_cond_expr_to_sepol_expr_helper(pdb, cil_expr, &head, &tail); in __cil_cond_expr_to_sepol_expr()
2361 if (rc != SEPOL_OK) { in __cil_cond_expr_to_sepol_expr()
2416 int rc = SEPOL_ERR; in cil_booleanif_to_policydb() local
2431 rc = SEPOL_ERR; in cil_booleanif_to_policydb()
2436 rc = __cil_cond_expr_to_sepol_expr(pdb, cil_boolif->datum_expr, &tmp_cond->expr); in cil_booleanif_to_policydb()
2437 if (rc != SEPOL_OK) { in cil_booleanif_to_policydb()
2442 rc = __cil_validate_cond_expr(tmp_cond->expr); in cil_booleanif_to_policydb()
2443 if (rc != SEPOL_OK) { in cil_booleanif_to_policydb()
2449 rc = cond_normalize_expr(pdb, tmp_cond); in cil_booleanif_to_policydb()
2450 if (rc != SEPOL_OK) { in cil_booleanif_to_policydb()
2461 rc = SEPOL_ERR; in cil_booleanif_to_policydb()
2497 rc = cil_tree_walk(true_node, __cil_cond_to_policydb_helper, NULL, NULL, &bool_args); in cil_booleanif_to_policydb()
2498 if (rc != SEPOL_OK) { in cil_booleanif_to_policydb()
2506 rc = cil_tree_walk(false_node, __cil_cond_to_policydb_helper, NULL, NULL, &bool_args); in cil_booleanif_to_policydb()
2507 if (rc != SEPOL_OK) { in cil_booleanif_to_policydb()
2521 return rc; in cil_booleanif_to_policydb()
2526 int rc = SEPOL_ERR; in cil_roletrans_to_policydb() local
2539 rc = __cil_expand_role(DATUM(roletrans->src), &role_bitmap); in cil_roletrans_to_policydb()
2540 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2542 rc = __cil_expand_type(roletrans->tgt, &type_bitmap); in cil_roletrans_to_policydb()
2543 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2547 rc = __cil_get_sepol_role_datum(pdb, DATUM(roletrans->result), &sepol_result); in cil_roletrans_to_policydb()
2548 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2551 rc = __cil_get_sepol_role_datum(pdb, DATUM(db->val_to_role[i]), &sepol_src); in cil_roletrans_to_policydb()
2552 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2555 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[j]), &sepol_tgt); in cil_roletrans_to_policydb()
2556 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2560 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_obj); in cil_roletrans_to_policydb()
2561 if (rc != SEPOL_OK) goto exit; in cil_roletrans_to_policydb()
2570 rc = hashtab_insert(role_trans_table, (hashtab_key_t)new, &(new->new_role)); in cil_roletrans_to_policydb()
2571 if (rc != SEPOL_OK) { in cil_roletrans_to_policydb()
2572 if (rc == SEPOL_EEXIST) { in cil_roletrans_to_policydb()
2578 rc = SEPOL_OK; in cil_roletrans_to_policydb()
2590 if (rc != SEPOL_OK) { in cil_roletrans_to_policydb()
2598 rc = SEPOL_OK; in cil_roletrans_to_policydb()
2604 return rc; in cil_roletrans_to_policydb()
2609 int rc = SEPOL_ERR; in cil_roleallow_to_policydb() local
2617 rc = __cil_expand_role(roleallow->src, &src_bitmap); in cil_roleallow_to_policydb()
2618 if (rc != SEPOL_OK) goto exit; in cil_roleallow_to_policydb()
2620 rc = __cil_expand_role(roleallow->tgt, &tgt_bitmap); in cil_roleallow_to_policydb()
2621 if (rc != SEPOL_OK) goto exit; in cil_roleallow_to_policydb()
2624 rc = __cil_get_sepol_role_datum(pdb, DATUM(db->val_to_role[i]), &sepol_src); in cil_roleallow_to_policydb()
2625 if (rc != SEPOL_OK) goto exit; in cil_roleallow_to_policydb()
2628 rc = __cil_get_sepol_role_datum(pdb, DATUM(db->val_to_role[j]), &sepol_tgt); in cil_roleallow_to_policydb()
2629 if (rc != SEPOL_OK) goto exit; in cil_roleallow_to_policydb()
2641 rc = SEPOL_OK; in cil_roleallow_to_policydb()
2646 return rc; in cil_roleallow_to_policydb()
2651 int rc = SEPOL_ERR; in __cil_constrain_expr_datum_to_sepol_expr() local
2659 rc = __cil_expand_user(item->data, &user_bitmap); in __cil_constrain_expr_datum_to_sepol_expr()
2660 if (rc != SEPOL_OK) goto exit; in __cil_constrain_expr_datum_to_sepol_expr()
2663 rc = __cil_get_sepol_user_datum(pdb, DATUM(db->val_to_user[i]), &sepol_user); in __cil_constrain_expr_datum_to_sepol_expr()
2664 if (rc != SEPOL_OK) { in __cil_constrain_expr_datum_to_sepol_expr()
2681 rc = __cil_expand_role(item->data, &role_bitmap); in __cil_constrain_expr_datum_to_sepol_expr()
2682 if (rc != SEPOL_OK) goto exit; in __cil_constrain_expr_datum_to_sepol_expr()
2685 rc = __cil_get_sepol_role_datum(pdb, DATUM(db->val_to_role[i]), &sepol_role); in __cil_constrain_expr_datum_to_sepol_expr()
2686 if (rc != SEPOL_OK) { in __cil_constrain_expr_datum_to_sepol_expr()
2704 rc = __cil_get_sepol_type_datum(pdb, item->data, &sepol_type); in __cil_constrain_expr_datum_to_sepol_expr()
2705 if (rc != SEPOL_OK) { in __cil_constrain_expr_datum_to_sepol_expr()
2709 rc = 0; in __cil_constrain_expr_datum_to_sepol_expr()
2715 rc = ebitmap_set_bit(&expr->type_names->types, sepol_type->s.value - 1, 1); in __cil_constrain_expr_datum_to_sepol_expr()
2718 if (rc != SEPOL_OK) { in __cil_constrain_expr_datum_to_sepol_expr()
2723 rc = __cil_expand_type(item->data, &type_bitmap); in __cil_constrain_expr_datum_to_sepol_expr()
2724 if (rc != SEPOL_OK) goto exit; in __cil_constrain_expr_datum_to_sepol_expr()
2727 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_type); in __cil_constrain_expr_datum_to_sepol_expr()
2728 if (rc != SEPOL_OK) { in __cil_constrain_expr_datum_to_sepol_expr()
2751 int rc = SEPOL_ERR; in __cil_constrain_expr_leaf_to_sepol_expr() local
2819 rc = __cil_constrain_expr_datum_to_sepol_expr(pdb, db, r_item, expr_flavor, expr); in __cil_constrain_expr_leaf_to_sepol_expr()
2820 if (rc != SEPOL_OK) { in __cil_constrain_expr_leaf_to_sepol_expr()
2827 rc = __cil_constrain_expr_datum_to_sepol_expr(pdb, db, curr, expr_flavor, expr); in __cil_constrain_expr_leaf_to_sepol_expr()
2828 if (rc != SEPOL_OK) { in __cil_constrain_expr_leaf_to_sepol_expr()
2833 rc = SEPOL_ERR; in __cil_constrain_expr_leaf_to_sepol_expr()
2841 return rc; in __cil_constrain_expr_leaf_to_sepol_expr()
2846 int rc = SEPOL_ERR; in __cil_constrain_expr_to_sepol_expr_helper() local
2861 rc = constraint_expr_init(op); in __cil_constrain_expr_to_sepol_expr_helper()
2862 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr_helper()
2902 rc = __cil_constrain_expr_leaf_to_sepol_expr(pdb, db, item, flavor, op); in __cil_constrain_expr_to_sepol_expr_helper()
2903 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr_helper()
2910 rc = __cil_constrain_expr_to_sepol_expr_helper(pdb, db, l_expr, &h1, &t1); in __cil_constrain_expr_to_sepol_expr_helper()
2911 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr_helper()
2920 rc = __cil_constrain_expr_to_sepol_expr_helper(pdb, db, l_expr, &h1, &t1); in __cil_constrain_expr_to_sepol_expr_helper()
2921 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr_helper()
2924 rc = __cil_constrain_expr_to_sepol_expr_helper(pdb, db, r_expr, &h2, &t2); in __cil_constrain_expr_to_sepol_expr_helper()
2925 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr_helper()
2944 int rc; in __cil_constrain_expr_to_sepol_expr() local
2947 rc = __cil_constrain_expr_to_sepol_expr_helper(pdb, db, cil_expr, &head, &tail); in __cil_constrain_expr_to_sepol_expr()
2948 if (rc != SEPOL_OK) { in __cil_constrain_expr_to_sepol_expr()
3002 int rc = SEPOL_ERR; in cil_constrain_to_policydb_helper() local
3010 rc = __cil_get_sepol_class_datum(pdb, class, &sepol_class); in cil_constrain_to_policydb_helper()
3011 if (rc != SEPOL_OK) goto exit; in cil_constrain_to_policydb_helper()
3013 rc = __cil_perms_to_datum(perms, sepol_class, &sepol_constrain->permissions); in cil_constrain_to_policydb_helper()
3014 if (rc != SEPOL_OK) { in cil_constrain_to_policydb_helper()
3024 rc = __cil_constrain_expr_to_sepol_expr(pdb, db, expr, &sepol_expr); in cil_constrain_to_policydb_helper()
3025 if (rc != SEPOL_OK) { in cil_constrain_to_policydb_helper()
3029 rc = __cil_validate_constrain_expr(sepol_expr); in cil_constrain_to_policydb_helper()
3030 if (rc != SEPOL_OK) { in cil_constrain_to_policydb_helper()
3043 return rc; in cil_constrain_to_policydb_helper()
3048 int rc = SEPOL_ERR; in cil_constrain_expand() local
3055 rc = cil_constrain_to_policydb_helper(pdb, db, DATUM(cp->class), cp->perms, expr); in cil_constrain_expand()
3056 if (rc != SEPOL_OK) { in cil_constrain_expand()
3063 rc = cil_constrain_expand(pdb, db, cmp->classperms, expr); in cil_constrain_expand()
3064 if (rc != SEPOL_OK) { in cil_constrain_expand()
3072 rc = cil_constrain_expand(pdb, db, cp->classperms, expr); in cil_constrain_expand()
3073 if (rc != SEPOL_OK) { in cil_constrain_expand()
3082 return rc; in cil_constrain_expand()
3087 int rc = SEPOL_ERR; in cil_constrain_to_policydb() local
3088 rc = cil_constrain_expand(pdb, db, cil_constrain->classperms, cil_constrain->datum_expr); in cil_constrain_to_policydb()
3089 if (rc != SEPOL_OK) { in cil_constrain_to_policydb()
3097 return rc; in cil_constrain_to_policydb()
3102 int rc = SEPOL_ERR; in cil_validatetrans_to_policydb() local
3113 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_validatetrans_to_policydb()
3114 if (rc != SEPOL_OK) goto exit; in cil_validatetrans_to_policydb()
3119 rc = __cil_constrain_expr_to_sepol_expr(pdb, db, expr, &sepol_expr); in cil_validatetrans_to_policydb()
3120 if (rc != SEPOL_OK) { in cil_validatetrans_to_policydb()
3130 rc = SEPOL_OK; in cil_validatetrans_to_policydb()
3134 return rc; in cil_validatetrans_to_policydb()
3139 int rc = SEPOL_ERR; in __cil_cats_to_mls_level() local
3149 rc = __cil_get_sepol_cat_datum(pdb, j->data, &sepol_cat); in __cil_cats_to_mls_level()
3150 if (rc != SEPOL_OK) goto exit; in __cil_cats_to_mls_level()
3152 rc = ebitmap_set_bit(&mls_level->cat, sepol_cat->s.value - 1, 1); in __cil_cats_to_mls_level()
3153 if (rc != SEPOL_OK) goto exit; in __cil_cats_to_mls_level()
3156 rc = __cil_get_sepol_cat_datum(pdb, i->data, &sepol_cat); in __cil_cats_to_mls_level()
3157 if (rc != SEPOL_OK) goto exit; in __cil_cats_to_mls_level()
3159 rc = ebitmap_set_bit(&mls_level->cat, sepol_cat->s.value - 1, 1); in __cil_cats_to_mls_level()
3160 if (rc != SEPOL_OK) goto exit; in __cil_cats_to_mls_level()
3172 int rc = SEPOL_ERR; in cil_sepol_level_define() local
3177 rc = __cil_get_sepol_level_datum(pdb, DATUM(cil_sens), &sepol_level); in cil_sepol_level_define()
3178 if (rc != SEPOL_OK) goto exit; in cil_sepol_level_define()
3187 rc = __cil_cats_to_mls_level(pdb, cats, mls_level); in cil_sepol_level_define()
3188 if (rc != SEPOL_OK) { in cil_sepol_level_define()
3198 return rc; in cil_sepol_level_define()
3203 int rc = SEPOL_ERR; in cil_level_to_mls_level() local
3208 rc = __cil_get_sepol_level_datum(pdb, DATUM(cil_sens), &sepol_level); in cil_level_to_mls_level()
3209 if (rc != SEPOL_OK) goto exit; in cil_level_to_mls_level()
3216 rc = __cil_cats_to_mls_level(pdb, cats, mls_level); in cil_level_to_mls_level()
3217 if (rc != SEPOL_OK) { in cil_level_to_mls_level()
3223 rc = SEPOL_OK; in cil_level_to_mls_level()
3225 return rc; in cil_level_to_mls_level()
3230 int rc = SEPOL_ERR; in __cil_levelrange_to_mls_range() local
3237 rc = cil_level_to_mls_level(pdb, low, mls_level); in __cil_levelrange_to_mls_range()
3238 if (rc != SEPOL_OK) { in __cil_levelrange_to_mls_range()
3244 rc = cil_level_to_mls_level(pdb, high, mls_level); in __cil_levelrange_to_mls_range()
3245 if (rc != SEPOL_OK) { in __cil_levelrange_to_mls_range()
3252 return rc; in __cil_levelrange_to_mls_range()
3257 int rc = SEPOL_ERR; in cil_userlevel_userrange_to_policydb() local
3262 rc = __cil_get_sepol_user_datum(pdb, DATUM(cil_user), &sepol_user); in cil_userlevel_userrange_to_policydb()
3263 if (rc != SEPOL_OK) goto exit; in cil_userlevel_userrange_to_policydb()
3265 rc = cil_level_to_mls_level(pdb, cil_level, &sepol_user->exp_dfltlevel); in cil_userlevel_userrange_to_policydb()
3266 if (rc != SEPOL_OK) { in cil_userlevel_userrange_to_policydb()
3270 rc = __cil_levelrange_to_mls_range(pdb, cil_levelrange, &sepol_user->exp_range); in cil_userlevel_userrange_to_policydb()
3271 if (rc != SEPOL_OK) { in cil_userlevel_userrange_to_policydb()
3278 return rc; in cil_userlevel_userrange_to_policydb()
3283 int rc = SEPOL_ERR; in __cil_context_to_sepol_context() local
3289 rc = __cil_get_sepol_user_datum(pdb, DATUM(cil_context->user), &sepol_user); in __cil_context_to_sepol_context()
3290 if (rc != SEPOL_OK) goto exit; in __cil_context_to_sepol_context()
3292 rc = __cil_get_sepol_role_datum(pdb, DATUM(cil_context->role), &sepol_role); in __cil_context_to_sepol_context()
3293 if (rc != SEPOL_OK) goto exit; in __cil_context_to_sepol_context()
3295 rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_context->type), &sepol_type); in __cil_context_to_sepol_context()
3296 if (rc != SEPOL_OK) goto exit; in __cil_context_to_sepol_context()
3305 rc = __cil_levelrange_to_mls_range(pdb, cil_lvlrange, &sepol_context->range); in __cil_context_to_sepol_context()
3306 if (rc != SEPOL_OK) { in __cil_context_to_sepol_context()
3316 return rc; in __cil_context_to_sepol_context()
3321 int rc = SEPOL_ERR; in cil_sidorder_to_policydb() local
3342 rc = __cil_context_to_sepol_context(pdb, cil_context, &new_ocon->context[0]); in cil_sidorder_to_policydb()
3343 if (rc != SEPOL_OK) { in cil_sidorder_to_policydb()
3353 return rc; in cil_sidorder_to_policydb()
3358 int rc = SEPOL_ERR; in cil_rangetransition_to_policydb() local
3371 rc = __cil_expand_type(rangetrans->src, &src_bitmap); in cil_rangetransition_to_policydb()
3372 if (rc != SEPOL_OK) goto exit; in cil_rangetransition_to_policydb()
3374 rc = __cil_expand_type(rangetrans->exec, &tgt_bitmap); in cil_rangetransition_to_policydb()
3375 if (rc != SEPOL_OK) goto exit; in cil_rangetransition_to_policydb()
3380 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[i]), &sepol_src); in cil_rangetransition_to_policydb()
3381 if (rc != SEPOL_OK) goto exit; in cil_rangetransition_to_policydb()
3384 rc = __cil_get_sepol_type_datum(pdb, DATUM(db->val_to_type[j]), &sepol_tgt); in cil_rangetransition_to_policydb()
3385 if (rc != SEPOL_OK) goto exit; in cil_rangetransition_to_policydb()
3388 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_rangetransition_to_policydb()
3389 if (rc != SEPOL_OK) goto exit; in cil_rangetransition_to_policydb()
3396 rc = __cil_levelrange_to_mls_range(pdb, rangetrans->range, newdatum); in cil_rangetransition_to_policydb()
3397 if (rc != SEPOL_OK) { in cil_rangetransition_to_policydb()
3403 rc = hashtab_insert(pdb->range_tr, (hashtab_key_t)newkey, newdatum); in cil_rangetransition_to_policydb()
3404 if (rc != SEPOL_OK) { in cil_rangetransition_to_policydb()
3405 if (rc == SEPOL_EEXIST) { in cil_rangetransition_to_policydb()
3410 rc = SEPOL_OK; in cil_rangetransition_to_policydb()
3427 if (rc != SEPOL_OK) { in cil_rangetransition_to_policydb()
3435 rc = SEPOL_OK; in cil_rangetransition_to_policydb()
3441 return rc; in cil_rangetransition_to_policydb()
3446 int rc = SEPOL_ERR; in cil_ibpkeycon_to_policydb() local
3455 rc = inet_pton(AF_INET6, cil_ibpkeycon->subnet_prefix_str, &subnet_prefix); in cil_ibpkeycon_to_policydb()
3456 if (rc != 1) { in cil_ibpkeycon_to_policydb()
3458 rc = SEPOL_ERR; in cil_ibpkeycon_to_policydb()
3467 rc = __cil_context_to_sepol_context(pdb, cil_ibpkeycon->context, &new_ocon->context[0]); in cil_ibpkeycon_to_policydb()
3468 if (rc != SEPOL_OK) in cil_ibpkeycon_to_policydb()
3475 return rc; in cil_ibpkeycon_to_policydb()
3480 int rc = SEPOL_ERR; in cil_portcon_to_policydb() local
3503 rc = SEPOL_ERR; in cil_portcon_to_policydb()
3510 rc = __cil_context_to_sepol_context(pdb, cil_portcon->context, &new_ocon->context[0]); in cil_portcon_to_policydb()
3511 if (rc != SEPOL_OK) { in cil_portcon_to_policydb()
3519 return rc; in cil_portcon_to_policydb()
3524 int rc = SEPOL_ERR; in cil_netifcon_to_policydb() local
3534 rc = __cil_context_to_sepol_context(pdb, cil_netifcon->if_context, &new_ocon->context[0]); in cil_netifcon_to_policydb()
3535 if (rc != SEPOL_OK) { in cil_netifcon_to_policydb()
3539 rc = __cil_context_to_sepol_context(pdb, cil_netifcon->packet_context, &new_ocon->context[1]); in cil_netifcon_to_policydb()
3540 if (rc != SEPOL_OK) { in cil_netifcon_to_policydb()
3549 return rc; in cil_netifcon_to_policydb()
3554 int rc = SEPOL_ERR; in cil_ibendportcon_to_policydb() local
3565 rc = __cil_context_to_sepol_context(pdb, cil_ibendportcon->context, &new_ocon->context[0]); in cil_ibendportcon_to_policydb()
3566 if (rc != SEPOL_OK) in cil_ibendportcon_to_policydb()
3573 return rc; in cil_ibendportcon_to_policydb()
3578 int rc = SEPOL_ERR; in cil_nodecon_to_policydb() local
3597 rc = SEPOL_ERR; in cil_nodecon_to_policydb()
3601 rc = __cil_context_to_sepol_context(pdb, cil_nodecon->context, &new_ocon->context[0]); in cil_nodecon_to_policydb()
3602 if (rc != SEPOL_OK) { in cil_nodecon_to_policydb()
3610 return rc; in cil_nodecon_to_policydb()
3615 int rc = SEPOL_ERR; in cil_fsuse_to_policydb() local
3626 rc = __cil_context_to_sepol_context(pdb, cil_fsuse->context, &new_ocon->context[0]); in cil_fsuse_to_policydb()
3627 if (rc != SEPOL_OK) { in cil_fsuse_to_policydb()
3635 return rc; in cil_fsuse_to_policydb()
3640 int rc = SEPOL_ERR; in cil_genfscon_to_policydb() local
3696 rc = SEPOL_ERR; in cil_genfscon_to_policydb()
3701 rc = SEPOL_ERR; in cil_genfscon_to_policydb()
3707 rc = __cil_context_to_sepol_context(pdb, cil_genfscon->context, &new_ocon->context[0]); in cil_genfscon_to_policydb()
3708 if (rc != SEPOL_OK) { in cil_genfscon_to_policydb()
3716 return rc; in cil_genfscon_to_policydb()
3721 int rc = SEPOL_ERR; in cil_pirqcon_to_policydb() local
3731 rc = __cil_context_to_sepol_context(pdb, cil_pirqcon->context, &new_ocon->context[0]); in cil_pirqcon_to_policydb()
3732 if (rc != SEPOL_OK) { in cil_pirqcon_to_policydb()
3740 return rc; in cil_pirqcon_to_policydb()
3745 int rc = SEPOL_ERR; in cil_iomemcon_to_policydb() local
3756 rc = __cil_context_to_sepol_context(pdb, cil_iomemcon->context, &new_ocon->context[0]); in cil_iomemcon_to_policydb()
3757 if (rc != SEPOL_OK) { in cil_iomemcon_to_policydb()
3765 return rc; in cil_iomemcon_to_policydb()
3770 int rc = SEPOL_ERR; in cil_ioportcon_to_policydb() local
3781 rc = __cil_context_to_sepol_context(pdb, cil_ioportcon->context, &new_ocon->context[0]); in cil_ioportcon_to_policydb()
3782 if (rc != SEPOL_OK) { in cil_ioportcon_to_policydb()
3790 return rc; in cil_ioportcon_to_policydb()
3795 int rc = SEPOL_ERR; in cil_pcidevicecon_to_policydb() local
3805 rc = __cil_context_to_sepol_context(pdb, cil_pcidevicecon->context, &new_ocon->context[0]); in cil_pcidevicecon_to_policydb()
3806 if (rc != SEPOL_OK) { in cil_pcidevicecon_to_policydb()
3814 return rc; in cil_pcidevicecon_to_policydb()
3819 int rc = SEPOL_ERR; in cil_devicetreecon_to_policydb() local
3829 rc = __cil_context_to_sepol_context(pdb, cil_devicetreecon->context, &new_ocon->context[0]); in cil_devicetreecon_to_policydb()
3830 if (rc != SEPOL_OK) { in cil_devicetreecon_to_policydb()
3838 return rc; in cil_devicetreecon_to_policydb()
3853 int rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_default_to_policydb() local
3854 if (rc != SEPOL_OK) goto exit; in cil_default_to_policydb()
3908 int rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_class); in cil_defaultrange_to_policydb() local
3909 if (rc != SEPOL_OK) goto exit; in cil_defaultrange_to_policydb()
3931 int rc = SEPOL_OK; in __cil_node_to_policydb() local
3955 rc = cil_role_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3958 rc = cil_type_to_policydb(pdb, node->data, type_value_to_cil); in __cil_node_to_policydb()
3961 rc = cil_typeattribute_to_policydb(pdb, node->data, type_value_to_cil); in __cil_node_to_policydb()
3964 rc = cil_policycap_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3967 rc = cil_user_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3970 rc = cil_bool_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3974 rc = cil_catalias_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3979 rc = cil_sepol_level_define(pdb, node->data); in __cil_node_to_policydb()
3989 rc = cil_type_bounds_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3992 rc = cil_typealias_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3995 rc = cil_typepermissive_to_policydb(pdb, node->data); in __cil_node_to_policydb()
3998 rc = cil_typeattribute_to_bitmap(pdb, db, node->data); in __cil_node_to_policydb()
4002 rc = cil_sensalias_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4006 rc = cil_role_bounds_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4007 if (rc != SEPOL_OK) goto exit; in __cil_node_to_policydb()
4008 rc = cil_roletype_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4011 rc = cil_user_bounds_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4012 if (rc != SEPOL_OK) goto exit; in __cil_node_to_policydb()
4014 rc = cil_userlevel_userrange_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4015 if (rc != SEPOL_OK) { in __cil_node_to_policydb()
4019 rc = cil_userrole_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4022 rc = cil_type_rule_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4034 rc = cil_roletrans_to_policydb(pdb, db, node->data, role_trans_table); in __cil_node_to_policydb()
4037 /*rc = cil_roleattributeset_to_policydb(pdb, node->data);*/ in __cil_node_to_policydb()
4040 rc = cil_typetransition_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4043 rc = cil_constrain_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4047 rc = cil_constrain_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4051 rc = cil_validatetrans_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4055 rc = cil_validatetrans_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4060 rc = cil_rangetransition_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4066 rc = cil_default_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4069 rc = cil_defaultrange_to_policydb(pdb, node->data); in __cil_node_to_policydb()
4078 rc = cil_booleanif_to_policydb(pdb, db, node); in __cil_node_to_policydb()
4083 rc = cil_avrule_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4090 rc = cil_avrulex_to_hashtable(pdb, db, node->data, args); in __cil_node_to_policydb()
4095 rc = cil_roleallow_to_policydb(pdb, db, node->data); in __cil_node_to_policydb()
4105 if (rc != SEPOL_OK) { in __cil_node_to_policydb()
4108 return rc; in __cil_node_to_policydb()
4113 int rc = SEPOL_ERR; in __cil_binary_create_helper() local
4119 rc = SEPOL_OK; in __cil_binary_create_helper()
4124 rc = SEPOL_OK; in __cil_binary_create_helper()
4130 rc = __cil_node_to_policydb(node, extra_args); in __cil_binary_create_helper()
4131 if (rc != SEPOL_OK) { in __cil_binary_create_helper()
4136 return rc; in __cil_binary_create_helper()
4141 int rc = SEPOL_ERR; in __cil_contexts_to_policydb() local
4143 rc = cil_portcon_to_policydb(pdb, db->portcon); in __cil_contexts_to_policydb()
4144 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4148 rc = cil_netifcon_to_policydb(pdb, db->netifcon); in __cil_contexts_to_policydb()
4149 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4153 rc = cil_nodecon_to_policydb(pdb, db->nodecon); in __cil_contexts_to_policydb()
4154 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4158 rc = cil_fsuse_to_policydb(pdb, db->fsuse); in __cil_contexts_to_policydb()
4159 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4163 rc = cil_genfscon_to_policydb(pdb, db->genfscon); in __cil_contexts_to_policydb()
4164 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4168 rc = cil_ibpkeycon_to_policydb(pdb, db->ibpkeycon); in __cil_contexts_to_policydb()
4169 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4173 rc = cil_ibendportcon_to_policydb(pdb, db->ibendportcon); in __cil_contexts_to_policydb()
4174 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4179 rc = cil_pirqcon_to_policydb(pdb, db->pirqcon); in __cil_contexts_to_policydb()
4180 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4184 rc = cil_iomemcon_to_policydb(pdb, db->iomemcon); in __cil_contexts_to_policydb()
4185 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4189 rc = cil_ioportcon_to_policydb(pdb, db->ioportcon); in __cil_contexts_to_policydb()
4190 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4194 rc = cil_pcidevicecon_to_policydb(pdb, db->pcidevicecon); in __cil_contexts_to_policydb()
4195 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4199 rc = cil_devicetreecon_to_policydb(pdb, db->devicetreecon); in __cil_contexts_to_policydb()
4200 if (rc != SEPOL_OK) { in __cil_contexts_to_policydb()
4206 return rc; in __cil_contexts_to_policydb()
4320 int rc = SEPOL_ERR; in __cil_policydb_val_arrays_create() local
4323 rc = hashtab_map(policydb->p_commons.table, &__cil_common_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4324 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4330 rc = hashtab_map(policydb->p_classes.table, &__cil_class_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4331 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4337 rc = hashtab_map(policydb->p_roles.table, &__cil_role_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4338 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4344 rc = hashtab_map(policydb->p_types.table, &__cil_type_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4345 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4351 rc = hashtab_map(policydb->p_users.table, &__cil_user_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4352 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4358 rc = hashtab_map(policydb->p_bools.table, &__cil_bool_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4359 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4364 rc = hashtab_map(policydb->p_levels.table, &__cil_level_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4365 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4370 rc = hashtab_map(policydb->p_cats.table, &__cil_cat_val_array_insert, policydb); in __cil_policydb_val_arrays_create()
4371 if (rc != SEPOL_OK) { in __cil_policydb_val_arrays_create()
4376 return rc; in __cil_policydb_val_arrays_create()
4415 int rc; in __cil_policydb_create() local
4418 rc = sepol_policydb_create(spdb); in __cil_policydb_create()
4419 if (rc < 0) { in __cil_policydb_create()
4438 return rc; in __cil_policydb_create()
4444 int rc = SEPOL_ERR; in __cil_policydb_init() local
4452 rc = cil_classorder_to_policydb(pdb, db, class_value_to_cil, perm_value_to_cil); in __cil_policydb_init()
4453 if (rc != SEPOL_OK) { in __cil_policydb_init()
4458 rc = cil_catorder_to_policydb(pdb, db); in __cil_policydb_init()
4459 if (rc != SEPOL_OK) { in __cil_policydb_init()
4463 rc = cil_sensitivityorder_to_policydb(pdb, db); in __cil_policydb_init()
4464 if (rc != SEPOL_OK) { in __cil_policydb_init()
4469 rc = avtab_alloc(&pdb->te_avtab, MAX_AVTAB_SIZE); in __cil_policydb_init()
4470 if (rc != SEPOL_OK) { in __cil_policydb_init()
4474 rc = avtab_alloc(&pdb->te_cond_avtab, MAX_AVTAB_SIZE); in __cil_policydb_init()
4475 if (rc != SEPOL_OK) { in __cil_policydb_init()
4483 return rc; in __cil_policydb_init()
4557 int rc = SEPOL_ERR; in cil_binary_create() local
4560 rc = __cil_policydb_create(db, &pdb); in cil_binary_create()
4561 if (rc != SEPOL_OK) { in cil_binary_create()
4565 rc = cil_binary_create_allocated_pdb(db, pdb); in cil_binary_create()
4566 if (rc != SEPOL_OK) { in cil_binary_create()
4577 return rc; in cil_binary_create()
4593 int rc = SEPOL_ERR; in __cil_rule_to_sepol_class_perms() local
4603 rc = __cil_get_sepol_class_datum(pdb, DATUM(cp->class), &sepol_class); in __cil_rule_to_sepol_class_perms()
4604 if (rc != SEPOL_OK) goto exit; in __cil_rule_to_sepol_class_perms()
4606 rc = __cil_perms_to_datum(cp->perms, sepol_class, &data); in __cil_rule_to_sepol_class_perms()
4607 if (rc != SEPOL_OK) goto exit; in __cil_rule_to_sepol_class_perms()
4619 rc = __cil_rule_to_sepol_class_perms(pdb, cmp->classperms, sepol_class_perms); in __cil_rule_to_sepol_class_perms()
4620 if (rc != SEPOL_OK) { in __cil_rule_to_sepol_class_perms()
4628 rc = __cil_rule_to_sepol_class_perms(pdb, cp->classperms, sepol_class_perms); in __cil_rule_to_sepol_class_perms()
4629 if (rc != SEPOL_OK) { in __cil_rule_to_sepol_class_perms()
4637 return rc; in __cil_rule_to_sepol_class_perms()
4642 int rc = SEPOL_OK; in __cil_permx_to_sepol_class_perms() local
4653 rc = __cil_get_sepol_class_datum(pdb, DATUM(c->data), &sepol_obj); in __cil_permx_to_sepol_class_perms()
4654 if (rc != SEPOL_OK) { in __cil_permx_to_sepol_class_perms()
4666 rc = SEPOL_ERR; in __cil_permx_to_sepol_class_perms()
4670 rc = __perm_str_to_datum(perm_str, sepol_obj, &data); in __cil_permx_to_sepol_class_perms()
4671 if (rc != SEPOL_OK) { in __cil_permx_to_sepol_class_perms()
4685 return rc; in __cil_permx_to_sepol_class_perms()
4697 int rc = SEPOL_ERR; in __cil_add_sepol_type() local
4707 rc = __cil_get_sepol_type_datum(pdb, datum, &sepol_datum); in __cil_add_sepol_type()
4708 if (rc != SEPOL_OK) goto exit; in __cil_add_sepol_type()
4712 rc = __cil_get_sepol_type_datum(pdb, datum, &sepol_datum); in __cil_add_sepol_type()
4713 if (rc != SEPOL_OK) goto exit; in __cil_add_sepol_type()
4720 return rc; in __cil_add_sepol_type()
4834 int rc; in __cil_print_neverallow_failure() local
4866 rc = cil_find_matching_avrule_in_ast(db->ast->root, avrule_flavor, &target, matching, CIL_FALSE); in __cil_print_neverallow_failure()
4867 if (rc) { in __cil_print_neverallow_failure()
4891 return rc; in __cil_print_neverallow_failure()
4896 int rc = SEPOL_OK; in cil_check_neverallow() local
4913 rc = __cil_add_sepol_type(pdb, db, cil_rule->src, &rule->stypes.types); in cil_check_neverallow()
4914 if (rc != SEPOL_OK) { in cil_check_neverallow()
4924 rc = __cil_add_sepol_type(pdb, db, cil_rule->src, &rule->ttypes.types); in cil_check_neverallow()
4925 if (rc != SEPOL_OK) { in cil_check_neverallow()
4929 rc = __cil_add_sepol_type(pdb, db, tgt, &rule->ttypes.types); in cil_check_neverallow()
4930 if (rc != SEPOL_OK) { in cil_check_neverallow()
4936 rc = __cil_rule_to_sepol_class_perms(pdb, cil_rule->perms.classperms, &rule->perms); in cil_check_neverallow()
4937 if (rc != SEPOL_OK) { in cil_check_neverallow()
4941 rc = check_assertion(pdb, rule); in cil_check_neverallow()
4942 if (rc == CIL_TRUE) { in cil_check_neverallow()
4944 rc = __cil_print_neverallow_failure(db, node); in cil_check_neverallow()
4945 if (rc != SEPOL_OK) { in cil_check_neverallow()
4951 rc = __cil_permx_to_sepol_class_perms(pdb, cil_rule->perms.x.permx, &rule->perms); in cil_check_neverallow()
4952 if (rc != SEPOL_OK) { in cil_check_neverallow()
4956rc = __cil_permx_bitmap_to_sepol_xperms_list(cil_rule->perms.x.permx->kind, cil_rule->perms.x.perm… in cil_check_neverallow()
4957 if (rc != SEPOL_OK) { in cil_check_neverallow()
4963 rc = check_assertion(pdb, rule); in cil_check_neverallow()
4964 if (rc == CIL_TRUE) { in cil_check_neverallow()
4966 rc = __cil_print_neverallow_failure(db, node); in cil_check_neverallow()
4967 if (rc != SEPOL_OK) { in cil_check_neverallow()
4986 return rc; in cil_check_neverallow()
4991 int rc = SEPOL_OK; in cil_check_neverallows() local
4995 rc = cil_check_neverallow(db, pdb, item->data, violation); in cil_check_neverallows()
4996 if (rc != SEPOL_OK) { in cil_check_neverallows()
5002 return rc; in cil_check_neverallows()
5039 int rc = SEPOL_ERR; in cil_avrule_from_sepol() local
5055 return rc; in cil_avrule_from_sepol()
5060 int rc = SEPOL_OK; in cil_check_type_bounds() local
5072 rc = __cil_get_sepol_type_datum(pdb, DATUM(t), &child); in cil_check_type_bounds()
5073 if (rc != SEPOL_OK) goto exit; in cil_check_type_bounds()
5075 rc = __cil_get_sepol_type_datum(pdb, DATUM(t->bounds), &parent); in cil_check_type_bounds()
5076 if (rc != SEPOL_OK) goto exit; in cil_check_type_bounds()
5078 rc = bounds_check_type(NULL, pdb, child->s.value, parent->s.value, &bad, &numbad); in cil_check_type_bounds()
5079 if (rc != SEPOL_OK) goto exit; in cil_check_type_bounds()
5103rc = cil_avrule_from_sepol(pdb, cur, &target, type_value_to_cil, class_value_to_cil, perm_value_to… in cil_check_type_bounds()
5104 if (rc != SEPOL_OK) { in cil_check_type_bounds()
5111 rc = cil_find_matching_avrule_in_ast(db->ast->root, CIL_AVRULE, &target, matching, CIL_TRUE); in cil_check_type_bounds()
5112 if (rc) { in cil_check_type_bounds()
5151 return rc; in cil_check_type_bounds()
5158 int rc = SEPOL_ERR; in cil_binary_create_allocated_pdb() local
5195 rc = __cil_policydb_init(pdb, db, class_value_to_cil, perm_value_to_cil); in cil_binary_create_allocated_pdb()
5196 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5232 rc = cil_tree_walk(db->ast->root, __cil_binary_create_helper, NULL, NULL, &extra_args); in cil_binary_create_allocated_pdb()
5233 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5239 rc = __cil_policydb_val_arrays_create(pdb); in cil_binary_create_allocated_pdb()
5240 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5247 rc = hashtab_map(avrulex_ioctl_table, __cil_avrulex_ioctl_to_policydb, pdb); in cil_binary_create_allocated_pdb()
5248 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5252 rc = hashtab_map(avrulex_nlmsg_table, __cil_avrulex_nlmsg_to_policydb, pdb); in cil_binary_create_allocated_pdb()
5253 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5260 rc = cil_sidorder_to_policydb(pdb, db); in cil_binary_create_allocated_pdb()
5261 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5265 rc = __cil_contexts_to_policydb(pdb, db); in cil_binary_create_allocated_pdb()
5266 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5272 rc = __cil_typeattr_bitmap_init(pdb); in cil_binary_create_allocated_pdb()
5273 if (rc != SEPOL_OK) { in cil_binary_create_allocated_pdb()
5285 rc = cil_check_neverallows(db, pdb, neverallows, &violation); in cil_binary_create_allocated_pdb()
5286 if (rc != SEPOL_OK) goto exit; in cil_binary_create_allocated_pdb()
5289 rc = bounds_check_users(NULL, pdb); in cil_binary_create_allocated_pdb()
5290 if (rc) { in cil_binary_create_allocated_pdb()
5295 rc = bounds_check_roles(NULL, pdb); in cil_binary_create_allocated_pdb()
5296 if (rc) { in cil_binary_create_allocated_pdb()
5301rc = cil_check_type_bounds(db, pdb, type_value_to_cil, class_value_to_cil, perm_value_to_cil, &vio… in cil_binary_create_allocated_pdb()
5302 if (rc != SEPOL_OK) goto exit; in cil_binary_create_allocated_pdb()
5305 rc = SEPOL_ERR; in cil_binary_create_allocated_pdb()
5314 rc = SEPOL_ERR; in cil_binary_create_allocated_pdb()
5320 rc = SEPOL_ERR; in cil_binary_create_allocated_pdb()
5324 rc = SEPOL_OK; in cil_binary_create_allocated_pdb()
5343 return rc; in cil_binary_create_allocated_pdb()