audit: update to 3.1.4

This commit is contained in:
Mihail Ivanchev 2024-06-02 22:28:22 +02:00 committed by classabbyamp
parent 6eceed3451
commit 27cb7ebedf
2 changed files with 67 additions and 3 deletions

View File

@ -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

View File

@ -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" ;;