Lines Matching refs:node

400 int cil_verify_decl_does_not_shadow_macro_parameter(struct cil_macro *macro, struct cil_tree_node *node, const char *name)
407 if (param->flavor == node->flavor) {
409 cil_log(CIL_ERR, "%s %s shadows a macro parameter in macro declaration\n", cil_node_to_string(node), name);
525 int __cil_verify_ordered_node_helper(struct cil_tree_node *node, __attribute__((unused)) uint32_t *finished, void *extra_args)
530 if (node->flavor == *flavor) {
531 if (node->flavor == CIL_SID) {
532 struct cil_sid *sid = node->data;
534 cil_tree_log(node, CIL_ERR, "SID %s not in sidorder statement", sid->datum.name);
537 } else if (node->flavor == CIL_CLASS) {
538 struct cil_class *class = node->data;
540 cil_tree_log(node, CIL_ERR, "Class %s not in classorder statement", class->datum.name);
543 } else if (node->flavor == CIL_CAT) {
544 struct cil_cat *cat = node->data;
546 cil_tree_log(node, CIL_ERR, "Category %s not in categoryorder statement", cat->datum.name);
549 } else if (node->flavor == CIL_SENS) {
550 struct cil_sens *sens = node->data;
552 cil_tree_log(node, CIL_ERR, "Sensitivity %s not in sensitivityorder statement", sens->datum.name);
586 struct cil_tree_node *node = sid->datum.nodes->head->data;
587 cil_tree_log(node, CIL_INFO, "No context assigned to SID %s, omitting from policy",sid->datum.name);
742 static int __cil_verify_named_levelrange(struct cil_db *db, struct cil_tree_node *node)
745 struct cil_levelrange *lr = node->data;
754 cil_tree_log(node, CIL_ERR, "Invalid named range");
758 static int __cil_verify_user_pre_eval(struct cil_tree_node *node)
761 struct cil_user *user = node->data;
794 cil_tree_log(node, CIL_ERR, "Invalid user");
798 static int __cil_verify_user_post_eval(struct cil_db *db, struct cil_tree_node *node)
801 struct cil_user *user = node->data;
813 cil_tree_log(node, CIL_ERR, "Invalid user");
817 static int __cil_verify_role(struct cil_tree_node *node)
820 struct cil_role *role = node->data;
844 cil_tree_log(node, CIL_ERR, "Invalid role");
848 static int __cil_verify_type(struct cil_tree_node *node)
851 struct cil_type *type = node->data;
875 cil_tree_log(node, CIL_ERR, "Invalid type");
957 static int __cil_verify_named_context(struct cil_db *db, struct cil_tree_node *node)
960 struct cil_context *ctx = node->data;
969 cil_tree_log(node, CIL_ERR, "Invalid named context");
974 static int __cil_verify_rule(struct cil_tree_node *node, struct cil_complex_symtab *symtab)
982 switch (node->flavor) {
984 roletrans = node->data;
992 typerule = node->data;
1009 cil_tree_log(node, CIL_ERR, "Duplicate rule defined");
1017 cil_tree_log(node, CIL_ERR, "Invalid rule");
1022 static int __cil_verify_booleanif_helper(struct cil_tree_node *node, __attribute__((unused)) uint32_t *finished, __attribute__((unused)) void *extra_args)
1025 struct cil_tree_node *rule_node = node;
1026 struct cil_booleanif *bif = node->parent->parent->data;
1034 cil_tree_log(node, CIL_ERR, "Neverallow found in tunableif block (treated as a booleanif due to preserve-tunables)");
1036 cil_tree_log(node, CIL_ERR, "Neverallow found in booleanif block");
1056 datum.data = node;
1073 cil_log(CIL_ERR, "Duplicate type rule found (line: %d)\n", node->line);
1095 const char * flavor = cil_node_to_string(node);
1097 cil_tree_log(node, CIL_ERR, "Invalid %s statement in tunableif (treated as a booleanif due to preserve-tunables)", flavor);
1099 cil_tree_log(node, CIL_ERR, "Invalid %s statement in booleanif", flavor);
1110 static int __cil_verify_booleanif(struct cil_tree_node *node, struct cil_complex_symtab *symtab)
1113 struct cil_booleanif *bif = (struct cil_booleanif*)node->data;
1114 struct cil_tree_node *cond_block = node->cl_head;
1127 cil_tree_log(node, CIL_ERR, "Invalid tunableif (treated as a booleanif due to preserve-tunables)");
1129 cil_tree_log(node, CIL_ERR, "Invalid booleanif");
1134 static int __cil_verify_netifcon(struct cil_db *db, struct cil_tree_node *node)
1137 struct cil_netifcon *netif = node->data;
1160 cil_tree_log(node, CIL_ERR, "Invalid netifcon");
1164 static int __cil_verify_ibendportcon(struct cil_db *db, struct cil_tree_node *node)
1167 struct cil_ibendportcon *ib_end_port = node->data;
1180 cil_tree_log(node, CIL_ERR, "Invalid ibendportcon");
1184 static int __cil_verify_genfscon(struct cil_db *db, struct cil_tree_node *node)
1187 struct cil_genfscon *genfs = node->data;
1201 cil_tree_log(node, CIL_ERR, "Invalid genfscon");
1205 static int __cil_verify_filecon(struct cil_db *db, struct cil_tree_node *node)
1208 struct cil_filecon *file = node->data;
1220 cil_tree_log(node, CIL_ERR, "Invalid filecon");
1231 static int __cil_verify_nodecon(struct cil_db *db, struct cil_tree_node *node)
1234 struct cil_nodecon *nodecon = node->data;
1248 cil_tree_log(node, CIL_ERR, "Invalid nodecon");
1252 static int __cil_verify_ibpkeycon(struct cil_db *db, struct cil_tree_node *node)
1255 struct cil_ibpkeycon *pkey = node->data;
1268 cil_tree_log(node, CIL_ERR, "Invalid ibpkeycon");
1272 static int __cil_verify_portcon(struct cil_db *db, struct cil_tree_node *node)
1275 struct cil_portcon *port = node->data;
1289 cil_tree_log(node, CIL_ERR, "Invalid portcon");
1293 static int __cil_verify_pirqcon(struct cil_db *db, struct cil_tree_node *node)
1296 struct cil_pirqcon *pirq = node->data;
1310 cil_tree_log(node, CIL_ERR, "Invalid pirqcon");
1314 static int __cil_verify_iomemcon(struct cil_db *db, struct cil_tree_node *node)
1317 struct cil_iomemcon *iomem = node->data;
1331 cil_tree_log(node, CIL_ERR, "Invalid iomemcon");
1335 static int __cil_verify_ioportcon(struct cil_db *db, struct cil_tree_node *node)
1338 struct cil_ioportcon *ioport = node->data;
1352 cil_tree_log(node, CIL_ERR, "Invalid ioportcon");
1356 static int __cil_verify_pcidevicecon(struct cil_db *db, struct cil_tree_node *node)
1359 struct cil_pcidevicecon *pcidev = node->data;
1373 cil_tree_log(node, CIL_ERR, "Invalid pcidevicecon");
1377 static int __cil_verify_devicetreecon(struct cil_db *db, struct cil_tree_node *node)
1380 struct cil_devicetreecon *dt = node->data;
1394 cil_tree_log(node, CIL_ERR, "Invalid devicetreecon");
1398 static int __cil_verify_fsuse(struct cil_db *db, struct cil_tree_node *node)
1401 struct cil_fsuse *fsuse = node->data;
1415 cil_tree_log(node, CIL_ERR, "Invalid fsuse");
1419 static int __cil_verify_permissionx(struct cil_permissionx *permx, struct cil_tree_node *node)
1433 cil_tree_log(node, CIL_ERR, "Invalid permissionx kind (%d)", permx->kind);
1449 cil_tree_log(node, CIL_ERR, "Invalid permissionx: %s is not a permission of class %s", kind_str, class->datum.name);
1466 static int __cil_verify_avrulex(struct cil_tree_node *node)
1468 struct cil_avrule *avrulex = node->data;
1469 return __cil_verify_permissionx(avrulex->perms.x.permx, node);
1472 static int __cil_verify_class(struct cil_tree_node *node)
1475 struct cil_class *class = node->data;
1488 for (curr_class_perm = node->cl_head;
1504 cil_tree_log(node, CIL_ERR, "Invalid class");
1508 static int __cil_verify_policycap(struct cil_tree_node *node)
1511 struct cil_policycap *polcap = node->data;
1521 cil_tree_log(node, CIL_ERR, "Invalid policycap (%s)", (const char*)polcap->datum.name);
1525 int __cil_verify_helper(struct cil_tree_node *node, uint32_t *finished, void *extra_args)
1537 if (node == NULL || extra_args == NULL) {
1549 if (node->flavor == CIL_MACRO) {
1553 } else if (node->flavor == CIL_BLOCK) {
1554 struct cil_block *blk = node->data;
1564 switch (node->flavor) {
1566 rc = __cil_verify_user_post_eval(db, node);
1573 rc = __cil_verify_role(node);
1576 rc = __cil_verify_type(node);
1587 *handleunknown = ((struct cil_handleunknown*)node->data)->handle_unknown;
1596 *mls = ((struct cil_mls*)node->data)->value;
1602 //rc = __cil_verify_rule(node, csymtab);
1606 //rc = __cil_verify_rule(node, csymtab);
1609 rc = __cil_verify_booleanif(node, csymtab);
1613 rc = __cil_verify_named_levelrange(db, node);
1616 rc = __cil_verify_class(node);
1619 rc = __cil_verify_policycap(node);
1628 switch (node->flavor) {
1630 rc = __cil_verify_named_context(db, node);
1633 rc = __cil_verify_netifcon(db, node);
1636 rc = __cil_verify_genfscon(db, node);
1639 rc = __cil_verify_filecon(db, node);
1642 rc = __cil_verify_nodecon(db, node);
1645 rc = __cil_verify_ibpkeycon(db, node);
1648 rc = __cil_verify_ibendportcon(db, node);
1651 rc = __cil_verify_portcon(db, node);
1654 rc = __cil_verify_pirqcon(db, node);
1657 rc = __cil_verify_iomemcon(db, node);
1660 rc = __cil_verify_ioportcon(db, node);
1663 rc = __cil_verify_pcidevicecon(db, node);
1666 rc = __cil_verify_devicetreecon(db, node);
1669 rc = __cil_verify_fsuse(db, node);
1672 rc = __cil_verify_avrulex(node);
1675 rc = __cil_verify_permissionx(node->data, node);
1788 static int __cil_verify_classpermission(struct cil_tree_node *node)
1790 struct cil_classpermission *cp = node->data;
1797 struct cil_tree_node *node;
1815 static int __cil_verify_map_class(struct cil_tree_node *node)
1817 struct cil_class *mc = node->data;
1821 map_args.node = node;
1833 int __cil_pre_verify_helper(struct cil_tree_node *node, uint32_t *finished, __attribute__((unused)) void *extra_args)
1837 switch (node->flavor) {
1843 struct cil_block *blk = node->data;
1850 rc = __cil_verify_user_pre_eval(node);
1853 rc = __cil_verify_map_class(node);
1856 rc = __cil_verify_classpermission(node);
1864 rc = cil_verify_no_self_reference(node->flavor, node->data, stack);