From af1eec118e760a692dc0b525dcb586ec925389741aa9636ba8401ff4f3930d4c Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 8 May 2022 13:58:25 +0000 Subject: [PATCH] Accepting request 975634 from home:bnavigator:branches:security:apparmor - Add python310-help-mr848.patch so that Tumbleweed can switch python3 to Python 3.10 (https://gitlab.com/apparmor/apparmor/-/merge_requests/848) OBS-URL: https://build.opensuse.org/request/show/975634 OBS-URL: https://build.opensuse.org/package/show/security:apparmor/apparmor?expand=0&rev=332 --- apparmor.changes | 7 +++++ apparmor.spec | 4 +++ python310-help-mr848.patch | 57 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 python310-help-mr848.patch diff --git a/apparmor.changes b/apparmor.changes index 4ca616e..e3869dd 100644 --- a/apparmor.changes +++ b/apparmor.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun May 8 13:25:28 UTC 2022 - Ben Greiner + +- Add python310-help-mr848.patch so that Tumbleweed can switch + python3 to Python 3.10 + (https://gitlab.com/apparmor/apparmor/-/merge_requests/848) + ------------------------------------------------------------------- Fri Apr 29 11:48:14 UTC 2022 - Christian Boltz diff --git a/apparmor.spec b/apparmor.spec index 9fc589d..77aea6e 100644 --- a/apparmor.spec +++ b/apparmor.spec @@ -103,6 +103,9 @@ Patch11: samba-new-dcerpcd.patch # allow php8 php-fpm to read its config (from upstream master+3.0 https://gitlab.com/apparmor/apparmor/-/merge_requests/876) Patch12: php8-fpm-mr876.patch +# allow python 3.10 --help output (from the branch-3.0 backport of https://gitlab.com/apparmor/apparmor/-/merge_requests/848) +Patch13: python310-help-mr848.patch + PreReq: sed BuildRoot: %{_tmppath}/%{name}-%{version}-build %define apparmor_bin_prefix %{?usrmerged:/usr}/lib/apparmor @@ -373,6 +376,7 @@ mv -v profiles/apparmor.d/usr.lib.apache2.mpm-prefork.apache2 profiles/apparmor/ %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build %define _lto_cflags %{nil} diff --git a/python310-help-mr848.patch b/python310-help-mr848.patch new file mode 100644 index 0000000..6683f1b --- /dev/null +++ b/python310-help-mr848.patch @@ -0,0 +1,57 @@ +From 8a21472175501823303a8af270bd38a60ff4ac9c Mon Sep 17 00:00:00 2001 +From: John Johansen +Date: Tue, 15 Feb 2022 19:17:30 +0000 +Subject: [PATCH] Merge make test-aa-notify test_help_contents () less strict + +Python 3.10 generates a slightly different --help output. + +Fixes https://gitlab.com/apparmor/apparmor/-/issues/220 + +Closes #220 +MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/848 +Acked-by: Approved-by: John Johansen +Merged-by: John Johansen + +(cherry picked from commit ba14227bb51a76b416a8da46c241a8d07506badc) +Signed-off-by: John Johansen +--- + utils/test/test-aa-notify.py | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/utils/test/test-aa-notify.py b/utils/test/test-aa-notify.py +index 2484c7f97..cfb5fa5a8 100644 +--- a/utils/test/test-aa-notify.py ++++ b/utils/test/test-aa-notify.py +@@ -148,13 +148,15 @@ Feb 4 13:40:38 XPS-13-9370 kernel: [128552.880347] audit: type=1400 audit({epoc + '''Test output of help text''' + + expected_return_code = 0 +- expected_output_is = \ ++ expected_output_1 = \ + '''usage: aa-notify [-h] [-p] [--display DISPLAY] [-f FILE] [-l] [-s NUM] [-v] + [-u USER] [-w NUM] [--debug] + + Display AppArmor notifications or messages for DENIED entries. ++''' + +-optional arguments: ++ expected_output_2 = \ ++''' + -h, --help show this help message and exit + -p, --poll poll AppArmor logs and display notifications + --display DISPLAY set the DISPLAY environment variable (might be needed if +@@ -174,8 +176,9 @@ optional arguments: + return_code, output = cmd([aanotify_bin, '--help']) + result = 'Got return code %d, expected %d\n' % (return_code, expected_return_code) + self.assertEqual(expected_return_code, return_code, result + output) +- result = 'Got output "%s", expected "%s"\n' % (output, expected_output_is) +- self.assertEqual(expected_output_is, output, result + output) ++ ++ self.assertIn(expected_output_1, output) ++ self.assertIn(expected_output_2, output) + + def test_entries_since_100_days(self): + '''Test showing log entries since 100 days''' +-- +GitLab +