Home | History | Annotate | Download | only in src

Lines Matching defs:rc

109 	int rc = SEPOL_ERR;
117 rc = __cil_resolve_perms(class_symtab, common_symtab, curr->data, &sub_list);
118 if (rc != SEPOL_OK) {
125 rc = cil_symtab_get_datum(class_symtab, curr->data, &perm_datum);
126 if (rc == SEPOL_ENOENT) {
128 rc = cil_symtab_get_datum(common_symtab, curr->data, &perm_datum);
131 if (rc != SEPOL_OK) {
144 return rc;
149 int rc = SEPOL_ERR;
154 rc = cil_resolve_name(current, cp->class_str, CIL_SYM_CLASSES, extra_args, &datum);
155 if (rc != SEPOL_OK) {
167 rc = __cil_resolve_perms(&class->perms, common_symtab, cp->perm_strs, &cp->perms);
168 if (rc != SEPOL_OK) {
175 return rc;
180 int rc = SEPOL_ERR;
183 rc = cil_resolve_name(current, cp_set->set_str, CIL_SYM_CLASSPERMSETS, extra_args, &datum);
184 if (rc != SEPOL_OK) {
191 rc = cil_resolve_classperms_list(current, cp_set->set->classperms, extra_args);
192 if (rc != SEPOL_OK) {
200 return rc;
205 int rc = SEPOL_ERR;
210 rc = cil_resolve_classperms(current, curr->data, extra_args);
211 if (rc != SEPOL_OK) {
215 rc = cil_resolve_classperms_set(current, curr->data, extra_args);
216 if (rc != SEPOL_OK) {
225 return rc;
230 int rc = SEPOL_ERR;
236 rc = cil_resolve_name(current, cps->set_str, CIL_SYM_CLASSPERMSETS, args, &datum);
237 if (rc != SEPOL_OK) {
241 rc = cil_resolve_classperms_list(current, cps->classperms, extra_args);
242 if (rc != SEPOL_OK) {
259 return rc;
282 int rc = SEPOL_ERR;
288 rc = cil_resolve_name(current, rule->src_str, CIL_SYM_TYPES, args, &src_datum);
289 if (rc != SEPOL_OK) {
300 rc = cil_resolve_name(current, rule->tgt_str, CIL_SYM_TYPES, args, &tgt_datum);
301 if (rc != SEPOL_OK) {
310 rc = cil_resolve_classperms_list(current, rule->classperms, extra_args);
311 if (rc != SEPOL_OK) {
318 return rc;
329 int rc = SEPOL_ERR;
331 rc = cil_resolve_name(current, rule->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
332 if (rc != SEPOL_OK) {
338 rc = cil_resolve_name(current, rule->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
339 if (rc != SEPOL_OK) {
345 rc = cil_resolve_name(current, rule->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
346 if (rc != SEPOL_OK) {
351 rc = cil_resolve_name(current, rule->result_str, CIL_SYM_TYPES, extra_args, &result_datum);
352 if (rc != SEPOL_OK) {
360 rc = SEPOL_ERR;
368 return rc;
377 int rc = SEPOL_ERR;
379 rc = cil_resolve_name(current, attrtypes->attr_str, CIL_SYM_TYPES, extra_args, &attr_datum);
380 if (rc != SEPOL_OK) {
387 rc = SEPOL_ERR;
394 rc = cil_resolve_expr(CIL_TYPEATTRIBUTESET, attrtypes->str_expr, &attrtypes->datum_expr, current, extra_args);
395 if (rc != SEPOL_OK) {
399 rc = cil_verify_no_self_reference(attr_datum, attrtypes->datum_expr);
400 if (rc != SEPOL_OK) {
413 return rc;
418 int rc = SEPOL_ERR;
425 rc = cil_flavor_to_symtab_index(flavor, &sym_index);
426 if (rc != SEPOL_OK) {
429 rc = cil_resolve_name(current, aliasactual->alias_str, sym_index, extra_args, &alias_datum);
430 if (rc != SEPOL_OK) {
434 rc = cil_resolve_name(current, aliasactual->actual_str, sym_index, extra_args, &actual_datum);
435 if (rc != SEPOL_OK) {
443 rc = SEPOL_ERR;
452 return rc;
504 int rc = SEPOL_ERR;
506 rc = cil_resolve_name(current, typeperm->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
507 if (rc != SEPOL_OK) {
515 rc = SEPOL_ERR;
524 return rc;
537 int rc = SEPOL_ERR;
539 rc = cil_resolve_name(current, nametypetrans->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
540 if (rc != SEPOL_OK) {
546 rc = cil_resolve_name(current, nametypetrans->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
547 if (rc != SEPOL_OK) {
553 rc = cil_resolve_name(current, nametypetrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
554 if (rc != SEPOL_OK) {
561 rc = cil_resolve_name(current, nametypetrans->name_str, CIL_SYM_NAMES, extra_args, &name_datum);
562 if (rc != SEPOL_OK) {
568 rc = cil_resolve_name(current, nametypetrans->result_str, CIL_SYM_TYPES, extra_args, &result_datum);
569 if (rc != SEPOL_OK) {
577 rc = SEPOL_ERR;
585 return rc;
595 int rc = SEPOL_ERR;
597 rc = cil_resolve_name(current, rangetrans->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
598 if (rc != SEPOL_OK) {
604 rc = cil_resolve_name(current, rangetrans->exec_str, CIL_SYM_TYPES, extra_args, &exec_datum);
605 if (rc != SEPOL_OK) {
611 rc = cil_resolve_name(current, rangetrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
612 if (rc != SEPOL_OK) {
618 rc = cil_resolve_name(current, rangetrans->range_str, CIL_SYM_LEVELRANGES, extra_args, &range_datum);
619 if (rc != SEPOL_OK) {
626 rc = cil_resolve_levelrange(current, rangetrans->range, extra_args);
627 if (rc != SEPOL_OK) {
632 rc = cil_resolve_levelrange(current, rangetrans->range, extra_args);
633 if (rc != SEPOL_OK) {
641 return rc;
660 int rc = SEPOL_ERR;
662 rc = cil_resolve_name(current, clscom->class_str, CIL_SYM_CLASSES, extra_args, &class_datum);
663 if (rc != SEPOL_OK) {
667 rc = cil_resolve_name(current, clscom->common_str, CIL_SYM_COMMONS, extra_args, &common_datum);
668 if (rc != SEPOL_OK) {
676 rc = SEPOL_ERR;
689 return rc;
694 int rc = SEPOL_ERR;
701 rc = cil_resolve_name(current, mapping->map_class_str, CIL_SYM_CLASSES, extra_args, &datum);
702 if (rc != SEPOL_OK) {
707 rc = cil_symtab_get_datum(&map->perms, mapping->map_perm_str, &datum);
708 if (rc != SEPOL_OK) {
714 rc = cil_resolve_classperms_list(current, mapping->classperms, extra_args);
715 if (rc != SEPOL_OK) {
730 return rc;
738 int rc = SEPOL_ERR;
740 rc = cil_resolve_name(current, userrole->user_str, CIL_SYM_USERS, extra_args, &user_datum);
741 if (rc != SEPOL_OK) {
746 rc = cil_resolve_name(current, userrole->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
747 if (rc != SEPOL_OK) {
761 return rc;
770 int rc = SEPOL_ERR;
772 rc = cil_resolve_name(current, usrlvl->user_str, CIL_SYM_USERS, extra_args, &user_datum);
773 if (rc != SEPOL_OK) {
779 rc = cil_resolve_name(current, usrlvl->level_str, CIL_SYM_LEVELS, extra_args, &lvl_datum);
780 if (rc != SEPOL_OK) {
788 rc = cil_resolve_level(current, user->dftlevel, extra_args);
789 if (rc != SEPOL_OK) {
794 rc = cil_resolve_level(current, usrlvl->level, extra_args);
795 if (rc != SEPOL_OK) {
804 return rc;
813 int rc = SEPOL_ERR;
815 rc = cil_resolve_name(current, userrange->user_str, CIL_SYM_USERS, extra_args, &user_datum);
816 if (rc != SEPOL_OK) {
822 rc = cil_resolve_name(current, userrange->range_str, CIL_SYM_LEVELRANGES, extra_args, &range_datum);
823 if (rc != SEPOL_OK) {
831 rc = cil_resolve_levelrange(current, user->range, extra_args);
832 if (rc != SEPOL_OK) {
837 rc = cil_resolve_levelrange(current, userrange->range, extra_args);
838 if (rc != SEPOL_OK) {
847 return rc;
854 int rc = SEPOL_ERR;
856 rc = cil_resolve_name(current, userprefix->user_str, CIL_SYM_USERS, extra_args, &user_datum);
857 if (rc != SEPOL_OK) {
863 return rc;
871 int rc = SEPOL_ERR;
873 rc = cil_resolve_name(current, selinuxuser->user_str, CIL_SYM_USERS, extra_args, &user_datum);
874 if (rc != SEPOL_OK) {
880 rc = cil_resolve_name(current, selinuxuser->range_str, CIL_SYM_LEVELRANGES, extra_args, &lvlrange_datum);
881 if (rc != SEPOL_OK) {
889 rc = cil_resolve_levelrange(current, selinuxuser->range, extra_args);
890 if (rc != SEPOL_OK) {
895 rc = cil_resolve_levelrange(current, selinuxuser->range, extra_args);
896 if (rc != SEPOL_OK) {
901 rc = SEPOL_OK;
903 return rc;
911 int rc = SEPOL_ERR;
913 rc = cil_resolve_name(current, roletype->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
914 if (rc != SEPOL_OK) {
919 rc = cil_resolve_name(current, roletype->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
920 if (rc != SEPOL_OK) {
929 return rc;
940 int rc = SEPOL_ERR;
942 rc = cil_resolve_name(current, roletrans->src_str, CIL_SYM_ROLES, extra_args, &src_datum);
943 if (rc != SEPOL_OK) {
948 rc = cil_resolve_name(current, roletrans->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
949 if (rc != SEPOL_OK) {
955 rc = cil_resolve_name(current, roletrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
956 if (rc != SEPOL_OK) {
961 rc = cil_resolve_name(current, roletrans->result_str, CIL_SYM_ROLES, extra_args, &result_datum);
962 if (rc != SEPOL_OK) {
967 rc = SEPOL_ERR;
977 return rc;
985 int rc = SEPOL_ERR;
987 rc = cil_resolve_name(current, roleallow->src_str, CIL_SYM_ROLES, extra_args, &src_datum);
988 if (rc != SEPOL_OK) {
993 rc = cil_resolve_name(current, roleallow->tgt_str, CIL_SYM_ROLES, extra_args, &tgt_datum);
994 if (rc != SEPOL_OK) {
1002 return rc;
1007 int rc = SEPOL_ERR;
1013 rc = cil_resolve_name(current, attrroles->attr_str, CIL_SYM_ROLES, extra_args, &attr_datum);
1014 if (rc != SEPOL_OK) {
1020 rc = SEPOL_ERR;
1026 rc = cil_resolve_expr(CIL_ROLEATTRIBUTESET, attrroles->str_expr, &attrroles->datum_expr, current, extra_args);
1027 if (rc != SEPOL_OK) {
1031 rc = cil_verify_no_self_reference(attr_datum, attrroles->datum_expr);
1032 if (rc != SEPOL_OK) {
1045 return rc;
1165 int rc = SEPOL_ERR;
1173 rc = __cil_ordered_list_insert(old, NULL, nfirst, NULL);
1174 return rc;
1197 rc = __cil_ordered_list_insert(old, NULL, nfirst, nmatch);
1198 if (rc != SEPOL_OK) {
1199 return rc;
1216 rc = __cil_ordered_list_insert(old, oprev, ncurr, nmatch);
1217 if (rc != SEPOL_OK) {
1218 return rc;
1241 rc = __cil_ordered_list_insert(old, old->tail, ncurr, NULL);
1242 if (rc != SEPOL_OK) {
1243 return rc;
1256 int rc = SEPOL_ERR;
1266 rc = __cil_ordered_lists_merge(composite, ordered_list->list);
1267 if (rc != SEPOL_OK) {
1305 int rc = SEPOL_ERR;
1310 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
1311 if (rc != SEPOL_OK) {
1326 return rc;
1338 int rc = SEPOL_ERR;
1343 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_SIDS, extra_args, &datum);
1344 if (rc != SEPOL_OK) {
1359 return rc;
1386 int rc = SEPOL_ERR;
1392 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CATS, extra_args, &cat_datum);
1393 if (rc != SEPOL_OK) {
1400 rc = SEPOL_ERR;
1415 return rc;
1427 int rc = SEPOL_ERR;
1432 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_SENS, extra_args, &datum);
1433 if (rc != SEPOL_OK) {
1448 return rc;
1453 int rc = SEPOL_ERR;
1455 rc = cil_resolve_expr(CIL_CATSET, cats->str_expr, &cats->datum_expr, current, extra_args);
1456 if (rc != SEPOL_OK) {
1464 return rc;
1470 int rc = SEPOL_ERR;
1472 rc = cil_resolve_cats(current, catset->cats, extra_args);
1473 if (rc != SEPOL_OK) {
1477 rc = cil_verify_no_self_reference((struct cil_symtab_datum *)catset, catset->cats->datum_expr);
1478 if (rc != SEPOL_OK) {
1484 return rc;
1489 int rc = SEPOL_ERR;
1494 rc = cil_resolve_name(current, (char*)senscat->sens_str, CIL_SYM_SENS, extra_args, &sens_datum);
1495 if (rc != SEPOL_OK) {
1500 rc = cil_resolve_cats(current, senscat->cats, extra_args);
1501 if (rc != SEPOL_OK) {
1516 return rc;
1522 int rc = SEPOL_ERR;
1524 rc = cil_resolve_name(current, (char*)level->sens_str, CIL_SYM_SENS, extra_args, &sens_datum);
1525 if (rc != SEPOL_OK) {
1533 rc = cil_resolve_cats(current, level->cats, extra_args);
1534 if (rc != SEPOL_OK) {
1542 return rc;
1549 int rc = SEPOL_ERR;
1552 rc = cil_resolve_name(current, lvlrange->low_str, CIL_SYM_LEVELS, extra_args, &low_datum);
1553 if (rc != SEPOL_OK) {
1560 rc = cil_resolve_level(current, lvlrange->low, extra_args);
1561 if (rc != SEPOL_OK) {
1566 rc = cil_resolve_level(current, lvlrange->low, extra_args);
1567 if (rc != SEPOL_OK) {
1573 rc = cil_resolve_name(current, lvlrange->high_str, CIL_SYM_LEVELS, extra_args, &high_datum);
1574 if (rc != SEPOL_OK) {
1581 rc = cil_resolve_level(current, lvlrange->high, extra_args);
1582 if (rc != SEPOL_OK) {
1587 rc = cil_resolve_level(current, lvlrange->high, extra_args);
1588 if (rc != SEPOL_OK) {
1596 return rc;
1602 int rc = SEPOL_ERR;
1604 rc = cil_resolve_classperms_list(current, cons->classperms, extra_args);
1605 if (rc != SEPOL_OK) {
1609 rc = cil_resolve_expr(CIL_CONSTRAIN, cons->str_expr, &cons->datum_expr, current, extra_args);
1610 if (rc != SEPOL_OK) {
1617 return rc;
1625 int rc = SEPOL_ERR;
1627 rc = cil_resolve_name(current, validtrans->class_str, CIL_SYM_CLASSES, args, &class_datum);
1628 if (rc != SEPOL_OK) {
1633 rc = cil_resolve_expr(CIL_VALIDATETRANS, validtrans->str_expr, &validtrans->datum_expr, current, extra_args);
1634 if (rc != SEPOL_OK) {
1641 return rc;
1652 int rc = SEPOL_ERR;
1654 rc = cil_resolve_name(current, context->user_str, CIL_SYM_USERS, extra_args, &user_datum);
1655 if (rc != SEPOL_OK) {
1661 rc = cil_resolve_name(current, context->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
1662 if (rc != SEPOL_OK) {
1668 rc = cil_resolve_name(current, context->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
1669 if (rc != SEPOL_OK) {
1677 rc = SEPOL_ERR;
1684 rc = cil_resolve_name(current, context->range_str, CIL_SYM_LEVELRANGES, extra_args, &lvlrange_datum);
1685 if (rc != SEPOL_OK) {
1693 rc = cil_resolve_levelrange(current, context->range, extra_args);
1694 if (rc != SEPOL_OK) {
1699 rc = cil_resolve_levelrange(current, context->range, extra_args);
1700 if (rc != SEPOL_OK) {
1708 return rc;
1715 int rc = SEPOL_ERR;
1718 rc = cil_resolve_name(current, filecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1719 if (rc != SEPOL_OK) {
1720 return rc;
1724 rc = cil_resolve_context(current, filecon->context, extra_args);
1725 if (rc != SEPOL_OK) {
1726 return rc;
1737 int rc = SEPOL_ERR;
1740 rc = cil_resolve_name(current, portcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1741 if (rc != SEPOL_OK) {
1746 rc = cil_resolve_context(current, portcon->context, extra_args);
1747 if (rc != SEPOL_OK) {
1755 return rc;
1762 int rc = SEPOL_ERR;
1765 rc = cil_resolve_name(current, genfscon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1766 if (rc != SEPOL_OK) {
1771 rc = cil_resolve_context(current, genfscon->context, extra_args);
1772 if (rc != SEPOL_OK) {
1780 return rc;
1789 int rc = SEPOL_ERR;
1792 rc = cil_resolve_name(current, nodecon->addr_str, CIL_SYM_IPADDRS, extra_args, &addr_datum);
1793 if (rc != SEPOL_OK) {
1800 rc = cil_resolve_name(current, nodecon->mask_str, CIL_SYM_IPADDRS, extra_args, &mask_datum);
1801 if (rc != SEPOL_OK) {
1808 rc = cil_resolve_name(current, nodecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1809 if (rc != SEPOL_OK) {
1814 rc = cil_resolve_context(current, nodecon->context, extra_args);
1815 if (rc != SEPOL_OK) {
1822 rc = SEPOL_ERR;
1830 return rc;
1839 int rc = SEPOL_ERR;
1842 rc = cil_resolve_name(current, netifcon->if_context_str, CIL_SYM_CONTEXTS, extra_args, &ifcon_datum);
1843 if (rc != SEPOL_OK) {
1848 rc = cil_resolve_context(current, netifcon->if_context, extra_args);
1849 if (rc != SEPOL_OK) {
1855 rc = cil_resolve_name(current, netifcon->packet_context_str, CIL_SYM_CONTEXTS, extra_args, &packcon_datum);
1856 if (rc != SEPOL_OK) {
1861 rc = cil_resolve_context(current, netifcon->packet_context, extra_args);
1862 if (rc != SEPOL_OK) {
1869 return rc;
1876 int rc = SEPOL_ERR;
1879 rc = cil_resolve_name(current, pirqcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1880 if (rc != SEPOL_OK) {
1885 rc = cil_resolve_context(current, pirqcon->context, extra_args);
1886 if (rc != SEPOL_OK) {
1894 return rc;
1901 int rc = SEPOL_ERR;
1904 rc = cil_resolve_name(current, iomemcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1905 if (rc != SEPOL_OK) {
1910 rc = cil_resolve_context(current, iomemcon->context, extra_args);
1911 if (rc != SEPOL_OK) {
1919 return rc;
1926 int rc = SEPOL_ERR;
1929 rc = cil_resolve_name(current, ioportcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1930 if (rc != SEPOL_OK) {
1935 rc = cil_resolve_context(current, ioportcon->context, extra_args);
1936 if (rc != SEPOL_OK) {
1944 return rc;
1951 int rc = SEPOL_ERR;
1954 rc = cil_resolve_name(current, pcidevicecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1955 if (rc != SEPOL_OK) {
1960 rc = cil_resolve_context(current, pcidevicecon->context, extra_args);
1961 if (rc != SEPOL_OK) {
1969 return rc;
1976 int rc = SEPOL_ERR;
1979 rc = cil_resolve_name(current, devicetreecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1980 if (rc != SEPOL_OK) {
1985 rc = cil_resolve_context(current, devicetreecon->context, extra_args);
1986 if (rc != SEPOL_OK) {
1994 return rc;
2001 int rc = SEPOL_ERR;
2004 rc = cil_resolve_name(current, fsuse->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2005 if (rc != SEPOL_OK) {
2010 rc = cil_resolve_context(current, fsuse->context, extra_args);
2011 if (rc != SEPOL_OK) {
2019 return rc;
2029 int rc = SEPOL_ERR;
2031 rc = cil_resolve_name(current, sidcon->sid_str, CIL_SYM_SIDS, extra_args, &sid_datum);
2032 if (rc != SEPOL_OK) {
2038 rc = cil_resolve_name(current, sidcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2039 if (rc != SEPOL_OK) {
2044 rc = cil_resolve_context(current, sidcon->context, extra_args);
2045 if (rc != SEPOL_OK) {
2052 rc = SEPOL_ERR;
2061 return rc;
2069 int rc = SEPOL_ERR;
2071 rc = cil_resolve_name(current, inherit->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2072 if (rc != SEPOL_OK) {
2080 rc = SEPOL_ERR;
2094 return rc;
2103 int rc = SEPOL_ERR;
2107 rc = SEPOL_OK;
2115 rc = SEPOL_OK;
2120 rc = cil_copy_ast(db, current, item->data);
2121 if (rc != SEPOL_OK) {
2130 return rc;
2138 int rc = SEPOL_ERR;
2140 rc = cil_resolve_name(current, abstract->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2141 if (rc != SEPOL_OK) {
2147 cil_log(CIL_ERR, "Failed to resolve blockabstract to a block, rc: %d\n", rc);
2156 return rc;
2166 int rc = SEPOL_ERR;
2172 rc = cil_resolve_name(current, in->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2173 if (rc != SEPOL_OK) {
2179 rc = cil_copy_ast(db, current, block_node);
2180 if (rc != SEPOL_OK) {
2181 printf("Failed to copy in, rc: %d\n", rc);
2192 return rc;
2206 int rc = SEPOL_ERR;
2220 rc = cil_resolve_name(node, in->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2221 if (rc != SEPOL_OK) {
2225 rc = cil_resolve_in(node, extra_args);
2226 if (rc != SEPOL_OK) {
2238 rc = SEPOL_ERR;
2244 rc = SEPOL_OK;
2247 return rc;
2253 int rc = SEPOL_ERR;
2259 rc = cil_flavor_to_symtab_index(flavor, &index);
2260 if (rc != SEPOL_OK) {
2264 rc = cil_resolve_name(current, bounds->parent_str, index, extra_args, &parent_datum);
2265 if (rc != SEPOL_OK) {
2269 rc = cil_resolve_name(current, bounds->child_str, index, extra_args, &child_datum);
2270 if (rc != SEPOL_OK) {
2281 rc = SEPOL_ERR;
2294 rc = SEPOL_ERR;
2309 rc = SEPOL_ERR;
2316 rc = SEPOL_ERR;
2323 rc = SEPOL_ERR;
2338 return rc;
2343 int rc = SEPOL_ERR;
2351 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
2352 if (rc != SEPOL_OK) {
2362 return rc;
2367 int rc = SEPOL_ERR;
2375 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
2376 if (rc != SEPOL_OK) {
2386 return rc;
2396 int rc = SEPOL_ERR;
2402 rc = cil_resolve_name(current, new_call->macro_str, CIL_SYM_BLOCKS, extra_args, &macro_datum);
2403 if (rc != SEPOL_OK) {
2411 rc = SEPOL_ERR;
2424 rc = SEPOL_ERR;
2437 rc = SEPOL_ERR;
2441 rc = SEPOL_ERR;
2481 rc = cil_fill_cats(pc, &catset->cats);
2482 if (rc != SEPOL_OK) {
2504 rc = cil_fill_level(pc->cl_head, level);
2505 if (rc != SEPOL_OK) {
2506 cil_log(CIL_ERR, "Failed to create anonymous level, rc: %d\n", rc);
2528 rc = cil_fill_levelrange(pc->cl_head, range);
2529 if (rc != SEPOL_OK) {
2530 cil_log(CIL_ERR, "Failed to create anonymous levelrange, rc: %d\n", rc);
2552 rc = cil_fill_ipaddr(pc->cl_head, ipaddr);
2553 if (rc != SEPOL_OK) {
2554 cil_log(CIL_ERR, "Failed to create anonymous ip address, rc; %d\n", rc);
2582 rc = cil_fill_classperms_list(pc, &cp->classperms);
2583 if (rc != SEPOL_OK) {
2601 rc = SEPOL_ERR;
2614 rc = SEPOL_ERR;
2619 rc = SEPOL_ERR;
2625 rc = cil_copy_ast(db, macro_node, current);
2626 if (rc != SEPOL_OK) {
2627 cil_log(CIL_ERR, "Failed to copy macro, rc: %d\n", rc);
2635 return rc;
2641 int rc = SEPOL_ERR;
2646 rc = SEPOL_OK;
2654 rc = SEPOL_ERR;
2728 rc = SEPOL_ERR;
2733 rc = cil_resolve_name(current, arg->arg_str, sym_index, extra_args, &(arg->arg));
2734 if (rc != SEPOL_OK) {
2743 return rc;
2750 int rc = SEPOL_ERR;
2762 rc = cil_flavor_to_symtab_index(arg->flavor, &param_index);
2766 rc = SEPOL_OK;
2775 return rc;
2780 int rc = SEPOL_ERR;
2813 rc = cil_resolve_name(parent, curr->data, sym_index, extra_args, &res_datum);
2814 if (rc != SEPOL_OK) {
2826 rc = cil_resolve_expr(expr_type, curr->data, &datum_sub_expr, parent, extra_args);
2827 if (rc != SEPOL_OK) {
2842 return rc;
2847 int rc = SEPOL_ERR;
2850 rc = cil_resolve_expr(CIL_BOOLEANIF, bif->str_expr, &bif->datum_expr, current, extra_args);
2851 if (rc != SEPOL_OK) {
2858 return rc;
2914 int rc = SEPOL_ERR;
2925 rc = cil_resolve_expr(CIL_TUNABLEIF, tif->str_expr, &tif->datum_expr, current, extra_args);
2926 if (rc != SEPOL_OK) {
2952 rc = cil_copy_ast(db, true_node, current->parent);
2953 if (rc != SEPOL_OK) {
2959 rc = cil_copy_ast(db, false_node, current->parent);
2960 if (rc != SEPOL_OK) {
2973 return rc;
2979 int rc = SEPOL_OK;
2992 rc = cil_resolve_tunif(node, args);
3004 rc = cil_resolve_blockinherit_link(node, args);
3009 rc = cil_resolve_blockinherit_copy(node, args);
3014 rc = cil_resolve_blockabstract(node, args);
3019 rc = cil_resolve_call1(node, args);
3024 rc = cil_resolve_call1(node, args);
3029 rc = cil_resolve_call2(node, args);
3035 rc = cil_resolve_aliasactual(node, args, CIL_TYPE);
3038 rc = cil_resolve_aliasactual(node, args, CIL_SENS);
3041 rc = cil_resolve_aliasactual(node, args, CIL_CAT);
3050 rc = cil_resolve_alias_to_actual(node, CIL_TYPE);
3053 rc = cil_resolve_alias_to_actual(node, CIL_SENS);
3056 rc = cil_resolve_alias_to_actual(node, CIL_CAT);
3065 rc = cil_resolve_sidorder(node, args);
3068 rc = cil_resolve_classorder(node, args);
3071 rc = cil_resolve_catorder(node, args);
3074 rc = cil_resolve_sensitivityorder(node, args);
3077 rc = cil_resolve_boolif(node, args);
3086 rc = cil_resolve_catset(node, (struct cil_catset*)node->data, args);
3095 rc = cil_resolve_senscat(node, args);
3098 rc = cil_resolve_classcommon(node, args);
3107 rc = cil_resolve_typeattributeset(node, args);
3110 rc = cil_resolve_bounds(node, args, CIL_TYPE);
3113 rc = cil_resolve_typepermissive(node, args);
3116 rc = cil_resolve_nametypetransition(node, args);
3119 rc = cil_resolve_rangetransition(node, args);
3122 rc = cil_resolve_classpermissionset(node, (struct cil_classpermissionset*)node->data, args);
3125 rc = cil_resolve_classmapping(node, args);
3128 rc = cil_resolve_avrule(node, args);
3131 rc = cil_resolve_type_rule(node, args);
3134 rc = cil_resolve_userrole(node, args);
3137 rc = cil_resolve_userlevel(node, args);
3140 rc = cil_resolve_userrange(node, args);
3143 rc = cil_resolve_bounds(node, args, CIL_USER);
3146 rc = cil_resolve_userprefix(node, args);
3150 rc = cil_resolve_selinuxuser(node, args);
3153 rc = cil_resolve_roleattributeset(node, args);
3156 rc = cil_resolve_roletype(node, args);
3159 rc = cil_resolve_roletransition(node, args);
3162 rc = cil_resolve_roleallow(node, args);
3165 rc = cil_resolve_bounds(node, args, CIL_ROLE);
3168 rc = cil_resolve_level(node, (struct cil_level*)node->data, args);
3171 rc = cil_resolve_levelrange(node, (struct cil_levelrange*)node->data, args);
3174 rc = cil_resolve_constrain(node, args);
3177 rc = cil_resolve_constrain(node, args);
3181 rc = cil_resolve_validatetrans(node, args);
3184 rc = cil_resolve_context(node, (struct cil_context*)node->data, args);
3187 rc = cil_resolve_filecon(node, args);
3190 rc = cil_resolve_portcon(node, args);
3193 rc = cil_resolve_nodecon(node, args);
3196 rc = cil_resolve_genfscon(node, args);
3199 rc = cil_resolve_netifcon(node, args);
3202 rc = cil_resolve_pirqcon(node, args);
3205 rc = cil_resolve_iomemcon(node, args);
3208 rc = cil_resolve_ioportcon(node, args);
3211 rc = cil_resolve_pcidevicecon(node, args);
3214 rc = cil_resolve_devicetreecon(node, args);
3217 rc = cil_resolve_fsuse(node, args);
3220 rc = cil_resolve_sidcontext(node, args);
3225 rc = cil_resolve_default(node, args);
3228 rc = cil_resolve_defaultrange(node, args);
3238 return rc;
3241 return rc;
3246 int rc = SEPOL_ERR;
3260 rc = SEPOL_ERR;
3277 rc = SEPOL_ERR;
3285 rc = SEPOL_OK;
3292 rc = SEPOL_OK;
3296 rc = __cil_resolve_ast_node(node, extra_args);
3297 if (rc == SEPOL_ENOENT && optstack != NULL) {
3302 rc = SEPOL_OK;
3303 } else if (rc != SEPOL_OK) {
3308 return rc;
3311 return rc;
3316 int rc = SEPOL_ERR;
3347 rc = SEPOL_ERR;
3371 return rc;
3377 int rc = SEPOL_ERR;
3419 return rc;
3424 int rc = SEPOL_ERR;
3453 rc = cil_tree_walk(current, __cil_resolve_ast_node_helper, __cil_resolve_ast_first_child_helper, __cil_resolve_ast_last_child_helper, &extra_args);
3454 if (rc != SEPOL_OK) {
3460 rc = cil_resolve_in_list(&extra_args);
3461 if (rc != SEPOL_OK) {
3474 rc = __cil_verify_ordered(current, CIL_SID);
3475 if (rc != SEPOL_OK) {
3479 rc = __cil_verify_ordered(current, CIL_CLASS);
3480 if (rc != SEPOL_OK) {
3484 rc = __cil_verify_ordered(current, CIL_CAT);
3485 if (rc != SEPOL_OK) {
3489 rc = __cil_verify_ordered(current, CIL_SENS);
3490 if (rc != SEPOL_OK) {
3518 rc = cil_reset_ast(current);
3519 if (rc != SEPOL_OK) {
3541 rc = __cil_verify_initsids(db->sidorder);
3542 if (rc != SEPOL_OK) {
3546 rc = SEPOL_OK;
3548 return rc;
3560 int rc = SEPOL_ERR;
3563 while (node != NULL && rc != SEPOL_OK) {
3570 rc = cil_symtab_get_datum(symtab, name, datum);
3574 rc = __cil_resolve_name_with_parents(node->parent, name, sym_index, datum);
3575 if (rc != SEPOL_OK) {
3577 rc = __cil_resolve_name_with_parents(NODE(inherit->block), name, sym_index, datum);
3585 rc = cil_symtab_get_datum(symtab, name, datum);
3590 rc = cil_resolve_name_call_args(call, name, sym_index, datum);
3591 if (rc != SEPOL_OK) {
3593 rc = __cil_resolve_name_with_parents(NODE(call->macro)->parent, name, sym_index, datum);
3609 return rc;
3614 int rc = SEPOL_ERR;
3616 rc = __cil_resolve_name_with_parents(node, name, sym_index, datum);
3617 if (rc != SEPOL_OK) {
3618 rc = __cil_resolve_name_with_root(db, name, sym_index, datum);
3620 return rc;
3625 int rc = SEPOL_ERR;
3639 rc = __cil_resolve_name_helper(db, ast_node->parent, name, sym_index, datum);
3640 if (rc != SEPOL_OK) {
3655 rc = __cil_resolve_name_helper(db, node->parent, current, CIL_SYM_BLOCKS, datum);
3656 if (rc != SEPOL_OK) {
3664 rc = cil_symtab_get_datum(symtab, current, datum);
3665 if (rc != SEPOL_OK) {
3676 rc = SEPOL_ERR;
3691 rc = cil_symtab_get_datum(symtab, current, datum);
3693 if (rc != SEPOL_OK) {
3698 rc = SEPOL_OK;
3701 if (rc != SEPOL_OK) {
3721 return rc;