aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Ressel <aranea@aixah.de>2017-11-13 07:33:01 +0100
committerAnthony G. Basile <blueness@gentoo.org>2017-11-13 04:44:43 -0500
commit69d51c8245bd290d210f71ac5412bed7e3a82161 (patch)
treea19829e2e1a797ce080ff81602bd527267e33ba2 /sys-process/audit
parentsys-process/audit: Import from ::gentoo (diff)
downloadmusl-69d51c8245bd290d210f71ac5412bed7e3a82161.tar.gz
musl-69d51c8245bd290d210f71ac5412bed7e3a82161.tar.bz2
musl-69d51c8245bd290d210f71ac5412bed7e3a82161.zip
sys-process/audit: Add patch for musl
Diffstat (limited to 'sys-process/audit')
-rw-r--r--sys-process/audit/audit-2.6.4.ebuild1
-rw-r--r--sys-process/audit/audit-2.7.1.ebuild1
-rw-r--r--sys-process/audit/files/audit-2.7.1-musl.patch173
3 files changed, 175 insertions, 0 deletions
diff --git a/sys-process/audit/audit-2.6.4.ebuild b/sys-process/audit/audit-2.6.4.ebuild
index e83cf86..d4ecbd3 100644
--- a/sys-process/audit/audit-2.6.4.ebuild
+++ b/sys-process/audit/audit-2.6.4.ebuild
@@ -35,6 +35,7 @@ pkg_setup() {
}
src_prepare() {
+ eapply "${FILESDIR}/${PN}-2.7.1-musl.patch"
eapply_user
# Do not build GUI tools
diff --git a/sys-process/audit/audit-2.7.1.ebuild b/sys-process/audit/audit-2.7.1.ebuild
index 85a1f9a..3886ae6 100644
--- a/sys-process/audit/audit-2.7.1.ebuild
+++ b/sys-process/audit/audit-2.7.1.ebuild
@@ -35,6 +35,7 @@ pkg_setup() {
}
src_prepare() {
+ eapply "${FILESDIR}/${P}-musl.patch"
eapply_user
# Do not build GUI tools
diff --git a/sys-process/audit/files/audit-2.7.1-musl.patch b/sys-process/audit/files/audit-2.7.1-musl.patch
new file mode 100644
index 0000000..099f985
--- /dev/null
+++ b/sys-process/audit/files/audit-2.7.1-musl.patch
@@ -0,0 +1,173 @@
+From db5c09f7995a27555a10418648d9dc7e1e8bb94b Mon Sep 17 00:00:00 2001
+From: Luis Ressel <aranea@aixah.de>
+Date: Mon, 13 Nov 2017 07:33:35 +0100
+Subject: [PATCH] Musl compability
+
+A couple of header fixes, one occurrence of rawmemchr() and three of
+strndupa().
+---
+ audisp/audispd.c | 4 +++-
+ auparse/auparse.c | 13 +++++++++++--
+ auparse/interpret.c | 2 +-
+ lib/libaudit.c | 2 +-
+ lib/netlink.c | 2 +-
+ src/auditctl.c | 1 +
+ src/auditd.c | 9 +++++++--
+ src/ausearch-lol.c | 13 +++++++++++--
+ 8 files changed, 36 insertions(+), 10 deletions(-)
+
+diff --git a/audisp/audispd.c b/audisp/audispd.c
+index 9831cf3..0720814 100644
+--- a/audisp/audispd.c
++++ b/audisp/audispd.c
+@@ -31,7 +31,9 @@
+ #include <pthread.h>
+ #include <dirent.h>
+ #include <fcntl.h>
+-#include <sys/poll.h>
++#include <limits.h>
++#include <poll.h>
++#include <sys/uio.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
+
+diff --git a/auparse/auparse.c b/auparse/auparse.c
+index 2812028..a5d8c9e 100644
+--- a/auparse/auparse.c
++++ b/auparse/auparse.c
+@@ -1090,10 +1090,19 @@ static int extract_timestamp(const char *b, au_event_t *e)
+ int rc = 1;
+
+ e->host = NULL;
++ char _tmp[341];
+ if (*b == 'n')
+- tmp = strndupa(b, 340);
++ {
++ strncpy(_tmp, b, 340);
++ _tmp[340] = '\0';
++ tmp = _tmp;
++ }
+ else
+- tmp = strndupa(b, 80);
++ {
++ strncpy(_tmp, b, 80);
++ _tmp[80] = '\0';
++ tmp = _tmp;
++ }
+ ptr = audit_strsplit(tmp);
+ if (ptr) {
+ // Optionally grab the node - may or may not be included
+diff --git a/auparse/interpret.c b/auparse/interpret.c
+index 071c4ef..ba38199 100644
+--- a/auparse/interpret.c
++++ b/auparse/interpret.c
+@@ -803,7 +803,7 @@ static const char *print_proctitle(const char *val)
+ size_t len = strlen(val) / 2;
+ const char *end = out + len;
+ char *ptr = out;
+- while ((ptr = rawmemchr(ptr, '\0'))) {
++ while ((ptr = memchr(ptr, '\0', SIZE_MAX))) {
+ if (ptr >= end)
+ break;
+ *ptr = ' ';
+diff --git a/lib/libaudit.c b/lib/libaudit.c
+index f434d4a..bd679a5 100644
+--- a/lib/libaudit.c
++++ b/lib/libaudit.c
+@@ -32,7 +32,7 @@
+ #include <pwd.h>
+ #include <grp.h>
+ #include <errno.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/utsname.h>
+ #include <sys/stat.h>
+ #include <fcntl.h> /* O_NOFOLLOW needs gnu defined */
+diff --git a/lib/netlink.c b/lib/netlink.c
+index 90c79b9..9486560 100644
+--- a/lib/netlink.c
++++ b/lib/netlink.c
+@@ -27,7 +27,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <time.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include "libaudit.h"
+ #include "private.h"
+
+diff --git a/src/auditctl.c b/src/auditctl.c
+index 81000ee..6415264 100644
+--- a/src/auditctl.c
++++ b/src/auditctl.c
+@@ -34,6 +34,7 @@
+ #include <sys/utsname.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <sys/select.h>
+ #include <libgen.h> /* For basename */
+ #include <limits.h> /* PATH_MAX */
+ #include "libaudit.h"
+diff --git a/src/auditd.c b/src/auditd.c
+index 3f0162d..535207d 100644
+--- a/src/auditd.c
++++ b/src/auditd.c
+@@ -30,6 +30,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <time.h>
++#include <alloca.h>
+ #include <sys/resource.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+@@ -185,7 +186,9 @@ static void child_handler2( int sig )
+
+ static int extract_type(const char *str)
+ {
+- const char *tptr, *ptr2, *ptr = str;
++ const char *ptr2, *ptr = str;
++ char *tptr;
++
+ if (*str == 'n') {
+ ptr = strchr(str+1, ' ');
+ if (ptr == NULL)
+@@ -195,7 +198,9 @@ static int extract_type(const char *str)
+ // ptr should be at 't'
+ ptr2 = strchr(ptr, ' ');
+ // get type=xxx in a buffer
+- tptr = strndupa(ptr, ptr2 - ptr);
++ tptr = (char *) alloca(ptr2 - ptr + 1);
++ strncpy(tptr, ptr, ptr2 - ptr);
++ tptr[ptr2 - ptr] = '\0';
+ // find =
+ str = strchr(tptr, '=');
+ if (str == NULL)
+diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c
+index b1aec06..bb9330d 100644
+--- a/src/ausearch-lol.c
++++ b/src/ausearch-lol.c
+@@ -135,10 +135,19 @@ static int extract_timestamp(const char *b, event *e)
+ char *ptr, *tmp, *tnode, *ttype;
+
+ e->node = NULL;
++ char _tmp[341];
+ if (*b == 'n')
+- tmp = strndupa(b, 340);
++ {
++ strncpy(_tmp, b, 340);
++ _tmp[340] = '\0';
++ tmp = _tmp;
++ }
+ else
+- tmp = strndupa(b, 80);
++ {
++ strncpy(_tmp, b, 80);
++ _tmp[80] = '\0';
++ tmp = _tmp;
++ }
+ ptr = audit_strsplit(tmp);
+ if (ptr) {
+ // Check to see if this is the node info
+--
+2.15.0
+