Lines Matching refs:rc
37 int rc;
39 rc = strs_stack_init(&stack);
40 if (rc != 0) {
92 rc = strs_stack_push(stack, new_val);
93 if (rc != 0) {
128 int rc;
132 rc = strs_stack_init(&stack);
133 if (rc != 0) {
244 rc = strs_stack_push(stack, new_val);
245 if (rc != 0) {
280 int rc = 0;
294 rc = -1;
308 rc = strs_create_and_add(strs, "(%s (%s (%s)) %s)", 4, key_word, classkey, perms+1, expr);
310 if (rc != 0) {
318 return rc;
331 int rc = 0;
336 rc = -1;
348 rc = strs_create_and_add(strs, "(%s %s %s)", 3, key_word, classkey, expr);
350 if (rc != 0) {
356 return rc;
364 int rc = 0;
371 rc = class_constraint_rules_to_strs(pdb, name, class, class->constraints, mls_strs, non_mls_strs);
372 if (rc != 0) {
382 return rc;
390 int rc = 0;
397 rc = class_validatetrans_rules_to_strs(pdb, name, class->validatetrans, mls_strs, non_mls_strs);
398 if (rc != 0) {
408 return rc;
439 int rc;
441 rc = strs_init(&strs, permtab->nprim);
442 if (rc != 0) {
446 rc = hashtab_map(permtab->table, hashtab_ordered_to_strs, strs);
447 if (rc != 0) {
468 int rc = 0;
512 rc = -1;
522 rc = -1;
530 rc = -1;
545 if (rc != 0) {
549 return rc;
561 int rc;
563 rc = strs_init(&strs, num_sids+1);
564 if (rc != 0) {
577 rc = -1;
581 rc = strs_add_at_index(strs, sid, i);
582 if (rc != 0) {
618 if (rc != 0) {
622 return rc;
627 int rc = 0;
630 rc = write_sids_to_cil(out, selinux_sid_to_str, SELINUX_SID_SZ,
633 rc = write_sids_to_cil(out, xen_sid_to_str, XEN_SID_SZ,
637 rc = -1;
640 return rc;
742 int rc = 0;
749 rc = write_default_user_to_cil(out, pdb->p_class_val_to_name[i], class);
750 if (rc != 0) {
761 rc = write_default_role_to_cil(out, pdb->p_class_val_to_name[i], class);
762 if (rc != 0) {
773 rc = write_default_type_to_cil(out, pdb->p_class_val_to_name[i], class);
774 if (rc != 0) {
789 rc = write_default_range_to_cil(out, pdb->p_class_val_to_name[i], class);
790 if (rc != 0) {
797 if (rc != 0) {
801 return rc;
826 int rc = 0;
829 rc = strs_add(strs, key);
832 return rc;
841 int rc = 0;
864 rc = hashtab_map(pdb->p_levels.table, map_count_sensitivity_aliases, &num);
865 if (rc != 0) {
871 rc = 0;
875 rc = strs_init(&strs, num);
876 if (rc != 0) {
880 rc = hashtab_map(pdb->p_levels.table, map_sensitivity_aliases_to_strs, strs);
881 if (rc != 0) {
898 rc = -1;
908 if (rc != 0) {
912 return rc;
930 int rc = 0;
933 rc = strs_add(strs, key);
936 return rc;
945 int rc = 0;
968 rc = hashtab_map(pdb->p_cats.table, map_count_category_aliases, &num);
969 if (rc != 0) {
975 rc = 0;
979 rc = strs_init(&strs, num);
980 if (rc != 0) {
984 rc = hashtab_map(pdb->p_cats.table, map_category_aliases_to_strs, strs);
985 if (rc != 0) {
1002 rc = -1;
1012 if (rc != 0) {
1016 return rc;
1122 int rc = 0;
1130 rc = -1;
1143 if (rc != 0) {
1147 return rc;
1152 int rc = 0;
1163 rc = write_sensitivity_rules_to_cil(out, pdb);
1164 if (rc != 0) {
1168 rc = write_category_rules_to_cil(out, pdb);
1169 if (rc != 0) {
1173 rc = write_sensitivitycategory_rules_to_cil(out, pdb);
1174 if (rc != 0) {
1179 if (rc != 0) {
1183 return rc;
1192 int rc = 0;
1194 rc = strs_init(&strs, 32);
1195 if (rc != 0) {
1203 rc = -1;
1207 rc = strs_create_and_add(strs, "(policycap %s)", 1, name);
1208 if (rc != 0) {
1220 if (rc != 0) {
1224 return rc;
1233 int rc = 0;
1235 rc = strs_init(&strs, pdb->p_types.nprim);
1236 if (rc != 0) {
1243 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1244 if (rc != 0) {
1256 rc = -1;
1265 if (rc != 0) {
1269 return rc;
1278 int rc = 0;
1280 rc = strs_init(&strs, pdb->p_roles.nprim);
1281 if (rc != 0) {
1288 rc = strs_add(strs, pdb->p_role_val_to_name[i]);
1289 if (rc != 0) {
1301 rc = -1;
1310 if (rc != 0) {
1314 return rc;
1331 int rc = 0;
1333 rc = strs_init(&strs, 32);
1334 if (rc != 0) {
1338 rc = hashtab_map(pdb->p_bools.table, map_boolean_to_strs, strs);
1339 if (rc != 0) {
1350 if (rc != 0) {
1354 return rc;
1363 int rc = 0;
1365 rc = strs_init(&strs, pdb->p_types.nprim);
1366 if (rc != 0) {
1373 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1374 if (rc != 0) {
1386 rc = -1;
1395 if (rc != 0) {
1399 return rc;
1417 int rc = 0;
1420 rc = strs_add(strs, key);
1422 return rc;
1432 int rc = 0;
1434 rc = hashtab_map(pdb->p_types.table, map_count_type_aliases, &num);
1435 if (rc != 0) {
1439 rc = strs_init(&strs, num);
1440 if (rc != 0) {
1444 rc = hashtab_map(pdb->p_types.table, map_type_aliases_to_strs, strs);
1445 if (rc != 0) {
1454 rc = -1;
1463 rc = -1;
1468 rc = -1;
1478 if (rc != 0) {
1482 return rc;
1492 int rc = 0;
1494 rc = strs_init(&strs, pdb->p_types.nprim);
1495 if (rc != 0) {
1503 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
1504 if (rc != 0) {
1517 rc = -1;
1522 rc = -1;
1532 if (rc != 0) {
1536 return rc;
1546 int rc;
1548 rc = strs_init(&strs, pdb->p_types.nprim);
1549 if (rc != 0) {
1561 rc = -1;
1565 rc = strs_create_and_add(strs, "(typeattributeset %s (%s))",
1568 if (rc != 0) {
1580 if (rc != 0) {
1584 return rc;
1593 int rc = 0;
1595 rc = strs_init(&strs, pdb->p_types.nprim);
1596 if (rc != 0) {
1601 rc = strs_add(strs, pdb->p_type_val_to_name[i-1]);
1602 if (rc != 0) {
1613 rc = -1;
1622 if (rc != 0) {
1626 return rc;
1802 int rc = 0;
1807 rc = -1;
1810 rc = strs_add(strs, rule);
1811 if (rc != 0) {
1818 return rc;
1825 int rc = 0;
1827 rc = strs_init(&strs, 1000);
1828 if (rc != 0) {
1836 rc = avtab_map(&pdb->te_avtab, map_avtab_write_helper, &args);
1837 if (rc != 0) {
1848 return rc;
1854 int rc = 0;
1857 rc = write_avtab_flavor_to_cil(out, pdb, avtab_flavors[i], indent);
1858 if (rc != 0) {
1864 if (rc != 0) {
1868 return rc;
1886 int rc;
1896 rc = strs_create_and_add(strs,
1899 if (rc)
1900 return rc;
1913 int rc = 0;
1915 rc = strs_init(&strs, 100);
1916 if (rc != 0) {
1923 rc = hashtab_map(pdb->filename_trans, map_filename_trans_to_str, &args);
1924 if (rc != 0) {
1935 if (rc != 0) {
1939 return rc;
1998 int rc;
2005 rc = -1;
2009 rc = strs_create_and_add(strs, "(rangetransition %s %s %s %s)", 4,
2012 if (rc != 0) {
2017 return rc;
2024 int rc = 0;
2026 rc = strs_init(&strs, 100);
2027 if (rc != 0) {
2034 rc = hashtab_map(pdb->range_tr, map_range_trans_to_str, &args);
2035 if (rc != 0) {
2046 if (rc != 0) {
2050 return rc;
2063 int rc;
2067 rc = strs_init(&strs, 64);
2068 if (rc != 0) {
2079 rc = -1;
2082 rc = strs_add(strs, rule);
2083 if (rc != 0) {
2101 return rc;
2122 int rc = 0;
2130 rc = -1;
2157 rc = write_cond_av_list_to_cil(out, pdb, cond->true_list, 2);
2158 if (rc != 0) {
2168 rc = write_cond_av_list_to_cil(out, pdb, cond->false_list, 2);
2169 if (rc != 0) {
2186 if (rc != 0) {
2190 return rc;
2201 int rc = 0;
2203 rc = strs_init(&strs, pdb->p_roles.nprim);
2204 if (rc != 0) {
2211 rc = strs_add(strs, pdb->p_role_val_to_name[i]);
2212 if (rc != 0) {
2237 rc = -1;
2254 rc = -1;
2259 rc = strs_init(&type_strs, pdb->p_types.nprim);
2260 if (rc != 0) {
2263 rc = ebitmap_to_strs(types, type_strs, pdb->p_type_val_to_name);
2264 if (rc != 0) {
2281 rc = strs_init(&strs, pdb->p_types.nprim);
2282 if (rc != 0) {
2289 rc = strs_add(strs, pdb->p_type_val_to_name[i]);
2290 if (rc != 0) {
2311 if (rc != 0) {
2315 return rc;
2323 int rc = 0;
2325 rc = strs_init(&strs, 32);
2326 if (rc != 0) {
2336 rc = strs_create_and_add(strs, "(roletransition %s %s %s %s)", 4,
2338 if (rc != 0) {
2352 if (rc != 0) {
2356 return rc;
2364 int rc = 0;
2366 rc = strs_init(&strs, 32);
2367 if (rc != 0) {
2375 rc = strs_create_and_add(strs, "(roleallow %s %s)", 2, role, new);
2376 if (rc != 0) {
2390 if (rc != 0) {
2394 return rc;
2404 int rc = 0;
2406 rc = strs_init(&strs, pdb->p_users.nprim);
2407 if (rc != 0) {
2413 rc = strs_add(strs, pdb->p_user_val_to_name[i]);
2414 if (rc != 0) {
2439 rc = -1;
2445 rc = strs_init(&role_strs, pdb->p_roles.nprim);
2446 if (rc != 0) {
2449 rc = ebitmap_to_strs(roles, role_strs, pdb->p_role_val_to_name);
2450 if (rc != 0) {
2455 rc = strs_add(role_strs, (char *)DEFAULT_OBJECT);
2456 if (rc != 0) {
2480 rc = -1;
2489 rc = -1;
2508 rc = -1;
2516 rc = -1;
2531 if (rc != 0) {
2535 return rc;
2571 int rc = -1;
2573 rc = strs_init(&strs, 32);
2574 if (rc != 0) {
2589 rc = -1;
2596 rc = -1;
2600 rc = strs_add_at_index(strs, rule, i);
2601 if (rc != 0) {
2613 if (rc != 0) {
2617 return rc;
2631 int rc = 0;
2640 rc = -1;
2647 rc = -1;
2657 if (rc != 0) {
2661 return rc;
2672 int rc;
2674 rc = strs_init(&strs, 32);
2675 if (rc != 0) {
2703 rc = -1;
2710 rc = -1;
2715 rc = strs_create_and_add(strs, "(genfscon %s \"%s\" %s %s)", 4,
2718 rc = strs_create_and_add(strs, "(genfscon %s \"%s\" %s)", 3,
2722 if (rc != 0) {
2735 if (rc != 0) {
2739 return rc;
2750 int rc = 0;
2760 rc = -1;
2767 rc = snprintf(low_high_str, 44, "%u", low);
2769 rc = snprintf(low_high_str, 44, "(%u %u)", low, high);
2771 if (rc < 0 || rc >= 44) {
2772 rc = -1;
2778 rc = -1;
2787 rc = 0;
2790 if (rc != 0) {
2794 return rc;
2801 int rc = 0;
2807 rc = -1;
2813 rc = -1;
2824 if (rc != 0) {
2828 return rc;
2837 int rc = 0;
2842 rc = -1;
2848 rc = -1;
2854 rc = -1;
2864 if (rc != 0) {
2868 return rc;
2877 int rc = 0;
2882 rc = -1;
2888 rc = -1;
2894 rc = -1;
2904 if (rc != 0) {
2908 return rc;
2920 int rc = 0;
2930 rc = -1;
2937 rc = snprintf(low_high_str, 44, "%u", low);
2939 rc = snprintf(low_high_str, 44, "(%u %u)", low, high);
2941 if (rc < 0 || rc >= 44) {
2942 rc = -1;
2948 rc = -1;
2957 rc = 0;
2960 if (rc != 0) {
2964 return rc;
2972 int rc = 0;
2976 rc = snprintf(port_str, 4, "%u", ibendportcon->u.ibendport.port);
2977 if (rc < 0 || rc >= 4) {
2978 rc = -1;
2984 rc = -1;
2994 rc = 0;
2997 if (rc != 0) {
3001 return rc;
3014 int rc = 0;
3017 rc = snprintf(pirq_str, 21, "%i", pirq->u.pirq);
3018 if (rc < 0 || rc >= 21) {
3019 rc = -1;
3025 rc = -1;
3034 rc = 0;
3037 if (rc != 0) {
3041 return rc;
3051 int rc = 0;
3057 rc = snprintf(low_high_str, 40, "0x%x", low);
3059 rc = snprintf(low_high_str, 40, "(0x%x 0x%x)", low, high);
3061 if (rc < 0 || rc >= 40) {
3062 rc = -1;
3068 rc = -1;
3077 rc = 0;
3080 if (rc != 0) {
3084 return rc;
3094 int rc = 0;
3100 rc = snprintf(low_high_str, 40, "0x%"PRIx64, low);
3102 rc = snprintf(low_high_str, 40, "(0x%"PRIx64" 0x%"PRIx64")", low, high);
3104 if (rc < 0 || rc >= 40) {
3105 rc = -1;
3111 rc = -1;
3120 rc = 0;
3123 if (rc != 0) {
3127 return rc;
3135 int rc = 0;
3138 rc = snprintf(device_str, 20, "0x%lx", (unsigned long)pcid->u.device);
3139 if (rc < 0 || rc >= 20) {
3140 rc = -1;
3146 rc = -1;
3155 rc = 0;
3158 if (rc != 0) {
3162 return rc;
3169 int rc = 0;
3175 rc = -1;
3185 if (rc != 0) {
3189 return rc;
3198 int rc = 0;
3200 rc = strs_init(&mls_constraints, 32);
3201 if (rc != 0) {
3205 rc = strs_init(&non_mls_constraints, 32);
3206 if (rc != 0) {
3210 rc = strs_init(&mls_validatetrans, 32);
3211 if (rc != 0) {
3215 rc = strs_init(&non_mls_validatetrans, 32);
3216 if (rc != 0) {
3222 rc = -1;
3228 rc = -1;
3240 rc = -1;
3244 rc = constraint_rules_to_strs(pdb, mls_constraints, non_mls_constraints);
3245 if (rc != 0) {
3249 rc = validatetrans_rules_to_strs(pdb, mls_validatetrans, non_mls_validatetrans);
3250 if (rc != 0) {
3254 rc = write_handle_unknown_to_cil(out, pdb);
3255 if (rc != 0) {
3259 rc = write_class_decl_rules_to_cil(out, pdb);
3260 if (rc != 0) {
3264 rc = write_sid_decl_rules_to_cil(out, pdb);
3265 if (rc != 0) {
3269 rc = write_default_rules_to_cil(out, pdb);
3270 if (rc != 0) {
3274 rc = write_mls_rules_to_cil(out, pdb);
3275 if (rc != 0) {
3282 rc = write_polcap_rules_to_cil(out, pdb);
3283 if (rc != 0) {
3287 rc = write_type_attributes_to_cil(out, pdb);
3288 if (rc != 0) {
3292 rc = write_role_attributes_to_cil(out, pdb);
3293 if (rc != 0) {
3297 rc = write_boolean_decl_rules_to_cil(out, pdb);
3298 if (rc != 0) {
3302 rc = write_type_decl_rules_to_cil(out, pdb);
3303 if (rc != 0) {
3307 rc = write_type_alias_rules_to_cil(out, pdb);
3308 if (rc != 0) {
3312 rc = write_type_bounds_rules_to_cil(out, pdb);
3313 if (rc != 0) {
3317 rc = write_type_attribute_sets_to_cil(out, pdb);
3318 if (rc != 0) {
3322 rc = write_type_permissive_rules_to_cil(out, pdb);
3323 if (rc != 0) {
3327 rc = write_avtab_to_cil(out, pdb, 0);
3328 if (rc != 0) {
3332 rc = write_filename_trans_rules_to_cil(out, pdb);
3333 if (rc != 0) {
3338 rc = write_range_trans_rules_to_cil(out, pdb);
3339 if (rc != 0) {
3344 rc = write_cond_nodes_to_cil(out, pdb);
3345 if (rc != 0) {
3349 rc = write_role_decl_rules_to_cil(out, pdb);
3350 if (rc != 0) {
3354 rc = write_role_transition_rules_to_cil(out, pdb);
3355 if (rc != 0) {
3359 rc = write_role_allow_rules_to_cil(out, pdb);
3360 if (rc != 0) {
3364 rc = write_user_decl_rules_to_cil(out, pdb);
3365 if (rc != 0) {
3372 rc = sort_ocontexts(pdb);
3373 if (rc != 0) {
3378 rc = write_selinux_isid_rules_to_cil(out, pdb);
3379 if (rc != 0) {
3383 rc = write_selinux_fsuse_rules_to_cil(out, pdb);
3384 if (rc != 0) {
3388 rc = write_genfscon_rules_to_cil(out, pdb);
3389 if (rc != 0) {
3393 rc = write_selinux_port_rules_to_cil(out, pdb);
3394 if (rc != 0) {
3398 rc = write_selinux_netif_rules_to_cil(out, pdb);
3399 if (rc != 0) {
3403 rc = write_selinux_node_rules_to_cil(out, pdb);
3404 if (rc != 0) {
3408 rc = write_selinux_node6_rules_to_cil(out, pdb);
3409 if (rc != 0) {
3413 rc = write_selinux_ibpkey_rules_to_cil(out, pdb);
3414 if (rc != 0) {
3418 rc = write_selinux_ibendport_rules_to_cil(out, pdb);
3419 if (rc != 0) {
3423 rc = write_xen_isid_rules_to_cil(out, pdb);
3424 if (rc != 0) {
3428 rc = write_xen_pirq_rules_to_cil(out, pdb);
3429 if (rc != 0) {
3433 rc = write_xen_ioport_rules_to_cil(out, pdb);
3434 if (rc != 0) {
3438 rc = write_xen_iomem_rules_to_cil(out, pdb);
3439 if (rc != 0) {
3443 rc = write_xen_pcidevice_rules_to_cil(out, pdb);
3444 if (rc != 0) {
3448 rc = write_xen_devicetree_rules_to_cil(out, pdb);
3449 if (rc != 0) {
3464 return rc;