Lines Matching refs:rc
172 int rc; in roles_init() local
178 rc = -ENOMEM; in roles_init()
184 rc = -EINVAL; in roles_init()
190 rc = -ENOMEM; in roles_init()
194 rc = hashtab_insert(p->p_roles.table, key, role); in roles_init()
195 if ( rc ) in roles_init()
198 return rc; in roles_init()
212 int i, rc; in policydb_init() local
218 rc = symtab_init(&p->symtab[i], symtab_sizes[i]); in policydb_init()
219 if ( rc ) in policydb_init()
223 rc = avtab_init(&p->te_avtab); in policydb_init()
224 if ( rc ) in policydb_init()
227 rc = roles_init(p); in policydb_init()
228 if ( rc ) in policydb_init()
231 rc = cond_policydb_init(p); in policydb_init()
232 if ( rc ) in policydb_init()
239 return rc; in policydb_init()
389 int rc; in policydb_index_classes() local
395 rc = -ENOMEM; in policydb_index_classes()
403 rc = -ENOMEM; in policydb_index_classes()
407 rc = hashtab_map(p->p_classes.table, class_index, p); in policydb_index_classes()
409 return rc; in policydb_index_classes()
438 int i, rc = 0; in policydb_index_others() local
459 rc = -ENOMEM; in policydb_index_others()
467 rc = -ENOMEM; in policydb_index_others()
475 rc = -ENOMEM; in policydb_index_others()
481 rc = -ENOMEM; in policydb_index_others()
491 rc = -ENOMEM; in policydb_index_others()
494 rc = hashtab_map(p->symtab[i].table, index_f[i], p); in policydb_index_others()
495 if ( rc ) in policydb_index_others()
500 return rc; in policydb_index_others()
737 int rc; in policydb_load_isids() local
739 rc = sidtab_init(s); in policydb_load_isids()
740 if ( rc ) in policydb_load_isids()
753 rc = -EINVAL; in policydb_load_isids()
760 rc = -EINVAL; in policydb_load_isids()
765 return rc; in policydb_load_isids()
843 int rc; in mls_read_range_helper() local
845 rc = next_entry(buf, fp, sizeof(u32)); in mls_read_range_helper()
846 if ( rc < 0 ) in mls_read_range_helper()
853 rc = -EINVAL; in mls_read_range_helper()
856 rc = next_entry(buf, fp, sizeof(u32) * items); in mls_read_range_helper()
857 if ( rc < 0 ) in mls_read_range_helper()
868 rc = ebitmap_read(&r->level[0].cat, fp); in mls_read_range_helper()
869 if ( rc ) in mls_read_range_helper()
877 rc = ebitmap_read(&r->level[1].cat, fp); in mls_read_range_helper()
878 if ( rc ) in mls_read_range_helper()
887 rc = ebitmap_cpy(&r->level[1].cat, &r->level[0].cat); in mls_read_range_helper()
888 if ( rc ) in mls_read_range_helper()
895 rc = 0; in mls_read_range_helper()
897 return rc; in mls_read_range_helper()
911 int rc; in context_read_and_validate() local
913 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate()
914 if ( rc < 0 ) in context_read_and_validate()
928 rc = -EINVAL; in context_read_and_validate()
937 rc = -EINVAL; in context_read_and_validate()
940 return rc; in context_read_and_validate()
953 int rc; in perm_read() local
960 rc = -ENOMEM; in perm_read()
964 rc = next_entry(buf, fp, sizeof buf); in perm_read()
965 if ( rc < 0 ) in perm_read()
974 rc = -ENOMEM; in perm_read()
977 rc = next_entry(key, fp, len); in perm_read()
978 if ( rc < 0 ) in perm_read()
982 rc = hashtab_insert(h, key, perdatum); in perm_read()
983 if ( rc ) in perm_read()
986 return rc; in perm_read()
998 int i, rc; in common_read() local
1003 rc = -ENOMEM; in common_read()
1007 rc = next_entry(buf, fp, sizeof buf); in common_read()
1008 if ( rc < 0 ) in common_read()
1014 rc = symtab_init(&comdatum->permissions, PERM_SYMTAB_SIZE); in common_read()
1015 if ( rc ) in common_read()
1023 rc = -ENOMEM; in common_read()
1026 rc = next_entry(key, fp, len); in common_read()
1027 if ( rc < 0 ) in common_read()
1033 rc = perm_read(p, comdatum->permissions.table, fp); in common_read()
1034 if ( rc ) in common_read()
1038 rc = hashtab_insert(h, key, comdatum); in common_read()
1039 if ( rc ) in common_read()
1042 return rc; in common_read()
1055 int rc, i, j, depth; in read_cons_helper() local
1073 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in read_cons_helper()
1074 if ( rc < 0 ) in read_cons_helper()
1075 return rc; in read_cons_helper()
1091 rc = next_entry(buf, fp, (sizeof(u32) * 3)); in read_cons_helper()
1092 if ( rc < 0 ) in read_cons_helper()
1093 return rc; in read_cons_helper()
1136 rc = next_entry(buf, fp, sizeof(u32)); in read_cons_helper()
1137 if ( rc < 0 ) in read_cons_helper()
1138 return rc; in read_cons_helper()
1160 int i, rc; in class_read() local
1165 rc = -ENOMEM; in class_read()
1169 rc = next_entry(buf, fp, sizeof(u32)*6); in class_read()
1170 if ( rc < 0 ) in class_read()
1177 rc = symtab_init(&cladatum->permissions, PERM_SYMTAB_SIZE); in class_read()
1178 if ( rc ) in class_read()
1188 rc = -ENOMEM; in class_read()
1191 rc = next_entry(key, fp, len); in class_read()
1192 if ( rc < 0 ) in class_read()
1199 rc = -EINVAL; in class_read()
1204 rc = perm_read(p, cladatum->permissions.table, fp); in class_read()
1205 if ( rc ) in class_read()
1209 rc = read_cons_helper(p, &cladatum->constraints, ncons, 0, fp); in class_read()
1210 if ( rc ) in class_read()
1216 rc = next_entry(buf, fp, sizeof(u32)); in class_read()
1217 if ( rc < 0 ) in class_read()
1220 rc = read_cons_helper(p, &cladatum->validatetrans, ncons, 1, fp); in class_read()
1221 if ( rc ) in class_read()
1227 rc = next_entry(buf, fp, sizeof(u32) * 3); in class_read()
1228 if ( rc ) in class_read()
1235 rc = next_entry(buf, fp, sizeof(u32) * 1); in class_read()
1236 if ( rc ) in class_read()
1241 rc = hashtab_insert(h, key, cladatum); in class_read()
1242 if ( rc ) in class_read()
1245 rc = 0; in class_read()
1247 return rc; in class_read()
1257 int rc; in role_read() local
1265 rc = -ENOMEM; in role_read()
1270 rc = next_entry(buf, fp, sizeof(buf[0]) * 3); in role_read()
1272 rc = next_entry(buf, fp, sizeof(buf[0]) * 2); in role_read()
1274 if ( rc < 0 ) in role_read()
1285 rc = -ENOMEM; in role_read()
1288 rc = next_entry(key, fp, len); in role_read()
1289 if ( rc < 0 ) in role_read()
1293 rc = ebitmap_read(&role->dominates, fp); in role_read()
1294 if ( rc ) in role_read()
1297 rc = ebitmap_read(&role->types, fp); in role_read()
1298 if ( rc ) in role_read()
1307 rc = -EINVAL; in role_read()
1310 rc = 0; in role_read()
1314 rc = hashtab_insert(h, key, role); in role_read()
1315 if ( rc ) in role_read()
1318 return rc; in role_read()
1328 int rc; in type_read() local
1336 rc = -ENOMEM; in type_read()
1337 return rc; in type_read()
1341 rc = next_entry(buf, fp, sizeof(buf[0]) * 4); in type_read()
1343 rc = next_entry(buf, fp, sizeof(buf[0]) * 3); in type_read()
1345 if ( rc < 0 ) in type_read()
1369 rc = -ENOMEM; in type_read()
1372 rc = next_entry(key, fp, len); in type_read()
1373 if ( rc < 0 ) in type_read()
1377 rc = hashtab_insert(h, key, typdatum); in type_read()
1378 if ( rc ) in type_read()
1381 return rc; in type_read()
1395 int rc; in mls_read_level() local
1399 rc = next_entry(buf, fp, sizeof buf); in mls_read_level()
1400 if ( rc < 0 ) in mls_read_level()
1422 int rc; in user_read() local
1430 rc = -ENOMEM; in user_read()
1435 rc = next_entry(buf, fp, sizeof(buf[0]) * 3); in user_read()
1437 rc = next_entry(buf, fp, sizeof(buf[0]) * 2); in user_read()
1439 if ( rc < 0 ) in user_read()
1450 rc = -ENOMEM; in user_read()
1453 rc = next_entry(key, fp, len); in user_read()
1454 if ( rc < 0 ) in user_read()
1458 rc = ebitmap_read(&usrdatum->roles, fp); in user_read()
1459 if ( rc ) in user_read()
1464 rc = mls_read_range_helper(&usrdatum->range, fp); in user_read()
1465 if ( rc ) in user_read()
1467 rc = mls_read_level(&usrdatum->dfltlevel, fp); in user_read()
1468 if ( rc ) in user_read()
1472 rc = hashtab_insert(h, key, usrdatum); in user_read()
1473 if ( rc ) in user_read()
1476 return rc; in user_read()
1486 int rc; in sens_read() local
1493 rc = -ENOMEM; in sens_read()
1497 rc = next_entry(buf, fp, sizeof buf); in sens_read()
1498 if ( rc < 0 ) in sens_read()
1507 rc = -ENOMEM; in sens_read()
1510 rc = next_entry(key, fp, len); in sens_read()
1511 if ( rc < 0 ) in sens_read()
1518 rc = -ENOMEM; in sens_read()
1523 rc = -EINVAL; in sens_read()
1527 rc = hashtab_insert(h, key, levdatum); in sens_read()
1528 if ( rc ) in sens_read()
1531 return rc; in sens_read()
1541 int rc; in cat_read() local
1548 rc = -ENOMEM; in cat_read()
1552 rc = next_entry(buf, fp, sizeof buf); in cat_read()
1553 if ( rc < 0 ) in cat_read()
1563 rc = -ENOMEM; in cat_read()
1566 rc = next_entry(key, fp, len); in cat_read()
1567 if ( rc < 0 ) in cat_read()
1571 rc = hashtab_insert(h, key, catdatum); in cat_read()
1572 if ( rc ) in cat_read()
1575 return rc; in cat_read()
1707 int rc; in policydb_bounds_sanity_check() local
1712 rc = hashtab_map(p->p_users.table, in policydb_bounds_sanity_check()
1714 if ( rc ) in policydb_bounds_sanity_check()
1715 return rc; in policydb_bounds_sanity_check()
1717 rc = hashtab_map(p->p_roles.table, in policydb_bounds_sanity_check()
1719 if ( rc ) in policydb_bounds_sanity_check()
1720 return rc; in policydb_bounds_sanity_check()
1722 rc = hashtab_map(p->p_types.table, in policydb_bounds_sanity_check()
1724 if ( rc ) in policydb_bounds_sanity_check()
1725 return rc; in policydb_bounds_sanity_check()
1741 int i, j, rc; in policydb_read() local
1749 rc = policydb_init(p); in policydb_read()
1750 if ( rc ) in policydb_read()
1754 rc = next_entry(buf, fp, sizeof(u32)* 2); in policydb_read()
1755 if ( rc < 0 ) in policydb_read()
1779 rc = -ENOMEM; in policydb_read()
1782 rc = next_entry(policydb_str, fp, len); in policydb_read()
1783 if ( rc < 0 ) in policydb_read()
1805 rc = next_entry(buf, fp, sizeof(u32)*4); in policydb_read()
1806 if ( rc < 0 ) in policydb_read()
1876 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
1877 if ( rc < 0 ) in policydb_read()
1883 rc = read_f[i](p, p->symtab[i].table, fp); in policydb_read()
1884 if ( rc ) in policydb_read()
1891 rc = avtab_read(&p->te_avtab, fp, p); in policydb_read()
1892 if ( rc ) in policydb_read()
1897 rc = cond_read_list(p, fp); in policydb_read()
1898 if ( rc ) in policydb_read()
1902 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
1903 if ( rc < 0 ) in policydb_read()
1912 rc = -ENOMEM; in policydb_read()
1920 rc = next_entry(buf, fp, sizeof(u32)*4); in policydb_read()
1922 rc = next_entry(buf, fp, sizeof(u32)*3); in policydb_read()
1923 if ( rc < 0 ) in policydb_read()
1932 rc = -EINVAL; in policydb_read()
1938 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
1939 if ( rc < 0 ) in policydb_read()
1948 rc = -ENOMEM; in policydb_read()
1955 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
1956 if ( rc < 0 ) in policydb_read()
1963 rc = -EINVAL; in policydb_read()
1971 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
1972 if ( rc ) in policydb_read()
1978 rc = -EINVAL; in policydb_read()
1983 rc = policydb_index_classes(p); in policydb_read()
1984 if ( rc ) in policydb_read()
1987 rc = policydb_index_others(p); in policydb_read()
1988 if ( rc ) in policydb_read()
1993 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
1994 if ( rc < 0 ) in policydb_read()
2003 rc = -ENOMEM; in policydb_read()
2011 rc = -EINVAL; in policydb_read()
2015 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2016 if ( rc < 0 ) in policydb_read()
2019 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2020 if ( rc ) in policydb_read()
2030 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2031 if ( rc < 0 ) in policydb_read()
2034 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2035 if ( rc ) in policydb_read()
2045 rc = next_entry(buf, fp, sizeof(u32) *2); in policydb_read()
2046 if ( rc < 0 ) in policydb_read()
2050 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2051 if ( rc ) in policydb_read()
2064 rc = next_entry(b64, fp, sizeof(u64) *2); in policydb_read()
2065 if ( rc < 0 ) in policydb_read()
2072 rc = next_entry(buf, fp, sizeof(u32) *2); in policydb_read()
2073 if ( rc < 0 ) in policydb_read()
2078 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2079 if ( rc ) in policydb_read()
2089 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2090 if ( rc < 0 ) in policydb_read()
2093 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2094 if ( rc ) in policydb_read()
2104 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2105 if ( rc < 0 ) in policydb_read()
2108 rc = -ENOMEM; in policydb_read()
2112 rc = next_entry(c->u.name, fp, len); in policydb_read()
2113 if ( rc < 0 ) in policydb_read()
2116 rc = context_read_and_validate(&c->context, p, fp); in policydb_read()
2117 if ( rc ) in policydb_read()
2123 rc = -EINVAL; in policydb_read()
2129 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2130 if ( rc < 0 ) in policydb_read()
2136 rc = -EINVAL; in policydb_read()
2143 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2144 if ( rc < 0 ) in policydb_read()
2153 rc = -ENOMEM; in policydb_read()
2160 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in policydb_read()
2161 if ( rc < 0 ) in policydb_read()
2167 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2168 if ( rc < 0 ) in policydb_read()
2177 rc = -EINVAL; in policydb_read()
2180 rc = mls_read_range_helper(&rt->target_range, fp); in policydb_read()
2181 if ( rc ) in policydb_read()
2209 rc = policydb_bounds_sanity_check(p); in policydb_read()
2210 if ( rc ) in policydb_read()
2213 rc = 0; in policydb_read()
2215 return rc; in policydb_read()
2217 if ( !rc ) in policydb_read()
2218 rc = -EINVAL; in policydb_read()