audit: Fix compilation with kernel 5.15
authorEneas U de Queiroz <cotequeiroz@gmail.com>
Thu, 5 May 2022 12:58:02 +0000 (09:58 -0300)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Fri, 20 May 2022 21:06:35 +0000 (23:06 +0200)
Linux 5.15 does not have the linux/ipx.h header.

The patch is a partial cherry-pick (skipped ChangeLog) of upstream
commit 6b09724c6 ("Make IPX packet interpretation dependent on the ipx
header file existing").

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 7be14da0d59ef59bfcb4b8c38fa9c93038cde8fb)

utils/audit/Makefile
utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch [new file with mode: 0644]

index e920366f4907fa5e6d6bb1aff2edafaf865f4401..05c2f4967ceed33aecf2f78b5fbcc4b3d2d7b87c 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=audit
 PKG_VERSION:=2.8.5
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://people.redhat.com/sgrubb/audit
diff --git a/utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch b/utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch
new file mode 100644 (file)
index 0000000..f4b4492
--- /dev/null
@@ -0,0 +1,52 @@
+From 6b09724c69d91668418ddb3af00da6db6755208c Mon Sep 17 00:00:00 2001
+From: Steve Grubb <sgrubb@redhat.com>
+Date: Thu, 2 Sep 2021 15:01:12 -0400
+Subject: [PATCH] Make IPX packet interpretation dependent on the ipx header
+ file existing
+
+--- a/auparse/interpret.c
++++ b/auparse/interpret.c
+@@ -44,8 +44,10 @@
+ #include <linux/ax25.h>
+ #include <linux/atm.h>
+ #include <linux/x25.h>
+-#include <linux/if.h>   // FIXME: remove when ipx.h is fixed
+-#include <linux/ipx.h>
++#ifdef HAVE_IPX_HEADERS
++  #include <linux/if.h>   // FIXME: remove when ipx.h is fixed
++  #include <linux/ipx.h>
++#endif
+ #include <linux/capability.h>
+ #include <sys/personality.h>
+ #include <sys/prctl.h>
+@@ -1158,6 +1160,7 @@ static const char *print_sockaddr(const
+                                             x->sax25_call.ax25_call[6]);
+                         }
+                         break;
++#ifdef HAVE_IPX_HEADERS
+                 case AF_IPX:
+                         {
+                                 const struct sockaddr_ipx *ip =
+@@ -1167,6 +1170,7 @@ static const char *print_sockaddr(const
+                                       str, ip->sipx_port, ip->sipx_network);
+                         }
+                         break;
++#endif
+                 case AF_ATMPVC:
+                         {
+                                 const struct sockaddr_atmpvc* at =
+--- a/configure.ac
++++ b/configure.ac
+@@ -414,6 +414,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