Skip to contentSkip to conversation

Backport patches from upstream to fix build with musl

PATCH New [email protected] 1 participant 1 message Feb 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Backport patches from upstream to fix build with musl

From: Luca Boccassi <[email protected]>

Audit 2.8.4 fails to build with musl. The fixes have been committed to the upstream master branch and can be backported. Building with glibc is unaffected.

---
 ...dupa-as-suggested-in-pull-request-25.patch |  47 ++++++
 ...tue-functions-for-strndupa-rawmemchr.patch | 134 ++++++++++++++++++
 recipes-security/audit/audit_2.8.4.bb         |   2 +
 3 files changed, 183 insertions(+)
 create mode 100644 recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch
 create mode 100644 recipes-security/audit/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch
recipes-security/audit/audit/0001-Remove-strdupa-as-suggested-in-pull-request-25.patch new file +47 -0
new file mode 100644
index 0000000..38029aa
@@ -0,0 +1,47 @@
+From a1782b58b687b74249dc8b2411a3f646b821ebd6 Mon Sep 17 00:00:00 2001
+From: Steve Grubb <[email protected]>
+Date: Thu, 4 Oct 2018 08:45:47 -0400
+Subject: [PATCH] Remove strdupa as suggested in pull request #25
+
+---
+ src/auditd.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+Origin: https://github.com/linux-audit/audit-userspace/commit/a1782b58b687b74249dc8b2411a3f646b821ebd6
+Applied-Upstream: yes
+
+diff --git a/src/auditd.c b/src/auditd.c
+index b0952db..c826ec0 100644
+--- a/src/auditd.c
++++ b/src/auditd.c
+@@ -209,21 +209,22 @@ static void cont_handler(struct ev_loop *loop, struct ev_signal *sig,
+ 
+ static int extract_type(const char *str)
+ {
+-	const char *tptr, *ptr2, *ptr = str;
++	const char *ptr2, *ptr = str;
+ 	if (*str == 'n') {
+ 		ptr = strchr(str+1, ' ');
+ 		if (ptr == NULL)
+ 			return -1; // Malformed - bomb out
+ 		ptr++;
+ 	}
++
+ 	// ptr should be at 't'
+ 	ptr2 = strchr(ptr, ' ');
+-	// get type=xxx in a buffer
+-	tptr = strndupa(ptr, ptr2 - ptr);
++
+ 	// find =
+-	str = strchr(tptr, '=');
+-	if (str == NULL)
++	str = strchr(ptr, '=');
++	if (str == NULL || str >= ptr2)
+ 		return -1; // Malformed - bomb out
++
+ 	// name is 1 past
+ 	str++;
+ 	return audit_name_to_msg_type(str);
+-- 
+2.20.1
+
recipes-security/audit/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch new file +134 -0

134 lines not on this page · raw message

recipes-security/audit/audit_2.8.4.bb +2 -0
index c756552..c29bb74 100644
@@ -11,6 +11,8 @@ SRC_URI = "http://people.redhat.com/sgrubb/${BPN}/${BPN}-${PV}.tar.gz \
            file://audit-python-configure.patch \
            file://audit-python.patch \
            file://fix-swig-host-contamination.patch \
+           file://0001-Remove-strdupa-as-suggested-in-pull-request-25.patch \
+           file://0002-Add-substitue-functions-for-strndupa-rawmemchr.patch \
            file://auditd \
            file://auditd.service \
            file://audit-volatile.conf \
Signature · 1 line
2.20.1