Lines Matching refs:rc

36 	int rc;
38 rc = strs_stack_init(&stack);
39 if (rc != 0) {
90 rc = strs_stack_push(stack, new_val);
91 if (rc != 0) {
126 int rc;
130 rc = strs_stack_init(&stack);
131 if (rc != 0) {
240 rc = strs_stack_push(stack, new_val);
241 if (rc != 0) {
281 int rc = 0;
289 rc = -1;
309 rc = strs_create_and_add(strs, "%s %s %s%s%s %s;", 6,
314 if (rc != 0) {
322 return rc;
335 int rc = 0;
340 rc = -1;
352 rc = strs_create_and_add(strs, "%s %s %s;", 3, flavor, classkey, expr);
354 if (rc != 0) {
360 return rc;
368 int rc = 0;
374 rc = class_constraint_rules_to_strs(pdb, name, class, class->constraints, mls_strs, non_mls_strs);
375 if (rc != 0) {
385 return rc;
393 int rc = 0;
399 rc = class_validatetrans_rules_to_strs(pdb, name, class->validatetrans, mls_strs, non_mls_strs);
400 if (rc != 0) {
410 return rc;
458 int rc;
460 rc = strs_init(&strs, num_sids+1);
461 if (rc != 0) {
473 rc = -1;
477 rc = strs_add_at_index(strs, sid, i);
478 if (rc != 0) {
497 if (rc != 0) {
501 return rc;
506 int rc = 0;
509 rc = write_sids_to_conf(out, selinux_sid_to_str, SELINUX_SID_SZ,
512 rc = write_sids_to_conf(out, xen_sid_to_str, XEN_SID_SZ,
516 rc = -1;
519 return rc;
525 int rc = 0;
527 rc = strs_init(&strs, permtab->nprim);
528 if (rc != 0) {
532 rc = hashtab_map(permtab->table, hashtab_ordered_to_strs, strs);
533 if (rc != 0) {
554 int rc = 0;
560 rc = -1;
570 rc = -1;
578 rc = -1;
612 if (rc != 0) {
616 return rc;
718 int rc = 0;
725 rc = write_default_user_to_conf(out, pdb->p_class_val_to_name[i], class);
726 if (rc != 0) {
737 rc = write_default_role_to_conf(out, pdb->p_class_val_to_name[i], class);
738 if (rc != 0) {
749 rc = write_default_type_to_conf(out, pdb->p_class_val_to_name[i], class);
750 if (rc != 0) {
765 rc = write_default_range_to_conf(out, pdb->p_class_val_to_name[i], class);
766 if (rc != 0) {
773 if (rc != 0) {
777 return rc;
784 int rc = 0;
787 rc = strs_add(strs, key);
790 return rc;
800 int rc = 0;
802 rc = strs_init(&strs, pdb->p_levels.nprim);
803 if (rc != 0) {
807 rc = hashtab_map(pdb->p_levels.table, map_sensitivity_aliases_to_strs, strs);
808 if (rc != 0) {
817 rc = -1;
826 rc = -1;
833 rc = -1;
841 rc = -1;
854 rc = -1;
879 rc = -1;
904 if (rc != 0) {
908 return rc;
915 int rc = 0;
918 rc = strs_add(strs, key);
921 return rc;
931 int rc = 0;
933 rc = strs_init(&strs, pdb->p_cats.nprim);
934 if (rc != 0) {
938 rc = hashtab_map(pdb->p_cats.table, map_category_aliases_to_strs, strs);
939 if (rc != 0) {
948 rc = -1;
957 rc = -1;
964 rc = -1;
972 rc = -1;
985 rc = -1;
1012 if (rc != 0) {
1016 return rc;
1109 int rc = 0;
1116 rc = -1;
1131 if (rc != 0) {
1135 return rc;
1140 int rc = 0;
1146 rc = write_sensitivity_rules_to_conf(out, pdb);
1147 if (rc != 0) {
1151 rc = write_category_rules_to_conf(out, pdb);
1152 if (rc != 0) {
1156 rc = write_level_rules_to_conf(out, pdb);
1157 if (rc != 0) {
1162 if (rc != 0) {
1166 return rc;
1175 int rc = 0;
1177 rc = strs_init(&strs, 32);
1178 if (rc != 0) {
1186 rc = -1;
1190 rc = strs_create_and_add(strs, "policycap %s;", 1, name);
1191 if (rc != 0) {
1203 if (rc != 0) {
1207 return rc;
1216 int rc = 0;
1218 rc = strs_init(&strs, pdb->p_types.nprim);
1219 if (rc != 0) {
1226 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1227 if (rc != 0) {
1239 rc = -1;
1248 if (rc != 0) {
1252 return rc;
1261 int rc = 0;
1263 rc = strs_init(&strs, pdb->p_roles.nprim);
1264 if (rc != 0) {
1271 rc = strs_add(strs, pdb->p_role_val_to_name[i]);
1272 if (rc != 0) {
1284 rc = -1;
1293 if (rc != 0) {
1297 return rc;
1314 int rc = 0;
1316 rc = strs_init(&strs, 32);
1317 if (rc != 0) {
1321 rc = hashtab_map(pdb->p_bools.table, map_boolean_to_strs, strs);
1322 if (rc != 0) {
1333 if (rc != 0) {
1337 return rc;
1346 int rc = 0;
1348 rc = strs_init(&strs, pdb->p_types.nprim);
1349 if (rc != 0) {
1356 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1357 if (rc != 0) {
1369 rc = -1;
1378 if (rc != 0) {
1382 return rc;
1400 int rc = 0;
1403 rc = strs_add(strs, key);
1405 return rc;
1415 int rc = 0;
1417 rc = hashtab_map(pdb->p_types.table, map_count_type_aliases, &num);
1418 if (rc != 0) {
1422 rc = strs_init(&strs, num);
1423 if (rc != 0) {
1427 rc = hashtab_map(pdb->p_types.table, map_type_aliases_to_strs, strs);
1428 if (rc != 0) {
1437 rc = -1;
1442 rc = -1;
1452 if (rc != 0) {
1456 return rc;
1466 int rc = 0;
1468 rc = strs_init(&strs, pdb->p_types.nprim);
1469 if (rc != 0) {
1477 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1478 if (rc != 0) {
1491 rc = -1;
1496 rc = -1;
1506 if (rc != 0) {
1510 return rc;
1519 int rc;
1537 rc = snprintf(p, len+1, "%s", strs->list[i]);
1538 if (rc < 0 || rc > (int)len) {
1560 int rc;
1562 rc = strs_init(&strs, 32);
1563 if (rc != 0) {
1567 rc = ebitmap_to_strs(map, strs, val_to_name);
1568 if (rc != 0) {
1589 int rc;
1591 rc = strs_init(&strs, pdb->p_types.nprim);
1592 if (rc != 0) {
1601 rc = ebitmap_cpy(&attrmap, &pdb->type_attr_map[i]);
1602 if (rc != 0) {
1605 rc = ebitmap_set_bit(&attrmap, i, 0);
1606 if (rc != 0) {
1614 rc = -1;
1618 rc = strs_create_and_add(strs, "typeattribute %s %s;",
1621 if (rc != 0) {
1633 if (rc != 0) {
1637 return rc;
1646 int rc = 0;
1648 rc = strs_init(&strs, pdb->p_types.nprim);
1649 if (rc != 0) {
1654 rc = strs_add(strs, pdb->p_type_val_to_name[i-1]);
1655 if (rc != 0) {
1666 rc = -1;
1675 if (rc != 0) {
1679 return rc;
1778 int rc = 0;
1783 rc = -1;
1786 rc = strs_add(strs, rule);
1787 if (rc != 0) {
1794 return rc;
1801 int rc = 0;
1803 rc = strs_init(&strs, 1000);
1804 if (rc != 0) {
1812 rc = avtab_map(&pdb->te_avtab, map_avtab_write_helper, &args);
1813 if (rc != 0) {
1824 return rc;
1830 int rc = 0;
1833 rc = write_avtab_flavor_to_conf(out, pdb, avtab_flavors[i], indent);
1834 if (rc != 0) {
1840 if (rc != 0) {
1844 return rc;
1862 int rc;
1872 rc = strs_create_and_add(strs,
1875 if (rc)
1876 return rc;
1889 int rc = 0;
1891 rc = strs_init(&strs, 100);
1892 if (rc != 0) {
1899 rc = hashtab_map(pdb->filename_trans, map_filename_trans_to_str, &args);
1900 if (rc != 0) {
1911 if (rc != 0) {
1915 return rc;
1974 int rc;
1981 rc = -1;
1985 rc = strs_create_and_add(strs, "range_transition %s %s:%s %s;", 4,
1988 if (rc != 0) {
1993 return rc;
2000 int rc = 0;
2002 rc = strs_init(&strs, 100);
2003 if (rc != 0) {
2010 rc = hashtab_map(pdb->range_tr, map_range_trans_to_str, &args);
2011 if (rc != 0) {
2022 if (rc != 0) {
2026 return rc;
2039 int rc;
2043 rc = strs_init(&strs, 64);
2044 if (rc != 0) {
2055 rc = -1;
2058 rc = strs_add(strs, rule);
2059 if (rc != 0) {
2077 return rc;
2098 int rc = 0;
2111 rc = -1;
2136 rc = write_cond_av_list_to_conf(out, pdb, cond->true_list, 1);
2137 if (rc != 0) {
2144 rc = write_cond_av_list_to_conf(out, pdb, cond->false_list, 1);
2145 if (rc != 0) {
2160 if (rc != 0) {
2164 return rc;
2173 int rc = 0;
2175 rc = strs_init(&strs, pdb->p_roles.nprim);
2176 if (rc != 0) {
2184 rc = strs_add(strs, pdb->p_role_val_to_name[i]);
2185 if (rc != 0) {
2208 rc = -1;
2214 rc = -1;
2242 if (rc != 0) {
2246 return rc;
2254 int rc = 0;
2256 rc = strs_init(&strs, 32);
2257 if (rc != 0) {
2267 rc = strs_create_and_add(strs, "role_transition %s %s:%s %s;", 4,
2269 if (rc != 0) {
2283 if (rc != 0) {
2287 return rc;
2295 int rc = 0;
2297 rc = strs_init(&strs, 32);
2298 if (rc != 0) {
2306 rc = strs_create_and_add(strs, "allow %s %s;", 2, role, new);
2307 if (rc != 0) {
2321 if (rc != 0) {
2325 return rc;
2334 int rc = 0;
2336 rc = strs_init(&strs, pdb->p_users.nprim);
2337 if (rc != 0) {
2343 rc = strs_add(strs, pdb->p_user_val_to_name[i]);
2344 if (rc != 0) {
2360 rc = -1;
2369 rc = -1;
2383 rc = -1;
2391 rc = -1;
2404 if (rc != 0) {
2408 return rc;
2439 int rc;
2441 rc = strs_init(&strs, 32);
2442 if (rc != 0) {
2457 rc = -1;
2464 rc = -1;
2468 rc = strs_add_at_index(strs, rule, i);
2469 if (rc != 0) {
2481 if (rc != 0) {
2485 return rc;
2499 int rc = 0;
2508 rc = -1;
2515 rc = -1;
2525 if (rc != 0) {
2529 return rc;
2540 int rc;
2542 rc = strs_init(&strs, 32);
2543 if (rc != 0) {
2571 rc = -1;
2578 rc = -1;
2583 rc = strs_create_and_add(strs, "genfscon %s \"%s\" %s %s", 4,
2586 rc = strs_create_and_add(strs, "genfscon %s \"%s\" %s", 3,
2590 if (rc != 0) {
2603 if (rc != 0) {
2607 return rc;
2618 int rc = 0;
2628 rc = -1;
2635 rc = snprintf(low_high_str, 44, "%u", low);
2637 rc = snprintf(low_high_str, 44, "%u-%u", low, high);
2639 if (rc < 0 || rc >= 44) {
2640 rc = -1;
2646 rc = -1;
2655 rc = 0;
2658 if (rc != 0) {
2662 return rc;
2669 int rc = 0;
2675 rc = -1;
2681 rc = -1;
2692 if (rc != 0) {
2696 return rc;
2705 int rc = 0;
2710 rc = -1;
2716 rc = -1;
2722 rc = -1;
2732 if (rc != 0) {
2736 return rc;
2746 int rc = 0;
2751 rc = -1;
2757 rc = -1;
2763 rc = -1;
2773 if (rc != 0) {
2777 return rc;
2789 int rc = 0;
2799 rc = -1;
2806 rc = snprintf(low_high_str, 44, "%u", low);
2808 rc = snprintf(low_high_str, 44, "%u-%u", low, high);
2810 if (rc < 0 || rc >= 44) {
2811 rc = -1;
2817 rc = -1;
2827 rc = 0;
2830 if (rc != 0) {
2834 return rc;
2842 int rc = 0;
2846 rc = snprintf(port_str, 4, "%u", ibendportcon->u.ibendport.port);
2847 if (rc < 0 || rc >= 4) {
2848 rc = -1;
2854 rc = -1;
2863 rc = 0;
2866 if (rc != 0) {
2870 return rc;
2884 int rc = 0;
2887 rc = snprintf(pirq_str, 21, "%i", pirq->u.pirq);
2888 if (rc < 0 || rc >= 21) {
2890 rc = -1;
2896 rc = -1;
2906 rc = 0;
2909 if (rc != 0) {
2913 return rc;
2923 int rc = 0;
2929 rc = snprintf(low_high_str, 40, "0x%x", low);
2931 rc = snprintf(low_high_str, 40, "0x%x-0x%x", low, high);
2933 if (rc < 0 || rc >= 40) {
2934 rc = -1;
2940 rc = -1;
2949 rc = 0;
2952 if (rc != 0) {
2956 return rc;
2966 int rc = 0;
2972 rc = snprintf(low_high_str, 40, "0x%"PRIx64, low);
2974 rc = snprintf(low_high_str, 40, "0x%"PRIx64"-0x%"PRIx64, low, high);
2976 if (rc < 0 || rc >= 40) {
2977 rc = -1;
2983 rc = -1;
2992 rc = 0;
2995 if (rc != 0) {
2999 return rc;
3007 int rc = 0;
3010 rc = snprintf(device_str, 20, "0x%lx", (unsigned long)pcid->u.device);
3011 if (rc < 0 || rc >= 20) {
3012 rc = -1;
3018 rc = -1;
3027 rc = 0;
3030 if (rc != 0) {
3034 return rc;
3041 int rc = 0;
3047 rc = -1;
3057 if (rc != 0) {
3061 return rc;
3070 int rc = 0;
3072 rc = strs_init(&mls_constraints, 32);
3073 if (rc != 0) {
3077 rc = strs_init(&non_mls_constraints, 32);
3078 if (rc != 0) {
3082 rc = strs_init(&mls_validatetrans, 32);
3083 if (rc != 0) {
3087 rc = strs_init(&non_mls_validatetrans, 32);
3088 if (rc != 0) {
3094 rc = -1;
3100 rc = -1;
3112 rc = -1;
3116 rc = constraint_rules_to_strs(pdb, mls_constraints, non_mls_constraints);
3117 if (rc != 0) {
3121 rc = validatetrans_rules_to_strs(pdb, mls_validatetrans, non_mls_validatetrans);
3122 if (rc != 0) {
3126 rc = write_handle_unknown_to_conf(out, pdb);
3127 if (rc != 0) {
3131 rc = write_class_decl_rules_to_conf(out, pdb);
3132 if (rc != 0) {
3136 rc = write_sid_decl_rules_to_conf(out, pdb);
3137 if (rc != 0) {
3141 rc = write_class_and_common_rules_to_conf(out, pdb);
3142 if (rc != 0) {
3146 rc = write_default_rules_to_conf(out, pdb);
3147 if (rc != 0) {
3151 rc = write_mls_rules_to_conf(out, pdb);
3152 if (rc != 0) {
3159 rc = write_polcap_rules_to_conf(out, pdb);
3160 if (rc != 0) {
3164 rc = write_type_attributes_to_conf(out, pdb);
3165 if (rc != 0) {
3169 rc = write_role_attributes_to_conf(out, pdb);
3170 if (rc != 0) {
3174 rc = write_boolean_decl_rules_to_conf(out, pdb);
3175 if (rc != 0) {
3179 rc = write_type_decl_rules_to_conf(out, pdb);
3180 if (rc != 0) {
3184 rc = write_type_alias_rules_to_conf(out, pdb);
3185 if (rc != 0) {
3189 rc = write_type_bounds_rules_to_conf(out, pdb);
3190 if (rc != 0) {
3194 rc = write_type_attribute_sets_to_conf(out, pdb);
3195 if (rc != 0) {
3199 rc = write_type_permissive_rules_to_conf(out, pdb);
3200 if (rc != 0) {
3204 rc = write_avtab_to_conf(out, pdb, 0);
3205 if (rc != 0) {
3211 rc = write_range_trans_rules_to_conf(out, pdb);
3212 if (rc != 0) {
3217 rc = write_cond_nodes_to_conf(out, pdb);
3218 if (rc != 0) {
3222 rc = write_role_decl_rules_to_conf(out, pdb);
3223 if (rc != 0) {
3227 rc = write_role_transition_rules_to_conf(out, pdb);
3228 if (rc != 0) {
3232 rc = write_role_allow_rules_to_conf(out, pdb);
3233 if (rc != 0) {
3237 rc = write_user_decl_rules_to_conf(out, pdb);
3238 if (rc != 0) {
3245 rc = sort_ocontexts(pdb);
3246 if (rc != 0) {
3251 rc = write_selinux_isid_rules_to_conf(out, pdb);
3252 if (rc != 0) {
3256 rc = write_selinux_fsuse_rules_to_conf(out, pdb);
3257 if (rc != 0) {
3261 rc = write_genfscon_rules_to_conf(out, pdb);
3262 if (rc != 0) {
3266 rc = write_selinux_port_rules_to_conf(out, pdb);
3267 if (rc != 0) {
3271 rc = write_selinux_netif_rules_to_conf(out, pdb);
3272 if (rc != 0) {
3276 rc = write_selinux_node_rules_to_conf(out, pdb);
3277 if (rc != 0) {
3281 rc = write_selinux_node6_rules_to_conf(out, pdb);
3282 if (rc != 0) {
3286 rc = write_selinux_ibpkey_rules_to_conf(out, pdb);
3287 if (rc != 0) {
3291 rc = write_selinux_ibendport_rules_to_conf(out, pdb);
3292 if (rc != 0) {
3296 rc = write_xen_isid_rules_to_conf(out, pdb);
3297 if (rc != 0) {
3301 rc = write_genfscon_rules_to_conf(out, pdb);
3302 if (rc != 0) {
3306 rc = write_xen_pirq_rules_to_conf(out, pdb);
3307 if (rc != 0) {
3311 rc = write_xen_iomem_rules_to_conf(out, pdb);
3312 if (rc != 0) {
3316 rc = write_xen_ioport_rules_to_conf(out, pdb);
3317 if (rc != 0) {
3321 rc = write_xen_pcidevice_rules_to_conf(out, pdb);
3322 if (rc != 0) {
3326 rc = write_xen_devicetree_rules_to_conf(out, pdb);
3327 if (rc != 0) {
3342 return rc;