Lines Matching refs:rc
116 int rc = SEPOL_ERR;
124 rc = __cil_resolve_perms(class_symtab, common_symtab, curr->data, &sub_list, class_flavor);
125 if (rc != SEPOL_OK) {
132 rc = cil_symtab_get_datum(class_symtab, curr->data, &perm_datum);
133 if (rc == SEPOL_ENOENT) {
135 rc = cil_symtab_get_datum(common_symtab, curr->data, &perm_datum);
138 if (rc != SEPOL_OK) {
156 return rc;
161 int rc = SEPOL_ERR;
170 rc = cil_resolve_name(current, cp->class_str, CIL_SYM_CLASSES, extra_args, &datum);
171 if (rc != SEPOL_OK) {
183 rc = __cil_resolve_perms(&class->perms, common_symtab, cp->perm_strs, &cp->perms, FLAVOR(datum));
184 if (rc != SEPOL_OK) {
191 return rc;
196 int rc = SEPOL_ERR;
199 rc = cil_resolve_name(current, cp_set->set_str, CIL_SYM_CLASSPERMSETS, extra_args, &datum);
200 if (rc != SEPOL_OK) {
207 rc = cil_resolve_classperms_list(current, cp_set->set->classperms, extra_args);
208 if (rc != SEPOL_OK) {
216 return rc;
221 int rc = SEPOL_ERR;
226 rc = cil_resolve_classperms(current, curr->data, extra_args);
227 if (rc != SEPOL_OK) {
231 rc = cil_resolve_classperms_set(current, curr->data, extra_args);
232 if (rc != SEPOL_OK) {
241 return rc;
246 int rc = SEPOL_ERR;
252 rc = cil_resolve_name(current, cps->set_str, CIL_SYM_CLASSPERMSETS, args, &datum);
253 if (rc != SEPOL_OK) {
257 rc = cil_resolve_classperms_list(current, cps->classperms, extra_args);
258 if (rc != SEPOL_OK) {
275 return rc;
298 int rc = SEPOL_ERR;
300 rc = cil_resolve_name(current, permx->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
301 if (rc != SEPOL_OK) {
309 return rc;
322 int rc = SEPOL_ERR;
328 rc = cil_resolve_name(current, rule->src_str, CIL_SYM_TYPES, args, &src_datum);
329 if (rc != SEPOL_OK) {
337 rc = cil_resolve_name(current, rule->tgt_str, CIL_SYM_TYPES, args, &tgt_datum);
338 if (rc != SEPOL_OK) {
349 rc = cil_resolve_classperms_list(current, rule->perms.classperms, extra_args);
350 if (rc != SEPOL_OK) {
355 rc = cil_resolve_name(current, rule->perms.x.permx_str, CIL_SYM_PERMX, args, &permx_datum);
356 if (rc != SEPOL_OK) {
361 rc = cil_resolve_permissionx(current, rule->perms.x.permx, extra_args);
362 if (rc != SEPOL_OK) {
371 return rc;
383 int rc = SEPOL_ERR;
385 rc = cil_resolve_name(current, rule->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
386 if (rc != SEPOL_OK) {
394 rc = cil_resolve_name(current, rule->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
395 if (rc != SEPOL_OK) {
401 rc = cil_resolve_name(current, rule->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
402 if (rc != SEPOL_OK) {
407 rc = cil_resolve_name(current, rule->result_str, CIL_SYM_TYPES, extra_args, &result_datum);
408 if (rc != SEPOL_OK) {
416 rc = SEPOL_ERR;
424 return rc;
433 int rc = SEPOL_ERR;
435 rc = cil_resolve_name(current, attrtypes->attr_str, CIL_SYM_TYPES, extra_args, &attr_datum);
436 if (rc != SEPOL_OK) {
443 rc = SEPOL_ERR;
450 rc = cil_resolve_expr(CIL_TYPEATTRIBUTESET, attrtypes->str_expr, &attrtypes->datum_expr, current, extra_args);
451 if (rc != SEPOL_OK) {
464 return rc;
474 int rc = SEPOL_ERR;
479 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_TYPES, extra_args, &attr_datum);
480 if (rc != SEPOL_OK) {
487 rc = SEPOL_ERR;
498 return rc;
503 int rc = SEPOL_ERR;
510 rc = cil_flavor_to_symtab_index(flavor, &sym_index);
511 if (rc != SEPOL_OK) {
515 rc = cil_resolve_name_keep_aliases(current, aliasactual->alias_str, sym_index, extra_args, &alias_datum);
516 if (rc != SEPOL_OK) {
521 rc = SEPOL_ERR;
525 rc = cil_resolve_name(current, aliasactual->actual_str, sym_index, extra_args, &actual_datum);
526 if (rc != SEPOL_OK) {
532 rc = SEPOL_ERR;
540 rc = SEPOL_ERR;
549 return rc;
605 int rc = SEPOL_ERR;
607 rc = cil_resolve_name(current, typeperm->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
608 if (rc != SEPOL_OK) {
616 rc = SEPOL_ERR;
625 return rc;
638 int rc = SEPOL_ERR;
640 rc = cil_resolve_name(current, nametypetrans->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
641 if (rc != SEPOL_OK) {
649 rc = cil_resolve_name(current, nametypetrans->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
650 if (rc != SEPOL_OK) {
656 rc = cil_resolve_name(current, nametypetrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
657 if (rc != SEPOL_OK) {
664 rc = cil_resolve_name(current, nametypetrans->name_str, CIL_SYM_NAMES, extra_args, &name_datum);
665 if (rc != SEPOL_OK) {
671 rc = cil_resolve_name(current, nametypetrans->result_str, CIL_SYM_TYPES, extra_args, &result_datum);
672 if (rc != SEPOL_OK) {
680 rc = SEPOL_ERR;
688 return rc;
698 int rc = SEPOL_ERR;
700 rc = cil_resolve_name(current, rangetrans->src_str, CIL_SYM_TYPES, extra_args, &src_datum);
701 if (rc != SEPOL_OK) {
706 rc = cil_resolve_name(current, rangetrans->exec_str, CIL_SYM_TYPES, extra_args, &exec_datum);
707 if (rc != SEPOL_OK) {
712 rc = cil_resolve_name(current, rangetrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
713 if (rc != SEPOL_OK) {
719 rc = cil_resolve_name(current, rangetrans->range_str, CIL_SYM_LEVELRANGES, extra_args, &range_datum);
720 if (rc != SEPOL_OK) {
727 rc = cil_resolve_levelrange(current, rangetrans->range, extra_args);
728 if (rc != SEPOL_OK) {
733 rc = cil_resolve_levelrange(current, rangetrans->range, extra_args);
734 if (rc != SEPOL_OK) {
742 return rc;
761 int rc = SEPOL_ERR;
763 rc = cil_resolve_name(current, clscom->class_str, CIL_SYM_CLASSES, extra_args, &class_datum);
764 if (rc != SEPOL_OK) {
769 rc = SEPOL_ERR;
773 rc = cil_resolve_name(current, clscom->common_str, CIL_SYM_COMMONS, extra_args, &common_datum);
774 if (rc != SEPOL_OK) {
782 rc = SEPOL_ERR;
793 rc = SEPOL_ERR;
800 return rc;
805 int rc = SEPOL_ERR;
812 rc = cil_resolve_name(current, mapping->map_class_str, CIL_SYM_CLASSES, extra_args, &datum);
813 if (rc != SEPOL_OK) {
818 rc = cil_symtab_get_datum(&map->perms, mapping->map_perm_str, &datum);
819 if (rc != SEPOL_OK) {
825 rc = cil_resolve_classperms_list(current, mapping->classperms, extra_args);
826 if (rc != SEPOL_OK) {
841 return rc;
849 int rc = SEPOL_ERR;
851 rc = cil_resolve_name(current, userrole->user_str, CIL_SYM_USERS, extra_args, &user_datum);
852 if (rc != SEPOL_OK) {
857 rc = cil_resolve_name(current, userrole->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
858 if (rc != SEPOL_OK) {
866 return rc;
876 int rc = SEPOL_ERR;
878 rc = cil_resolve_name(current, usrlvl->user_str, CIL_SYM_USERS, extra_args, &user_datum);
879 if (rc != SEPOL_OK) {
887 rc = SEPOL_ERR;
894 rc = cil_resolve_name(current, usrlvl->level_str, CIL_SYM_LEVELS, extra_args, &lvl_datum);
895 if (rc != SEPOL_OK) {
903 rc = cil_resolve_level(current, user->dftlevel, extra_args);
904 if (rc != SEPOL_OK) {
909 rc = cil_resolve_level(current, usrlvl->level, extra_args);
910 if (rc != SEPOL_OK) {
919 return rc;
929 int rc = SEPOL_ERR;
931 rc = cil_resolve_name(current, userrange->user_str, CIL_SYM_USERS, extra_args, &user_datum);
932 if (rc != SEPOL_OK) {
940 rc = SEPOL_ERR;
947 rc = cil_resolve_name(current, userrange->range_str, CIL_SYM_LEVELRANGES, extra_args, &range_datum);
948 if (rc != SEPOL_OK) {
956 rc = cil_resolve_levelrange(current, user->range, extra_args);
957 if (rc != SEPOL_OK) {
962 rc = cil_resolve_levelrange(current, userrange->range, extra_args);
963 if (rc != SEPOL_OK) {
972 return rc;
980 int rc = SEPOL_ERR;
982 rc = cil_resolve_name(current, userprefix->user_str, CIL_SYM_USERS, extra_args, &user_datum);
983 if (rc != SEPOL_OK) {
991 rc = SEPOL_ERR;
998 return rc;
1007 int rc = SEPOL_ERR;
1009 rc = cil_resolve_name(current, selinuxuser->user_str, CIL_SYM_USERS, extra_args, &user_datum);
1010 if (rc != SEPOL_OK) {
1018 rc = SEPOL_ERR;
1025 rc = cil_resolve_name(current, selinuxuser->range_str, CIL_SYM_LEVELRANGES, extra_args, &lvlrange_datum);
1026 if (rc != SEPOL_OK) {
1033 rc = cil_resolve_levelrange(current, selinuxuser->range, extra_args);
1034 if (rc != SEPOL_OK) {
1039 rc = cil_resolve_levelrange(current, selinuxuser->range, extra_args);
1040 if (rc != SEPOL_OK) {
1045 rc = SEPOL_OK;
1047 return rc;
1055 int rc = SEPOL_ERR;
1057 rc = cil_resolve_name(current, roletype->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
1058 if (rc != SEPOL_OK) {
1063 rc = cil_resolve_name(current, roletype->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
1064 if (rc != SEPOL_OK) {
1072 return rc;
1083 int rc = SEPOL_ERR;
1085 rc = cil_resolve_name(current, roletrans->src_str, CIL_SYM_ROLES, extra_args, &src_datum);
1086 if (rc != SEPOL_OK) {
1091 rc = cil_resolve_name(current, roletrans->tgt_str, CIL_SYM_TYPES, extra_args, &tgt_datum);
1092 if (rc != SEPOL_OK) {
1097 rc = cil_resolve_name(current, roletrans->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum);
1098 if (rc != SEPOL_OK) {
1103 rc = cil_resolve_name(current, roletrans->result_str, CIL_SYM_ROLES, extra_args, &result_datum);
1104 if (rc != SEPOL_OK) {
1109 rc = SEPOL_ERR;
1118 return rc;
1126 int rc = SEPOL_ERR;
1128 rc = cil_resolve_name(current, roleallow->src_str, CIL_SYM_ROLES, extra_args, &src_datum);
1129 if (rc != SEPOL_OK) {
1134 rc = cil_resolve_name(current, roleallow->tgt_str, CIL_SYM_ROLES, extra_args, &tgt_datum);
1135 if (rc != SEPOL_OK) {
1143 return rc;
1148 int rc = SEPOL_ERR;
1154 rc = cil_resolve_name(current, attrroles->attr_str, CIL_SYM_ROLES, extra_args, &attr_datum);
1155 if (rc != SEPOL_OK) {
1161 rc = SEPOL_ERR;
1167 rc = cil_resolve_expr(CIL_ROLEATTRIBUTESET, attrroles->str_expr, &attrroles->datum_expr, current, extra_args);
1168 if (rc != SEPOL_OK) {
1181 return rc;
1301 int rc = SEPOL_ERR;
1309 rc = __cil_ordered_list_insert(old, NULL, nfirst, NULL);
1310 return rc;
1333 rc = __cil_ordered_list_insert(old, NULL, nfirst, nmatch);
1334 if (rc != SEPOL_OK) {
1335 return rc;
1352 rc = __cil_ordered_list_insert(old, oprev, ncurr, nmatch);
1353 if (rc != SEPOL_OK) {
1354 return rc;
1377 rc = __cil_ordered_list_insert(old, old->tail, ncurr, NULL);
1378 if (rc != SEPOL_OK) {
1379 return rc;
1392 int rc = SEPOL_ERR;
1409 rc = SEPOL_ERR;
1415 rc = SEPOL_OK;
1418 return rc;
1427 int rc = SEPOL_ERR;
1437 rc = __cil_ordered_lists_merge(composite, ordered_list->list);
1438 if (rc != SEPOL_OK) {
1459 rc = insert_unordered(composite, *unordered_lists);
1460 if (rc != SEPOL_OK) {
1487 int rc = SEPOL_ERR;
1498 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
1499 if (rc != SEPOL_OK) {
1501 rc = SEPOL_ERR;
1506 rc = SEPOL_ERR;
1525 return rc;
1537 int rc = SEPOL_ERR;
1542 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_SIDS, extra_args, &datum);
1543 if (rc != SEPOL_OK) {
1549 rc = SEPOL_ERR;
1565 return rc;
1592 int rc = SEPOL_ERR;
1598 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CATS, extra_args, &cat_datum);
1599 if (rc != SEPOL_OK) {
1606 rc = SEPOL_ERR;
1622 return rc;
1634 int rc = SEPOL_ERR;
1639 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_SENS, extra_args, &datum);
1640 if (rc != SEPOL_OK) {
1646 rc = SEPOL_ERR;
1661 return rc;
1666 int rc = SEPOL_ERR;
1668 rc = cil_resolve_expr(CIL_CATSET, cats->str_expr, &cats->datum_expr, current, extra_args);
1669 if (rc != SEPOL_OK) {
1676 return rc;
1687 int rc = SEPOL_ERR;
1692 rc = cil_resolve_name(current, (char*)senscat->sens_str, CIL_SYM_SENS, extra_args, &sens_datum);
1693 if (rc != SEPOL_OK) {
1698 rc = cil_resolve_cats(current, senscat->cats, extra_args);
1699 if (rc != SEPOL_OK) {
1714 return rc;
1720 int rc = SEPOL_ERR;
1726 rc = cil_resolve_name(current, (char*)level->sens_str, CIL_SYM_SENS, extra_args, &sens_datum);
1727 if (rc != SEPOL_OK) {
1735 rc = cil_resolve_cats(current, level->cats, extra_args);
1736 if (rc != SEPOL_OK) {
1744 return rc;
1751 int rc = SEPOL_ERR;
1754 rc = cil_resolve_name(current, lvlrange->low_str, CIL_SYM_LEVELS, extra_args, &low_datum);
1755 if (rc != SEPOL_OK) {
1762 rc = cil_resolve_level(current, lvlrange->low, extra_args);
1763 if (rc != SEPOL_OK) {
1768 rc = cil_resolve_level(current, lvlrange->low, extra_args);
1769 if (rc != SEPOL_OK) {
1775 rc = cil_resolve_name(current, lvlrange->high_str, CIL_SYM_LEVELS, extra_args, &high_datum);
1776 if (rc != SEPOL_OK) {
1783 rc = cil_resolve_level(current, lvlrange->high, extra_args);
1784 if (rc != SEPOL_OK) {
1789 rc = cil_resolve_level(current, lvlrange->high, extra_args);
1790 if (rc != SEPOL_OK) {
1798 return rc;
1804 int rc = SEPOL_ERR;
1806 rc = cil_resolve_classperms_list(current, cons->classperms, extra_args);
1807 if (rc != SEPOL_OK) {
1811 rc = cil_resolve_expr(CIL_CONSTRAIN, cons->str_expr, &cons->datum_expr, current, extra_args);
1812 if (rc != SEPOL_OK) {
1819 return rc;
1827 int rc = SEPOL_ERR;
1829 rc = cil_resolve_name(current, validtrans->class_str, CIL_SYM_CLASSES, args, &class_datum);
1830 if (rc != SEPOL_OK) {
1835 rc = cil_resolve_expr(CIL_VALIDATETRANS, validtrans->str_expr, &validtrans->datum_expr, current, extra_args);
1836 if (rc != SEPOL_OK) {
1843 return rc;
1854 int rc = SEPOL_ERR;
1856 rc = cil_resolve_name(current, context->user_str, CIL_SYM_USERS, extra_args, &user_datum);
1857 if (rc != SEPOL_OK) {
1865 rc = SEPOL_ERR;
1871 rc = cil_resolve_name(current, context->role_str, CIL_SYM_ROLES, extra_args, &role_datum);
1872 if (rc != SEPOL_OK) {
1878 rc = SEPOL_ERR;
1885 rc = cil_resolve_name(current, context->type_str, CIL_SYM_TYPES, extra_args, &type_datum);
1886 if (rc != SEPOL_OK) {
1893 rc = SEPOL_ERR;
1900 rc = cil_resolve_name(current, context->range_str, CIL_SYM_LEVELRANGES, extra_args, &lvlrange_datum);
1901 if (rc != SEPOL_OK) {
1908 rc = cil_resolve_levelrange(current, context->range, extra_args);
1909 if (rc != SEPOL_OK) {
1914 rc = cil_resolve_levelrange(current, context->range, extra_args);
1915 if (rc != SEPOL_OK) {
1923 return rc;
1930 int rc = SEPOL_ERR;
1933 rc = cil_resolve_name(current, filecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1934 if (rc != SEPOL_OK) {
1935 return rc;
1939 rc = cil_resolve_context(current, filecon->context, extra_args);
1940 if (rc != SEPOL_OK) {
1941 return rc;
1952 int rc = SEPOL_ERR;
1955 rc = cil_resolve_name(current, ibpkeycon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1956 if (rc != SEPOL_OK)
1961 rc = cil_resolve_context(current, ibpkeycon->context, extra_args);
1962 if (rc != SEPOL_OK)
1969 return rc;
1976 int rc = SEPOL_ERR;
1979 rc = cil_resolve_name(current, portcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
1980 if (rc != SEPOL_OK) {
1985 rc = cil_resolve_context(current, portcon->context, extra_args);
1986 if (rc != SEPOL_OK) {
1994 return rc;
2001 int rc = SEPOL_ERR;
2004 rc = cil_resolve_name(current, genfscon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2005 if (rc != SEPOL_OK) {
2010 rc = cil_resolve_context(current, genfscon->context, extra_args);
2011 if (rc != SEPOL_OK) {
2019 return rc;
2028 int rc = SEPOL_ERR;
2031 rc = cil_resolve_name(current, nodecon->addr_str, CIL_SYM_IPADDRS, extra_args, &addr_datum);
2032 if (rc != SEPOL_OK) {
2039 rc = cil_resolve_name(current, nodecon->mask_str, CIL_SYM_IPADDRS, extra_args, &mask_datum);
2040 if (rc != SEPOL_OK) {
2047 rc = cil_resolve_name(current, nodecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2048 if (rc != SEPOL_OK) {
2053 rc = cil_resolve_context(current, nodecon->context, extra_args);
2054 if (rc != SEPOL_OK) {
2061 rc = SEPOL_ERR;
2069 return rc;
2078 int rc = SEPOL_ERR;
2081 rc = cil_resolve_name(current, netifcon->if_context_str, CIL_SYM_CONTEXTS, extra_args, &ifcon_datum);
2082 if (rc != SEPOL_OK) {
2087 rc = cil_resolve_context(current, netifcon->if_context, extra_args);
2088 if (rc != SEPOL_OK) {
2094 rc = cil_resolve_name(current, netifcon->packet_context_str, CIL_SYM_CONTEXTS, extra_args, &packcon_datum);
2095 if (rc != SEPOL_OK) {
2100 rc = cil_resolve_context(current, netifcon->packet_context, extra_args);
2101 if (rc != SEPOL_OK) {
2108 return rc;
2116 int rc = SEPOL_ERR;
2119 rc = cil_resolve_name(current, ibendportcon->context_str, CIL_SYM_CONTEXTS, extra_args, &con_datum);
2120 if (rc != SEPOL_OK)
2125 rc = cil_resolve_context(current, ibendportcon->context, extra_args);
2126 if (rc != SEPOL_OK)
2133 return rc;
2140 int rc = SEPOL_ERR;
2143 rc = cil_resolve_name(current, pirqcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2144 if (rc != SEPOL_OK) {
2149 rc = cil_resolve_context(current, pirqcon->context, extra_args);
2150 if (rc != SEPOL_OK) {
2158 return rc;
2165 int rc = SEPOL_ERR;
2168 rc = cil_resolve_name(current, iomemcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2169 if (rc != SEPOL_OK) {
2174 rc = cil_resolve_context(current, iomemcon->context, extra_args);
2175 if (rc != SEPOL_OK) {
2183 return rc;
2190 int rc = SEPOL_ERR;
2193 rc = cil_resolve_name(current, ioportcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2194 if (rc != SEPOL_OK) {
2199 rc = cil_resolve_context(current, ioportcon->context, extra_args);
2200 if (rc != SEPOL_OK) {
2208 return rc;
2215 int rc = SEPOL_ERR;
2218 rc = cil_resolve_name(current, pcidevicecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2219 if (rc != SEPOL_OK) {
2224 rc = cil_resolve_context(current, pcidevicecon->context, extra_args);
2225 if (rc != SEPOL_OK) {
2233 return rc;
2240 int rc = SEPOL_ERR;
2243 rc = cil_resolve_name(current, devicetreecon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2244 if (rc != SEPOL_OK) {
2249 rc = cil_resolve_context(current, devicetreecon->context, extra_args);
2250 if (rc != SEPOL_OK) {
2258 return rc;
2265 int rc = SEPOL_ERR;
2268 rc = cil_resolve_name(current, fsuse->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2269 if (rc != SEPOL_OK) {
2274 rc = cil_resolve_context(current, fsuse->context, extra_args);
2275 if (rc != SEPOL_OK) {
2283 return rc;
2293 int rc = SEPOL_ERR;
2295 rc = cil_resolve_name(current, sidcon->sid_str, CIL_SYM_SIDS, extra_args, &sid_datum);
2296 if (rc != SEPOL_OK) {
2302 rc = cil_resolve_name(current, sidcon->context_str, CIL_SYM_CONTEXTS, extra_args, &context_datum);
2303 if (rc != SEPOL_OK) {
2308 rc = cil_resolve_context(current, sidcon->context, extra_args);
2309 if (rc != SEPOL_OK) {
2316 rc = SEPOL_ERR;
2325 return rc;
2333 int rc = SEPOL_ERR;
2335 rc = cil_resolve_name(current, inherit->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2336 if (rc != SEPOL_OK) {
2344 rc = SEPOL_ERR;
2358 return rc;
2367 int rc = SEPOL_ERR;
2371 rc = SEPOL_OK;
2379 rc = SEPOL_OK;
2384 rc = cil_copy_ast(db, current, item->data);
2385 if (rc != SEPOL_OK) {
2394 return rc;
2416 int rc = SEPOL_ERR;
2418 rc = cil_resolve_name(current, abstract->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2419 if (rc != SEPOL_OK) {
2425 cil_log(CIL_ERR, "Failed to resolve blockabstract to a block, rc: %d\n", rc);
2426 rc = SEPOL_ERR;
2435 return rc;
2445 int rc = SEPOL_ERR;
2451 rc = cil_resolve_name(current, in->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2452 if (rc != SEPOL_OK) {
2462 rc = SEPOL_ERR;
2467 rc = cil_copy_ast(db, current, block_node);
2468 if (rc != SEPOL_OK) {
2478 return rc;
2490 int rc = SEPOL_ERR;
2504 rc = cil_resolve_name(node, in->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2505 if (rc != SEPOL_OK) {
2509 rc = cil_resolve_in(node, extra_args);
2510 if (rc != SEPOL_OK) {
2522 rc = SEPOL_ERR;
2528 rc = SEPOL_OK;
2531 return rc;
2537 int rc = SEPOL_ERR;
2543 rc = cil_flavor_to_symtab_index(flavor, &index);
2544 if (rc != SEPOL_OK) {
2548 rc = cil_resolve_name(current, bounds->parent_str, index, extra_args, &parent_datum);
2549 if (rc != SEPOL_OK) {
2554 rc = SEPOL_ERR;
2559 rc = cil_resolve_name(current, bounds->child_str, index, extra_args, &child_datum);
2560 if (rc != SEPOL_OK) {
2565 rc = SEPOL_ERR;
2575 rc = SEPOL_ERR;
2587 rc = SEPOL_ERR;
2599 rc = SEPOL_ERR;
2614 return rc;
2619 int rc = SEPOL_ERR;
2627 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
2628 if (rc != SEPOL_OK) {
2637 return rc;
2642 int rc = SEPOL_ERR;
2650 rc = cil_resolve_name(current, (char *)curr->data, CIL_SYM_CLASSES, extra_args, &datum);
2651 if (rc != SEPOL_OK) {
2660 return rc;
2702 int rc = SEPOL_ERR;
2716 rc = SEPOL_OK;
2726 rc = SEPOL_ERR;
2730 rc = SEPOL_OK;
2732 return rc;
2741 int rc = SEPOL_ERR;
2765 rc = SEPOL_ERR;
2769 rc = SEPOL_ERR;
2781 rc = SEPOL_ERR;
2796 rc = SEPOL_ERR;
2805 rc = SEPOL_ERR;
2814 rc = SEPOL_ERR;
2823 rc = SEPOL_ERR;
2832 rc = SEPOL_ERR;
2841 rc = SEPOL_ERR;
2851 rc = cil_fill_cats(arg_node, &catset->cats);
2852 if (rc != SEPOL_OK) {
2866 rc = SEPOL_ERR;
2880 rc = cil_fill_level(arg_node->cl_head, level);
2881 if (rc != SEPOL_OK) {
2882 cil_log(CIL_ERR, "Failed to create anonymous level, rc: %d\n", rc);
2896 rc = SEPOL_ERR;
2910 rc = cil_fill_levelrange(arg_node->cl_head, range);
2911 if (rc != SEPOL_OK) {
2912 cil_log(CIL_ERR, "Failed to create anonymous levelrange, rc: %d\n", rc);
2926 rc = SEPOL_ERR;
2938 rc = SEPOL_ERR;
2944 rc = cil_fill_ipaddr(arg_node, ipaddr);
2945 if (rc != SEPOL_OK) {
2965 rc = SEPOL_ERR;
2974 rc = SEPOL_ERR;
2985 rc = cil_fill_classperms_list(arg_node, &cp->classperms);
2986 if (rc != SEPOL_OK) {
3000 rc = SEPOL_ERR;
3011 rc = SEPOL_ERR;
3024 rc = SEPOL_ERR;
3031 return rc;
3040 int rc = SEPOL_ERR;
3046 rc = cil_resolve_name(current, call->macro_str, CIL_SYM_BLOCKS, extra_args, ¯o_datum);
3047 if (rc != SEPOL_OK) {
3055 rc = SEPOL_ERR;
3060 rc = cil_build_call_args(current, call, call->macro, extra_args);
3061 if (rc != SEPOL_OK) {
3065 rc = cil_check_recursive_call(current, macro_node);
3066 if (rc != SEPOL_OK) {
3070 rc = cil_copy_ast(args->db, macro_node, current);
3071 if (rc != SEPOL_OK) {
3081 return rc;
3087 int rc = SEPOL_ERR;
3092 rc = SEPOL_OK;
3100 rc = SEPOL_ERR;
3174 rc = SEPOL_ERR;
3181 rc = cil_resolve_name(current, arg->arg_str, sym_index, extra_args, &datum);
3182 if (rc != SEPOL_OK) {
3196 rc = cil_resolve_name(current, arg->arg_str, sym_index, extra_args, &(arg->arg));
3197 if (rc != SEPOL_OK) {
3201 rc = cil_symtab_insert(s, datum->name, datum, NULL);
3202 if (rc != SEPOL_OK) {
3216 return rc;
3223 int rc = SEPOL_ERR;
3235 rc = cil_flavor_to_symtab_index(arg->flavor, ¶m_index);
3239 rc = *datum ? SEPOL_OK : SEPOL_ERR;
3248 return rc;
3253 int rc = SEPOL_ERR;
3288 rc = cil_resolve_name(parent, curr->data, sym_index, extra_args, &res_datum);
3289 if (rc != SEPOL_OK) {
3296 rc = SEPOL_ERR;
3302 rc = cil_resolve_expr(expr_type, catset->cats->str_expr, &catset->cats->datum_expr, parent, extra_args);
3303 if (rc != SEPOL_OK) {
3320 rc = cil_resolve_expr(expr_type, curr->data, &datum_sub_expr, parent, extra_args);
3321 if (rc != SEPOL_OK) {
3339 return rc;
3344 int rc = SEPOL_ERR;
3347 rc = cil_resolve_expr(CIL_BOOLEANIF, bif->str_expr, &bif->datum_expr, current, extra_args);
3348 if (rc != SEPOL_OK) {
3355 return rc;
3411 int rc = SEPOL_ERR;
3422 rc = cil_resolve_expr(CIL_TUNABLEIF, tif->str_expr, &tif->datum_expr, current, extra_args);
3423 if (rc != SEPOL_OK) {
3449 rc = cil_copy_ast(db, true_node, current->parent);
3450 if (rc != SEPOL_OK) {
3456 rc = cil_copy_ast(db, false_node, current->parent);
3457 if (rc != SEPOL_OK) {
3470 return rc;
3475 int rc = SEPOL_ERR;
3481 rc = cil_resolve_name(current, attrusers->attr_str, CIL_SYM_USERS, extra_args, &attr_datum);
3482 if (rc != SEPOL_OK) {
3488 rc = SEPOL_ERR;
3494 rc = cil_resolve_expr(CIL_USERATTRIBUTESET, attrusers->str_expr, &attrusers->datum_expr, current, extra_args);
3495 if (rc != SEPOL_OK) {
3508 return rc;
3550 int rc;
3572 rc = cil_check_inheritances(block_node, max, count, stack, loop);
3574 if (rc != SEPOL_OK) {
3584 rc = cil_check_inheritances(node, max, count, stack, loop);
3585 if (rc != SEPOL_OK) {
3599 int rc;
3609 rc = cil_check_inheritances(node, max, &num_potential, stack, &loop);
3612 return rc;
3617 int rc = SEPOL_OK;
3629 rc = cil_resolve_tunif(node, args);
3644 rc = cil_resolve_blockinherit_link(node, args);
3649 rc = cil_resolve_blockinherit_copy(node, args);
3654 rc = cil_resolve_blockabstract(node, args);
3669 rc = cil_resolve_call(node, args);
3674 rc = cil_resolve_call_args(node, args);
3680 rc = cil_resolve_aliasactual(node, args, CIL_TYPE, CIL_TYPEALIAS);
3683 rc = cil_resolve_aliasactual(node, args, CIL_SENS, CIL_SENSALIAS);
3686 rc = cil_resolve_aliasactual(node, args, CIL_CAT, CIL_CATALIAS);
3695 rc = cil_resolve_alias_to_actual(node, CIL_TYPE);
3698 rc = cil_resolve_alias_to_actual(node, CIL_SENS);
3701 rc = cil_resolve_alias_to_actual(node, CIL_CAT);
3710 rc = cil_resolve_sidorder(node, args);
3713 rc = cil_resolve_classorder(node, args);
3716 rc = cil_resolve_catorder(node, args);
3719 rc = cil_resolve_sensitivityorder(node, args);
3722 rc = cil_resolve_boolif(node, args);
3731 rc = cil_resolve_catset(node, (struct cil_catset*)node->data, args);
3740 rc = cil_resolve_senscat(node, args);
3743 rc = cil_resolve_classcommon(node, args);
3752 rc = cil_resolve_typeattributeset(node, args);
3755 rc = cil_resolve_expandtypeattribute(node, args);
3758 rc = cil_resolve_bounds(node, args, CIL_TYPE, CIL_TYPEATTRIBUTE);
3761 rc = cil_resolve_typepermissive(node, args);
3764 rc = cil_resolve_nametypetransition(node, args);
3767 rc = cil_resolve_rangetransition(node, args);
3770 rc = cil_resolve_classpermissionset(node, (struct cil_classpermissionset*)node->data, args);
3773 rc = cil_resolve_classmapping(node, args);
3777 rc = cil_resolve_avrule(node, args);
3780 rc = cil_resolve_permissionx(node, (struct cil_permissionx*)node->data, args);
3783 rc = cil_resolve_type_rule(node, args);
3786 rc = cil_resolve_userrole(node, args);
3789 rc = cil_resolve_userlevel(node, args);
3792 rc = cil_resolve_userrange(node, args);
3795 rc = cil_resolve_bounds(node, args, CIL_USER, CIL_USERATTRIBUTE);
3798 rc = cil_resolve_userprefix(node, args);
3802 rc = cil_resolve_selinuxuser(node, args);
3805 rc = cil_resolve_roleattributeset(node, args);
3808 rc = cil_resolve_roletype(node, args);
3811 rc = cil_resolve_roletransition(node, args);
3814 rc = cil_resolve_roleallow(node, args);
3817 rc = cil_resolve_bounds(node, args, CIL_ROLE, CIL_ROLEATTRIBUTE);
3820 rc = cil_resolve_level(node, (struct cil_level*)node->data, args);
3823 rc = cil_resolve_levelrange(node, (struct cil_levelrange*)node->data, args);
3826 rc = cil_resolve_constrain(node, args);
3829 rc = cil_resolve_constrain(node, args);
3833 rc = cil_resolve_validatetrans(node, args);
3836 rc = cil_resolve_context(node, (struct cil_context*)node->data, args);
3839 rc = cil_resolve_filecon(node, args);
3842 rc = cil_resolve_ibpkeycon(node, args);
3845 rc = cil_resolve_portcon(node, args);
3848 rc = cil_resolve_nodecon(node, args);
3851 rc = cil_resolve_genfscon(node, args);
3854 rc = cil_resolve_netifcon(node, args);
3857 rc = cil_resolve_ibendportcon(node, args);
3860 rc = cil_resolve_pirqcon(node, args);
3863 rc = cil_resolve_iomemcon(node, args);
3866 rc = cil_resolve_ioportcon(node, args);
3869 rc = cil_resolve_pcidevicecon(node, args);
3872 rc = cil_resolve_devicetreecon(node, args);
3875 rc = cil_resolve_fsuse(node, args);
3878 rc = cil_resolve_sidcontext(node, args);
3883 rc = cil_resolve_default(node, args);
3886 rc = cil_resolve_defaultrange(node, args);
3889 rc = cil_resolve_userattributeset(node, args);
3899 return rc;
3902 return rc;
3907 int rc = SEPOL_OK;
3923 rc = SEPOL_ERR;
3936 rc = SEPOL_ERR;
3948 rc = SEPOL_ERR;
3960 rc = SEPOL_ERR;
3964 rc = SEPOL_ERR;
3967 if (rc == SEPOL_ERR) {
3980 rc = SEPOL_OK;
3987 rc = SEPOL_OK;
3991 rc = __cil_resolve_ast_node(node, extra_args);
3992 if (rc == SEPOL_ENOENT) {
4001 rc = SEPOL_OK;
4006 return rc;
4009 return rc;
4014 int rc = SEPOL_ERR;
4037 return rc;
4043 int rc = SEPOL_ERR;
4087 return rc;
4092 int rc = SEPOL_ERR;
4098 return rc;
4130 rc = cil_tree_walk(current, __cil_resolve_ast_node_helper, __cil_resolve_ast_first_child_helper, __cil_resolve_ast_last_child_helper, &extra_args);
4131 if (rc != SEPOL_OK) {
4137 rc = cil_resolve_in_list(extra_args.in_list_before, &extra_args);
4138 if (rc != SEPOL_OK) {
4143 rc = cil_resolve_in_list(extra_args.in_list_after, &extra_args);
4144 if (rc != SEPOL_OK) {
4158 rc = cil_check_for_bad_inheritance(current);
4159 if (rc != SEPOL_OK) {
4160 rc = SEPOL_ERR;
4168 rc = SEPOL_ERR;
4173 rc = SEPOL_ERR;
4178 rc = SEPOL_ERR;
4184 rc = SEPOL_ERR;
4188 rc = __cil_verify_ordered(current, CIL_SID);
4189 if (rc != SEPOL_OK) {
4193 rc = __cil_verify_ordered(current, CIL_CLASS);
4194 if (rc != SEPOL_OK) {
4198 rc = __cil_verify_ordered(current, CIL_CAT);
4199 if (rc != SEPOL_OK) {
4203 rc = __cil_verify_ordered(current, CIL_SENS);
4204 if (rc != SEPOL_OK) {
4244 rc = cil_reset_ast(current);
4245 if (rc != SEPOL_OK) {
4260 rc = __cil_verify_initsids(db->sidorder);
4261 if (rc != SEPOL_OK) {
4265 rc = SEPOL_OK;
4277 return rc;
4289 int rc = SEPOL_ERR;
4292 while (node != NULL && rc != SEPOL_OK) {
4301 rc = cil_symtab_get_datum(symtab, name, datum);
4307 rc = __cil_resolve_name_with_parents(node->parent, name, sym_index, datum);
4308 if (rc != SEPOL_OK) {
4310 rc = __cil_resolve_name_with_parents(NODE(inherit->block)->parent, name, sym_index, datum);
4318 rc = cil_symtab_get_datum(symtab, name, datum);
4325 rc = cil_symtab_get_datum(symtab, name, datum);
4326 if (rc == SEPOL_OK) {
4328 rc = SEPOL_ERR;
4330 rc = cil_resolve_name_call_args(call, name, sym_index, datum);
4331 if (rc != SEPOL_OK) {
4333 rc = __cil_resolve_name_with_parents(NODE(call->macro)->parent, name, sym_index, datum);
4350 return rc;
4355 int rc = SEPOL_ERR;
4357 rc = __cil_resolve_name_with_parents(node, name, sym_index, datum);
4358 if (rc != SEPOL_OK) {
4359 rc = __cil_resolve_name_with_root(db, name, sym_index, datum);
4361 return rc;
4366 int rc = SEPOL_ERR;
4369 rc = cil_resolve_name_keep_aliases(ast_node, name, sym_index, extra_args, datum);
4370 if (rc != SEPOL_OK) {
4386 rc = SEPOL_OK;
4389 return rc;
4394 int rc = SEPOL_ERR;
4408 rc = __cil_resolve_name_helper(db, ast_node->parent, name, sym_index, datum);
4409 if (rc != SEPOL_OK) {
4431 rc = __cil_resolve_name_helper(db, node->parent, current, CIL_SYM_BLOCKS, datum);
4432 if (rc != SEPOL_OK) {
4440 rc = cil_symtab_get_datum(symtab, current, datum);
4441 if (rc != SEPOL_OK) {
4452 rc = SEPOL_ERR;
4464 rc = cil_symtab_get_datum(symtab, current, datum);
4466 if (rc != SEPOL_OK) {
4471 rc = SEPOL_OK;
4474 if (rc != SEPOL_OK) {
4478 return rc;