From 8b3765b49c27a009c99e2aa47c85cf3e84ce86ec Mon Sep 17 00:00:00 2001 From: Mihail Ivanchev Date: Sun, 2 Jun 2024 22:28:22 +0200 Subject: [PATCH] audit: update to 3.1.4 --- srcpkgs/audit/patches/strndupa.patch | 64 ++++++++++++++++++++++++++++ srcpkgs/audit/template | 6 +-- 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/audit/patches/strndupa.patch diff --git a/srcpkgs/audit/patches/strndupa.patch b/srcpkgs/audit/patches/strndupa.patch new file mode 100644 index 00000000000000..dcd7f6330d4cf3 --- /dev/null +++ b/srcpkgs/audit/patches/strndupa.patch @@ -0,0 +1,64 @@ +diff --git a/auparse/auparse.c b/auparse/auparse.c +index 20ebe4f8..ab3d3189 100644 +--- a/auparse/auparse.c ++++ b/auparse/auparse.c +@@ -1224,12 +1224,23 @@ static int extract_timestamp(const char *b, au_event_t *e) + { + char *ptr, *tmp; + int rc = 1; ++ size_t len; + + e->host = NULL; +- if (*b == 'n') +- tmp = strndupa(b, 340); +- else +- tmp = strndupa(b, 80); ++ if (*b == 'n') { ++ /* tmp = strndupa(b, 340); */ ++ len = strnlen(b, 340); ++ tmp = alloca(len + 1); ++ tmp[len] = 0; ++ memcpy(tmp, b, len); ++ } ++ else { ++ /* tmp = strndupa(b, 80); */ ++ len = strnlen(b, 80); ++ tmp = alloca(len + 1); ++ tmp[len] = 0; ++ memcpy(tmp, b, len); ++ } + ptr = audit_strsplit(tmp); + if (ptr) { + // Optionally grab the node - may or may not be included +diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c +index 9893afb0..4695817e 100644 +--- a/src/ausearch-lol.c ++++ b/src/ausearch-lol.c +@@ -178,12 +178,23 @@ static inline char *strndupa(const char *old, size_t n) + static int extract_timestamp(const char *b, event *e) + { + char *ptr, *tmp, *tnode, *ttype; ++ size_t len; + + e->node = NULL; +- if (*b == 'n') +- tmp = strndupa(b, 340); +- else +- tmp = strndupa(b, 80); ++ if (*b == 'n') { ++ /* tmp = strndupa(b, 340); */ ++ len = strnlen(b, 340); ++ tmp = alloca(len + 1); ++ tmp[len] = 0; ++ memcpy(tmp, b, len); ++ } ++ else { ++ /* tmp = strndupa(b, 80); */ ++ len = strnlen(b, 80); ++ tmp = alloca(len + 1); ++ tmp[len] = 0; ++ memcpy(tmp, b, len); ++ } + ptr = audit_strsplit(tmp); + if (ptr) { + // Check to see if this is the node info diff --git a/srcpkgs/audit/template b/srcpkgs/audit/template index 63913bc07c31b6..eb181d4083aa26 100644 --- a/srcpkgs/audit/template +++ b/srcpkgs/audit/template @@ -1,7 +1,7 @@ # Template file for 'audit' pkgname=audit -version=3.0.3 -revision=6 +version=3.1.4 +revision=1 build_style=gnu-configure configure_args="--libdir=/usr/lib --enable-shared=audit --enable-gssapi-krb5 --with-apparmor --with-libcap-ng --with-python3" @@ -15,7 +15,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later" homepage="https://people.redhat.com/sgrubb/audit" changelog="https://raw.githubusercontent.com/linux-audit/audit-userspace/master/ChangeLog" distfiles="${homepage}/${pkgname}-${version}.tar.gz" -checksum=23777e1dc9a80a2ee06a4d442a6a0a9bcbf1ae7ee4b5738a220ff619738cc904 +checksum=220a78cf35e6a7c57f42fcfc42b759692641c7e8e0e39c9844fbc0aa51783631 case "$XBPS_TARGET_MACHINE" in *-musl) configure_args+=" --disable-zos-remote" ;;