diff --git a/audit.spec b/audit.spec index 88d7bb2..86f5a67 100644 --- a/audit.spec +++ b/audit.spec @@ -2,7 +2,7 @@ Summary: User space tools for kernel auditing Name: audit Epoch: 1 Version: 3.0.1 -Release: 4 +Release: 5 License: GPLv2+ and LGPLv2+ URL: https://people.redhat.com/sgrubb/audit/ Source0: https://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz @@ -33,6 +33,9 @@ Patch21: backport-auditd.service-Restart-on-failure-ignoring-some-exit.p Patch22: backport-0001-In-auditd-close-the-logging-file-descriptor-when-log.patch Patch23: backport-0002-In-auditd-close-the-logging-file-descriptor-when-log.patch Patch24: audit-Add-sw64-architecture.patch +Patch25: backport-Make-IPX-packet-interpretation-dependent-on-the-ipx-.patch +Patch26: backport-audit-flex-array-workaround.patch +Patch27: backport-audit-undo-flex-array.patch BuildRequires: gcc swig libtool systemd kernel-headers >= 2.6.29 BuildRequires: openldap-devel krb5-devel libcap-ng-devel @@ -106,8 +109,36 @@ libauparse can be used by python3. %package_help %prep -%autosetup -n %{name}-%{version} -p1 +%setup -n %{name}-%{version} -q cp %{SOURCE1} . +cp /usr/include/linux/audit.h lib/ +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 autoreconf -f -i %build @@ -151,6 +182,11 @@ mv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir} touch -r ./audit.spec $RPM_BUILD_ROOT/etc/libaudit.conf touch -r ./audit.spec $RPM_BUILD_ROOT/usr/share/man/man5/libaudit.conf.5.gz +cur=`pwd` +cd $RPM_BUILD_ROOT +patch -p1 < %{PATCH27} +cd $cur + %delete_la %check @@ -368,6 +404,9 @@ fi %attr(644,root,root) %{_mandir}/man8/*.8.gz %changelog +* Mon Jan 16 2023 zhangguangzhi - 1:3.0.1-5 +- backport patch adapt to kernel 6.1 + * Wed Nov 23 2022 zhangguangzhi - 1:3.0.1-4 - del golang_arches for check diff --git a/backport-Make-IPX-packet-interpretation-dependent-on-the-ipx-.patch b/backport-Make-IPX-packet-interpretation-dependent-on-the-ipx-.patch new file mode 100644 index 0000000..fbb6732 --- /dev/null +++ b/backport-Make-IPX-packet-interpretation-dependent-on-the-ipx-.patch @@ -0,0 +1,65 @@ +From 6b09724c69d91668418ddb3af00da6db6755208c Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Thu, 2 Sep 2021 15:01:12 -0400 +Subject: [PATCH] Make IPX packet interpretation dependent on the ipx header + file existing + +Conflict: del ChangeLog +--- + auparse/interpret.c | 8 ++++++-- + configure.ac | 6 ++++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/auparse/interpret.c b/auparse/interpret.c +index 63829aa..6c31645 100644 +--- a/auparse/interpret.c ++++ b/auparse/interpret.c +@@ -44,8 +44,10 @@ + #include + #include + #include +-#include // FIXME: remove when ipx.h is fixed +-#include ++#ifdef HAVE_IPX_HEADERS ++ #include // FIXME: remove when ipx.h is fixed ++ #include ++#endif + #include + #include + #include +@@ -1279,6 +1281,7 @@ static const char *print_sockaddr(const char *val) + x->sax25_call.ax25_call[6]); + } + break; ++#ifdef HAVE_IPX_HEADERS + case AF_IPX: + { + const struct sockaddr_ipx *ip = +@@ -1288,6 +1291,7 @@ static const char *print_sockaddr(const char *val) + str, ip->sipx_port, ip->sipx_network); + } + break; ++#endif + case AF_ATMPVC: + { + const struct sockaddr_atmpvc* at = +diff --git a/configure.ac b/configure.ac +index 8f541e4..005eb0b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -418,6 +418,12 @@ if test x"$LIBWRAP_LIBS" != "x"; then + AC_DEFINE_UNQUOTED(HAVE_LIBWRAP, [], Define if tcp_wrappers support is enabled ) + fi + ++# linux/ipx.h - deprecated in 2018 ++AC_CHECK_HEADER(linux/ipx.h, ipx_headers=yes, ipx_headers=no) ++if test $ipx_headers = yes ; then ++ AC_DEFINE(HAVE_IPX_HEADERS,1,[IPX packet interpretation]) ++fi ++ + # See if we want to support lower capabilities for plugins + LIBCAP_NG_PATH + +-- +2.27.0 + diff --git a/backport-audit-flex-array-workaround.patch b/backport-audit-flex-array-workaround.patch new file mode 100644 index 0000000..66d16ee --- /dev/null +++ b/backport-audit-flex-array-workaround.patch @@ -0,0 +1,47 @@ +commit 0d31f225faef8da3fcd0f69f6544aa274102fe53 +Author: Steve Grubb +Date: Wed Feb 23 14:24:50 2022 -0500 +Subject: workaround a kernel change that breaks the build + +--- + bindings/swig/src.auditswig.i | 2 +- + lib/audit.h | 2 +- + lib/libaudit.h | 2 +- + 3 files changed, 3 insertions(+)m 3 deletions(-) + +diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i +--- a/bindings/swig/src/auditswig.i ++++ b/bindings/swig/src/auditswig.i +@@ -39,7 +39,7 @@ signed + #define __attribute(X) /*nothing*/ + typedef unsigned __u32; + typedef unsigned uid_t; +-%include "/usr/include/linux/audit.h" ++%include "../lib/audit.h" + #define __extension__ /*nothing*/ + %include + %include "../lib/libaudit.h" +diff --git a/lib/audit.h b/lib/audit.h +--- a/lib/audit.h ++++ b/lib/audit.h +@@ -514,7 +514,7 @@ struct audit_rule_data { + __u32 values[AUDIT_MAX_FIELDS]; + __u32 fieldflags[AUDIT_MAX_FIELDS]; + __u32 buflen; /* total length of string fields */ +- char buf[]; /* string fields buffer */ ++ char buf[0]; /* string fields buffer */ + }; + + #endif /* _LINUX_AUDIT_H_ */ +diff --git a/lib/libaudit.h b/lib/libaudit.h +--- a/lib/libaudit.h ++++ b/lib/libaudit.h +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include ++#include "audit.h" + #include + #include + diff --git a/backport-audit-undo-flex-array.patch b/backport-audit-undo-flex-array.patch new file mode 100644 index 0000000..aeec0e7 --- /dev/null +++ b/backport-audit-undo-flex-array.patch @@ -0,0 +1,21 @@ +commit 2df0fecef9ea2225de116c1e969462cb4846241d +Author: Steve Grubb +Date: Thu Feb 24 09:11:06 2022 -0500 +Subject: Undo fix to libaudit.h before installing + +--- + ./usr/include/libaudit.h | 2 +- + 1 flies changed, 1 insertions(+), 1 deletions(-) + +diff --git a/./usr/include/libaudit.h b/.user/include/libaudit.h +--- a/./usr/include/libaudit.h ++++ b/./usr/include/libaudit.h +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include "audit.h" ++#include + #include + #include +