Skip to content

Commit

Permalink
apparmor: update to 3.0.13
Browse files Browse the repository at this point in the history
Use PKG_SOURCE_PROTO for smaller tarballs.

Removed upstreamed patches

Backport basename patch for musl compatibility.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Oct 30, 2024
1 parent 4a55b26 commit 22ad5d8
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 417 deletions.
14 changes: 7 additions & 7 deletions utils/apparmor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=apparmor
PKG_VERSION:=3.0.3
PKG_RELEASE:=6
PKG_VERSION:=3.0.13
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gitlab.com/apparmor/apparmor/-/archive/v$(PKG_VERSION)
PKG_HASH:=66db49cc578e6a85ba2fc350507ad1741d2534cdfc7ed71a81261f84d6e2262d
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE_URL:=https://gitlab.com/apparmor/apparmor
PKG_MIRROR_HASH:=0f47852e1559607c2e62919a781d2f8226acbdb0df00b025be7ebc79e5c9bc8b

PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>

PKG_BUILD_DEPENDS:=swig/host python-setuptools-scm/host

Expand Down
2 changes: 1 addition & 1 deletion utils/apparmor/patches/020-remove-which-dep.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>

--- a/utils/aa-unconfined
+++ b/utils/aa-unconfined
@@ -116,7 +116,7 @@ def read_proc_current(filename):
@@ -125,7 +125,7 @@ def escape_special_chars(data):
pids = set()
if paranoid:
pids = get_all_pids()
Expand Down
4 changes: 2 additions & 2 deletions utils/apparmor/patches/030-systemd.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/parser/Makefile
+++ b/parser/Makefile
@@ -351,7 +351,7 @@ install-redhat:
@@ -361,7 +361,7 @@ install-redhat:
install -m 755 rc.apparmor.$(subst install-,,$@) $(DESTDIR)/etc/init.d/apparmor

.PHONY: install-suse
Expand All @@ -9,7 +9,7 @@
install -m 755 -d $(SBINDIR)
ln -sf service $(SBINDIR)/rcapparmor

@@ -414,14 +414,6 @@ install-indep: indep
@@ -425,14 +425,6 @@ install-indep: indep
$(MAKE) -C po install NAME=${NAME} DESTDIR=${DESTDIR}
$(MAKE) install_manpages DESTDIR=${DESTDIR}

Expand Down
4 changes: 2 additions & 2 deletions utils/apparmor/patches/050-disable-man-pages.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
install-arch: arch
--- a/parser/Makefile
+++ b/parser/Makefile
@@ -195,7 +195,7 @@ extra_docs: pdf
@@ -197,7 +197,7 @@ extra_docs: pdf
indep: docs
$(Q)$(MAKE) -C po all

Expand All @@ -29,7 +29,7 @@

.PHONY: coverage
coverage:
@@ -396,7 +396,6 @@ endif
@@ -406,7 +406,6 @@ endif

.PHONY: install
install:
Expand Down
36 changes: 36 additions & 0 deletions utils/apparmor/patches/070-basename.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 7fb040bde69ebdfce48cf1a01c1a62fd4f8eef0a Mon Sep 17 00:00:00 2001
From: Jules Maselbas <jmaselbas@zdiv.net>
Date: Thu, 16 May 2024 12:01:00 +0200
Subject: [PATCH] libapparamor: Define a portable version of gnu basename

Since musl 1.2.5, basename(3) prototype is only provided in libgen.h
(as mandated by POSIX) and not in strings.h. Also there is a major
difference between the gnu basename and the one defined in libgen.h,
the latter modify the argument string making them incompatible.

Fix this by defining a portable version of basename using strchr.
---
libraries/libapparmor/testsuite/test_multi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -7,6 +5,12 @@

#include <aalogparse.h>

+static const char *basename(const char *path)
+{
+ const char *p = strrchr(path, '/');
+ return p ? p + 1 : path;
+}
+
int print_results(aa_log_record *record);

int main(int argc, char **argv)
81 changes: 0 additions & 81 deletions utils/apparmor/patches/070-python-3.10.patch

This file was deleted.

This file was deleted.

Loading

0 comments on commit 22ad5d8

Please sign in to comment.