From d600266156ac6b04a0e2cb6c45ffc1369d8ea976 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Wed, 26 May 2021 10:03:23 +0800 Subject: [PATCH] Keep auditd off by default, and remove unused patch --- ...e-caused-by-corrected-event-ordering.patch | 67 ------------------- audit.spec | 13 +++- 2 files changed, 11 insertions(+), 69 deletions(-) delete mode 100644 Fix-memleak-in-auparse-caused-by-corrected-event-ordering.patch diff --git a/Fix-memleak-in-auparse-caused-by-corrected-event-ordering.patch b/Fix-memleak-in-auparse-caused-by-corrected-event-ordering.patch deleted file mode 100644 index 7ef151b..0000000 --- a/Fix-memleak-in-auparse-caused-by-corrected-event-ordering.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 1af601fed7c23849ae50cacf0eff15fa7dc781a8 Mon Sep 17 00:00:00 2001 -From: Steve Grubb -Date: Tue, 26 Mar 2019 09:18:00 -0400 -Subject: [PATCH 1/2] Fix memleak in auparse caused by corrected event ordering - ---- - auparse/auparse.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/auparse/auparse.c b/auparse/auparse.c -index 042ea2b..af5dc7b 100644 ---- a/auparse/auparse.c -+++ b/auparse/auparse.c -@@ -266,6 +266,14 @@ static event_list_t *au_get_ready_event(auparse_state_t *au, int is_test) - au_lolnode *ptr = lowest; - while (ptr->status == EBS_EMPTY && lol->maxi > 0) { - lol->maxi--; -+ if (ptr->l) { -+ aup_list_clear(ptr->l); -+ free(ptr->l); -+ ptr->l = NULL; -+ au->le = NULL; // this should crash -+ // usage of au->le -+ // until reset -+ } - ptr = &lol->array[lol->maxi]; - } - } - -From a4ed2001dd9db902764256ee08bd53e2039f217e Mon Sep 17 00:00:00 2001 -From: Steve Grubb -Date: Tue, 26 Mar 2019 17:24:37 -0400 -Subject: [PATCH 2/2] Fix memleak in auparse caused by corrected event ordering - part 2 - ---- - auparse/auparse.c | 17 ----------------- - 1 file changed, 17 deletions(-) - -diff --git a/auparse/auparse.c b/auparse/auparse.c -index af5dc7b..7662b85 100644 ---- a/auparse/auparse.c -+++ b/auparse/auparse.c -@@ -260,23 +260,6 @@ static event_list_t *au_get_ready_event(auparse_state_t *au, int is_test) - if (lowest && lowest->status == EBS_COMPLETE) { - lowest->status = EBS_EMPTY; - au->au_ready--; -- // Try to consolidate the array so that we iterate -- // over a smaller portion next time -- if (lowest == &lol->array[lol->maxi]) { -- au_lolnode *ptr = lowest; -- while (ptr->status == EBS_EMPTY && lol->maxi > 0) { -- lol->maxi--; -- if (ptr->l) { -- aup_list_clear(ptr->l); -- free(ptr->l); -- ptr->l = NULL; -- au->le = NULL; // this should crash -- // usage of au->le -- // until reset -- } -- ptr = &lol->array[lol->maxi]; -- } -- } - return lowest->l; - } - diff --git a/audit.spec b/audit.spec index 04d3d6c..845c5a3 100644 --- a/audit.spec +++ b/audit.spec @@ -1,10 +1,12 @@ %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%define enable_audit 0 + Summary: User space tools for kernel auditing Name: audit Epoch: 1 Version: 3.0 -Release: 1 +Release: 2 License: GPLv2+ and LGPLv2+ URL: https://people.redhat.com/sgrubb/audit/ Source0: https://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz @@ -194,8 +196,9 @@ if [ -d "/etc/audisp/" -a `/usr/bin/pkgconf --modversion audit | cut -d'.' -f 1` fi fi fi - +%if %{enable_audit} %systemd_post auditd.service +%endif %post -n audispd-plugins # after installing audispd-plugins @@ -266,9 +269,11 @@ fi %postun /sbin/ldconfig +%if %{enable_audit} if [ $1 -ge 1 ]; then /sbin/service auditd condrestart > /dev/null 2>&1 || : fi +%endif %files %doc README @@ -360,6 +365,10 @@ fi %attr(644,root,root) %{_mandir}/man8/*.8.gz %changelog +* Wed May 26 2021 yixiangzhike - 3.0-2 +- keep auditd off by default +- remove unused patch + * Tue May 25 2021 yixiangzhike - 3.0-1 - update to 3.0 -- Gitee