Lines Matching refs:node

1082 	struct cil_tree_node *node = NULL;
1107 node = NODE(result_datum);
1108 if (node->flavor != CIL_ROLE) {
1110 cil_log(CIL_ERR, "roletransition must result in a role, but %s is a %s\n", roletrans->result_str, cil_node_to_string(node));
1187 struct cil_tree_node *node;
1196 (*ordered)->node = NULL;
1202 (*ordered)->node = NULL;
1451 cil_tree_log(ordered_list->node, CIL_ERR, "Unable to merge ordered list");
1514 class_list->node = current;
1558 ordered->node = current;
1597 struct cil_tree_node *node = NULL;
1603 node = NODE(cat_datum);
1604 if (node->flavor != CIL_CAT) {
1615 ordered->node = current;
1654 ordered->node = current;
1851 struct cil_tree_node *node = NULL;
1861 node = NODE(user_datum);
1863 if (node->flavor != CIL_USER) {
1876 node = NODE(role_datum);
1877 if (node->flavor != CIL_ROLE) {
1890 node = NODE(type_datum);
1892 if (node->flavor != CIL_TYPE && node->flavor != CIL_TYPEALIAS) {
2332 struct cil_tree_node *node = NULL;
2340 node = NODE(block_datum);
2342 if (node->flavor != CIL_BLOCK) {
2343 cil_log(CIL_ERR, "%s is not a block\n", cil_node_to_string(node));
2397 static void cil_mark_subtree_abstract(struct cil_tree_node *node)
2399 struct cil_block *block = node->data;
2403 for (node = node->cl_head; node; node = node->next) {
2404 if (node->flavor == CIL_BLOCK) {
2405 cil_mark_subtree_abstract(node);
2484 struct cil_tree_node *node = NULL;
2501 node = curr->data;
2502 in = node->data;
2504 rc = cil_resolve_name(node, in->block_str, CIL_SYM_BLOCKS, extra_args, &block_datum);
2507 last_failed_node = node;
2509 rc = cil_resolve_in(node, extra_args);
3533 static unsigned cil_count_actual(struct cil_tree_node *node)
3537 if (node->flavor == CIL_BLOCKINHERIT) {
3541 for (node = node->cl_head; node; node = node->next) {
3542 count += cil_count_actual(node);
3548 static int cil_check_inheritances(struct cil_tree_node *node, unsigned max, unsigned *count, struct cil_stack *stack, unsigned *loop)
3552 if (node->flavor == CIL_BLOCKINHERIT) {
3553 struct cil_blockinherit *bi = node->data;
3556 cil_tree_log(node, CIL_ERR, "Degenerate inheritance detected");
3567 cil_tree_log(node, CIL_ERR, " blockinherit");
3576 cil_tree_log(node, CIL_ERR, " blockinherit");
3583 for (node = node->cl_head; node; node = node->next) {
3584 rc = cil_check_inheritances(node, max, count, stack, loop);
3593 static int cil_check_for_bad_inheritance(struct cil_tree_node *node)
3601 num_actual = cil_count_actual(node);
3609 rc = cil_check_inheritances(node, max, &num_potential, stack, &loop);
3615 static int __cil_resolve_ast_node(struct cil_tree_node *node, void *extra_args)
3621 if (node == NULL || args == NULL) {
3628 if (node->flavor == CIL_TUNABLEIF) {
3629 rc = cil_resolve_tunif(node, args);
3633 if (node->flavor == CIL_IN) {
3636 struct cil_in *in = node->data;
3638 cil_list_prepend(args->in_list_before, CIL_NODE, node);
3643 if (node->flavor == CIL_BLOCKINHERIT) {
3644 rc = cil_resolve_blockinherit_link(node, args);
3648 if (node->flavor == CIL_BLOCK) {
3649 rc = cil_resolve_blockinherit_copy(node, args);
3653 if (node->flavor == CIL_BLOCKABSTRACT) {
3654 rc = cil_resolve_blockabstract(node, args);
3658 if (node->flavor == CIL_IN) {
3661 struct cil_in *in = node->data;
3663 cil_list_prepend(args->in_list_after, CIL_NODE, node);
3668 if (node->flavor == CIL_CALL && args->macro == NULL) {
3669 rc = cil_resolve_call(node, args);
3673 if (node->flavor == CIL_CALL && args->macro == NULL) {
3674 rc = cil_resolve_call_args(node, args);
3678 switch (node->flavor) {
3680 rc = cil_resolve_aliasactual(node, args, CIL_TYPE, CIL_TYPEALIAS);
3683 rc = cil_resolve_aliasactual(node, args, CIL_SENS, CIL_SENSALIAS);
3686 rc = cil_resolve_aliasactual(node, args, CIL_CAT, CIL_CATALIAS);
3693 switch (node->flavor) {
3695 rc = cil_resolve_alias_to_actual(node, CIL_TYPE);
3698 rc = cil_resolve_alias_to_actual(node, CIL_SENS);
3701 rc = cil_resolve_alias_to_actual(node, CIL_CAT);
3708 switch (node->flavor) {
3710 rc = cil_resolve_sidorder(node, args);
3713 rc = cil_resolve_classorder(node, args);
3716 rc = cil_resolve_catorder(node, args);
3719 rc = cil_resolve_sensitivityorder(node, args);
3722 rc = cil_resolve_boolif(node, args);
3729 switch (node->flavor) {
3731 rc = cil_resolve_catset(node, (struct cil_catset*)node->data, args);
3738 switch (node->flavor) {
3740 rc = cil_resolve_senscat(node, args);
3743 rc = cil_resolve_classcommon(node, args);
3750 switch (node->flavor) {
3752 rc = cil_resolve_typeattributeset(node, args);
3755 rc = cil_resolve_expandtypeattribute(node, args);
3758 rc = cil_resolve_bounds(node, args, CIL_TYPE, CIL_TYPEATTRIBUTE);
3761 rc = cil_resolve_typepermissive(node, args);
3764 rc = cil_resolve_nametypetransition(node, args);
3767 rc = cil_resolve_rangetransition(node, args);
3770 rc = cil_resolve_classpermissionset(node, (struct cil_classpermissionset*)node->data, args);
3773 rc = cil_resolve_classmapping(node, args);
3777 rc = cil_resolve_avrule(node, args);
3780 rc = cil_resolve_permissionx(node, (struct cil_permissionx*)node->data, args);
3783 rc = cil_resolve_type_rule(node, args);
3786 rc = cil_resolve_userrole(node, args);
3789 rc = cil_resolve_userlevel(node, args);
3792 rc = cil_resolve_userrange(node, args);
3795 rc = cil_resolve_bounds(node, args, CIL_USER, CIL_USERATTRIBUTE);
3798 rc = cil_resolve_userprefix(node, args);
3802 rc = cil_resolve_selinuxuser(node, args);
3805 rc = cil_resolve_roleattributeset(node, args);
3808 rc = cil_resolve_roletype(node, args);
3811 rc = cil_resolve_roletransition(node, args);
3814 rc = cil_resolve_roleallow(node, args);
3817 rc = cil_resolve_bounds(node, args, CIL_ROLE, CIL_ROLEATTRIBUTE);
3820 rc = cil_resolve_level(node, (struct cil_level*)node->data, args);
3823 rc = cil_resolve_levelrange(node, (struct cil_levelrange*)node->data, args);
3826 rc = cil_resolve_constrain(node, args);
3829 rc = cil_resolve_constrain(node, args);
3833 rc = cil_resolve_validatetrans(node, args);
3836 rc = cil_resolve_context(node, (struct cil_context*)node->data, args);
3839 rc = cil_resolve_filecon(node, args);
3842 rc = cil_resolve_ibpkeycon(node, args);
3845 rc = cil_resolve_portcon(node, args);
3848 rc = cil_resolve_nodecon(node, args);
3851 rc = cil_resolve_genfscon(node, args);
3854 rc = cil_resolve_netifcon(node, args);
3857 rc = cil_resolve_ibendportcon(node, args);
3860 rc = cil_resolve_pirqcon(node, args);
3863 rc = cil_resolve_iomemcon(node, args);
3866 rc = cil_resolve_ioportcon(node, args);
3869 rc = cil_resolve_pcidevicecon(node, args);
3872 rc = cil_resolve_devicetreecon(node, args);
3875 rc = cil_resolve_fsuse(node, args);
3878 rc = cil_resolve_sidcontext(node, args);
3883 rc = cil_resolve_default(node, args);
3886 rc = cil_resolve_defaultrange(node, args);
3889 rc = cil_resolve_userattributeset(node, args);
3905 static int __cil_resolve_ast_node_helper(struct cil_tree_node *node, uint32_t *finished, void *extra_args)
3915 if (node == NULL) {
3920 if (node->flavor == CIL_CAT ||
3921 node->flavor == CIL_SENS) {
3922 cil_tree_log(node, CIL_ERR, "%s is not allowed in block", cil_node_to_string(node));
3929 if (node->flavor == CIL_TUNABLE ||
3930 node->flavor == CIL_IN ||
3931 node->flavor == CIL_BLOCK ||
3932 node->flavor == CIL_BLOCKINHERIT ||
3933 node->flavor == CIL_BLOCKABSTRACT ||
3934 node->flavor == CIL_MACRO) {
3935 cil_tree_log(node, CIL_ERR, "%s is not allowed in macro", cil_node_to_string(node));
3942 if (node->flavor == CIL_TUNABLE ||
3943 node->flavor == CIL_IN ||
3944 node->flavor == CIL_BLOCK ||
3945 node->flavor == CIL_BLOCKABSTRACT ||
3946 node->flavor == CIL_MACRO) {
3947 cil_tree_log(node, CIL_ERR, "%s is not allowed in optional", cil_node_to_string(node));
3954 if (node->flavor != CIL_TUNABLEIF &&
3955 node->flavor != CIL_CALL &&
3956 node->flavor != CIL_CONDBLOCK &&
3957 node->flavor != CIL_AVRULE &&
3958 node->flavor != CIL_TYPE_RULE &&
3959 node->flavor != CIL_NAMETYPETRANSITION) {
3961 } else if (node->flavor == CIL_AVRULE) {
3962 struct cil_avrule *rule = node->data;
3969 cil_tree_log(node, CIL_ERR, "%s is not allowed in tunableif being treated as a booleanif", cil_node_to_string(node));
3971 cil_tree_log(node, CIL_ERR, "%s is not allowed in booleanif", cil_node_to_string(node));
3977 if (node->flavor == CIL_MACRO) {
3985 if (node->flavor == CIL_BLOCK && ((((struct cil_block*)node->data)->is_abstract == CIL_TRUE) && (pass > CIL_PASS_BLKABS))) {
3991 rc = __cil_resolve_ast_node(node, extra_args);
3994 cil_tree_log(node, CIL_ERR, "Failed to resolve %s statement", cil_node_to_string(node));
3999 cil_tree_log(node, CIL_INFO, "Failed to resolve %s statement", cil_node_to_string(node));
4287 static int __cil_resolve_name_with_parents(struct cil_tree_node *node, char *name, enum cil_sym_index sym_index, struct cil_symtab_datum **datum)
4292 while (node != NULL && rc != SEPOL_OK) {
4293 switch (node->flavor) {
4298 struct cil_block *block = node->data;
4306 struct cil_blockinherit *inherit = node->data;
4307 rc = __cil_resolve_name_with_parents(node->parent, name, sym_index, datum);
4316 struct cil_macro *macro = node->data;
4322 struct cil_call *call = node->data;
4346 node = node->parent;
4353 static int __cil_resolve_name_helper(struct cil_db *db, struct cil_tree_node *node, char *name, enum cil_sym_index sym_index, struct cil_symtab_datum **datum)
4357 rc = __cil_resolve_name_with_parents(node, name, sym_index, datum);
4367 struct cil_tree_node *node = NULL;
4374 /* If this datum is an alias, then return the actual node
4377 node = NODE(*datum);
4378 if (node->flavor == CIL_TYPEALIAS || node->flavor == CIL_SENSALIAS
4379 || node->flavor == CIL_CATALIAS) {
4397 struct cil_tree_node *node = NULL;
4426 node = ast_node;
4431 rc = __cil_resolve_name_helper(db, node->parent, current, CIL_SYM_BLOCKS, datum);
4445 node = NODE(*datum);
4446 if (node->flavor == CIL_BLOCK) {
4447 symtab = &((struct cil_block*)node->data)->symtab[CIL_SYM_BLOCKS];
4450 cil_log(CIL_WARN, "Can only use %s name for name resolution in \"in\" blocks\n", cil_node_to_string(node));
4455 if (node->flavor == CIL_MACRO) {
4456 struct cil_macro *macro = node->data;