free(policy_user);
policy_user = name;
name = NULL;
+ policy_category = POLICY_CATEGORY_USER;
state = STATE_POLICY;
} else {
log_error("Unexpected token (5) in %s:%u.", path, line);
free(policy_group);
policy_group = name;
name = NULL;
+ policy_category = POLICY_CATEGORY_GROUP;
state = STATE_POLICY;
} else {
log_error("Unexpected token (6) at %s:%u.", path, line);
LIST_REMOVE(items, first, i);
policy_item_free(i);
}
-
- policy_item_free(i);
}
while ((first = hashmap_steal_first(p->group_items))) {
LIST_REMOVE(items, first, i);
policy_item_free(i);
}
-
- policy_item_free(i);
}
hashmap_free(p->user_items);
static void dump_hashmap_items(Hashmap *h) {
PolicyItem *i;
Iterator j;
- char *k;
+ void *k;
HASHMAP_FOREACH_KEY(i, k, h, j) {
- printf("Item for %s", k);
+ printf("Item for %u:\n", PTR_TO_UINT(k));
dump_items(i);
}
}
-void policy_dump(Policy *p) {
+noreturn void policy_dump(Policy *p) {
- printf("→ Default Items:\n");
+ printf("%s Default Items:\n", draw_special_char(DRAW_ARROW));
dump_items(p->default_items);
- printf("→ Mandatory Items:\n");
+ printf("%s Mandatory Items:\n", draw_special_char(DRAW_ARROW));
dump_items(p->mandatory_items);
- printf("→ Group Items:\n");
+ printf("%s Group Items:\n", draw_special_char(DRAW_ARROW));
dump_hashmap_items(p->group_items);
- printf("→ User Items:\n");
+ printf("%s User Items:\n", draw_special_char(DRAW_ARROW));
dump_hashmap_items(p->user_items);
exit(0);
}