From 4090fef787f8769d6491851984fb70781950d865 Mon Sep 17 00:00:00 2001 From: r0man1an Date: Thu, 18 Jun 2026 00:28:29 +0200 Subject: [PATCH] apparmor: update to 4.1.7 --- .../apparmor/patches/fix_logprofconf.patch | 55 +------------- .../patches/libapparmor-basename.patch | 20 ------ srcpkgs/apparmor/patches/python3.13.patch | 72 ------------------- srcpkgs/apparmor/template | 19 ++--- 4 files changed, 13 insertions(+), 153 deletions(-) delete mode 100644 srcpkgs/apparmor/patches/libapparmor-basename.patch delete mode 100644 srcpkgs/apparmor/patches/python3.13.patch diff --git a/srcpkgs/apparmor/patches/fix_logprofconf.patch b/srcpkgs/apparmor/patches/fix_logprofconf.patch index 6a98bddc9af545..9e1b54480ffb66 100644 --- a/srcpkgs/apparmor/patches/fix_logprofconf.patch +++ b/srcpkgs/apparmor/patches/fix_logprofconf.patch @@ -1,65 +1,16 @@ modify logprof.conf for Void Linux - --- a/utils/logprof.conf +++ b/utils/logprof.conf -@@ -12,11 +12,11 @@ +@@ -12,10 +12,10 @@ [settings] profiledir = /etc/apparmor.d /etc/subdomain.d - inactive_profiledir = /usr/share/apparmor/extra-profiles + inactive_profiledir = /usr/share/apparmor/extra-profiles - logfiles = /var/log/audit/audit.log /var/log/syslog /var/log/messages + logfiles = /var/log/audit/audit.log /var/log/socklog/kernel/current /var/log/syslog /var/log/messages - parser = /sbin/apparmor_parser /sbin/subdomain_parser -+ parser = /usr/bin/apparmor_parser /usr/bin/subdomain_parser - ldd = /usr/bin/ldd - logger = /bin/logger /usr/bin/logger ++ parser = /usr/bin/apparmor_parser /usr/bin/subdomain_parser + logger = /usr/bin/logger # customize how file ownership permissions are presented - # 0 - off -@@ -38,27 +38,29 @@ - - [qualifiers] - # things will be painfully broken if bash has a profile -- /bin/bash = icnu -- /usr/bin/bash = icnu -- /bin/ksh = icnu -- /usr/bin/ksh = icnu -- /bin/dash = icnu -- /usr/bin/dash = icnu -- /bin/zsh = icnu -- /usr/bin/zsh = icnu -+ /bin/bash = icnu -+ /usr/bin/bash = icnu -+ /bin/ksh = icnu -+ /usr/bin/ksh = icnu -+ /bin/dash = icnu -+ /usr/bin/dash = icnu -+ /bin/zsh = icnu -+ /usr/bin/zsh = icnu -+ /bin/fish = icnu -+ /usr/bin/fish = icnu -+ /bin/ash = icnu -+ /usr/bin/ash = icnu -+ /bin/rc = icnu -+ /usr/bin/rc = icnu - - # these programs can't function if they're confined - /bin/mount = u - /usr/bin/mount = u - /etc/init.d/subdomain = u -- /sbin/cardmgr = u -- /usr/sbin/cardmgr = u -- /sbin/subdomain_parser = u -- /usr/sbin/subdomain_parser = u -- /usr/sbin/genprof = u -- /usr/sbin/logprof = u -- /usr/lib/YaST2/servers_non_y2/ag_genprof = u -- /usr/lib/YaST2/servers_non_y2/ag_logprof = u -+ /usr/bin/cardmgr = u -+ /usr/bin/subdomain_parser = u -+ /usr/bin/genprof = u -+ /usr/bin/logprof = u - - # these ones shouldn't have their own profiles - /bin/awk = icn diff --git a/srcpkgs/apparmor/patches/libapparmor-basename.patch b/srcpkgs/apparmor/patches/libapparmor-basename.patch deleted file mode 100644 index 7977d2c2f85fc9..00000000000000 --- a/srcpkgs/apparmor/patches/libapparmor-basename.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/libraries/libapparmor/testsuite/test_multi.c -+++ b/libraries/libapparmor/testsuite/test_multi.c -@@ -1,5 +1,3 @@ --#define _GNU_SOURCE /* for glibc's basename version */ -- - #include - #include - #include -@@ -7,6 +5,11 @@ - - #include - -+static const char *basename(const char *path) -+{ -+ return strrchr(path, '/') ? strrchr(path, '/')+1 : path; -+} -+ - int print_results(aa_log_record *record); - - int main(int argc, char **argv) diff --git a/srcpkgs/apparmor/patches/python3.13.patch b/srcpkgs/apparmor/patches/python3.13.patch deleted file mode 100644 index 1f4d85ce3fc923..00000000000000 --- a/srcpkgs/apparmor/patches/python3.13.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 434e34bb510b4cab04e64cd5b21d635c6be8c8ea Mon Sep 17 00:00:00 2001 -From: Mikko Rapeli -Date: Fri, 29 Nov 2024 13:46:32 +0000 -Subject: [PATCH] fail.py: handle missing cgitb - -It's no longer in python standard library starting -at version 3.13. Fixes: - -root@qemuarm64:~# aa-complain /etc/apparmor.d/* -Traceback (most recent call last): - File "/usr/sbin/aa-complain", line 18, in - from apparmor.fail import enable_aa_exception_handler - File "/usr/lib/python3.13/site-packages/apparmor/fail.py", line 12, in - import cgitb -ModuleNotFoundError: No module named 'cgitb' - -Signed-off-by: Mikko Rapeli ---- - utils/apparmor/fail.py | 25 +++++++++++++++---------- - 1 file changed, 15 insertions(+), 10 deletions(-) - -diff --git a/utils/apparmor/fail.py b/utils/apparmor/fail.py -index ece6efc43..a71ceb66a 100644 ---- a/utils/apparmor/fail.py -+++ b/utils/apparmor/fail.py -@@ -8,7 +8,11 @@ - # - # ------------------------------------------------------------------ - --import cgitb -+try: -+ import cgitb -+except ImportError: -+ cgitb = None -+ pass - import sys - import traceback - from tempfile import NamedTemporaryFile -@@ -32,20 +36,21 @@ def handle_exception(*exc_info): - print('', file=sys.stderr) - error(ex.value) - else: -- with NamedTemporaryFile('w', prefix='apparmor-bugreport-', suffix='.txt', delete=False) as file: -- cgitb_hook = cgitb.Hook(display=1, file=file, format='text', context=10) -- cgitb_hook.handle(exc_info) -- -- file.write('Please consider reporting a bug at https://gitlab.com/apparmor/apparmor/-/issues\n') -- file.write('and attach this file.\n') -+ if cgitb: -+ with NamedTemporaryFile('w', prefix='apparmor-bugreport-', suffix='.txt', delete=False) as file: -+ cgitb_hook = cgitb.Hook(display=1, file=file, format='text', context=10) -+ cgitb_hook.handle(exc_info) -+ file.write('Please consider reporting a bug at https://gitlab.com/apparmor/apparmor/-/issues\n') -+ file.write('and attach this file.\n') - - print(''.join(traceback.format_exception(*exc_info)), file=sys.stderr) -- print('', file=sys.stderr) - print('An unexpected error occurred!', file=sys.stderr) - print('', file=sys.stderr) -- print('For details, see %s' % file.name, file=sys.stderr) -+ if cgitb: -+ print('For details, see %s' % file.name, file=sys.stderr) - print('Please consider reporting a bug at https://gitlab.com/apparmor/apparmor/-/issues', file=sys.stderr) -- print('and attach this file.', file=sys.stderr) -+ if cgitb: -+ print('and attach this file.', file=sys.stderr) - - - def enable_aa_exception_handler(): --- -GitLab - diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template index bef91ada3fd568..71e38441041608 100644 --- a/srcpkgs/apparmor/template +++ b/srcpkgs/apparmor/template @@ -1,15 +1,14 @@ # Template file for 'apparmor' pkgname=apparmor -reverts="4.0.2_1" -version=3.1.7 -revision=6 +version=4.1.7 +revision=1 build_wrksrc=libraries/libapparmor build_style=gnu-configure conf_files="/etc/apparmor.d/local/* /etc/apparmor/*" make_dirs="/etc/apparmor.d/disable 0755 root root" configure_args="$(vopt_with python) $(vopt_with perl)" hostmakedepends="bison flex gettext python3 which python3-setuptools pkg-config - perl $(vopt_if python swig)" + perl autoconf-archive automake libtool python3-packaging-bootstrap $(vopt_if python swig)" makedepends="$(vopt_if python python3-devel)" depends="runit-void-apparmor libapparmor-${version}_${revision} python3-notify2 python3-psutil python3-dbus iproute2" @@ -19,8 +18,8 @@ maintainer="Orphaned " license="GPL-2.0-only" homepage="https://gitlab.com/apparmor/apparmor" changelog="https://gitlab.com/apparmor/apparmor/-/wikis/Release_Notes_${version}" -distfiles="https://launchpad.net/apparmor/${version%.*}/${version}/+download/apparmor-${version}.tar.gz" -checksum=c6c161d6dbd99c2f10758ff347cbc6848223c7381f311de62522f22b0a16de64 +distfiles="https://gitlab.com/apparmor/apparmor/-/archive/v${version}/apparmor-v${version}.tar.gz" +checksum=ded4cd419b8a05002a108a0912208e2098695752664c6a59464d2dda418e0452 replaces="apparmor-vim>=0" # /usr/lib/perl5/core_perl/CORE/perl.h:3360:22: error: unknown type name 'off64_t'; @@ -39,6 +38,11 @@ if [ -z "$CROSS_BUILD" ]; then build_options_default+=" perl" fi +pre_configure() { + cd ${wrksrc}/libraries/libapparmor + autoreconf -fiv +} + pre_build() { # Replace release profiles with our own cd ${wrksrc} @@ -72,9 +76,6 @@ post_install() { rm -f ${DESTDIR}/usr/bin/aa-notify fi - # we installed a custom conflicting profile - rm ${DESTDIR}/etc/apparmor.d/{,local/}php-fpm - vinstall utils/aa-notify.desktop 644 usr/share/applications vdoc "${FILESDIR}/README.voidlinux" }