2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-30 13:58:22 +00:00

Merge branch 'cboltz-revert-cboltz-fix-complain-named-profiles-in-2.12' into 'apparmor-2.12'

Revert backporting cboltz-fix-complain-named-profiles to 2.12

See merge request apparmor/apparmor!186

Revert commit 995c0e96 in the 2.12 branch
set_profile_flags(): allow named profiles without attachment

See merge request apparmor/apparmor!142
This commit/fix is only needed in 2.13+ because of changes introduced in
2.13 (matching profile names with globs in aa-complain), and actually
breaks 2.12.
(The alternative is to backport the profile name glob matching to 2.12.)

Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen
2018-09-12 23:26:24 +00:00

View File

@@ -643,11 +643,6 @@ def change_profile_flags(prof_filename, program, flag, set_flag):
newflags = ', '.join(add_or_remove_flag(old_flags, flag, set_flag))
if profile == program or program is None:
profile_glob = AARE(matches['attachment'], True)
else:
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
header_data = {
'attachment': matches['attachment'] or '',