diff --git a/parser/parser.h b/parser/parser.h index 3e0eb5ee9..56fae71f2 100644 --- a/parser/parser.h +++ b/parser/parser.h @@ -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); diff --git a/parser/parser_regex.c b/parser/parser_regex.c index 4a8018b65..6d61c61fb 100644 --- a/parser/parser_regex.c +++ b/parser/parser_regex.c @@ -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; diff --git a/parser/profile.h b/parser/profile.h index d245a1376..207c9b57e 100644 --- a/parser/profile.h +++ b/parser/profile.h @@ -459,7 +459,12 @@ public: printf("Name:\t\t%s\n", name); else printf("Name:\t\t\n"); - + if (attachment) + printf("Attachment:\t%s\n", attachment); + else { + const char *local = local_name(name); + printf("Attachment:\t%s\n", local[0] == '/' ? local : ""); + } if (parent) printf("Local To:\t%s\n", parent->name); else