Lines Matching refs:new

51 	struct cil_list *new;
54 cil_list_init(&new, data->flavor);
59 cil_list_append(new, CIL_STRING, orig_item->data);
64 cil_list_append(new, CIL_LIST, new_sub);
73 cil_list_append(new, CIL_PARAM, pn);
78 cil_list_append(new, orig_item->flavor, orig_item->data);
83 *copy = new;
88 char *new = NULL;
91 new = data;
93 *copy = new;
106 struct cil_block *new;
107 cil_block_init(&new);
108 *copy = new;
119 struct cil_blockabstract *new = NULL;
121 cil_blockabstract_init(&new);
123 new->block_str = orig->block_str;
125 *copy = new;
133 struct cil_blockinherit *new = NULL;
135 cil_blockinherit_init(&new);
137 new->block_str = orig->block_str;
138 new->block = orig->block;
140 *copy = new;
153 struct cil_policycap *new;
154 cil_policycap_init(&new);
155 *copy = new;
171 struct cil_perm *new;
172 cil_perm_init(&new);
173 *copy = new;
181 void cil_copy_classperms(struct cil_classperms *orig, struct cil_classperms **new)
183 cil_classperms_init(new);
184 (*new)->class_str = orig->class_str;
185 cil_copy_list(orig->perm_strs, &((*new)->perm_strs));
188 void cil_copy_classperms_set(struct cil_classperms_set *orig, struct cil_classperms_set **new)
190 cil_classperms_set_init(new);
191 (*new)->set_str = orig->set_str;
194 void cil_copy_classperms_list(struct cil_list *orig, struct cil_list **new)
202 cil_list_init(new, CIL_LIST_ITEM);
207 cil_list_append(*new, CIL_CLASSPERMS, cp);
211 cil_list_append(*new, CIL_CLASSPERMS_SET, cp_set);
219 struct cil_classmapping *new = NULL;
221 cil_classmapping_init(&new);
223 new->map_class_str = orig->map_class_str;
224 new->map_perm_str = orig->map_perm_str;
226 cil_copy_classperms_list(orig->classperms, &new->classperms);
228 *copy = new;
236 struct cil_class *new = NULL;
246 cil_class_init(&new);
248 new->common = NULL;
250 *copy = new;
258 struct cil_classorder *new = NULL;
260 cil_classorder_init(&new);
262 cil_copy_list(orig->class_list_str, &new->class_list_str);
265 *copy = new;
273 struct cil_classpermission *new = NULL;
285 cil_classpermission_init(&new);
287 cil_copy_classperms_list(orig->classperms, &new->classperms);
289 *copy = new;
297 struct cil_classpermissionset *new = NULL;
299 cil_classpermissionset_init(&new);
301 new->set_str = orig->set_str;
303 cil_copy_classperms_list(orig->classperms, &new->classperms);
305 *copy = new;
313 struct cil_classcommon *new = NULL;
315 cil_classcommon_init(&new);
317 new->class_str = orig->class_str;
318 new->common_str = orig->common_str;
320 *copy = new;
333 struct cil_sid *new;
334 cil_sid_init(&new);
335 *copy = new;
346 struct cil_sidcontext *new = NULL;
348 cil_sidcontext_init(&new);
351 new->context_str = orig->context_str;
353 cil_context_init(&new->context);
354 cil_copy_fill_context(db, orig->context, new->context);
357 *copy = new;
365 struct cil_sidorder *new = NULL;
367 cil_sidorder_init(&new);
369 cil_copy_list(orig->sid_list_str, &new->sid_list_str);
372 *copy = new;
385 struct cil_user *new;
386 cil_user_init(&new);
387 *copy = new;
398 struct cil_userattribute *new = NULL;
404 cil_userattribute_init(&new);
405 *copy = new;
416 struct cil_userattributeset *new = NULL;
418 cil_userattributeset_init(&new);
420 new->attr_str = orig->attr_str;
422 cil_copy_expr(db, orig->str_expr, &new->str_expr);
423 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
425 *copy = new;
433 struct cil_userrole *new = NULL;
435 cil_userrole_init(&new);
437 new->user_str = orig->user_str;
438 new->role_str = orig->role_str;
440 *copy = new;
448 struct cil_userlevel *new = NULL;
450 cil_userlevel_init(&new);
452 new->user_str = orig->user_str;
455 new->level_str = orig->level_str;
457 cil_copy_fill_level(db, orig->level, &new->level);
460 *copy = new;
468 struct cil_userrange *new = NULL;
470 cil_userrange_init(&new);
472 new->user_str = orig->user_str;
475 new->range_str = orig->range_str;
477 cil_levelrange_init(&new->range);
478 cil_copy_fill_levelrange(db, orig->range, new->range);
481 *copy = new;
489 struct cil_userprefix *new = NULL;
491 cil_userprefix_init(&new);
493 new->user_str = orig->user_str;
494 new->prefix_str = orig->prefix_str;
496 *copy = new;
509 struct cil_role *new;
510 cil_role_init(&new);
511 *copy = new;
522 struct cil_roletype *new = NULL;
524 cil_roletype_init(&new);
526 new->role_str = orig->role_str;
527 new->type_str = orig->type_str;
529 *copy = new;
542 struct cil_roleattribute *new;
543 cil_roleattribute_init(&new);
544 *copy = new;
555 struct cil_roleattributeset *new = NULL;
557 cil_roleattributeset_init(&new);
559 new->attr_str = orig->attr_str;
561 cil_copy_expr(db, orig->str_expr, &new->str_expr);
562 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
564 *copy = new;
572 struct cil_roleallow *new = NULL;
574 cil_roleallow_init(&new);
576 new->src_str = orig->src_str;
577 new->tgt_str = orig->tgt_str;
579 *copy = new;
592 struct cil_type *new;
593 cil_type_init(&new);
594 *copy = new;
605 struct cil_typepermissive *new = NULL;
607 cil_typepermissive_init(&new);
609 new->type_str = orig->type_str;
611 *copy = new;
624 struct cil_typeattribute *new;
625 cil_typeattribute_init(&new);
626 *copy = new;
637 struct cil_typeattributeset *new = NULL;
639 cil_typeattributeset_init(&new);
641 new->attr_str = orig->attr_str;
643 cil_copy_expr(db, orig->str_expr, &new->str_expr);
644 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
646 *copy = new;
654 struct cil_alias *new = NULL;
664 cil_alias_init(&new);
666 *copy = new;
674 struct cil_aliasactual *new = NULL;
676 cil_aliasactual_init(&new);
678 new->alias_str = orig->alias_str;
679 new->actual_str = orig->actual_str;
681 *copy = new;
689 struct cil_roletransition *new = NULL;
691 cil_roletransition_init(&new);
693 new->src_str = orig->src_str;
694 new->tgt_str = orig->tgt_str;
695 new->obj_str = orig->obj_str;
696 new->result_str = orig->result_str;
698 *copy = new;
706 struct cil_nametypetransition *new = NULL;
708 cil_nametypetransition_init(&new);
710 new->src_str = orig->src_str;
711 new->tgt_str = orig->tgt_str;
712 new->obj_str = orig->obj_str;
713 new->name_str = orig->name_str;
714 new->result_str = orig->result_str;
717 *copy = new;
725 struct cil_rangetransition *new = NULL;
727 cil_rangetransition_init(&new);
729 new->src_str = orig->src_str;
730 new->exec_str = orig->exec_str;
731 new->obj_str = orig->obj_str;
734 new->range_str = orig->range_str;
736 cil_levelrange_init(&new->range);
737 cil_copy_fill_levelrange(db, orig->range, new->range);
740 *copy = new;
748 struct cil_bool *new = NULL;
758 cil_bool_init(&new);
759 new->value = orig->value;
760 *copy = new;
768 struct cil_tunable *new = NULL;
778 cil_tunable_init(&new);
779 new->value = orig->value;
780 *copy = new;
785 void cil_copy_fill_permissionx(struct cil_db *db, struct cil_permissionx *orig, struct cil_permissionx *new)
787 new->kind = orig->kind;
788 new->obj_str = orig->obj_str;
789 cil_copy_expr(db, orig->expr_str, &new->expr_str);
795 struct cil_avrule *new = NULL;
797 cil_avrule_init(&new);
799 new->is_extended = orig->is_extended;
800 new->rule_kind = orig->rule_kind;
801 new->src_str = orig->src_str;
802 new->tgt_str = orig->tgt_str;
804 if (!new->is_extended) {
805 cil_copy_classperms_list(orig->perms.classperms, &new->perms.classperms);
807 if (new->perms.x.permx_str != NULL) {
808 new->perms.x.permx_str = orig->perms.x.permx_str;
810 cil_permissionx_init(&new->perms.x.permx);
811 cil_copy_fill_permissionx(db, orig->perms.x.permx, new->perms.x.permx);
815 *copy = new;
823 struct cil_permissionx *new = NULL;
834 cil_permissionx_init(&new);
835 cil_copy_fill_permissionx(db, orig, new);
837 *copy = new;
845 struct cil_type_rule *new = NULL;
847 cil_type_rule_init(&new);
849 new->rule_kind = orig->rule_kind;
850 new->src_str = orig->src_str;
851 new->tgt_str = orig->tgt_str;
852 new->obj_str = orig->obj_str;
853 new->result_str = orig->result_str;
855 *copy = new;
868 struct cil_sens *new;
869 cil_sens_init(&new);
870 *copy = new;
886 struct cil_cat *new;
887 cil_cat_init(&new);
888 *copy = new;
896 void cil_copy_cats(struct cil_db *db, struct cil_cats *orig, struct cil_cats **new)
898 cil_cats_init(new);
899 cil_copy_expr(db, orig->str_expr, &(*new)->str_expr);
900 cil_copy_expr(db, orig->datum_expr, &(*new)->datum_expr);
906 struct cil_catset *new = NULL;
916 cil_catset_init(&new);
918 cil_copy_cats(db, orig->cats, &new->cats);
920 *copy = new;
928 struct cil_senscat *new = NULL;
930 cil_senscat_init(&new);
932 new->sens_str = orig->sens_str;
934 cil_copy_cats(db, orig->cats, &new->cats);
936 *copy = new;
944 struct cil_catorder *new = NULL;
946 cil_catorder_init(&new);
948 cil_copy_list(orig->cat_list_str, &new->cat_list_str);
951 *copy = new;
959 struct cil_sensorder *new = NULL;
961 cil_sensorder_init(&new);
963 cil_copy_list(orig->sens_list_str, &new->sens_list_str);
966 *copy = new;
971 void cil_copy_fill_level(struct cil_db *db, struct cil_level *orig, struct cil_level **new)
973 cil_level_init(new);
975 (*new)->sens_str = orig->sens_str;
978 cil_copy_cats(db, orig->cats, &(*new)->cats);
985 struct cil_level *new = NULL;
997 cil_copy_fill_level(db, orig, &new);
999 *copy = new;
1004 void cil_copy_fill_levelrange(struct cil_db *db, struct cil_levelrange *data, struct cil_levelrange *new)
1007 new->low_str = data->low_str;
1009 cil_copy_fill_level(db, data->low, &new->low);
1013 new->high_str = data->high_str;
1015 cil_copy_fill_level(db, data->high, &new->high);
1022 struct cil_levelrange *new = NULL;
1034 cil_levelrange_init(&new);
1035 cil_copy_fill_levelrange(db, orig, new);
1037 *copy = new;
1042 void cil_copy_fill_context(struct cil_db *db, struct cil_context *data, struct cil_context *new)
1044 new->user_str = data->user_str;
1045 new->role_str = data->role_str;
1046 new->type_str = data->type_str;
1049 new->range_str = data->range_str;
1051 cil_levelrange_init(&new->range);
1052 cil_copy_fill_levelrange(db, data->range, new->range);
1059 struct cil_context *new = NULL;
1071 cil_context_init(&new);
1072 cil_copy_fill_context(db, orig, new);
1074 *copy = new;
1082 struct cil_netifcon *new = NULL;
1084 cil_netifcon_init(&new);
1086 new->interface_str = orig->interface_str;
1089 new->if_context_str = orig->if_context_str;
1091 cil_context_init(&new->if_context);
1092 cil_copy_fill_context(db, orig->if_context, new->if_context);
1096 new->packet_context_str = orig->packet_context_str;
1098 cil_context_init(&new->packet_context);
1099 cil_copy_fill_context(db, orig->packet_context, new->packet_context);
1102 *copy = new;
1110 struct cil_genfscon *new = NULL;
1112 cil_genfscon_init(&new);
1114 new->fs_str = orig->fs_str;
1115 new->path_str = orig->path_str;
1118 new->context_str = orig->context_str;
1120 cil_context_init(&new->context);
1121 cil_copy_fill_context(db, orig->context, new->context);
1124 *copy = new;
1132 struct cil_filecon *new = NULL;
1134 cil_filecon_init(&new);
1136 new->path_str = orig->path_str;
1137 new->type = orig->type;
1140 new->context_str = orig->context_str;
1142 cil_context_init(&new->context);
1143 cil_copy_fill_context(db, orig->context, new->context);
1146 *copy = new;
1154 struct cil_nodecon *new = NULL;
1156 cil_nodecon_init(&new);
1159 new->addr_str = orig->addr_str;
1161 cil_ipaddr_init(&new->addr);
1162 cil_copy_fill_ipaddr(orig->addr, new->addr);
1166 new->mask_str = orig->mask_str;
1168 cil_ipaddr_init(&new->mask);
1169 cil_copy_fill_ipaddr(orig->mask, new->mask);
1173 new->context_str = orig->context_str;
1175 cil_context_init(&new->context);
1176 cil_copy_fill_context(db, orig->context, new->context);
1179 *copy = new;
1187 struct cil_portcon *new = NULL;
1189 cil_portcon_init(&new);
1191 new->proto = orig->proto;
1192 new->port_low = orig->port_low;
1193 new->port_high = orig->port_high;
1196 new->context_str = orig->context_str;
1198 cil_context_init(&new->context);
1199 cil_copy_fill_context(db, orig->context, new->context);
1202 *copy = new;
1210 struct cil_pirqcon *new = NULL;
1212 cil_pirqcon_init(&new);
1214 new->pirq = orig->pirq;
1217 new->context_str = orig->context_str;
1219 cil_context_init(&new->context);
1220 cil_copy_fill_context(db, orig->context, new->context);
1223 *copy = new;
1231 struct cil_iomemcon *new = NULL;
1233 cil_iomemcon_init(&new);
1235 new->iomem_low = orig->iomem_low;
1236 new->iomem_high = orig->iomem_high;
1239 new->context_str = orig->context_str;
1241 cil_context_init(&new->context);
1242 cil_copy_fill_context(db, orig->context, new->context);
1245 *copy = new;
1253 struct cil_ioportcon *new = NULL;
1255 cil_ioportcon_init(&new);
1257 new->ioport_low = orig->ioport_low;
1258 new->ioport_high = orig->ioport_high;
1261 new->context_str = orig->context_str;
1263 cil_context_init(&new->context);
1264 cil_copy_fill_context(db, orig->context, new->context);
1267 *copy = new;
1275 struct cil_pcidevicecon *new = NULL;
1277 cil_pcidevicecon_init(&new);
1279 new->dev = orig->dev;
1282 new->context_str = orig->context_str;
1284 cil_context_init(&new->context);
1285 cil_copy_fill_context(db, orig->context, new->context);
1288 *copy = new;
1296 struct cil_devicetreecon *new = NULL;
1298 cil_devicetreecon_init(&new);
1300 new->path = orig->path;
1303 new->context_str = orig->context_str;
1305 cil_context_init(&new->context);
1306 cil_copy_fill_context(db, orig->context, new->context);
1309 *copy = new;
1317 struct cil_fsuse *new = NULL;
1319 cil_fsuse_init(&new);
1321 new->type = orig->type;
1322 new->fs_str = orig->fs_str;
1325 new->context_str = orig->context_str;
1327 cil_context_init(&new->context);
1328 cil_copy_fill_context(db, orig->context, new->context);
1331 *copy = new;
1336 int cil_copy_expr(struct cil_db *db, struct cil_list *orig, struct cil_list **new)
1341 *new = NULL;
1345 cil_list_init(new, orig->flavor);
1352 cil_list_append(*new, CIL_LIST, sub_list);
1356 cil_list_append(*new, CIL_STRING, curr->data);
1359 cil_list_append(*new, curr->flavor, curr->data);
1362 cil_list_append(*new, curr->flavor, curr->data);
1365 cil_list_append(*new, curr->flavor, curr->data);
1369 cil_list_append(*new, curr->flavor, curr->data);
1380 struct cil_constrain *new = NULL;
1382 cil_constrain_init(&new);
1383 cil_copy_classperms_list(orig->classperms, &new->classperms);
1385 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1386 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1388 *copy = new;
1396 struct cil_validatetrans *new = NULL;
1398 cil_validatetrans_init(&new);
1400 new->class_str = orig->class_str;
1402 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1403 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1405 *copy = new;
1413 struct cil_call *new = NULL;
1416 cil_call_init(&new);
1418 new->macro_str = orig->macro_str;
1419 new->macro = orig->macro;
1422 cil_tree_init(&new->args_tree);
1423 rc = cil_copy_ast(db, orig->args_tree->root, new->args_tree->root);
1429 new->copied = orig->copied;
1431 *copy = new;
1436 cil_destroy_call(new);
1448 struct cil_macro *new;
1449 cil_macro_init(&new);
1451 cil_copy_list(orig->params, &new->params);
1454 *copy = new;
1513 struct cil_optional *new;
1514 cil_optional_init(&new);
1515 *copy = new;
1523 void cil_copy_fill_ipaddr(struct cil_ipaddr *data, struct cil_ipaddr *new)
1525 new->family = data->family;
1526 memcpy(&new->ip, &data->ip, sizeof(data->ip));
1532 struct cil_ipaddr *new = NULL;
1542 cil_ipaddr_init(&new);
1543 cil_copy_fill_ipaddr(orig, new);
1545 *copy = new;
1553 struct cil_condblock *new = *copy;
1554 cil_condblock_init(&new);
1555 new->flavor = orig->flavor;
1556 *copy = new;
1564 struct cil_booleanif *new = NULL;
1566 cil_boolif_init(&new);
1568 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1569 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1570 new->preserved_tunable = orig->preserved_tunable;
1572 *copy = new;
1580 struct cil_tunableif *new = NULL;
1582 cil_tunif_init(&new);
1584 cil_copy_expr(db, orig->str_expr, &new->str_expr);
1585 cil_copy_expr(db, orig->datum_expr, &new->datum_expr);
1587 *copy = new;
1595 struct cil_default *new = NULL;
1597 cil_default_init(&new);
1599 new->flavor = orig->flavor;
1602 cil_copy_list(orig->class_strs, &new->class_strs);
1605 new->object = orig->object;
1607 *copy = new;
1615 struct cil_defaultrange *new = NULL;
1617 cil_defaultrange_init(&new);
1620 cil_copy_list(orig->class_strs, &new->class_strs);
1623 new->object_range = orig->object_range;
1625 *copy = new;
1633 struct cil_handleunknown *new = NULL;
1635 cil_handleunknown_init(&new);
1636 new->handle_unknown = orig->handle_unknown;
1637 *copy = new;
1645 struct cil_mls *new = NULL;
1647 cil_mls_init(&new);
1648 new->value = orig->value;
1649 *copy = new;
1657 struct cil_bounds *new = NULL;
1659 cil_bounds_init(&new);
1661 new->parent_str = orig->parent_str;
1662 new->child_str = orig->child_str;
1664 *copy = new;
1673 struct cil_tree_node *new = NULL;
1963 cil_tree_node_init(&new);
1965 new->parent = parent;
1966 new->line = orig->line;
1967 new->path = orig->path;
1968 new->flavor = orig->flavor;
1969 new->data = data;
1972 rc = cil_symtab_insert(symtab, ((struct cil_symtab_datum*)orig->data)->name, ((struct cil_symtab_datum*)data), new);
1974 namespace = new;
1986 if (param->flavor == new->flavor) {
1987 if (param->str == ((struct cil_symtab_datum*)new->data)->name) {
1988 cil_log(CIL_ERR, "%s %s shadows a macro parameter (%s line:%d)\n", cil_node_to_string(new), ((struct cil_symtab_datum*)orig->data)->name, orig->path, orig->line);
1999 if (new->flavor == CIL_BLOCKINHERIT) {
2000 blockinherit = new->data;
2007 cil_list_append(blockinherit->block->bi_nodes, CIL_NODE, new);
2012 parent->cl_head = new;
2013 parent->cl_tail = new;
2015 parent->cl_tail->next = new;
2016 parent->cl_tail = new;
2020 args->dest = new;
2029 cil_tree_node_destroy(&new);