diff --git a/parser/af_unix.cc b/parser/af_unix.cc index bd1972145..064de6c42 100644 --- a/parser/af_unix.cc +++ b/parser/af_unix.cc @@ -157,9 +157,11 @@ int unix_rule::expand_variables(void) error = expand_entry_variables(&addr); if (error) return error; + filter_slashes(addr); error = expand_entry_variables(&peer_addr); if (error) return error; + filter_slashes(peer_addr); return 0; } diff --git a/parser/parser.h b/parser/parser.h index 553643e18..aac2674be 100644 --- a/parser/parser.h +++ b/parser/parser.h @@ -402,6 +402,7 @@ extern int post_process_entry(struct cod_entry *entry); extern int process_policydb(Profile *prof); extern int process_policy_ents(Profile *prof); +extern void filter_slashes(char *path); /* parser_variable.c */ int expand_entry_variables(char **name); diff --git a/parser/parser_regex.c b/parser/parser_regex.c index f3052440f..fe8a63905 100644 --- a/parser/parser_regex.c +++ b/parser/parser_regex.c @@ -47,7 +47,7 @@ enum error_type { * that's a distinct namespace in linux) and trailing slashes. * NOTE: modifies in place the contents of the path argument */ -static void filter_slashes(char *path) +void filter_slashes(char *path) { char *sptr, *dptr; BOOL seen_slash = 0;