Lines Matching refs:c
277 struct context *c; in constraint_expr_eval() local
402 c = scontext; in constraint_expr_eval()
404 c = tcontext; in constraint_expr_eval()
406 c = xcontext; in constraint_expr_eval()
407 if (!c) { in constraint_expr_eval()
413 val1 = c->user; in constraint_expr_eval()
415 val1 = c->role; in constraint_expr_eval()
417 val1 = c->type; in constraint_expr_eval()
1847 struct context *c, in convert_context() argument
1866 if (c->str) { in convert_context()
1870 s = kstrdup(c->str, GFP_KERNEL); in convert_context()
1875 c->len, &ctx, SECSID_NULL); in convert_context()
1879 c->str); in convert_context()
1881 kfree(c->str); in convert_context()
1882 memcpy(c, &ctx, sizeof(*c)); in convert_context()
1891 c->str, -rc); in convert_context()
1896 rc = context_cpy(&oldc, c); in convert_context()
1903 sym_name(args->oldp, SYM_USERS, c->user - 1)); in convert_context()
1906 c->user = usrdatum->value; in convert_context()
1911 sym_name(args->oldp, SYM_ROLES, c->role - 1)); in convert_context()
1914 c->role = role->value; in convert_context()
1919 sym_name(args->oldp, SYM_TYPES, c->type - 1)); in convert_context()
1922 c->type = typdatum->value; in convert_context()
1926 rc = mls_convert_context(args->oldp, args->newp, c); in convert_context()
1935 mls_context_destroy(c); in convert_context()
1954 rc = mls_range_set(c, range); in convert_context()
1960 if (!policydb_context_isvalid(args->newp, c)) { in convert_context()
1977 context_destroy(c); in convert_context()
1978 c->str = s; in convert_context()
1979 c->len = len; in convert_context()
1981 c->str); in convert_context()
2162 struct ocontext *c; in security_port_sid() local
2167 c = policydb.ocontexts[OCON_PORT]; in security_port_sid()
2168 while (c) { in security_port_sid()
2169 if (c->u.port.protocol == protocol && in security_port_sid()
2170 c->u.port.low_port <= port && in security_port_sid()
2171 c->u.port.high_port >= port) in security_port_sid()
2173 c = c->next; in security_port_sid()
2176 if (c) { in security_port_sid()
2177 if (!c->sid[0]) { in security_port_sid()
2179 &c->context[0], in security_port_sid()
2180 &c->sid[0]); in security_port_sid()
2184 *out_sid = c->sid[0]; in security_port_sid()
2202 struct ocontext *c; in security_netif_sid() local
2206 c = policydb.ocontexts[OCON_NETIF]; in security_netif_sid()
2207 while (c) { in security_netif_sid()
2208 if (strcmp(name, c->u.name) == 0) in security_netif_sid()
2210 c = c->next; in security_netif_sid()
2213 if (c) { in security_netif_sid()
2214 if (!c->sid[0] || !c->sid[1]) { in security_netif_sid()
2216 &c->context[0], in security_netif_sid()
2217 &c->sid[0]); in security_netif_sid()
2221 &c->context[1], in security_netif_sid()
2222 &c->sid[1]); in security_netif_sid()
2226 *if_sid = c->sid[0]; in security_netif_sid()
2261 struct ocontext *c; in security_node_sid() local
2275 c = policydb.ocontexts[OCON_NODE]; in security_node_sid()
2276 while (c) { in security_node_sid()
2277 if (c->u.node.addr == (addr & c->u.node.mask)) in security_node_sid()
2279 c = c->next; in security_node_sid()
2288 c = policydb.ocontexts[OCON_NODE6]; in security_node_sid()
2289 while (c) { in security_node_sid()
2290 if (match_ipv6_addrmask(addrp, c->u.node6.addr, in security_node_sid()
2291 c->u.node6.mask)) in security_node_sid()
2293 c = c->next; in security_node_sid()
2303 if (c) { in security_node_sid()
2304 if (!c->sid[0]) { in security_node_sid()
2306 &c->context[0], in security_node_sid()
2307 &c->sid[0]); in security_node_sid()
2311 *out_sid = c->sid[0]; in security_node_sid()
2456 struct ocontext *c; in security_genfs_sid() local
2477 for (c = genfs->head; c; c = c->next) { in security_genfs_sid()
2478 len = strlen(c->u.name); in security_genfs_sid()
2479 if ((!c->v.sclass || sclass == c->v.sclass) && in security_genfs_sid()
2480 (strncmp(c->u.name, path, len) == 0)) in security_genfs_sid()
2485 if (!c) in security_genfs_sid()
2488 if (!c->sid[0]) { in security_genfs_sid()
2489 rc = sidtab_context_to_sid(&sidtab, &c->context[0], &c->sid[0]); in security_genfs_sid()
2494 *sid = c->sid[0]; in security_genfs_sid()
2513 struct ocontext *c; in security_fs_use() local
2517 c = policydb.ocontexts[OCON_FSUSE]; in security_fs_use()
2518 while (c) { in security_fs_use()
2519 if (strcmp(fstype, c->u.name) == 0) in security_fs_use()
2521 c = c->next; in security_fs_use()
2524 if (c) { in security_fs_use()
2525 *behavior = c->v.behavior; in security_fs_use()
2526 if (!c->sid[0]) { in security_fs_use()
2527 rc = sidtab_context_to_sid(&sidtab, &c->context[0], in security_fs_use()
2528 &c->sid[0]); in security_fs_use()
2532 *sid = c->sid[0]; in security_fs_use()