Lines Matching refs:new_rule
1252 avrule_t *cur, *new_rule = NULL, *tail; in copy_avrule_list() local
1262 if ((new_rule = (avrule_t *) malloc(sizeof(avrule_t))) == NULL) { in copy_avrule_list()
1265 avrule_init(new_rule); in copy_avrule_list()
1267 new_rule->specified = cur->specified; in copy_avrule_list()
1268 new_rule->flags = cur->flags; in copy_avrule_list()
1270 (&cur->stypes, &new_rule->stypes, module, state) == -1 in copy_avrule_list()
1271 || type_set_convert(&cur->ttypes, &new_rule->ttypes, module, in copy_avrule_list()
1289 if (new_rule->specified & AVRULE_AV) { in copy_avrule_list()
1307 if (new_rule->perms == NULL) { in copy_avrule_list()
1308 new_rule->perms = new_perm; in copy_avrule_list()
1318 new_rule->xperms = calloc(1, sizeof(*new_rule->xperms)); in copy_avrule_list()
1319 if (!new_rule->xperms) in copy_avrule_list()
1321 memcpy(new_rule->xperms, cur->xperms, in copy_avrule_list()
1322 sizeof(*new_rule->xperms)); in copy_avrule_list()
1325 new_rule->line = cur->line; in copy_avrule_list()
1326 new_rule->source_line = cur->source_line; in copy_avrule_list()
1328 new_rule->source_filename = strdup(cur->source_filename); in copy_avrule_list()
1329 if (!new_rule->source_filename) in copy_avrule_list()
1336 *dst = new_rule; in copy_avrule_list()
1338 tail->next = new_rule; in copy_avrule_list()
1340 tail = new_rule; in copy_avrule_list()
1346 avrule_destroy(new_rule); in copy_avrule_list()
1347 free(new_rule); in copy_avrule_list()
1355 role_trans_rule_t *cur, *new_rule = NULL, *tail; in copy_role_trans_list() local
1365 if ((new_rule = in copy_role_trans_list()
1370 role_trans_rule_init(new_rule); in copy_role_trans_list()
1373 (&cur->roles, &new_rule->roles, module, state) in copy_role_trans_list()
1374 || type_set_or_convert(&cur->types, &new_rule->types, in copy_role_trans_list()
1381 if (ebitmap_set_bit(&new_rule->classes, in copy_role_trans_list()
1389 new_rule->new_role = module->map[SYM_ROLES][cur->new_role - 1]; in copy_role_trans_list()
1392 *dst = new_rule; in copy_role_trans_list()
1394 tail->next = new_rule; in copy_role_trans_list()
1396 tail = new_rule; in copy_role_trans_list()
1402 role_trans_rule_list_destroy(new_rule); in copy_role_trans_list()
1410 role_allow_rule_t *cur, *new_rule = NULL, *tail; in copy_role_allow_list() local
1419 if ((new_rule = in copy_role_allow_list()
1424 role_allow_rule_init(new_rule); in copy_role_allow_list()
1427 (&cur->roles, &new_rule->roles, module, state) in copy_role_allow_list()
1429 &new_rule->new_roles, module, in copy_role_allow_list()
1434 *dst = new_rule; in copy_role_allow_list()
1436 tail->next = new_rule; in copy_role_allow_list()
1438 tail = new_rule; in copy_role_allow_list()
1444 role_allow_rule_list_destroy(new_rule); in copy_role_allow_list()
1453 filename_trans_rule_t *cur, *new_rule, *tail; in copy_filename_trans_list() local
1461 new_rule = malloc(sizeof(*new_rule)); in copy_filename_trans_list()
1462 if (!new_rule) in copy_filename_trans_list()
1465 filename_trans_rule_init(new_rule); in copy_filename_trans_list()
1468 *dst = new_rule; in copy_filename_trans_list()
1470 tail->next = new_rule; in copy_filename_trans_list()
1471 tail = new_rule; in copy_filename_trans_list()
1473 new_rule->name = strdup(cur->name); in copy_filename_trans_list()
1474 if (!new_rule->name) in copy_filename_trans_list()
1477 if (type_set_or_convert(&cur->stypes, &new_rule->stypes, module, state) || in copy_filename_trans_list()
1478 type_set_or_convert(&cur->ttypes, &new_rule->ttypes, module, state)) in copy_filename_trans_list()
1481 new_rule->tclass = module->map[SYM_CLASSES][cur->tclass - 1]; in copy_filename_trans_list()
1482 new_rule->otype = module->map[SYM_TYPES][cur->otype - 1]; in copy_filename_trans_list()
1496 range_trans_rule_t *rule, *new_rule = NULL; in copy_range_trans_list() local
1501 new_rule = in copy_range_trans_list()
1503 if (!new_rule) in copy_range_trans_list()
1506 range_trans_rule_init(new_rule); in copy_range_trans_list()
1508 new_rule->next = *dst; in copy_range_trans_list()
1509 *dst = new_rule; in copy_range_trans_list()
1511 if (type_set_convert(&rule->stypes, &new_rule->stypes, in copy_range_trans_list()
1515 if (type_set_convert(&rule->ttypes, &new_rule->ttypes, in copy_range_trans_list()
1522 (&new_rule->tclasses, in copy_range_trans_list()
1528 if (mls_range_convert(&rule->trange, &new_rule->trange, mod, state)) in copy_range_trans_list()
1535 range_trans_rule_list_destroy(new_rule); in copy_range_trans_list()