mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-04 08:15:21 +00:00
parser: Fix expansion of variables in unix rules addr= conditional
The parser is not treating unix addr as a path and filtering slashes
after variable expansion. This can lead to errors where
@{foo}=/a/
unix bind addr=@{foo}/bar,
will always fail because addr is being matched as /a//bar instead of
/a/bar.
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/607
Fixes: https://bugs.launchpad.net/apparmor/+bug/1856738
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 6af05006d9
)
This commit is contained in:
@@ -151,9 +151,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user