Home
last modified time | relevance | path

Searched refs:permx (Results 1 – 12 of 12) sorted by relevance

/external/selinux/libsepol/cil/src/
Dcil_post.c755 static int __evaluate_permissionx_expression(struct cil_permissionx *permx, struct cil_db *db) in __evaluate_permissionx_expression() argument
759 permx->perms = cil_malloc(sizeof(*permx->perms)); in __evaluate_permissionx_expression()
760 ebitmap_init(permx->perms); in __evaluate_permissionx_expression()
762 …rc = __cil_expr_to_bitmap(permx->expr_str, permx->perms, 0x10000, db); // max is one more than 0xF… in __evaluate_permissionx_expression()
765 ebitmap_destroy(permx->perms); in __evaluate_permissionx_expression()
766 free(permx->perms); in __evaluate_permissionx_expression()
767 permx->perms = NULL; in __evaluate_permissionx_expression()
1267 rc = __evaluate_permissionx_expression(rule->perms.x.permx, db); in __cil_post_db_attr_helper()
1273 struct cil_permissionx *permx = node->data; in __cil_post_db_attr_helper() local
1274 rc = __evaluate_permissionx_expression(permx, db); in __cil_post_db_attr_helper()
Dcil.c2172 void cil_permissionx_init(struct cil_permissionx **permx) in cil_permissionx_init() argument
2174 *permx = cil_malloc(sizeof(**permx)); in cil_permissionx_init()
2176 cil_symtab_datum_init(&(*permx)->datum); in cil_permissionx_init()
2177 (*permx)->kind = CIL_NONE; in cil_permissionx_init()
2178 (*permx)->obj_str = NULL; in cil_permissionx_init()
2179 (*permx)->obj = NULL; in cil_permissionx_init()
2180 (*permx)->expr_str = NULL; in cil_permissionx_init()
2181 (*permx)->perms = NULL; in cil_permissionx_init()
Dcil_write_ast.c377 static int cil_unfill_permx(struct cil_permissionx *permx, char **out_str) { in cil_unfill_permx() argument
383 switch (permx->kind) { in cil_unfill_permx()
388 cil_log(CIL_ERR, "Unknown permissionx kind: %d\n", permx->kind); in cil_unfill_permx()
393 obj = permx->obj_str; in cil_unfill_permx()
394 rc = cil_unfill_expr(permx->expr_str, &expr, 1); in cil_unfill_permx()
778 rc = cil_unfill_permx(avrule->perms.x.permx, &xperms); in cil_write_avrule_x()
Dcil_find.c339 if (cil_permissionx_match_any(avrule->perms.x.permx, target->perms.x.permx)) { in cil_find_matching_avrule()
Dcil_verify.c1230 int __cil_verify_permissionx(struct cil_permissionx *permx, struct cil_tree_node *node) in __cil_verify_permissionx() argument
1239 switch (permx->kind) { in __cil_verify_permissionx()
1244 cil_tree_log(node, CIL_ERR, "Invalid permissionx kind (%d)", permx->kind); in __cil_verify_permissionx()
1249 classes = cil_expand_class(permx->obj); in __cil_verify_permissionx()
1280 return __cil_verify_permissionx(avrulex->perms.x.permx, node); in __cil_verify_avrulex()
Dcil_build_ast.c2044 if (rule->perms.x.permx_str == NULL && rule->perms.x.permx != NULL) { in cil_destroy_avrule()
2045 cil_destroy_permissionx(rule->perms.x.permx); in cil_destroy_avrule()
2052 int cil_fill_permissionx(struct cil_tree_node *parse_current, struct cil_permissionx *permx) in cil_fill_permissionx() argument
2069 permx->kind = CIL_PERMX_KIND_IOCTL; in cil_fill_permissionx()
2076 permx->obj_str = parse_current->next->data; in cil_fill_permissionx()
2078 rc = cil_gen_expr(parse_current->next->next, CIL_PERMISSIONX, &permx->expr_str); in cil_fill_permissionx()
2100 struct cil_permissionx *permx = NULL; in cil_gen_permissionx() local
2112 cil_permissionx_init(&permx); in cil_gen_permissionx()
2116 …rc = cil_gen_node(db, ast_node, (struct cil_symtab_datum*)permx, (hashtab_key_t)key, CIL_SYM_PERMX… in cil_gen_permissionx()
2121 rc = cil_fill_permissionx(parse_current->next->next->cl_head, permx); in cil_gen_permissionx()
[all …]
Dcil_binary.c1785 …_symtab_datum *src, struct cil_symtab_datum *tgt, struct cil_permissionx *permx, struct cil_args_b… in __cil_avrulex_to_hashtable_helper() argument
1800 class_list = cil_expand_class(permx->obj); in __cil_avrulex_to_hashtable_helper()
1806 switch (permx->kind) { in __cil_avrulex_to_hashtable_helper()
1808 …rulex_ioctl_table, kind, sepol_src->s.value, sepol_tgt->s.value, sepol_obj->s.value, permx->perms); in __cil_avrulex_to_hashtable_helper()
1853 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, src, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1864 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1887 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1907 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
1924 rc = __cil_avrulex_to_hashtable_helper(pdb, kind, src, tgt, cil_avrulex->perms.x.permx, args); in cil_avrulex_to_hashtable()
4349 static int __cil_permx_to_sepol_class_perms(policydb_t *pdb, struct cil_permissionx *permx, class_p… in __cil_permx_to_sepol_class_perms() argument
[all …]
Dcil_policy.c1106 static void cil_xperms_to_policy(FILE *out, struct cil_permissionx *permx) in cil_xperms_to_policy() argument
1113 if (permx->kind == CIL_PERMX_KIND_IOCTL) { in cil_xperms_to_policy()
1119 fprintf(out, "%s %s {", DATUM(permx->obj)->fqn, kind); in cil_xperms_to_policy()
1121 ebitmap_for_each_bit(permx->perms, node, i) { in cil_xperms_to_policy()
1122 if (!ebitmap_get_bit(permx->perms, i)) in cil_xperms_to_policy()
1184 cil_xperms_to_policy(out, rule->perms.x.permx); in cil_av_rulex_to_policy()
Dcil_internal.h604 struct cil_permissionx *permx; member
1002 void cil_permissionx_init(struct cil_permissionx **permx);
Dcil_build_ast.h116 void cil_destroy_permissionx(struct cil_permissionx *permx);
Dcil_copy_ast.c833 cil_permissionx_init(&new->perms.x.permx); in cil_copy_avrule()
834 cil_copy_fill_permissionx(db, orig->perms.x.permx, new->perms.x.permx); in cil_copy_avrule()
Dcil_resolve_ast.c294 int cil_resolve_permissionx(struct cil_tree_node *current, struct cil_permissionx *permx, void *ext… in cil_resolve_permissionx() argument
299 rc = cil_resolve_name(current, permx->obj_str, CIL_SYM_CLASSES, extra_args, &obj_datum); in cil_resolve_permissionx()
303 permx->obj = (struct cil_class*)obj_datum; in cil_resolve_permissionx()
358 rule->perms.x.permx = (struct cil_permissionx*)permx_datum; in cil_resolve_avrule()
360 rc = cil_resolve_permissionx(current, rule->perms.x.permx, extra_args); in cil_resolve_avrule()