Lines Matching refs:strs
33 struct strs *stack; in cond_expr_to_str()
122 struct strs *stack = NULL; in constraint_expr_to_str()
273 struct strs *mls_list, in class_constraint_rules_to_strs()
274 struct strs *non_mls_list) in class_constraint_rules_to_strs()
277 struct strs *strs; in class_constraint_rules_to_strs() local
303 strs = mls_list; in class_constraint_rules_to_strs()
306 strs = non_mls_list; in class_constraint_rules_to_strs()
309 rc = strs_create_and_add(strs, "%s %s %s%s%s %s;", 6, in class_constraint_rules_to_strs()
327 struct strs *mls_list, in class_validatetrans_rules_to_strs()
328 struct strs *non_mls_list) in class_validatetrans_rules_to_strs()
331 struct strs *strs; in class_validatetrans_rules_to_strs() local
346 strs = mls_list; in class_validatetrans_rules_to_strs()
349 strs = non_mls_list; in class_validatetrans_rules_to_strs()
352 rc = strs_create_and_add(strs, "%s %s %s;", 3, flavor, classkey, expr); in class_validatetrans_rules_to_strs()
363 static int constraint_rules_to_strs(struct policydb *pdb, struct strs *mls_strs, struct strs *non_m… in constraint_rules_to_strs()
388 static int validatetrans_rules_to_strs(struct policydb *pdb, struct strs *mls_strs, struct strs *no… in validatetrans_rules_to_strs()
454 struct strs *strs; in write_sids_to_conf() local
460 rc = strs_init(&strs, num_sids+1); in write_sids_to_conf()
477 rc = strs_add_at_index(strs, sid, i); in write_sids_to_conf()
483 for (i=0; i<strs_num_items(strs); i++) { in write_sids_to_conf()
484 sid = strs_read_at_index(strs, i); in write_sids_to_conf()
492 for (i=num_sids; i<strs_num_items(strs); i++) { in write_sids_to_conf()
493 sid = strs_read_at_index(strs, i); in write_sids_to_conf()
496 strs_destroy(&strs); in write_sids_to_conf()
523 struct strs *strs; in class_or_common_perms_to_str() local
527 rc = strs_init(&strs, permtab->nprim); in class_or_common_perms_to_str()
532 rc = hashtab_map(permtab->table, hashtab_ordered_to_strs, strs); in class_or_common_perms_to_str()
537 if (strs_num_items(strs) > 0) { in class_or_common_perms_to_str()
538 perms = strs_to_str(strs); in class_or_common_perms_to_str()
542 strs_destroy(&strs); in class_or_common_perms_to_str()
778 struct strs *strs = args; in map_sensitivity_aliases_to_strs() local
782 rc = strs_add(strs, key); in map_sensitivity_aliases_to_strs()
791 struct strs *strs; in write_sensitivity_rules_to_conf() local
797 rc = strs_init(&strs, pdb->p_levels.nprim); in write_sensitivity_rules_to_conf()
802 rc = hashtab_map(pdb->p_levels.table, map_sensitivity_aliases_to_strs, strs); in write_sensitivity_rules_to_conf()
807 num = strs_num_items(strs); in write_sensitivity_rules_to_conf()
818 name = strs_read_at_index(strs, i); in write_sensitivity_rules_to_conf()
897 strs_destroy(&strs); in write_sensitivity_rules_to_conf()
909 struct strs *strs = args; in map_category_aliases_to_strs() local
913 rc = strs_add(strs, key); in map_category_aliases_to_strs()
922 struct strs *strs; in write_category_rules_to_conf() local
928 rc = strs_init(&strs, pdb->p_cats.nprim); in write_category_rules_to_conf()
933 rc = hashtab_map(pdb->p_cats.table, map_category_aliases_to_strs, strs); in write_category_rules_to_conf()
938 num = strs_num_items(strs); in write_category_rules_to_conf()
949 name = strs_read_at_index(strs, i); in write_category_rules_to_conf()
1005 strs_destroy(&strs); in write_category_rules_to_conf()
1166 struct strs *strs; in write_polcap_rules_to_conf() local
1172 rc = strs_init(&strs, 32); in write_polcap_rules_to_conf()
1185 rc = strs_create_and_add(strs, "policycap %s;", 1, name); in write_polcap_rules_to_conf()
1191 strs_sort(strs); in write_polcap_rules_to_conf()
1192 strs_write_each(strs, out); in write_polcap_rules_to_conf()
1195 strs_free_all(strs); in write_polcap_rules_to_conf()
1196 strs_destroy(&strs); in write_polcap_rules_to_conf()
1209 struct strs *strs; in write_type_attributes_to_conf() local
1213 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_attributes_to_conf()
1221 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_attributes_to_conf()
1228 strs_sort(strs); in write_type_attributes_to_conf()
1230 num = strs_num_items(strs); in write_type_attributes_to_conf()
1232 name = strs_read_at_index(strs, i); in write_type_attributes_to_conf()
1241 strs_destroy(&strs); in write_type_attributes_to_conf()
1254 struct strs *strs; in write_role_attributes_to_conf() local
1258 rc = strs_init(&strs, pdb->p_roles.nprim); in write_role_attributes_to_conf()
1266 rc = strs_add(strs, pdb->p_role_val_to_name[i]); in write_role_attributes_to_conf()
1273 strs_sort(strs); in write_role_attributes_to_conf()
1275 num = strs_num_items(strs); in write_role_attributes_to_conf()
1277 name = strs_read_at_index(strs, i); in write_role_attributes_to_conf()
1286 strs_destroy(&strs); in write_role_attributes_to_conf()
1297 struct strs *strs = (struct strs *)args; in map_boolean_to_strs() local
1303 return strs_create_and_add(strs, "bool %s %s;", 2, key, value); in map_boolean_to_strs()
1308 struct strs *strs; in write_boolean_decl_rules_to_conf() local
1311 rc = strs_init(&strs, 32); in write_boolean_decl_rules_to_conf()
1316 rc = hashtab_map(pdb->p_bools.table, map_boolean_to_strs, strs); in write_boolean_decl_rules_to_conf()
1321 strs_sort(strs); in write_boolean_decl_rules_to_conf()
1322 strs_write_each(strs, out); in write_boolean_decl_rules_to_conf()
1325 strs_free_all(strs); in write_boolean_decl_rules_to_conf()
1326 strs_destroy(&strs); in write_boolean_decl_rules_to_conf()
1338 struct strs *strs; in write_type_decl_rules_to_conf() local
1343 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_decl_rules_to_conf()
1351 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_decl_rules_to_conf()
1358 strs_sort(strs); in write_type_decl_rules_to_conf()
1360 num = strs_num_items(strs); in write_type_decl_rules_to_conf()
1362 name = strs_read_at_index(strs, i); in write_type_decl_rules_to_conf()
1371 strs_destroy(&strs); in write_type_decl_rules_to_conf()
1394 struct strs *strs = args; in map_type_aliases_to_strs() local
1398 rc = strs_add(strs, key); in map_type_aliases_to_strs()
1406 struct strs *strs; in write_type_alias_rules_to_conf() local
1417 rc = strs_init(&strs, num); in write_type_alias_rules_to_conf()
1422 rc = hashtab_map(pdb->p_types.table, map_type_aliases_to_strs, strs); in write_type_alias_rules_to_conf()
1427 strs_sort(strs); in write_type_alias_rules_to_conf()
1430 name = strs_read_at_index(strs, i); in write_type_alias_rules_to_conf()
1445 strs_destroy(&strs); in write_type_alias_rules_to_conf()
1457 struct strs *strs; in write_type_bounds_rules_to_conf() local
1463 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_bounds_rules_to_conf()
1472 rc = strs_add(strs, pdb->p_type_val_to_name[i]); in write_type_bounds_rules_to_conf()
1480 strs_sort(strs); in write_type_bounds_rules_to_conf()
1482 num = strs_num_items(strs); in write_type_bounds_rules_to_conf()
1484 child = strs_read_at_index(strs, i); in write_type_bounds_rules_to_conf()
1499 strs_destroy(&strs); in write_type_bounds_rules_to_conf()
1508 static char *attr_strs_to_str(struct strs *strs) in attr_strs_to_str() argument
1516 if (strs->num == 0) { in attr_strs_to_str()
1521 len = strs_len_items(strs) + 2*strs->num - 1; in attr_strs_to_str()
1529 for (i=0; i<strs->num; i++) { in attr_strs_to_str()
1530 if (!strs->list[i]) continue; in attr_strs_to_str()
1531 len = strlen(strs->list[i]); in attr_strs_to_str()
1532 rc = snprintf(p, len+1, "%s", strs->list[i]); in attr_strs_to_str()
1539 if (i < strs->num - 1) { in attr_strs_to_str()
1553 struct strs *strs; in attrmap_to_str() local
1557 rc = strs_init(&strs, 32); in attrmap_to_str()
1562 rc = ebitmap_to_strs(map, strs, val_to_name); in attrmap_to_str()
1567 strs_sort(strs); in attrmap_to_str()
1569 str = attr_strs_to_str(strs); in attrmap_to_str()
1572 strs_destroy(&strs); in attrmap_to_str()
1580 struct strs *strs; in write_type_attribute_sets_to_conf() local
1586 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_attribute_sets_to_conf()
1613 rc = strs_create_and_add(strs, "typeattribute %s %s;", in write_type_attribute_sets_to_conf()
1621 strs_sort(strs); in write_type_attribute_sets_to_conf()
1622 strs_write_each(strs, out); in write_type_attribute_sets_to_conf()
1625 strs_free_all(strs); in write_type_attribute_sets_to_conf()
1626 strs_destroy(&strs); in write_type_attribute_sets_to_conf()
1637 struct strs *strs; in write_type_permissive_rules_to_conf() local
1643 rc = strs_init(&strs, pdb->p_types.nprim); in write_type_permissive_rules_to_conf()
1649 rc = strs_add(strs, pdb->p_type_val_to_name[i-1]); in write_type_permissive_rules_to_conf()
1655 strs_sort(strs); in write_type_permissive_rules_to_conf()
1657 num = strs_num_items(strs); in write_type_permissive_rules_to_conf()
1659 name = strs_read_at_index(strs, i); in write_type_permissive_rules_to_conf()
1668 strs_destroy(&strs); in write_type_permissive_rules_to_conf()
1763 struct strs *strs; member
1771 struct strs *strs = map_args->strs; in map_avtab_write_helper() local
1781 rc = strs_add(strs, rule); in map_avtab_write_helper()
1795 struct strs *strs; in write_avtab_flavor_to_conf() local
1798 rc = strs_init(&strs, 1000); in write_avtab_flavor_to_conf()
1805 args.strs = strs; in write_avtab_flavor_to_conf()
1812 strs_sort(strs); in write_avtab_flavor_to_conf()
1813 strs_write_each_indented(strs, out, indent); in write_avtab_flavor_to_conf()
1816 strs_free_all(strs); in write_avtab_flavor_to_conf()
1817 strs_destroy(&strs); in write_avtab_flavor_to_conf()
1844 struct strs *strs; member
1853 struct strs *strs = map_args->strs; in map_filename_trans_to_str() local
1867 rc = strs_create_and_add(strs, in map_filename_trans_to_str()
1883 struct strs *strs; in write_filename_trans_rules_to_conf() local
1886 rc = strs_init(&strs, 100); in write_filename_trans_rules_to_conf()
1892 args.strs = strs; in write_filename_trans_rules_to_conf()
1899 strs_sort(strs); in write_filename_trans_rules_to_conf()
1900 strs_write_each(strs, out); in write_filename_trans_rules_to_conf()
1903 strs_free_all(strs); in write_filename_trans_rules_to_conf()
1904 strs_destroy(&strs); in write_filename_trans_rules_to_conf()
1958 struct strs *strs; member
1967 struct strs *strs = map_args->strs; in map_range_trans_to_str() local
1980 rc = strs_create_and_add(strs, "range_transition %s %s:%s %s;", 4, in map_range_trans_to_str()
1994 struct strs *strs; in write_range_trans_rules_to_conf() local
1997 rc = strs_init(&strs, 100); in write_range_trans_rules_to_conf()
2003 args.strs = strs; in write_range_trans_rules_to_conf()
2010 strs_sort(strs); in write_range_trans_rules_to_conf()
2011 strs_write_each(strs, out); in write_range_trans_rules_to_conf()
2014 strs_free_all(strs); in write_range_trans_rules_to_conf()
2015 strs_destroy(&strs); in write_range_trans_rules_to_conf()
2031 struct strs *strs; in write_cond_av_list_to_conf() local
2038 rc = strs_init(&strs, 64); in write_cond_av_list_to_conf()
2053 rc = strs_add(strs, rule); in write_cond_av_list_to_conf()
2061 strs_sort(strs); in write_cond_av_list_to_conf()
2062 strs_write_each_indented(strs, out, indent); in write_cond_av_list_to_conf()
2063 strs_free_all(strs); in write_cond_av_list_to_conf()
2064 strs_destroy(&strs); in write_cond_av_list_to_conf()
2070 strs_free_all(strs); in write_cond_av_list_to_conf()
2071 strs_destroy(&strs); in write_cond_av_list_to_conf()
2165 struct strs *strs; in write_role_decl_rules_to_conf() local
2170 rc = strs_init(&strs, pdb->p_roles.nprim); in write_role_decl_rules_to_conf()
2179 rc = strs_add(strs, pdb->p_role_val_to_name[i]); in write_role_decl_rules_to_conf()
2186 strs_sort(strs); in write_role_decl_rules_to_conf()
2188 num = strs_num_items(strs); in write_role_decl_rules_to_conf()
2191 name = strs_read_at_index(strs, i); in write_role_decl_rules_to_conf()
2199 name = strs_read_at_index(strs, i); in write_role_decl_rules_to_conf()
2235 strs_destroy(&strs); in write_role_decl_rules_to_conf()
2247 struct strs *strs; in write_role_transition_rules_to_conf() local
2251 rc = strs_init(&strs, 32); in write_role_transition_rules_to_conf()
2262 rc = strs_create_and_add(strs, "role_transition %s %s:%s %s;", 4, in write_role_transition_rules_to_conf()
2271 strs_sort(strs); in write_role_transition_rules_to_conf()
2272 strs_write_each(strs, out); in write_role_transition_rules_to_conf()
2275 strs_free_all(strs); in write_role_transition_rules_to_conf()
2276 strs_destroy(&strs); in write_role_transition_rules_to_conf()
2288 struct strs *strs; in write_role_allow_rules_to_conf() local
2292 rc = strs_init(&strs, 32); in write_role_allow_rules_to_conf()
2301 rc = strs_create_and_add(strs, "allow %s %s;", 2, role, new); in write_role_allow_rules_to_conf()
2309 strs_sort(strs); in write_role_allow_rules_to_conf()
2310 strs_write_each(strs, out); in write_role_allow_rules_to_conf()
2313 strs_free_all(strs); in write_role_allow_rules_to_conf()
2314 strs_destroy(&strs); in write_role_allow_rules_to_conf()
2326 struct strs *strs; in write_user_decl_rules_to_conf() local
2331 rc = strs_init(&strs, pdb->p_users.nprim); in write_user_decl_rules_to_conf()
2338 rc = strs_add(strs, pdb->p_user_val_to_name[i]); in write_user_decl_rules_to_conf()
2344 strs_sort(strs); in write_user_decl_rules_to_conf()
2346 num = strs_num_items(strs); in write_user_decl_rules_to_conf()
2349 name = strs_read_at_index(strs, i); in write_user_decl_rules_to_conf()
2396 if (strs) in write_user_decl_rules_to_conf()
2397 strs_destroy(&strs); in write_user_decl_rules_to_conf()
2429 struct strs *strs; in write_sid_context_rules_to_conf() local
2436 rc = strs_init(&strs, 32); in write_sid_context_rules_to_conf()
2463 rc = strs_add_at_index(strs, rule, i); in write_sid_context_rules_to_conf()
2470 strs_write_each(strs, out); in write_sid_context_rules_to_conf()
2473 strs_free_all(strs); in write_sid_context_rules_to_conf()
2474 strs_destroy(&strs); in write_sid_context_rules_to_conf()
2531 struct strs *strs; in write_genfscon_rules_to_conf() local
2537 rc = strs_init(&strs, 32); in write_genfscon_rules_to_conf()
2578 rc = strs_create_and_add(strs, "genfscon %s \"%s\" %s %s", 4, in write_genfscon_rules_to_conf()
2581 rc = strs_create_and_add(strs, "genfscon %s \"%s\" %s", 3, in write_genfscon_rules_to_conf()
2591 strs_sort(strs); in write_genfscon_rules_to_conf()
2592 strs_write_each(strs, out); in write_genfscon_rules_to_conf()
2595 strs_free_all(strs); in write_genfscon_rules_to_conf()
2596 strs_destroy(&strs); in write_genfscon_rules_to_conf()
3061 struct strs *mls_constraints = NULL; in sepol_kernel_policydb_to_conf()
3062 struct strs *non_mls_constraints = NULL; in sepol_kernel_policydb_to_conf()
3063 struct strs *mls_validatetrans = NULL; in sepol_kernel_policydb_to_conf()
3064 struct strs *non_mls_validatetrans = NULL; in sepol_kernel_policydb_to_conf()