2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Debugging fixups:

- report applied modes (enforce, complain, audit)
- if local profile, report name of profile it is local to
This commit is contained in:
Steve Beattie
2009-03-12 19:23:27 +00:00
parent 27b8275d5a
commit 24ddc6f081

View File

@@ -724,7 +724,6 @@ void debug_cod_entries(struct cod_entry *list)
debug_base_perm_mask(SHIFT_TO_BASE(item->mode, AA_OTHER_SHIFT));
if (item->name)
printf("\tName:\t(%s)\n", item->name);
else
printf("\tName:\tNULL\n");
@@ -737,6 +736,24 @@ void debug_cod_entries(struct cod_entry *list)
}
}
void debug_flags(struct codomain *cod)
{
printf("Profile Mode:\t");
if (cod->flags.complain)
printf("Complain");
else
printf("Enforce");
if (cod->flags.audit)
printf(", Audit");
if (cod->flags.hat)
printf(", Hat");
printf("\n");
}
static const char *capnames[] = {
"chown",
"dac_override",
@@ -792,6 +809,11 @@ void debug_cod_list(struct codomain *cod)
else
printf("Name:\t\tNULL\n");
if (cod->local)
printf("Local To:\t%s\n", cod->parent->name);
debug_flags(cod);
printf("Capabilities:\t");
for (i = 0; i < (sizeof(capnames)/sizeof(char *)); i++) {
if (((1 << i) & cod->capabilities) != 0) {