Lines Matching refs:orig

102 	struct cil_block *orig = data;
103 char *key = orig->datum.name;
109 cil_tree_log(NODE(orig), CIL_ERR, "Block %s being copied", key);
113 cil_tree_log(NODE(orig), CIL_WARN, "Block %s being copied", key);
127 struct cil_blockabstract *orig = data;
132 new->block_str = orig->block_str;
141 struct cil_blockinherit *orig = data;
146 new->block_str = orig->block_str;
147 new->block = orig->block;
156 struct cil_policycap *orig = data;
157 char *key = orig->datum.name;
174 struct cil_perm *orig = data;
175 char *key = orig->datum.name;
190 void cil_copy_classperms(struct cil_classperms *orig, struct cil_classperms **new)
193 (*new)->class_str = orig->class_str;
194 cil_copy_list(orig->perm_strs, &((*new)->perm_strs));
197 void cil_copy_classperms_set(struct cil_classperms_set *orig, struct cil_classperms_set **new)
200 (*new)->set_str = orig->set_str;
203 void cil_copy_classperms_list(struct cil_list *orig, struct cil_list **new)
207 if (orig == NULL) {
212 cil_list_for_each(orig_item, orig) {
227 struct cil_classmapping *orig = data;
232 new->map_class_str = orig->map_class_str;
233 new->map_perm_str = orig->map_perm_str;
235 cil_copy_classperms_list(orig->classperms, &new->classperms);
244 struct cil_class *orig = data;
246 char *key = orig->datum.name;
266 struct cil_classorder *orig = data;
270 if (orig->class_list_str != NULL) {
271 cil_copy_list(orig->class_list_str, &new->class_list_str);
281 struct cil_classpermission *orig = data;
283 char *key = orig->datum.name;
296 cil_copy_classperms_list(orig->classperms, &new->classperms);
305 struct cil_classpermissionset *orig = data;
310 new->set_str = orig->set_str;
312 cil_copy_classperms_list(orig->classperms, &new->classperms);
321 struct cil_classcommon *orig = data;
326 new->class_str = orig->class_str;
327 new->common_str = orig->common_str;
336 struct cil_sid *orig = data;
337 char *key = orig->datum.name;
354 struct cil_sidcontext *orig = data;
359 if (orig->context_str != NULL) {
360 new->context_str = orig->context_str;
363 cil_copy_fill_context(db, orig->context, new->context);
373 struct cil_sidorder *orig = data;
377 if (orig->sid_list_str != NULL) {
378 cil_copy_list(orig->sid_list_str, &new->sid_list_str);
388 struct cil_user *orig = data;
389 char *key = orig->datum.name;
406 struct cil_userattribute *orig = data;
408 char *key = orig->datum.name;
424 struct cil_userattributeset *orig = data;
429 new->attr_str = orig->attr_str;
431 cil_copy_expr(db, orig->str_expr, &new->str_expr);
432 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
441 struct cil_userrole *orig = data;
446 new->user_str = orig->user_str;
447 new->role_str = orig->role_str;
456 struct cil_userlevel *orig = data;
461 new->user_str = orig->user_str;
463 if (orig->level_str != NULL) {
464 new->level_str = orig->level_str;
466 cil_copy_fill_level(db, orig->level, &new->level);
476 struct cil_userrange *orig = data;
481 new->user_str = orig->user_str;
483 if (orig->range_str != NULL) {
484 new->range_str = orig->range_str;
487 cil_copy_fill_levelrange(db, orig->range, new->range);
497 struct cil_userprefix *orig = data;
502 new->user_str = orig->user_str;
503 new->prefix_str = orig->prefix_str;
512 struct cil_role *orig = data;
513 char *key = orig->datum.name;
530 struct cil_roletype *orig = data;
535 new->role_str = orig->role_str;
536 new->type_str = orig->type_str;
545 struct cil_roleattribute *orig = data;
546 char *key = orig->datum.name;
563 struct cil_roleattributeset *orig = data;
568 new->attr_str = orig->attr_str;
570 cil_copy_expr(db, orig->str_expr, &new->str_expr);
571 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
580 struct cil_roleallow *orig = data;
585 new->src_str = orig->src_str;
586 new->tgt_str = orig->tgt_str;
605 struct cil_typepermissive *orig = data;
610 new->type_str = orig->type_str;
629 struct cil_typeattributeset *orig = data;
634 new->attr_str = orig->attr_str;
636 cil_copy_expr(db, orig->str_expr, &new->str_expr);
637 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
646 struct cil_expandtypeattribute *orig = data;
651 if (orig->attr_strs != NULL) {
652 cil_copy_list(orig->attr_strs, &new->attr_strs);
655 if (orig->attr_datums != NULL) {
656 cil_copy_list(orig->attr_datums, &new->attr_datums);
659 new->expand = orig->expand;
668 struct cil_alias *orig = data;
670 char *key = orig->datum.name;
688 struct cil_aliasactual *orig = data;
693 new->alias_str = orig->alias_str;
694 new->actual_str = orig->actual_str;
703 struct cil_roletransition *orig = data;
708 new->src_str = orig->src_str;
709 new->tgt_str = orig->tgt_str;
710 new->obj_str = orig->obj_str;
711 new->result_str = orig->result_str;
720 struct cil_nametypetransition *orig = data;
725 new->src_str = orig->src_str;
726 new->tgt_str = orig->tgt_str;
727 new->obj_str = orig->obj_str;
728 new->name_str = orig->name_str;
729 new->result_str = orig->result_str;
739 struct cil_rangetransition *orig = data;
744 new->src_str = orig->src_str;
745 new->exec_str = orig->exec_str;
746 new->obj_str = orig->obj_str;
748 if (orig->range_str != NULL) {
749 new->range_str = orig->range_str;
752 cil_copy_fill_levelrange(db, orig->range, new->range);
762 struct cil_bool *orig = data;
764 char *key = orig->datum.name;
774 new->value = orig->value;
782 struct cil_tunable *orig = data;
784 char *key = orig->datum.name;
794 new->value = orig->value;
800 static void cil_copy_fill_permissionx(struct cil_db *db, struct cil_permissionx *orig, struct cil_permissionx *new)
802 new->kind = orig->kind;
803 new->obj_str = orig->obj_str;
804 cil_copy_expr(db, orig->expr_str, &new->expr_str);
809 struct cil_avrule *orig = data;
814 new->is_extended = orig->is_extended;
815 new->rule_kind = orig->rule_kind;
816 new->src_str = orig->src_str;
817 new->tgt_str = orig->tgt_str;
820 cil_copy_classperms_list(orig->perms.classperms, &new->perms.classperms);
822 if (orig->perms.x.permx_str != NULL) {
823 new->perms.x.permx_str = orig->perms.x.permx_str;
826 cil_copy_fill_permissionx(db, orig->perms.x.permx, new->perms.x.permx);
837 struct cil_permissionx *orig = data;
839 char *key = orig->datum.name;
850 cil_copy_fill_permissionx(db, orig, new);
859 struct cil_type_rule *orig = data;
864 new->rule_kind = orig->rule_kind;
865 new->src_str = orig->src_str;
866 new->tgt_str = orig->tgt_str;
867 new->obj_str = orig->obj_str;
868 new->result_str = orig->result_str;
877 struct cil_sens *orig = data;
878 char *key = orig->datum.name;
895 struct cil_cat *orig = data;
896 char *key = orig->datum.name;
911 static void cil_copy_cats(struct cil_db *db, struct cil_cats *orig, struct cil_cats **new)
914 cil_copy_expr(db, orig->str_expr, &(*new)->str_expr);
915 cil_copy_expr(db, orig->datum_expr, &(*new)->datum_expr);
920 struct cil_catset *orig = data;
922 char *key = orig->datum.name;
933 cil_copy_cats(db, orig->cats, &new->cats);
942 struct cil_senscat *orig = data;
947 new->sens_str = orig->sens_str;
949 cil_copy_cats(db, orig->cats, &new->cats);
958 struct cil_catorder *orig = data;
962 if (orig->cat_list_str != NULL) {
963 cil_copy_list(orig->cat_list_str, &new->cat_list_str);
973 struct cil_sensorder *orig = data;
977 if (orig->sens_list_str != NULL) {
978 cil_copy_list(orig->sens_list_str, &new->sens_list_str);
986 void cil_copy_fill_level(struct cil_db *db, struct cil_level *orig, struct cil_level **new)
990 (*new)->sens_str = orig->sens_str;
992 if (orig->cats != NULL) {
993 cil_copy_cats(db, orig->cats, &(*new)->cats);
999 struct cil_level *orig = data;
1001 char *key = orig->datum.name;
1012 cil_copy_fill_level(db, orig, &new);
1036 struct cil_levelrange *orig = data;
1038 char *key = orig->datum.name;
1050 cil_copy_fill_levelrange(db, orig, new);
1073 struct cil_context *orig = data;
1075 char *key = orig->datum.name;
1087 cil_copy_fill_context(db, orig, new);
1096 struct cil_netifcon *orig = data;
1101 new->interface_str = orig->interface_str;
1103 if (orig->if_context_str != NULL) {
1104 new->if_context_str = orig->if_context_str;
1107 cil_copy_fill_context(db, orig->if_context, new->if_context);
1110 if (orig->packet_context_str != NULL) {
1111 new->packet_context_str = orig->packet_context_str;
1114 cil_copy_fill_context(db, orig->packet_context, new->packet_context);
1124 struct cil_genfscon *orig = data;
1129 new->fs_str = orig->fs_str;
1130 new->path_str = orig->path_str;
1132 if (orig->context_str != NULL) {
1133 new->context_str = orig->context_str;
1136 cil_copy_fill_context(db, orig->context, new->context);
1146 struct cil_filecon *orig = data;
1151 new->path_str = orig->path_str;
1152 new->type = orig->type;
1154 if (orig->context_str != NULL) {
1155 new->context_str = orig->context_str;
1156 } else if (orig->context != NULL) {
1158 cil_copy_fill_context(db, orig->context, new->context);
1168 struct cil_nodecon *orig = data;
1173 if (orig->addr_str != NULL) {
1174 new->addr_str = orig->addr_str;
1177 cil_copy_fill_ipaddr(orig->addr, new->addr);
1180 if (orig->mask_str != NULL) {
1181 new->mask_str = orig->mask_str;
1184 cil_copy_fill_ipaddr(orig->mask, new->mask);
1187 if (orig->context_str != NULL) {
1188 new->context_str = orig->context_str;
1191 cil_copy_fill_context(db, orig->context, new->context);
1201 struct cil_ibpkeycon *orig = data;
1206 new->subnet_prefix_str = orig->subnet_prefix_str;
1207 new->pkey_low = orig->pkey_low;
1208 new->pkey_high = orig->pkey_high;
1210 if (orig->context_str) {
1211 new->context_str = orig->context_str;
1214 cil_copy_fill_context(db, orig->context, new->context);
1224 struct cil_ibendportcon *orig = data;
1229 new->dev_name_str = orig->dev_name_str;
1230 new->port = orig->port;
1232 if (orig->context_str) {
1233 new->context_str = orig->context_str;
1236 cil_copy_fill_context(db, orig->context, new->context);
1246 struct cil_portcon *orig = data;
1251 new->proto = orig->proto;
1252 new->port_low = orig->port_low;
1253 new->port_high = orig->port_high;
1255 if (orig->context_str != NULL) {
1256 new->context_str = orig->context_str;
1259 cil_copy_fill_context(db, orig->context, new->context);
1269 struct cil_pirqcon *orig = data;
1274 new->pirq = orig->pirq;
1276 if (orig->context_str != NULL) {
1277 new->context_str = orig->context_str;
1280 cil_copy_fill_context(db, orig->context, new->context);
1290 struct cil_iomemcon *orig = data;
1295 new->iomem_low = orig->iomem_low;
1296 new->iomem_high = orig->iomem_high;
1298 if (orig->context_str != NULL) {
1299 new->context_str = orig->context_str;
1302 cil_copy_fill_context(db, orig->context, new->context);
1312 struct cil_ioportcon *orig = data;
1317 new->ioport_low = orig->ioport_low;
1318 new->ioport_high = orig->ioport_high;
1320 if (orig->context_str != NULL) {
1321 new->context_str = orig->context_str;
1324 cil_copy_fill_context(db, orig->context, new->context);
1334 struct cil_pcidevicecon *orig = data;
1339 new->dev = orig->dev;
1341 if (orig->context_str != NULL) {
1342 new->context_str = orig->context_str;
1345 cil_copy_fill_context(db, orig->context, new->context);
1355 struct cil_devicetreecon *orig = data;
1360 new->path = orig->path;
1362 if (orig->context_str != NULL) {
1363 new->context_str = orig->context_str;
1366 cil_copy_fill_context(db, orig->context, new->context);
1376 struct cil_fsuse *orig = data;
1381 new->type = orig->type;
1382 new->fs_str = orig->fs_str;
1384 if (orig->context_str != NULL) {
1385 new->context_str = orig->context_str;
1388 cil_copy_fill_context(db, orig->context, new->context);
1396 int cil_copy_expr(struct cil_db *db, struct cil_list *orig, struct cil_list **new)
1400 if (orig == NULL) {
1405 cil_list_init(new, orig->flavor);
1407 cil_list_for_each(curr, orig) {
1439 struct cil_constrain *orig = data;
1443 cil_copy_classperms_list(orig->classperms, &new->classperms);
1445 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1446 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1455 struct cil_validatetrans *orig = data;
1460 new->class_str = orig->class_str;
1462 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1463 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1472 struct cil_call *orig = data;
1478 new->macro_str = orig->macro_str;
1479 new->macro = orig->macro;
1481 if (orig->args_tree != NULL) {
1483 rc = cil_copy_ast(db, orig->args_tree->root, new->args_tree->root);
1489 new->copied = orig->copied;
1502 struct cil_macro *orig = data;
1503 char *key = orig->datum.name;
1509 cil_tree_log(NODE(orig), CIL_ERR, "Macro %s being copied", key);
1513 cil_tree_log(NODE(orig), CIL_WARN, "Skipping macro %s", key);
1519 if (orig->params != NULL) {
1520 cil_copy_list(orig->params, &new->params);
1546 struct cil_ipaddr *orig = data;
1548 char * key = orig->datum.name;
1558 cil_copy_fill_ipaddr(orig, new);
1567 struct cil_condblock *orig = data;
1570 new->flavor = orig->flavor;
1578 struct cil_booleanif *orig = data;
1583 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1584 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1585 new->preserved_tunable = orig->preserved_tunable;
1594 struct cil_tunableif *orig = data;
1599 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1600 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1609 struct cil_default *orig = data;
1614 new->flavor = orig->flavor;
1616 if (orig->class_strs != NULL) {
1617 cil_copy_list(orig->class_strs, &new->class_strs);
1620 new->object = orig->object;
1629 struct cil_defaultrange *orig = data;
1634 if (orig->class_strs != NULL) {
1635 cil_copy_list(orig->class_strs, &new->class_strs);
1638 new->object_range = orig->object_range;
1647 struct cil_handleunknown *orig = data;
1651 new->handle_unknown = orig->handle_unknown;
1659 struct cil_mls *orig = data;
1663 new->value = orig->value;
1671 struct cil_bounds *orig = data;
1676 new->parent_str = orig->parent_str;
1677 new->child_str = orig->child_str;
1686 struct cil_src_info *orig = data;
1691 new->kind = orig->kind;
1692 new->hll_line = orig->hll_line;
1693 new->path = orig->path;
1700 static int __cil_copy_node_helper(struct cil_tree_node *orig, uint32_t *finished, void *extra_args)
1714 if (orig == NULL || extra_args == NULL) {
1723 switch (orig->flavor) {
1997 if (orig->flavor >= CIL_MIN_DECLARATIVE) {
1998 rc = cil_flavor_to_symtab_index(orig->flavor, &sym_index);
2009 rc = (*copy_func)(db, orig->data, &data, symtab);
2011 if (orig->flavor == CIL_MACRO && data == NULL) {
2024 new->line = orig->line;
2025 new->hll_offset = orig->hll_offset;
2026 new->flavor = orig->flavor;
2029 if (orig->flavor == CIL_BLOCK && DATUM(data)->nodes->head != NULL) {
2037 } else if (orig->flavor >= CIL_MIN_DECLARATIVE) {
2039 if (DATUM(data)->nodes->head && FLAVOR(data) != orig->flavor) {
2040 cil_tree_log(orig, CIL_ERR, "Incompatible flavor when trying to copy %s", DATUM(data)->name);
2047 rc = cil_add_decl_to_symtab(db, symtab, DATUM(orig->data)->name, DATUM(data), new);
2065 rc = cil_verify_decl_does_not_shadow_macro_parameter(namespace->data, orig, DATUM(orig->data)->name);
2092 if (orig->cl_head != NULL) {
2096 cil_tree_log(orig, CIL_ERR, "Problem copying %s node", cil_node_to_string(orig));
2107 static int __cil_copy_last_child_helper(__attribute__((unused)) struct cil_tree_node *orig, void *extra_args)
2124 int cil_copy_ast(struct cil_db *db, struct cil_tree_node *orig, struct cil_tree_node *dest)
2133 rc = cil_tree_walk(orig, __cil_copy_node_helper, NULL, __cil_copy_last_child_helper, &extra_args);
2135 cil_tree_log(dest, CIL_ERR, "Failed to copy %s to %s", cil_node_to_string(orig), cil_node_to_string(dest));