audit: update to 2.8.5.
This commit is contained in:
parent
3431f146e4
commit
33357dbf12
1
srcpkgs/audit/INSTALL.msg
Normal file
1
srcpkgs/audit/INSTALL.msg
Normal file
@ -0,0 +1 @@
|
|||||||
|
python-audit is no longer provided by Void Linux, and will be fully removed from the repos on 2019-06-19.
|
@ -1,158 +1,97 @@
|
|||||||
Source: Hoshpak, based on earlier work by doughdemon
|
From d579a08bb1cde71f939c13ac6b2261052ae9f77e Mon Sep 17 00:00:00 2001
|
||||||
Upstream: No
|
From: Steve Grubb <sgrubb@redhat.com>
|
||||||
Reason: musl compatibility
|
Date: Tue, 26 Feb 2019 18:33:33 -0500
|
||||||
From 81e3ac4db3e779f38e92cb9d9329db4cd76a8954 Mon Sep 17 00:00:00 2001
|
Subject: [PATCH] Add substitue functions for strndupa & rawmemchr
|
||||||
From: Helmut Pozimski <helmut@pozimski.eu>
|
|
||||||
Date: Fri, 21 Sep 2018 20:22:47 +0200
|
|
||||||
Subject: [PATCH] conditionally switch to alternatives for strndupa and
|
|
||||||
rawmemchr for non-glibc libcs
|
|
||||||
|
|
||||||
---
|
diff --git auparse/auparse.c auparse/auparse.c
|
||||||
auparse/auparse.c | 17 +++++++++++++----
|
index 69127b7a..042ea2b0 100644
|
||||||
auparse/interpret.c | 4 ++++
|
|
||||||
src/auditd.c | 7 ++++++-
|
|
||||||
src/ausearch-lol.c | 16 ++++++++++++----
|
|
||||||
4 files changed, 35 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/auparse/auparse.c b/auparse/auparse.c
|
|
||||||
index 69127b7..9e444f6 100644
|
|
||||||
--- auparse/auparse.c
|
--- auparse/auparse.c
|
||||||
+++ auparse/auparse.c
|
+++ auparse/auparse.c
|
||||||
@@ -1126,10 +1126,19 @@ static int extract_timestamp(const char *b, au_event_t *e)
|
@@ -1119,6 +1119,16 @@ static int str2event(char *s, au_event_t *e)
|
||||||
int rc = 1;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
e->host = NULL;
|
+#ifndef HAVE_STRNDUPA
|
||||||
- if (*b == 'n')
|
+static inline char *strndupa(const char *old, size_t n)
|
||||||
- tmp = strndupa(b, 340);
|
+{
|
||||||
- else
|
+ size_t len = strnlen(old, n);
|
||||||
- tmp = strndupa(b, 80);
|
+ char *tmp = alloca(len + 1);
|
||||||
+ #ifdef __GLIBC__
|
+ tmp[len] = 0;
|
||||||
+ tmp = alloca(340);
|
+ return memcpy(tmp, old, len);
|
||||||
+ if (*b == 'n')
|
+}
|
||||||
+ tmp = strndupa(b, 340);
|
+#endif
|
||||||
+ else
|
+
|
||||||
+ tmp = strndupa(b, 80);
|
/* Returns 0 on success and 1 on error */
|
||||||
+ #else
|
static int extract_timestamp(const char *b, au_event_t *e)
|
||||||
+ tmp = alloca(340);
|
{
|
||||||
+ if (*b == 'n')
|
diff --git auparse/interpret.c auparse/interpret.c
|
||||||
+ tmp = strncpy(tmp, b, 340);
|
index 88523c6d..f19ee854 100644
|
||||||
+ else
|
|
||||||
+ tmp = strncpy(tmp, b, 80);
|
|
||||||
+ #endif
|
|
||||||
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 4783d86..d779fc7 100644
|
|
||||||
--- auparse/interpret.c
|
--- auparse/interpret.c
|
||||||
+++ auparse/interpret.c
|
+++ auparse/interpret.c
|
||||||
@@ -864,7 +864,11 @@ static const char *print_proctitle(const char *val)
|
@@ -855,6 +855,13 @@ static const char *print_escaped_ext(const idata *id)
|
||||||
|
return print_escaped(id->val);
|
||||||
|
}
|
||||||
|
|
||||||
|
+// rawmemchr is faster. Let's use it if we have it.
|
||||||
|
+#ifdef HAVE_RAWMEMCHR
|
||||||
|
+#define STRCHR rawmemchr
|
||||||
|
+#else
|
||||||
|
+#define STRCHR strchr
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
static const char *print_proctitle(const char *val)
|
||||||
|
{
|
||||||
|
char *out = (char *)print_escaped(val);
|
||||||
|
@@ -865,7 +872,7 @@ static const char *print_proctitle(const char *val)
|
||||||
// Proctitle has arguments separated by NUL bytes
|
// Proctitle has arguments separated by NUL bytes
|
||||||
// We need to write over the NUL bytes with a space
|
// We need to write over the NUL bytes with a space
|
||||||
// so that we can see the arguments
|
// so that we can see the arguments
|
||||||
+ #ifdef __GLIBC__
|
- while ((ptr = rawmemchr(ptr, '\0'))) {
|
||||||
while ((ptr = rawmemchr(ptr, '\0'))) {
|
+ while ((ptr = STRCHR(ptr, '\0'))) {
|
||||||
+ #else
|
|
||||||
+ while (ptr < end) {
|
|
||||||
+ #endif
|
|
||||||
if (ptr >= end)
|
if (ptr >= end)
|
||||||
break;
|
break;
|
||||||
*ptr = ' ';
|
*ptr = ' ';
|
||||||
diff --git a/src/auditd.c b/src/auditd.c
|
diff --git configure.ac configure.ac
|
||||||
index 4939b5a..8ad08d8 100644
|
index acd6d615..00658d4f 100644
|
||||||
--- src/auditd.c
|
--- configure.ac
|
||||||
+++ src/auditd.c
|
+++ configure.ac
|
||||||
@@ -224,7 +224,12 @@ static int extract_type(const char *str)
|
@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-remote
|
||||||
// ptr should be at 't'
|
AC_CHECK_FUNCS([posix_fallocate])
|
||||||
ptr2 = strchr(ptr, ' ');
|
dnl; signalfd is needed for libev
|
||||||
// get type=xxx in a buffer
|
AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ])
|
||||||
- tptr = strndupa(ptr, ptr2 - ptr);
|
+dnl; check if rawmemchr is available
|
||||||
+ #ifdef __GLIBC__
|
+AC_CHECK_FUNCS([rawmemchr])
|
||||||
+ tptr = strndupa(ptr, ptr2 - ptr);
|
+dnl; check if strndupa is available
|
||||||
+ #else
|
+AC_LINK_IFELSE(
|
||||||
+ tptr = alloca(ptr2 - ptr);
|
+ [AC_LANG_SOURCE(
|
||||||
+ tptr = strncpy(tptr, ptr, ptr2 - ptr);
|
+ [[
|
||||||
+ #endif
|
+ #define _GNU_SOURCE
|
||||||
// find =
|
+ #include <string.h>
|
||||||
str = strchr(tptr, '=');
|
+ int main() { (void) strndupa("test", 10); return 0; }]])],
|
||||||
if (str == NULL)
|
+ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])],
|
||||||
diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c
|
+ []
|
||||||
index ec6f453..51e7696 100644
|
+)
|
||||||
|
|
||||||
|
ALLWARNS=""
|
||||||
|
ALLDEBUG="-g"
|
||||||
|
diff --git src/ausearch-lol.c src/ausearch-lol.c
|
||||||
|
index bebbcf4b..0babd517 100644
|
||||||
--- src/ausearch-lol.c
|
--- src/ausearch-lol.c
|
||||||
+++ src/ausearch-lol.c
|
+++ src/ausearch-lol.c
|
||||||
@@ -160,10 +160,18 @@ static int extract_timestamp(const char *b, event *e)
|
@@ -152,6 +152,16 @@ static int compare_event_time(event *e1, event *e2)
|
||||||
char *ptr, *tmp, *tnode, *ttype;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
e->node = NULL;
|
+#ifndef HAVE_STRNDUPA
|
||||||
- if (*b == 'n')
|
+static inline char *strndupa(const char *old, size_t n)
|
||||||
- tmp = strndupa(b, 340);
|
+{
|
||||||
- else
|
+ size_t len = strnlen(old, n);
|
||||||
- tmp = strndupa(b, 80);
|
+ char *tmp = alloca(len + 1);
|
||||||
+ #ifdef __GLIBC__
|
+ tmp[len] = 0;
|
||||||
+ if (*b == 'n')
|
+ return memcpy(tmp, old, len);
|
||||||
+ tmp = strndupa(b, 340);
|
+}
|
||||||
+ else
|
+#endif
|
||||||
+ tmp = strndupa(b, 80);
|
+
|
||||||
+ #else
|
/*
|
||||||
+ tmp = alloca(340);
|
* This function will look at the line and pick out pieces of it.
|
||||||
+ if (*b == 'n')
|
*/
|
||||||
+ tmp = strncpy(tmp, b, 340);
|
|
||||||
+ else
|
|
||||||
+ tmp = strncpy(tmp, b, 80);
|
|
||||||
+ #endif
|
|
||||||
ptr = audit_strsplit(tmp);
|
|
||||||
if (ptr) {
|
|
||||||
// Check to see if this is the node info
|
|
||||||
--
|
|
||||||
2.19.0
|
|
||||||
|
|
||||||
From ca1590b95b3f786ca11f165656c31e525359e19c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helmut Pozimski <helmut@pozimski.eu>
|
|
||||||
Date: Fri, 21 Sep 2018 20:44:18 +0200
|
|
||||||
Subject: [PATCH 2/2] replace usage of pthread_yield with sched_yield
|
|
||||||
|
|
||||||
---
|
|
||||||
audisp/plugins/zos-remote/zos-remote-queue.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/audisp/plugins/zos-remote/zos-remote-queue.c b/audisp/plugins/zos-remote/zos-remote-queue.c
|
|
||||||
index 8071dca..d5e30dd 100644
|
|
||||||
--- audisp/plugins/zos-remote/zos-remote-queue.c
|
|
||||||
+++ audisp/plugins/zos-remote/zos-remote-queue.c
|
|
||||||
@@ -77,7 +77,7 @@ retry:
|
|
||||||
pthread_mutex_unlock(&queue_lock);
|
|
||||||
} else {
|
|
||||||
pthread_mutex_unlock(&queue_lock);
|
|
||||||
- pthread_yield(); /* Let dequeue thread run to clear queue */
|
|
||||||
+ sched_yield(); /* Let dequeue thread run to clear queue */
|
|
||||||
retry_cnt++;
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.19.0
|
|
||||||
|
|
||||||
From 5c52c6c662f0a3ab3b2f7a45024ef7aee9a6999d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helmut Pozimski <helmut@pozimski.eu>
|
|
||||||
Date: Fri, 21 Sep 2018 21:24:56 +0200
|
|
||||||
Subject: [PATCH 3/3] change stdint include to import in auditswig.i to
|
|
||||||
accomodate compilation on musl
|
|
||||||
|
|
||||||
---
|
|
||||||
bindings/swig/src/auditswig.i | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i
|
|
||||||
index 356a5ab..8ad09da 100644
|
|
||||||
--- bindings/swig/src/auditswig.i
|
|
||||||
+++ bindings/swig/src/auditswig.i
|
|
||||||
@@ -41,6 +41,6 @@ typedef unsigned __u32;
|
|
||||||
typedef unsigned uid_t;
|
|
||||||
%include "/usr/include/linux/audit.h"
|
|
||||||
#define __extension__ /*nothing*/
|
|
||||||
-%include "/usr/include/stdint.h"
|
|
||||||
+%import "/usr/include/stdint.h"
|
|
||||||
%include "../lib/libaudit.h"
|
|
||||||
|
|
||||||
--
|
|
||||||
2.19.0
|
|
||||||
|
|
||||||
|
@ -1,33 +1,32 @@
|
|||||||
# Template file for 'audit'
|
# Template file for 'audit'
|
||||||
pkgname=audit
|
pkgname=audit
|
||||||
version=2.8.4
|
version=2.8.5
|
||||||
revision=2
|
revision=1
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--libdir=/usr/lib --enable-shared=audit --enable-gssapi-krb5
|
configure_args="--libdir=/usr/lib --enable-shared=audit --enable-gssapi-krb5
|
||||||
--with-apparmor --with-libcap-ng --with-python --with-python3"
|
--with-apparmor --with-libcap-ng --with-python3"
|
||||||
hostmakedepends="automake libtool pkg-config intltool python python3 swig"
|
hostmakedepends="automake libtool pkg-config intltool python3 swig"
|
||||||
makedepends="mit-krb5-devel libldap-devel libapparmor-devel libcap-ng-devel
|
makedepends="mit-krb5-devel libldap-devel libapparmor-devel libcap-ng-devel
|
||||||
python-devel python3-devel"
|
python3-devel"
|
||||||
make_dirs="/var/log/audit 0700 root root"
|
make_dirs="/var/log/audit 0700 root root"
|
||||||
short_desc="Linux Security Auditing Framework"
|
short_desc="Linux Security Auditing Framework"
|
||||||
maintainer="Cameron Nemo <camerontnorman@gmail.com>"
|
maintainer="Cameron Nemo <camerontnorman@gmail.com>"
|
||||||
license="GPL-2.0-or-later, LGPL-2.0-or-later"
|
license="GPL-2.0-or-later, LGPL-2.0-or-later"
|
||||||
homepage="https://people.redhat.com/sgrubb/audit"
|
homepage="https://people.redhat.com/sgrubb/audit"
|
||||||
distfiles="${homepage}/${pkgname}-${version}.tar.gz"
|
distfiles="${homepage}/${pkgname}-${version}.tar.gz"
|
||||||
checksum=a410694d09fc5708d980a61a5abcb9633a591364f1ecc7e97ad5daef9c898c38
|
checksum=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
|
||||||
|
|
||||||
if [ "$CROSS_BUILD" ]; then
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
pre_configure() {
|
*-musl) configure_args+=" --disable-zos-remote" ;;
|
||||||
sed -i "s;^PYINCLUDEDIR=.*;PYINCLUDEDIR=${XBPS_CROSS_BASE}/usr/include/python${py2_ver};" configure
|
*) ;;
|
||||||
}
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vinstall rules/10-base-config.rules 644 etc/audit/rules.d
|
vinstall rules/10-base-config.rules 644 etc/audit/rules.d
|
||||||
vmkdir usr/share/examples/audit/rules.d
|
vmkdir usr/share/examples/audit/rules.d
|
||||||
vcopy "rules/*" usr/share/examples/audit/rules.d
|
vcopy "rules/*" usr/share/examples/audit/rules.d
|
||||||
rm -rf "${DESTDIR}/etc/rc.d"
|
rm -rf -- "${DESTDIR}/etc/rc.d"
|
||||||
rm -rf "${DESTDIR}/etc/sysconfig"
|
rm -rf -- "${DESTDIR}/etc/sysconfig"
|
||||||
vsv auditd
|
vsv auditd
|
||||||
vsv auditctl
|
vsv auditctl
|
||||||
}
|
}
|
||||||
@ -85,12 +84,9 @@ libauparse-devel_package() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
python-audit_package() {
|
python-audit_package() {
|
||||||
lib32disabled=yes
|
archs=noarch
|
||||||
short_desc+=" - Python2 bindings"
|
build_style=meta
|
||||||
pycompile_module="audit.py"
|
short_desc+=" - Python2 bindings (removed package)"
|
||||||
pkg_install() {
|
|
||||||
vmove "usr/lib/python2*"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
python3-audit_package() {
|
python3-audit_package() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user