Lines Matching refs:rc
36 int rc; in cond_expr_to_str() local
38 rc = strs_stack_init(&stack); in cond_expr_to_str()
39 if (rc != 0) { in cond_expr_to_str()
90 rc = strs_stack_push(stack, new_val); in cond_expr_to_str()
91 if (rc != 0) { in cond_expr_to_str()
124 int rc; in constraint_expr_to_str() local
128 rc = strs_stack_init(&stack); in constraint_expr_to_str()
129 if (rc != 0) { in constraint_expr_to_str()
230 rc = strs_stack_push(stack, new_val); in constraint_expr_to_str()
231 if (rc != 0) { in constraint_expr_to_str()
269 int rc = 0; in class_constraint_rules_to_strs() local
274 rc = -1; in class_constraint_rules_to_strs()
292 rc = strs_create_and_add(strs, format_str, 4, in class_constraint_rules_to_strs()
295 if (rc != 0) { in class_constraint_rules_to_strs()
303 return rc; in class_constraint_rules_to_strs()
316 int rc = 0; in class_validatetrans_rules_to_strs() local
321 rc = -1; in class_validatetrans_rules_to_strs()
333 rc = strs_create_and_add(strs, "%s %s %s;", 3, flavor, classkey, expr); in class_validatetrans_rules_to_strs()
335 if (rc != 0) { in class_validatetrans_rules_to_strs()
341 return rc; in class_validatetrans_rules_to_strs()
349 int rc = 0; in constraint_rules_to_strs() local
355 … rc = class_constraint_rules_to_strs(pdb, name, class, class->constraints, mls_strs, non_mls_strs); in constraint_rules_to_strs()
356 if (rc != 0) { in constraint_rules_to_strs()
366 return rc; in constraint_rules_to_strs()
374 int rc = 0; in validatetrans_rules_to_strs() local
380 rc = class_validatetrans_rules_to_strs(pdb, name, class->validatetrans, mls_strs, non_mls_strs); in validatetrans_rules_to_strs()
381 if (rc != 0) { in validatetrans_rules_to_strs()
391 return rc; in validatetrans_rules_to_strs()
439 int rc; in write_sids_to_conf() local
441 rc = strs_init(&strs, num_sids+1); in write_sids_to_conf()
442 if (rc != 0) { in write_sids_to_conf()
454 rc = strs_add_at_index(strs, sid, i); in write_sids_to_conf()
455 if (rc != 0) { in write_sids_to_conf()
474 if (rc != 0) { in write_sids_to_conf()
478 return rc; in write_sids_to_conf()
483 int rc = 0; in write_sid_decl_rules_to_conf() local
486 rc = write_sids_to_conf(out, selinux_sid_to_str, SELINUX_SID_SZ, in write_sid_decl_rules_to_conf()
489 rc = write_sids_to_conf(out, xen_sid_to_str, XEN_SID_SZ, in write_sid_decl_rules_to_conf()
493 rc = -1; in write_sid_decl_rules_to_conf()
496 return rc; in write_sid_decl_rules_to_conf()
502 int rc = 0; in class_or_common_perms_to_str() local
504 rc = strs_init(&strs, permtab->nprim); in class_or_common_perms_to_str()
505 if (rc != 0) { in class_or_common_perms_to_str()
509 rc = hashtab_map(permtab->table, hashtab_ordered_to_strs, strs); in class_or_common_perms_to_str()
510 if (rc != 0) { in class_or_common_perms_to_str()
531 int rc = 0; in write_class_and_common_rules_to_conf() local
537 rc = -1; in write_class_and_common_rules_to_conf()
546 rc = -1; in write_class_and_common_rules_to_conf()
554 rc = -1; in write_class_and_common_rules_to_conf()
582 if (rc != 0) { in write_class_and_common_rules_to_conf()
586 return rc; in write_class_and_common_rules_to_conf()
685 int rc = 0; in write_default_rules_to_conf() local
691 rc = write_default_user_to_conf(out, pdb->p_class_val_to_name[i], class); in write_default_rules_to_conf()
692 if (rc != 0) { in write_default_rules_to_conf()
702 rc = write_default_role_to_conf(out, pdb->p_class_val_to_name[i], class); in write_default_rules_to_conf()
703 if (rc != 0) { in write_default_rules_to_conf()
713 rc = write_default_type_to_conf(out, pdb->p_class_val_to_name[i], class); in write_default_rules_to_conf()
714 if (rc != 0) { in write_default_rules_to_conf()
728 rc = write_default_range_to_conf(out, pdb->p_class_val_to_name[i], class); in write_default_rules_to_conf()
729 if (rc != 0) { in write_default_rules_to_conf()
736 if (rc != 0) { in write_default_rules_to_conf()
740 return rc; in write_default_rules_to_conf()
747 int rc = 0; in map_sensitivity_aliases_to_strs() local
750 rc = strs_add(strs, key); in map_sensitivity_aliases_to_strs()
753 return rc; in map_sensitivity_aliases_to_strs()
763 int rc = 0; in write_sensitivity_rules_to_conf() local
765 rc = strs_init(&strs, pdb->p_levels.nprim); in write_sensitivity_rules_to_conf()
766 if (rc != 0) { in write_sensitivity_rules_to_conf()
770 rc = hashtab_map(pdb->p_levels.table, map_sensitivity_aliases_to_strs, strs); in write_sensitivity_rules_to_conf()
771 if (rc != 0) { in write_sensitivity_rules_to_conf()
780 rc = -1; in write_sensitivity_rules_to_conf()
789 rc = -1; in write_sensitivity_rules_to_conf()
800 rc = -1; in write_sensitivity_rules_to_conf()
813 rc = -1; in write_sensitivity_rules_to_conf()
838 rc = -1; in write_sensitivity_rules_to_conf()
863 if (rc != 0) { in write_sensitivity_rules_to_conf()
867 return rc; in write_sensitivity_rules_to_conf()
874 int rc = 0; in map_category_aliases_to_strs() local
877 rc = strs_add(strs, key); in map_category_aliases_to_strs()
880 return rc; in map_category_aliases_to_strs()
890 int rc = 0; in write_category_rules_to_conf() local
892 rc = strs_init(&strs, pdb->p_levels.nprim); in write_category_rules_to_conf()
893 if (rc != 0) { in write_category_rules_to_conf()
897 rc = hashtab_map(pdb->p_cats.table, map_category_aliases_to_strs, strs); in write_category_rules_to_conf()
898 if (rc != 0) { in write_category_rules_to_conf()
907 rc = -1; in write_category_rules_to_conf()
916 rc = -1; in write_category_rules_to_conf()
927 rc = -1; in write_category_rules_to_conf()
940 rc = -1; in write_category_rules_to_conf()
967 if (rc != 0) { in write_category_rules_to_conf()
971 return rc; in write_category_rules_to_conf()
1068 int rc = 0; in write_level_rules_to_conf() local
1075 rc = -1; in write_level_rules_to_conf()
1090 if (rc != 0) { in write_level_rules_to_conf()
1094 return rc; in write_level_rules_to_conf()
1099 int rc = 0; in write_mls_rules_to_conf() local
1105 rc = write_sensitivity_rules_to_conf(out, pdb); in write_mls_rules_to_conf()
1106 if (rc != 0) { in write_mls_rules_to_conf()
1110 rc = write_category_rules_to_conf(out, pdb); in write_mls_rules_to_conf()
1111 if (rc != 0) { in write_mls_rules_to_conf()
1115 rc = write_level_rules_to_conf(out, pdb); in write_mls_rules_to_conf()
1116 if (rc != 0) { in write_mls_rules_to_conf()
1121 if (rc != 0) { in write_mls_rules_to_conf()
1125 return rc; in write_mls_rules_to_conf()
1134 int rc = 0; in write_polcap_rules_to_conf() local
1136 rc = strs_init(&strs, 32); in write_polcap_rules_to_conf()
1137 if (rc != 0) { in write_polcap_rules_to_conf()
1147 rc = -1; in write_polcap_rules_to_conf()
1151 rc = strs_create_and_add(strs, "policycap %s;", 1, name); in write_polcap_rules_to_conf()
1152 if (rc != 0) { in write_polcap_rules_to_conf()
1164 if (rc != 0) { in write_polcap_rules_to_conf()
1168 return rc; in write_polcap_rules_to_conf()
1177 int rc = 0; in write_type_attributes_to_conf() local
1179 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_attributes_to_conf()
1180 if (rc != 0) { in write_type_attributes_to_conf()
1187 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_attributes_to_conf()
1188 if (rc != 0) { in write_type_attributes_to_conf()
1200 rc = -1; in write_type_attributes_to_conf()
1209 if (rc != 0) { in write_type_attributes_to_conf()
1213 return rc; in write_type_attributes_to_conf()
1222 int rc = 0; in write_role_attributes_to_conf() local
1224 rc = strs_init(&strs, pdb->p_roles.nprim); in write_role_attributes_to_conf()
1225 if (rc != 0) { in write_role_attributes_to_conf()
1232 rc = strs_add(strs, pdb->p_role_val_to_name[i]); in write_role_attributes_to_conf()
1233 if (rc != 0) { in write_role_attributes_to_conf()
1245 rc = -1; in write_role_attributes_to_conf()
1254 if (rc != 0) { in write_role_attributes_to_conf()
1258 return rc; in write_role_attributes_to_conf()
1275 int rc = 0; in write_boolean_decl_rules_to_conf() local
1277 rc = strs_init(&strs, 32); in write_boolean_decl_rules_to_conf()
1278 if (rc != 0) { in write_boolean_decl_rules_to_conf()
1282 rc = hashtab_map(pdb->p_bools.table, map_boolean_to_strs, strs); in write_boolean_decl_rules_to_conf()
1283 if (rc != 0) { in write_boolean_decl_rules_to_conf()
1294 if (rc != 0) { in write_boolean_decl_rules_to_conf()
1298 return rc; in write_boolean_decl_rules_to_conf()
1307 int rc = 0; in write_type_decl_rules_to_conf() local
1309 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_decl_rules_to_conf()
1310 if (rc != 0) { in write_type_decl_rules_to_conf()
1317 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_decl_rules_to_conf()
1318 if (rc != 0) { in write_type_decl_rules_to_conf()
1330 rc = -1; in write_type_decl_rules_to_conf()
1339 if (rc != 0) { in write_type_decl_rules_to_conf()
1343 return rc; in write_type_decl_rules_to_conf()
1353 int rc = 0; in write_type_alias_rules_to_conf() local
1355 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_alias_rules_to_conf()
1356 if (rc != 0) { in write_type_alias_rules_to_conf()
1363 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_alias_rules_to_conf()
1364 if (rc != 0) { in write_type_alias_rules_to_conf()
1377 rc = -1; in write_type_alias_rules_to_conf()
1382 rc = -1; in write_type_alias_rules_to_conf()
1392 if (rc != 0) { in write_type_alias_rules_to_conf()
1396 return rc; in write_type_alias_rules_to_conf()
1406 int rc = 0; in write_type_bounds_rules_to_conf() local
1408 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_bounds_rules_to_conf()
1409 if (rc != 0) { in write_type_bounds_rules_to_conf()
1417 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_bounds_rules_to_conf()
1418 if (rc != 0) { in write_type_bounds_rules_to_conf()
1431 rc = -1; in write_type_bounds_rules_to_conf()
1436 rc = -1; in write_type_bounds_rules_to_conf()
1446 if (rc != 0) { in write_type_bounds_rules_to_conf()
1450 return rc; in write_type_bounds_rules_to_conf()
1459 int rc; in attr_strs_to_str() local
1477 rc = snprintf(p, len+1, "%s", strs->list[i]); in attr_strs_to_str()
1478 if (rc < 0 || rc > (int)len) { in attr_strs_to_str()
1500 int rc; in attrmap_to_str() local
1502 rc = strs_init(&strs, 32); in attrmap_to_str()
1503 if (rc != 0) { in attrmap_to_str()
1507 rc = ebitmap_to_strs(map, strs, val_to_name); in attrmap_to_str()
1508 if (rc != 0) { in attrmap_to_str()
1529 int rc; in write_type_attribute_sets_to_conf() local
1531 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_attribute_sets_to_conf()
1532 if (rc != 0) { in write_type_attribute_sets_to_conf()
1541 rc = ebitmap_cpy(&attrmap, &pdb->type_attr_map[i]); in write_type_attribute_sets_to_conf()
1542 if (rc != 0) { in write_type_attribute_sets_to_conf()
1545 rc = ebitmap_set_bit(&attrmap, i, 0); in write_type_attribute_sets_to_conf()
1546 if (rc != 0) { in write_type_attribute_sets_to_conf()
1554 rc = -1; in write_type_attribute_sets_to_conf()
1558 rc = strs_create_and_add(strs, "typeattribute %s %s;", in write_type_attribute_sets_to_conf()
1561 if (rc != 0) { in write_type_attribute_sets_to_conf()
1573 if (rc != 0) { in write_type_attribute_sets_to_conf()
1577 return rc; in write_type_attribute_sets_to_conf()
1586 int rc = 0; in write_type_permissive_rules_to_conf() local
1588 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_permissive_rules_to_conf()
1589 if (rc != 0) { in write_type_permissive_rules_to_conf()
1595 rc = strs_add(strs, pdb->p_type_val_to_name[i-1]); in write_type_permissive_rules_to_conf()
1596 if (rc != 0) { in write_type_permissive_rules_to_conf()
1607 rc = -1; in write_type_permissive_rules_to_conf()
1616 if (rc != 0) { in write_type_permissive_rules_to_conf()
1620 return rc; in write_type_permissive_rules_to_conf()
1719 int rc = 0; in map_avtab_write_helper() local
1724 rc = -1; in map_avtab_write_helper()
1727 rc = strs_add(strs, rule); in map_avtab_write_helper()
1728 if (rc != 0) { in map_avtab_write_helper()
1735 return rc; in map_avtab_write_helper()
1742 int rc = 0; in write_avtab_flavor_to_conf() local
1744 rc = strs_init(&strs, 1000); in write_avtab_flavor_to_conf()
1745 if (rc != 0) { in write_avtab_flavor_to_conf()
1753 rc = avtab_map(&pdb->te_avtab, map_avtab_write_helper, &args); in write_avtab_flavor_to_conf()
1754 if (rc != 0) { in write_avtab_flavor_to_conf()
1765 return rc; in write_avtab_flavor_to_conf()
1771 int rc = 0; in write_avtab_to_conf() local
1774 rc = write_avtab_flavor_to_conf(out, pdb, avtab_flavors[i], indent); in write_avtab_to_conf()
1775 if (rc != 0) { in write_avtab_to_conf()
1781 if (rc != 0) { in write_avtab_to_conf()
1785 return rc; in write_avtab_to_conf()
1816 int rc = 0; in write_filename_trans_rules_to_conf() local
1818 rc = strs_init(&strs, 100); in write_filename_trans_rules_to_conf()
1819 if (rc != 0) { in write_filename_trans_rules_to_conf()
1826 rc = hashtab_map(pdb->filename_trans, map_filename_trans_to_str, &args); in write_filename_trans_rules_to_conf()
1827 if (rc != 0) { in write_filename_trans_rules_to_conf()
1838 if (rc != 0) { in write_filename_trans_rules_to_conf()
1842 return rc; in write_filename_trans_rules_to_conf()
1901 int rc; in map_range_trans_to_str() local
1908 rc = -1; in map_range_trans_to_str()
1912 rc = strs_create_and_add(strs, "range_transition %s %s:%s %s;", 4, in map_range_trans_to_str()
1915 if (rc != 0) { in map_range_trans_to_str()
1920 return rc; in map_range_trans_to_str()
1927 int rc = 0; in write_range_trans_rules_to_conf() local
1929 rc = strs_init(&strs, 100); in write_range_trans_rules_to_conf()
1930 if (rc != 0) { in write_range_trans_rules_to_conf()
1937 rc = hashtab_map(pdb->range_tr, map_range_trans_to_str, &args); in write_range_trans_rules_to_conf()
1938 if (rc != 0) { in write_range_trans_rules_to_conf()
1949 if (rc != 0) { in write_range_trans_rules_to_conf()
1953 return rc; in write_range_trans_rules_to_conf()
1966 int rc; in write_cond_av_list_to_conf() local
1970 rc = strs_init(&strs, 64); in write_cond_av_list_to_conf()
1971 if (rc != 0) { in write_cond_av_list_to_conf()
1982 rc = -1; in write_cond_av_list_to_conf()
1985 rc = strs_add(strs, rule); in write_cond_av_list_to_conf()
1986 if (rc != 0) { in write_cond_av_list_to_conf()
2004 return rc; in write_cond_av_list_to_conf()
2025 int rc = 0; in write_cond_nodes_to_conf() local
2038 rc = -1; in write_cond_nodes_to_conf()
2063 rc = write_cond_av_list_to_conf(out, pdb, cond->true_list, 1); in write_cond_nodes_to_conf()
2064 if (rc != 0) { in write_cond_nodes_to_conf()
2071 rc = write_cond_av_list_to_conf(out, pdb, cond->false_list, 1); in write_cond_nodes_to_conf()
2072 if (rc != 0) { in write_cond_nodes_to_conf()
2087 if (rc != 0) { in write_cond_nodes_to_conf()
2091 return rc; in write_cond_nodes_to_conf()
2100 int rc = 0; in write_role_decl_rules_to_conf() local
2102 rc = strs_init(&strs, pdb->p_roles.nprim); in write_role_decl_rules_to_conf()
2103 if (rc != 0) { in write_role_decl_rules_to_conf()
2111 rc = strs_add(strs, pdb->p_role_val_to_name[i]); in write_role_decl_rules_to_conf()
2112 if (rc != 0) { in write_role_decl_rules_to_conf()
2135 rc = -1; in write_role_decl_rules_to_conf()
2141 rc = -1; in write_role_decl_rules_to_conf()
2169 if (rc != 0) { in write_role_decl_rules_to_conf()
2173 return rc; in write_role_decl_rules_to_conf()
2181 int rc = 0; in write_role_transition_rules_to_conf() local
2183 rc = strs_init(&strs, 32); in write_role_transition_rules_to_conf()
2184 if (rc != 0) { in write_role_transition_rules_to_conf()
2194 rc = strs_create_and_add(strs, "role_transition %s %s:%s %s;", 4, in write_role_transition_rules_to_conf()
2196 if (rc != 0) { in write_role_transition_rules_to_conf()
2210 if (rc != 0) { in write_role_transition_rules_to_conf()
2214 return rc; in write_role_transition_rules_to_conf()
2222 int rc = 0; in write_role_allow_rules_to_conf() local
2224 rc = strs_init(&strs, 32); in write_role_allow_rules_to_conf()
2225 if (rc != 0) { in write_role_allow_rules_to_conf()
2233 rc = strs_create_and_add(strs, "allow %s %s;", 2, role, new); in write_role_allow_rules_to_conf()
2234 if (rc != 0) { in write_role_allow_rules_to_conf()
2248 if (rc != 0) { in write_role_allow_rules_to_conf()
2252 return rc; in write_role_allow_rules_to_conf()
2261 int rc = 0; in write_user_decl_rules_to_conf() local
2263 rc = strs_init(&strs, pdb->p_users.nprim); in write_user_decl_rules_to_conf()
2264 if (rc != 0) { in write_user_decl_rules_to_conf()
2269 rc = strs_add(strs, pdb->p_user_val_to_name[i]); in write_user_decl_rules_to_conf()
2270 if (rc != 0) { in write_user_decl_rules_to_conf()
2286 rc = -1; in write_user_decl_rules_to_conf()
2295 rc = -1; in write_user_decl_rules_to_conf()
2309 rc = -1; in write_user_decl_rules_to_conf()
2317 rc = -1; in write_user_decl_rules_to_conf()
2329 if (rc != 0) { in write_user_decl_rules_to_conf()
2333 return rc; in write_user_decl_rules_to_conf()
2364 int rc; in write_sid_context_rules_to_conf() local
2366 rc = strs_init(&strs, 32); in write_sid_context_rules_to_conf()
2367 if (rc != 0) { in write_sid_context_rules_to_conf()
2382 rc = -1; in write_sid_context_rules_to_conf()
2389 rc = -1; in write_sid_context_rules_to_conf()
2393 rc = strs_add_at_index(strs, rule, i); in write_sid_context_rules_to_conf()
2394 if (rc != 0) { in write_sid_context_rules_to_conf()
2406 if (rc != 0) { in write_sid_context_rules_to_conf()
2410 return rc; in write_sid_context_rules_to_conf()
2424 int rc = 0; in write_selinux_fsuse_rules_to_conf() local
2433 rc = -1; in write_selinux_fsuse_rules_to_conf()
2440 rc = -1; in write_selinux_fsuse_rules_to_conf()
2450 if (rc != 0) { in write_selinux_fsuse_rules_to_conf()
2454 return rc; in write_selinux_fsuse_rules_to_conf()
2463 int rc; in write_genfscon_rules_to_conf() local
2465 rc = strs_init(&strs, 32); in write_genfscon_rules_to_conf()
2466 if (rc != 0) { in write_genfscon_rules_to_conf()
2477 rc = -1; in write_genfscon_rules_to_conf()
2481 rc = strs_create_and_add(strs, "genfscon %s %s %s", 3, in write_genfscon_rules_to_conf()
2484 if (rc != 0) { in write_genfscon_rules_to_conf()
2497 if (rc != 0) { in write_genfscon_rules_to_conf()
2501 return rc; in write_genfscon_rules_to_conf()
2512 int rc = 0; in write_selinux_port_rules_to_conf() local
2522 rc = -1; in write_selinux_port_rules_to_conf()
2529 rc = snprintf(low_high_str, 44, "%u", low); in write_selinux_port_rules_to_conf()
2531 rc = snprintf(low_high_str, 44, "%u-%u", low, high); in write_selinux_port_rules_to_conf()
2533 if (rc < 0 || rc >= 44) { in write_selinux_port_rules_to_conf()
2534 rc = -1; in write_selinux_port_rules_to_conf()
2540 rc = -1; in write_selinux_port_rules_to_conf()
2549 rc = 0; in write_selinux_port_rules_to_conf()
2552 if (rc != 0) { in write_selinux_port_rules_to_conf()
2556 return rc; in write_selinux_port_rules_to_conf()
2563 int rc = 0; in write_selinux_netif_rules_to_conf() local
2569 rc = -1; in write_selinux_netif_rules_to_conf()
2575 rc = -1; in write_selinux_netif_rules_to_conf()
2586 if (rc != 0) { in write_selinux_netif_rules_to_conf()
2590 return rc; in write_selinux_netif_rules_to_conf()
2599 int rc = 0; in write_selinux_node_rules_to_conf() local
2604 rc = -1; in write_selinux_node_rules_to_conf()
2610 rc = -1; in write_selinux_node_rules_to_conf()
2616 rc = -1; in write_selinux_node_rules_to_conf()
2626 if (rc != 0) { in write_selinux_node_rules_to_conf()
2630 return rc; in write_selinux_node_rules_to_conf()
2640 int rc = 0; in write_selinux_node6_rules_to_conf() local
2645 rc = -1; in write_selinux_node6_rules_to_conf()
2651 rc = -1; in write_selinux_node6_rules_to_conf()
2657 rc = -1; in write_selinux_node6_rules_to_conf()
2667 if (rc != 0) { in write_selinux_node6_rules_to_conf()
2671 return rc; in write_selinux_node6_rules_to_conf()
2683 int rc = 0; in write_selinux_ibpkey_rules_to_conf() local
2694 rc = -1; in write_selinux_ibpkey_rules_to_conf()
2701 rc = snprintf(low_high_str, 44, "%u", low); in write_selinux_ibpkey_rules_to_conf()
2703 rc = snprintf(low_high_str, 44, "%u-%u", low, high); in write_selinux_ibpkey_rules_to_conf()
2705 if (rc < 0 || rc >= 44) { in write_selinux_ibpkey_rules_to_conf()
2706 rc = -1; in write_selinux_ibpkey_rules_to_conf()
2712 rc = -1; in write_selinux_ibpkey_rules_to_conf()
2722 rc = 0; in write_selinux_ibpkey_rules_to_conf()
2725 if (rc != 0) { in write_selinux_ibpkey_rules_to_conf()
2729 return rc; in write_selinux_ibpkey_rules_to_conf()
2737 int rc = 0; in write_selinux_ibendport_rules_to_conf() local
2741 rc = snprintf(port_str, 4, "%u", ibendportcon->u.ibendport.port); in write_selinux_ibendport_rules_to_conf()
2742 if (rc < 0 || rc >= 4) { in write_selinux_ibendport_rules_to_conf()
2743 rc = -1; in write_selinux_ibendport_rules_to_conf()
2749 rc = -1; in write_selinux_ibendport_rules_to_conf()
2758 rc = 0; in write_selinux_ibendport_rules_to_conf()
2761 if (rc != 0) { in write_selinux_ibendport_rules_to_conf()
2765 return rc; in write_selinux_ibendport_rules_to_conf()
2779 int rc = 0; in write_xen_pirq_rules_to_conf() local
2782 rc = snprintf(pirq_str, 21, "%i", pirq->u.pirq); in write_xen_pirq_rules_to_conf()
2783 if (rc < 0 || rc >= 21) { in write_xen_pirq_rules_to_conf()
2785 rc = -1; in write_xen_pirq_rules_to_conf()
2791 rc = -1; in write_xen_pirq_rules_to_conf()
2801 rc = 0; in write_xen_pirq_rules_to_conf()
2804 if (rc != 0) { in write_xen_pirq_rules_to_conf()
2808 return rc; in write_xen_pirq_rules_to_conf()
2818 int rc = 0; in write_xen_ioport_rules_to_conf() local
2824 rc = snprintf(low_high_str, 40, "0x%x", low); in write_xen_ioport_rules_to_conf()
2826 rc = snprintf(low_high_str, 40, "0x%x-0x%x", low, high); in write_xen_ioport_rules_to_conf()
2828 if (rc < 0 || rc >= 40) { in write_xen_ioport_rules_to_conf()
2829 rc = -1; in write_xen_ioport_rules_to_conf()
2835 rc = -1; in write_xen_ioport_rules_to_conf()
2844 rc = 0; in write_xen_ioport_rules_to_conf()
2847 if (rc != 0) { in write_xen_ioport_rules_to_conf()
2851 return rc; in write_xen_ioport_rules_to_conf()
2861 int rc = 0; in write_xen_iomem_rules_to_conf() local
2867 rc = snprintf(low_high_str, 40, "0x%"PRIx64, low); in write_xen_iomem_rules_to_conf()
2869 rc = snprintf(low_high_str, 40, "0x%"PRIx64"-0x%"PRIx64, low, high); in write_xen_iomem_rules_to_conf()
2871 if (rc < 0 || rc >= 40) { in write_xen_iomem_rules_to_conf()
2872 rc = -1; in write_xen_iomem_rules_to_conf()
2878 rc = -1; in write_xen_iomem_rules_to_conf()
2887 rc = 0; in write_xen_iomem_rules_to_conf()
2890 if (rc != 0) { in write_xen_iomem_rules_to_conf()
2894 return rc; in write_xen_iomem_rules_to_conf()
2902 int rc = 0; in write_xen_pcidevice_rules_to_conf() local
2905 rc = snprintf(device_str, 20, "0x%lx", (unsigned long)pcid->u.device); in write_xen_pcidevice_rules_to_conf()
2906 if (rc < 0 || rc >= 20) { in write_xen_pcidevice_rules_to_conf()
2907 rc = -1; in write_xen_pcidevice_rules_to_conf()
2913 rc = -1; in write_xen_pcidevice_rules_to_conf()
2922 rc = 0; in write_xen_pcidevice_rules_to_conf()
2925 if (rc != 0) { in write_xen_pcidevice_rules_to_conf()
2929 return rc; in write_xen_pcidevice_rules_to_conf()
2936 int rc = 0; in write_xen_devicetree_rules_to_conf() local
2942 rc = -1; in write_xen_devicetree_rules_to_conf()
2952 if (rc != 0) { in write_xen_devicetree_rules_to_conf()
2956 return rc; in write_xen_devicetree_rules_to_conf()
2965 int rc = 0; in sepol_kernel_policydb_to_conf() local
2967 rc = strs_init(&mls_constraints, 32); in sepol_kernel_policydb_to_conf()
2968 if (rc != 0) { in sepol_kernel_policydb_to_conf()
2972 rc = strs_init(&non_mls_constraints, 32); in sepol_kernel_policydb_to_conf()
2973 if (rc != 0) { in sepol_kernel_policydb_to_conf()
2977 rc = strs_init(&mls_validatetrans, 32); in sepol_kernel_policydb_to_conf()
2978 if (rc != 0) { in sepol_kernel_policydb_to_conf()
2982 rc = strs_init(&non_mls_validatetrans, 32); in sepol_kernel_policydb_to_conf()
2983 if (rc != 0) { in sepol_kernel_policydb_to_conf()
2989 rc = -1; in sepol_kernel_policydb_to_conf()
2995 rc = -1; in sepol_kernel_policydb_to_conf()
2999 rc = constraint_rules_to_strs(pdb, mls_constraints, non_mls_constraints); in sepol_kernel_policydb_to_conf()
3000 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3004 rc = validatetrans_rules_to_strs(pdb, mls_validatetrans, non_mls_validatetrans); in sepol_kernel_policydb_to_conf()
3005 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3009 rc = write_handle_unknown_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3010 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3014 rc = write_class_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3015 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3019 rc = write_sid_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3020 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3024 rc = write_class_and_common_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3025 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3029 rc = write_default_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3030 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3034 rc = write_mls_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3035 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3042 rc = write_polcap_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3043 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3047 rc = write_type_attributes_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3048 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3052 rc = write_role_attributes_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3053 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3057 rc = write_boolean_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3058 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3062 rc = write_type_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3063 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3067 rc = write_type_alias_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3068 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3072 rc = write_type_bounds_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3073 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3077 rc = write_type_attribute_sets_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3078 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3082 rc = write_type_permissive_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3083 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3087 rc = write_avtab_to_conf(out, pdb, 0); in sepol_kernel_policydb_to_conf()
3088 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3094 rc = write_range_trans_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3095 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3100 rc = write_cond_nodes_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3101 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3105 rc = write_role_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3106 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3110 rc = write_role_transition_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3111 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3115 rc = write_role_allow_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3116 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3120 rc = write_user_decl_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3121 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3128 rc = sort_ocontexts(pdb); in sepol_kernel_policydb_to_conf()
3129 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3134 rc = write_selinux_isid_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3135 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3139 rc = write_selinux_fsuse_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3140 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3144 rc = write_genfscon_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3145 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3149 rc = write_selinux_port_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3150 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3154 rc = write_selinux_netif_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3155 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3159 rc = write_selinux_node_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3160 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3164 rc = write_selinux_node6_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3165 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3169 rc = write_selinux_ibpkey_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3170 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3174 rc = write_selinux_ibendport_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3175 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3179 rc = write_xen_isid_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3180 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3184 rc = write_genfscon_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3185 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3189 rc = write_xen_pirq_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3190 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3194 rc = write_xen_iomem_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3195 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3199 rc = write_xen_ioport_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3200 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3204 rc = write_xen_pcidevice_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3205 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3209 rc = write_xen_devicetree_rules_to_conf(out, pdb); in sepol_kernel_policydb_to_conf()
3210 if (rc != 0) { in sepol_kernel_policydb_to_conf()
3225 return rc; in sepol_kernel_policydb_to_conf()