2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

apparmor_parser: show attachment in --debug output

When showing the content of profiles with `apparmor_parser --debug`, the
attachment path is now displayed within the 'Debugging built structures'
section.

Signed-off-by: Maxime Bélair <maxime.belair@canonical.com>
This commit is contained in:
Maxime Bélair 2025-04-17 19:46:32 +02:00
parent cda9153772
commit 5d7fe96fd0
3 changed files with 8 additions and 2 deletions

View File

@ -410,6 +410,7 @@ extern int process_policydb(Profile *prof);
extern int process_policy_ents(Profile *prof);
extern void filter_slashes(char *path);
extern const char *local_name(const char *name);
/* parser_variable.c */
int expand_entry_variables(char **name);

View File

@ -433,7 +433,7 @@ out:
return ptype;
}
static const char *local_name(const char *name)
const char *local_name(const char *name)
{
const char *t;

View File

@ -459,7 +459,12 @@ public:
printf("Name:\t\t%s\n", name);
else
printf("Name:\t\t<NULL>\n");
if (attachment)
printf("Attachment:\t%s\n", attachment);
else {
const char *local = local_name(name);
printf("Attachment:\t%s\n", local[0] == '/' ? local : "<NULL>");
}
if (parent)
printf("Local To:\t%s\n", parent->name);
else