mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 06:45:38 +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:
@@ -724,7 +724,6 @@ void debug_cod_entries(struct cod_entry *list)
|
|||||||
debug_base_perm_mask(SHIFT_TO_BASE(item->mode, AA_OTHER_SHIFT));
|
debug_base_perm_mask(SHIFT_TO_BASE(item->mode, AA_OTHER_SHIFT));
|
||||||
if (item->name)
|
if (item->name)
|
||||||
printf("\tName:\t(%s)\n", item->name);
|
printf("\tName:\t(%s)\n", item->name);
|
||||||
|
|
||||||
else
|
else
|
||||||
printf("\tName:\tNULL\n");
|
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[] = {
|
static const char *capnames[] = {
|
||||||
"chown",
|
"chown",
|
||||||
"dac_override",
|
"dac_override",
|
||||||
@@ -792,6 +809,11 @@ void debug_cod_list(struct codomain *cod)
|
|||||||
else
|
else
|
||||||
printf("Name:\t\tNULL\n");
|
printf("Name:\t\tNULL\n");
|
||||||
|
|
||||||
|
if (cod->local)
|
||||||
|
printf("Local To:\t%s\n", cod->parent->name);
|
||||||
|
|
||||||
|
debug_flags(cod);
|
||||||
|
|
||||||
printf("Capabilities:\t");
|
printf("Capabilities:\t");
|
||||||
for (i = 0; i < (sizeof(capnames)/sizeof(char *)); i++) {
|
for (i = 0; i < (sizeof(capnames)/sizeof(char *)); i++) {
|
||||||
if (((1 << i) & cod->capabilities) != 0) {
|
if (((1 << i) & cod->capabilities) != 0) {
|
||||||
|
Reference in New Issue
Block a user