mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 22:35:35 +00:00
set_profile_flags(): allow named profiles without attachment
Named profiles can come without an attachment path specified, for example profile foo {...} This patch fixes set_profile_flags() to actually allow that instead of erroring out. References: - https://bugzilla.opensuse.org/show_bug.cgi?id=1096269 comment #3 and #4 - https://bugs.launchpad.net/apparmor/+bug/1775591
This commit is contained in:
@@ -674,7 +674,8 @@ def set_profile_flags(prof_filename, program, newflags):
|
||||
if (matches['attachment'] is not None):
|
||||
profile_glob = AARE(matches['attachment'], True)
|
||||
else:
|
||||
profile_glob = AARE(matches['profile'], True)
|
||||
profile_glob = AARE(matches['profile'], False) # named profiles can come without an attachment path specified ("profile foo {...}")
|
||||
|
||||
if (program is not None and profile_glob.match(program)) or program is None or program == matches['profile']:
|
||||
found = True
|
||||
if program is not None and program != profile:
|
||||
|
Reference in New Issue
Block a user