From 0e882d6023eddd19966c4d19c87743645eebd247 Mon Sep 17 00:00:00 2001 From: Renbo Date: Thu, 4 Jul 2024 17:14:41 +0800 Subject: [PATCH 1/3] update to audit-3.1.2-1.src.rpm Signed-off-by: Renbo --- ...it-audit-3.0.8-flex-array-workaround.patch | 13 -- audit-3.0.8-auparse-path-norm.patch | 31 ----- audit-3.0.8-drop-protecthome.patch | 26 ---- audit-3.0.8-flex-array-workaround.patch | 26 ---- audit-3.0.8-undo-flex-array.patch | 13 -- audit-3.1-fanotify-records.patch | 122 ------------------ audit-add-sw.patch | 91 ------------- audit.spec | 68 ++-------- download | 2 +- 9 files changed, 13 insertions(+), 379 deletions(-) delete mode 100644 1000-split-audit-3.0.8-flex-array-workaround.patch delete mode 100644 audit-3.0.8-auparse-path-norm.patch delete mode 100644 audit-3.0.8-drop-protecthome.patch delete mode 100644 audit-3.0.8-flex-array-workaround.patch delete mode 100644 audit-3.0.8-undo-flex-array.patch delete mode 100644 audit-3.1-fanotify-records.patch delete mode 100644 audit-add-sw.patch diff --git a/1000-split-audit-3.0.8-flex-array-workaround.patch b/1000-split-audit-3.0.8-flex-array-workaround.patch deleted file mode 100644 index 1814a81..0000000 --- a/1000-split-audit-3.0.8-flex-array-workaround.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/audit.h b/lib/audit.h -index 51d7f2b..b2f306d 100644 ---- 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/audit-3.0.8-auparse-path-norm.patch b/audit-3.0.8-auparse-path-norm.patch deleted file mode 100644 index 2fb20fb..0000000 --- a/audit-3.0.8-auparse-path-norm.patch +++ /dev/null @@ -1,31 +0,0 @@ -From becc1c297279f757835943e2cad63992134511f9 Mon Sep 17 00:00:00 2001 -From: Sergio Correia -Date: Mon, 7 Mar 2022 13:11:09 -0300 -Subject: [PATCH] auparse: fix off-by-one issue in path_norm() (#242) - -When defining dest = rpath + 1, we end up having the first char of -`dest' as NULL -- since `rpath' points to `working', which is a static -buffer. - -With the first char as NULL, path_norm() ends up producing an empty string. - -This commit fixes the issue reported in this [1] mailing list post. - -[1] https://listman.redhat.com/archives/linux-audit/2022-February/018844.html ---- - auparse/interpret.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/auparse/interpret.c b/auparse/interpret.c -index c8a0d96dd..df593c44c 100644 ---- a/auparse/interpret.c -+++ b/auparse/interpret.c -@@ -895,7 +895,7 @@ static char *path_norm(const char *name) - return strdup(name); - - rpath = working; -- dest = rpath + 1; -+ dest = rpath; - rpath_limit = rpath + PATH_MAX; - - for (start = name; *start; start = end) { diff --git a/audit-3.0.8-drop-protecthome.patch b/audit-3.0.8-drop-protecthome.patch deleted file mode 100644 index a9a70de..0000000 --- a/audit-3.0.8-drop-protecthome.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c426507a501efde0367a09a81e917d1d10722b78 Mon Sep 17 00:00:00 2001 -From: Sergio Correia -Date: Thu, 31 Mar 2022 15:00:57 -0300 -Subject: [PATCH] Drop ProtectHome from auditd.service as it interferes with - rules - -Upstream: https://github.com/linux-audit/audit-userspace/commit/12cf14ed ---- - init.d/auditd.service | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/init.d/auditd.service b/init.d/auditd.service -index e801281..0a4c498 100644 ---- a/init.d/auditd.service -+++ b/init.d/auditd.service -@@ -36,7 +36,6 @@ MemoryDenyWriteExecute=true - LockPersonality=true - ProtectControlGroups=true - ProtectKernelModules=true --ProtectHome=true - RestrictRealtime=true - - [Install] --- -2.35.1 - diff --git a/audit-3.0.8-flex-array-workaround.patch b/audit-3.0.8-flex-array-workaround.patch deleted file mode 100644 index bb6f632..0000000 --- a/audit-3.0.8-flex-array-workaround.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i -index 21aafca..8c48123 100644 ---- 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/libaudit.h b/lib/libaudit.h -index 08b7d22..6b7408c 100644 ---- a/lib/libaudit.h -+++ b/lib/libaudit.h -@@ -32,7 +32,7 @@ extern "C" { - #include - #include - #include --#include -+#include "audit.h" - #include - #include - diff --git a/audit-3.0.8-undo-flex-array.patch b/audit-3.0.8-undo-flex-array.patch deleted file mode 100644 index 917eaf3..0000000 --- a/audit-3.0.8-undo-flex-array.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/usr/include/libaudit.h b/usr/include/libaudit.h -index 6b7408c..08b7d22 100644 ---- a/usr/include/libaudit.h -+++ b/usr/include/libaudit.h -@@ -32,7 +32,7 @@ extern "C" { - #include - #include - #include --#include "audit.h" -+#include - #include - #include - diff --git a/audit-3.1-fanotify-records.patch b/audit-3.1-fanotify-records.patch deleted file mode 100644 index b3195b9..0000000 --- a/audit-3.1-fanotify-records.patch +++ /dev/null @@ -1,122 +0,0 @@ -From d1aec22f62b1cd95c16b26b67a9268ed27713f84 Mon Sep 17 00:00:00 2001 -From: Steve Grubb -Date: Tue, 7 Feb 2023 10:32:11 -0500 -Subject: [PATCH] Add support for new FANOTIFY record fields - ---- - ChangeLog | 1 + - auparse/auparse-defs.h | 5 ++-- - auparse/interpret.c | 65 +++++++++++++++++++++++++++++++++++++++++- - auparse/typetab.h | 4 +++ - 4 files changed, 72 insertions(+), 3 deletions(-) - -diff --git a/auparse/auparse-defs.h b/auparse/auparse-defs.h -index 7c0ac76..81a85a4 100644 ---- a/auparse/auparse-defs.h -+++ b/auparse/auparse-defs.h -@@ -88,7 +88,8 @@ typedef enum { AUPARSE_TYPE_UNCLASSIFIED, AUPARSE_TYPE_UID, AUPARSE_TYPE_GID, - AUPARSE_TYPE_NETACTION, AUPARSE_TYPE_MACPROTO, - AUPARSE_TYPE_IOCTL_REQ, AUPARSE_TYPE_ESCAPED_KEY, - AUPARSE_TYPE_ESCAPED_FILE, AUPARSE_TYPE_FANOTIFY, -- AUPARSE_TYPE_NLMCGRP, AUPARSE_TYPE_RESOLVE -+ AUPARSE_TYPE_NLMCGRP, AUPARSE_TYPE_RESOLVE, AUPARSE_TYPE_TRUST, -+ AUPARSE_TYPE_FAN_TYPE, AUPARSE_TYPE_FAN_INFO - } auparse_type_t; - - /* This type determines what escaping if any gets applied to interpreted fields */ -diff --git a/auparse/interpret.c b/auparse/interpret.c -index 373851f..f106056 100644 ---- a/auparse/interpret.c -+++ b/auparse/interpret.c -@@ -2372,6 +2372,60 @@ static const char *print_openat2_resolve(const char *val) - return strdup(buf); - } - -+static const char *print_trust(const char *val) -+{ -+ const char *out; -+ -+ if (strcmp(val, "0") == 0) -+ out = strdup("no"); -+ else if (strcmp(val, "1") == 0) -+ out = strdup("yes"); -+ else -+ out = strdup("unknown"); -+ -+ return out; -+} -+ -+// fan_type always preceeds fan_info -+static int last_type = 2; -+static const char *print_fan_type(const char *val) -+{ -+ const char *out; -+ -+ if (strcmp(val, "0") == 0) { -+ out = strdup("none"); -+ last_type = 0; -+ } else if (strcmp(val, "1") == 0) { -+ out = strdup("rule_info"); -+ last_type = 1; -+ } else { -+ out = strdup("unknown"); -+ last_type = 2; -+ } -+ -+ return out; -+} -+ -+static const char *print_fan_info(const char *val) -+{ -+ const char *out; -+ if (last_type == 1) { -+ errno = 0; -+ unsigned long info = strtoul(val, NULL, 16); -+ if (errno) { -+ if (asprintf(&out, "conversion error(%s)", val) < 0) -+ out = NULL; -+ return out; -+ } else { -+ if (asprintf(&out, "%lu", info) < 0) -+ out = NULL; -+ return out; -+ } -+ } else -+ out = strdup(val); -+ return out; -+} -+ - static const char *print_a0(const char *val, const idata *id) - { - char *out; -@@ -3286,6 +3340,15 @@ unknown: - case AUPARSE_TYPE_RESOLVE: - out = print_openat2_resolve(id->val); - break; -+ case AUPARSE_TYPE_TRUST: -+ out = print_trust(id->val); -+ break; -+ case AUPARSE_TYPE_FAN_TYPE: -+ out = print_fan_type(id->val); -+ break; -+ case AUPARSE_TYPE_FAN_INFO: -+ out = print_fan_info(id->val); -+ break; - case AUPARSE_TYPE_MAC_LABEL: - case AUPARSE_TYPE_UNCLASSIFIED: - default: -diff --git a/auparse/typetab.h b/auparse/typetab.h -index 0e37d02..5c8fca8 100644 ---- a/auparse/typetab.h -+++ b/auparse/typetab.h -@@ -145,3 +145,7 @@ _S(AUPARSE_TYPE_ESCAPED, "sw" ) - _S(AUPARSE_TYPE_ESCAPED, "root_dir" ) - _S(AUPARSE_TYPE_NLMCGRP, "nl-mcgrp" ) - _S(AUPARSE_TYPE_RESOLVE, "resolve" ) -+_S(AUPARSE_TYPE_TRUST, "subj_trust" ) -+_S(AUPARSE_TYPE_TRUST, "obj_trust" ) -+_S(AUPARSE_TYPE_FAN_TYPE, "fan_type" ) -+_S(AUPARSE_TYPE_FAN_INFO, "fan_info" ) --- -2.41.0 - diff --git a/audit-add-sw.patch b/audit-add-sw.patch deleted file mode 100644 index 627282a..0000000 --- a/audit-add-sw.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 34a7470dec3f87d107dc5f42c04721ec0f1a01ef Mon Sep 17 00:00:00 2001 -From: wxiat -Date: Mon, 19 Jun 2023 16:30:44 +0800 -Subject: [PATCH] add sw - -Signed-off-by: wxiat ---- - bindings/swig/python/audit.py | 1 + - bindings/swig/python3/audit.py | 1 + - lib/libaudit.h | 1 + - src/libev/ev.c | 3 +++ - tools/ausyscall/ausyscall.c | 6 ++++++ - 5 files changed, 12 insertions(+) - -diff --git a/bindings/swig/python/audit.py b/bindings/swig/python/audit.py -index 260d7e5..071862a 100644 ---- a/bindings/swig/python/audit.py -+++ b/bindings/swig/python/audit.py -@@ -614,6 +614,7 @@ MACH_PPC = _audit.MACH_PPC - MACH_S390X = _audit.MACH_S390X - MACH_S390 = _audit.MACH_S390 - MACH_ALPHA = _audit.MACH_ALPHA -+MACH_SW_64 = _audit.MACH_SW_64 - MACH_ARM = _audit.MACH_ARM - MACH_AARCH64 = _audit.MACH_AARCH64 - MACH_PPC64LE = _audit.MACH_PPC64LE -diff --git a/bindings/swig/python3/audit.py b/bindings/swig/python3/audit.py -index a50e225..b5f1e6e 100644 ---- a/bindings/swig/python3/audit.py -+++ b/bindings/swig/python3/audit.py -@@ -614,6 +614,7 @@ MACH_PPC = _audit.MACH_PPC - MACH_S390X = _audit.MACH_S390X - MACH_S390 = _audit.MACH_S390 - MACH_ALPHA = _audit.MACH_ALPHA -+MACH_SW_64 = _audit.MACH_SW_64 - MACH_ARM = _audit.MACH_ARM - MACH_AARCH64 = _audit.MACH_AARCH64 - MACH_PPC64LE = _audit.MACH_PPC64LE -diff --git a/lib/libaudit.h b/lib/libaudit.h -index 08b7d22..3160f0c 100644 ---- a/lib/libaudit.h -+++ b/lib/libaudit.h -@@ -577,6 +577,7 @@ typedef enum { - MACH_S390X, - MACH_S390, - MACH_ALPHA, // Deprecated but has to stay -+ MACH_SW_64, - MACH_ARM, - MACH_AARCH64, - MACH_PPC64LE -diff --git a/src/libev/ev.c b/src/libev/ev.c -index a4ef36f..8f5e037 100644 ---- a/src/libev/ev.c -+++ b/src/libev/ev.c -@@ -828,6 +828,8 @@ struct signalfd_siginfo - #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" : : : "memory") - #elif defined __alpha__ - #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory") -+ #elif defined __sw_64__ -+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("memb" : : : "memory") - #elif defined __hppa__ - #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") - #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("") -@@ -1550,6 +1552,7 @@ ecb_binary32_to_binary16 (uint32_t x) - || defined __s390__ || defined __s390x__ \ - || defined __mips__ \ - || defined __alpha__ \ -+ || defined __sw_64__ \ - || defined __hppa__ \ - || defined __ia64__ \ - || defined __m68k__ \ -diff --git a/tools/ausyscall/ausyscall.c b/tools/ausyscall/ausyscall.c -index 8e59219..ce8d7da 100644 ---- a/tools/ausyscall/ausyscall.c -+++ b/tools/ausyscall/ausyscall.c -@@ -73,6 +73,12 @@ int main(int argc, char *argv[]) - } else if (strcmp("ia64", argv[i]) == 0) { - fputs("IA64 processor support is deprecated\n", - stderr); -+#ifndef WITH_SW_64 -+ } else if (strcmp("sw_64", argv[i]) == 0) { -+ fputs("Sw_64 eabi processor support is not enabled\n", -+ stderr); -+ exit(1); -+#endif - #ifndef WITH_ARM - } else if (strcmp("arm", argv[i]) == 0) { - fputs("Arm eabi processor support is not enabled\n", --- -2.31.1 - diff --git a/audit.spec b/audit.spec index f5171f2..c7f1a10 100644 --- a/audit.spec +++ b/audit.spec @@ -1,23 +1,14 @@ -%define anolis_release .0.2 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: User space tools for kernel auditing Name: audit -Version: 3.0.7 -Release: 5%{anolis_release}%{?dist} +Version: 3.1.2 +Release: 1%{?dist} License: GPLv2+ URL: http://people.redhat.com/sgrubb/audit/ Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz Source1: https://www.gnu.org/licenses/lgpl-2.1.txt -Patch1: audit-3.0.8-auparse-path-norm.patch -Patch2: audit-3.0.8-drop-protecthome.patch -Patch3: audit-3.1-fanotify-records.patch -Patch4: audit-3.0.8-flex-array-workaround.patch -Patch5: audit-3.0.8-undo-flex-array.patch -Patch1000: 1000-split-audit-3.0.8-flex-array-workaround.patch -Patch2000: audit-add-sw.patch - BuildRequires: gcc swig make BuildRequires: openldap-devel BuildRequires: krb5-devel libcap-ng-devel @@ -29,9 +20,6 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires(post): systemd coreutils Requires(preun): systemd initscripts Requires(postun): systemd coreutils initscripts -Requires: glibc - -Provides: /sbin/auditd %description The audit package contains the user space utilities for @@ -93,38 +81,16 @@ incoming audit events, as they happen, to a configured z/OS SMF (Service Management Facility) database, through an IBM Tivoli Directory Server (ITDS) set for Remote Audit service. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep %setup -q cp %{SOURCE1} . - #autoreconf -fv --install -cp /usr/include/linux/audit.h lib/ - -%patch -P 1 -p1 -%patch -P 2 -p1 -%patch -P 3 -p1 -%patch -P 4 -p1 -%ifnarch loongarch64 sw_64 -%patch -P 1000 -p1 -%endif -%ifarch sw_64 -%patch -P 2000 -p1 -%endif - %build %configure --with-python=no \ --with-python3=yes \ --enable-gssapi-krb5=yes --with-arm --with-aarch64 \ - --with-libcap-ng=yes --enable-zos-remote \ + --with-libcap-ng=yes --without-golang --enable-zos-remote \ --enable-systemd make CFLAGS="%{optflags}" %{?_smp_mflags} @@ -149,13 +115,6 @@ find $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages -name '*.a' -delete || t 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 -# undo the workaround -cur=`pwd` -cd $RPM_BUILD_ROOT -patch -p1 < %{PATCH5} -find . -name '*.orig' -delete -cd $cur - %check make check # Get rid of make files so that they don't get packaged. @@ -209,6 +168,7 @@ fi %attr(755,root,root) %{python3_sitearch}/* %files +%doc README ChangeLog init.d/auditd.cron %{!?_licensedir:%global license %%doc} %license COPYING %attr(755,root,root) %{_datadir}/%{name} @@ -262,12 +222,15 @@ fi %config(noreplace) %attr(640,root,root) /etc/audit/audisp-remote.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/au-remote.conf %config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/syslog.conf +%config(noreplace) %attr(640,root,root) /etc/audit/plugins.d/af_unix.conf %attr(750,root,root) %{_sbindir}/audisp-remote %attr(750,root,root) %{_sbindir}/audisp-syslog +%attr(750,root,root) %{_sbindir}/audisp-af_unix %attr(700,root,root) %dir %{_var}/spool/audit %attr(644,root,root) %{_mandir}/man5/audisp-remote.conf.5.gz %attr(644,root,root) %{_mandir}/man8/audisp-remote.8.gz %attr(644,root,root) %{_mandir}/man8/audisp-syslog.8.gz +%attr(644,root,root) %{_mandir}/man8/audisp-af_unix.8.gz %files -n audispd-plugins-zos %attr(644,root,root) %{_mandir}/man8/audispd-zos-remote.8.gz @@ -276,23 +239,16 @@ fi %config(noreplace) %attr(640,root,root) /etc/audit/zos-remote.conf %attr(750,root,root) %{_sbindir}/audispd-zos-remote -%files doc -%doc README ChangeLog init.d/auditd.cron - %changelog -* Tue Mar 19 2024 wxiat - 3.0.7-5.0.2 -- cherry-pick `add sw patch #63160b250a36d3a0326470e2814e9ad8d6b45589` - -* Mon Dec 25 2023 Zhao Hang - 3.0.7-5.0.1 -- Remove unneeded modification -- Add doc sub package (Bo Ren) -- Split audit-3.0.8-flex-array-workaround.patch (Bo Ren) +* Sat Oct 21 2023 Sergio Correia - 3.1.2-1 +- Rebase audit to latest upstream release + Resolves: RHEL-15001 * Thu Jun 22 2023 Radovan Sroka - 3.0.7-5 - Introduce new fanotify record fields -Resolves: rhbz#2216668 + Resolves: rhbz#2216668 - invalid use of flexible array member -Resolves: rhbz#2116867 + Resolves: rhbz#2116867 * Mon May 02 2022 Sergio Correia - 3.0.7-4 - Drop ProtectHome from auditd.service as it interferes with rules diff --git a/download b/download index e1fc563..d3a9b23 100644 --- a/download +++ b/download @@ -1 +1 @@ -34fab69e80ea6668e9c72e73ec24fd88 audit-3.0.7.tar.gz +9d325b543f79b20a8f7ff2021ebac0c3 audit-3.1.2.tar.gz -- Gitee From fbeae5c3b00c289cc843be5aae3b91085d206b7f Mon Sep 17 00:00:00 2001 From: Bo Ren Date: Sat, 16 Jul 2022 11:50:59 +0800 Subject: [PATCH 2/3] spec: add doc sub package Signed-off-by: Bo Ren --- audit.spec | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/audit.spec b/audit.spec index c7f1a10..2bcd74f 100644 --- a/audit.spec +++ b/audit.spec @@ -1,9 +1,10 @@ +%define anolis_release .0.1 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: User space tools for kernel auditing Name: audit Version: 3.1.2 -Release: 1%{?dist} +Release: 1%{anolis_release}%{?dist} License: GPLv2+ URL: http://people.redhat.com/sgrubb/audit/ Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz @@ -20,6 +21,9 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires(post): systemd coreutils Requires(preun): systemd initscripts Requires(postun): systemd coreutils initscripts +Requires: glibc + +Provides: /sbin/auditd %description The audit package contains the user space utilities for @@ -81,6 +85,14 @@ incoming audit events, as they happen, to a configured z/OS SMF (Service Management Facility) database, through an IBM Tivoli Directory Server (ITDS) set for Remote Audit service. +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Doc pages for %{name}. + %prep %setup -q cp %{SOURCE1} . @@ -168,7 +180,6 @@ fi %attr(755,root,root) %{python3_sitearch}/* %files -%doc README ChangeLog init.d/auditd.cron %{!?_licensedir:%global license %%doc} %license COPYING %attr(755,root,root) %{_datadir}/%{name} @@ -239,7 +250,13 @@ fi %config(noreplace) %attr(640,root,root) /etc/audit/zos-remote.conf %attr(750,root,root) %{_sbindir}/audispd-zos-remote +%files doc +%doc README ChangeLog init.d/auditd.cron + %changelog +* Thu Jul 04 2024 Zhao Hang - 3.1.2-1.0.1 +- Add doc sub package (Bo Ren) + * Sat Oct 21 2023 Sergio Correia - 3.1.2-1 - Rebase audit to latest upstream release Resolves: RHEL-15001 -- Gitee From 602ec2c148729bad070557f4605bf285a5584eef Mon Sep 17 00:00:00 2001 From: wxiat Date: Mon, 19 Jun 2023 16:32:44 +0800 Subject: [PATCH 3/3] cherry-pick `add sw patch #63160b250a36d3a0326470e2814e9ad8d6b45589` Signed-off-by: wxiat Signed-off-by: Weisson --- audit-add-sw.patch | 91 ++++++++++++++++++++++++++++++++++++++++++++++ audit.spec | 7 ++++ 2 files changed, 98 insertions(+) create mode 100644 audit-add-sw.patch diff --git a/audit-add-sw.patch b/audit-add-sw.patch new file mode 100644 index 0000000..627282a --- /dev/null +++ b/audit-add-sw.patch @@ -0,0 +1,91 @@ +From 34a7470dec3f87d107dc5f42c04721ec0f1a01ef Mon Sep 17 00:00:00 2001 +From: wxiat +Date: Mon, 19 Jun 2023 16:30:44 +0800 +Subject: [PATCH] add sw + +Signed-off-by: wxiat +--- + bindings/swig/python/audit.py | 1 + + bindings/swig/python3/audit.py | 1 + + lib/libaudit.h | 1 + + src/libev/ev.c | 3 +++ + tools/ausyscall/ausyscall.c | 6 ++++++ + 5 files changed, 12 insertions(+) + +diff --git a/bindings/swig/python/audit.py b/bindings/swig/python/audit.py +index 260d7e5..071862a 100644 +--- a/bindings/swig/python/audit.py ++++ b/bindings/swig/python/audit.py +@@ -614,6 +614,7 @@ MACH_PPC = _audit.MACH_PPC + MACH_S390X = _audit.MACH_S390X + MACH_S390 = _audit.MACH_S390 + MACH_ALPHA = _audit.MACH_ALPHA ++MACH_SW_64 = _audit.MACH_SW_64 + MACH_ARM = _audit.MACH_ARM + MACH_AARCH64 = _audit.MACH_AARCH64 + MACH_PPC64LE = _audit.MACH_PPC64LE +diff --git a/bindings/swig/python3/audit.py b/bindings/swig/python3/audit.py +index a50e225..b5f1e6e 100644 +--- a/bindings/swig/python3/audit.py ++++ b/bindings/swig/python3/audit.py +@@ -614,6 +614,7 @@ MACH_PPC = _audit.MACH_PPC + MACH_S390X = _audit.MACH_S390X + MACH_S390 = _audit.MACH_S390 + MACH_ALPHA = _audit.MACH_ALPHA ++MACH_SW_64 = _audit.MACH_SW_64 + MACH_ARM = _audit.MACH_ARM + MACH_AARCH64 = _audit.MACH_AARCH64 + MACH_PPC64LE = _audit.MACH_PPC64LE +diff --git a/lib/libaudit.h b/lib/libaudit.h +index 08b7d22..3160f0c 100644 +--- a/lib/libaudit.h ++++ b/lib/libaudit.h +@@ -577,6 +577,7 @@ typedef enum { + MACH_S390X, + MACH_S390, + MACH_ALPHA, // Deprecated but has to stay ++ MACH_SW_64, + MACH_ARM, + MACH_AARCH64, + MACH_PPC64LE +diff --git a/src/libev/ev.c b/src/libev/ev.c +index a4ef36f..8f5e037 100644 +--- a/src/libev/ev.c ++++ b/src/libev/ev.c +@@ -828,6 +828,8 @@ struct signalfd_siginfo + #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" : : : "memory") + #elif defined __alpha__ + #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory") ++ #elif defined __sw_64__ ++ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("memb" : : : "memory") + #elif defined __hppa__ + #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory") + #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("") +@@ -1550,6 +1552,7 @@ ecb_binary32_to_binary16 (uint32_t x) + || defined __s390__ || defined __s390x__ \ + || defined __mips__ \ + || defined __alpha__ \ ++ || defined __sw_64__ \ + || defined __hppa__ \ + || defined __ia64__ \ + || defined __m68k__ \ +diff --git a/tools/ausyscall/ausyscall.c b/tools/ausyscall/ausyscall.c +index 8e59219..ce8d7da 100644 +--- a/tools/ausyscall/ausyscall.c ++++ b/tools/ausyscall/ausyscall.c +@@ -73,6 +73,12 @@ int main(int argc, char *argv[]) + } else if (strcmp("ia64", argv[i]) == 0) { + fputs("IA64 processor support is deprecated\n", + stderr); ++#ifndef WITH_SW_64 ++ } else if (strcmp("sw_64", argv[i]) == 0) { ++ fputs("Sw_64 eabi processor support is not enabled\n", ++ stderr); ++ exit(1); ++#endif + #ifndef WITH_ARM + } else if (strcmp("arm", argv[i]) == 0) { + fputs("Arm eabi processor support is not enabled\n", +-- +2.31.1 + diff --git a/audit.spec b/audit.spec index 2bcd74f..e209591 100644 --- a/audit.spec +++ b/audit.spec @@ -10,6 +10,7 @@ URL: http://people.redhat.com/sgrubb/audit/ Source0: http://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz Source1: https://www.gnu.org/licenses/lgpl-2.1.txt +Patch2000: audit-add-sw.patch BuildRequires: gcc swig make BuildRequires: openldap-devel BuildRequires: krb5-devel libcap-ng-devel @@ -98,6 +99,10 @@ Doc pages for %{name}. cp %{SOURCE1} . #autoreconf -fv --install +%ifarch sw_64 +%patch -P 2000 -p1 +%endif + %build %configure --with-python=no \ --with-python3=yes \ @@ -256,6 +261,8 @@ fi %changelog * Thu Jul 04 2024 Zhao Hang - 3.1.2-1.0.1 - Add doc sub package (Bo Ren) +- cherry-pick `add sw patch #63160b250a36d3a0326470e2814e9ad8d6b45589` (nijie@wxiat.com) + * Sat Oct 21 2023 Sergio Correia - 3.1.2-1 - Rebase audit to latest upstream release -- Gitee