sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (e97a8c6bf29cb2b7d4b3fabe7d8e1ff9f2718fdb)
- From: Vlad Glagolev <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (e97a8c6bf29cb2b7d4b3fabe7d8e1ff9f2718fdb)
- Date: Tue, 27 Mar 2018 10:45:42 +0000
GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:
security/audit/DETAILS | 1
security/audit/HISTORY | 5 +++
security/audit/PRE_BUILD | 2 +
security/audit/logging.patch | 54
+++++++++++++++++++++++++++++++++++++++++++
4 files changed, 62 insertions(+)
New commits:
commit e97a8c6bf29cb2b7d4b3fabe7d8e1ff9f2718fdb
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
audit: corrected logging
diff --git a/security/audit/DETAILS b/security/audit/DETAILS
index 22de6b9..fac6440 100755
--- a/security/audit/DETAILS
+++ b/security/audit/DETAILS
@@ -1,5 +1,6 @@
SPELL="audit"
VERSION="2.8.3"
+ PATCHLEVEL=1
SOURCE="${SPELL}-${VERSION}.tar.gz"
SOURCE_URL[0]="http://people.redhat.com/sgrubb/${SPELL}/${SOURCE}"
SOURCE_HASH=sha512:aa939b81a66111f4e466208d7a38414bd186d00ccd374b420439764905b4707bbfcdc2331a6179a080fca981d19171696ecabd26674205b2f9339c44954db933
diff --git a/security/audit/HISTORY b/security/audit/HISTORY
index e7dc565..b77d565 100644
--- a/security/audit/HISTORY
+++ b/security/audit/HISTORY
@@ -1,3 +1,8 @@
+2018-03-27 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: PATCHLEVEL=1
+ * PRE_BUILD: apply patch
+ * logging.patch: added, to fix disabled logging
+
2018-03-22 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 2.8.3; turn off doc dir gathering
* DEPENDS: python[3] and openldap become optional; corrected flags;
diff --git a/security/audit/PRE_BUILD b/security/audit/PRE_BUILD
index 21db4f0..7bf2a96 100755
--- a/security/audit/PRE_BUILD
+++ b/security/audit/PRE_BUILD
@@ -1,6 +1,8 @@
default_pre_build &&
cd "${SOURCE_DIRECTORY}" &&
+patch -p1 < "${SPELL_DIRECTORY}/logging.patch" &&
+
sedit "/auditd.init/d" init.d/Makefile.am &&
autoreconf -fi
diff --git a/security/audit/logging.patch b/security/audit/logging.patch
new file mode 100644
index 0000000..102467f
--- /dev/null
+++ b/security/audit/logging.patch
@@ -0,0 +1,54 @@
+From 623c4868441848ff81763dc9a73fe490d805bd14 Mon Sep 17 00:00:00 2001
+From: Steve Grubb <sgrubb AT redhat.com>
+Date: Mon, 26 Mar 2018 16:44:20 -0400
+Subject: [PATCH] Fix log file check/creation when file logging is disabled
+ entirely. This is specifically useful when you have syslog logging module
+ enabled, and dont want to leave unnecessary cruft such as empty log files.
+ Reported by Vlad Glagolev
+
+---
+ src/auditd-config.c | 9 ++++-----
+ src/auditd-event.c | 3 +++
+ 2 files changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/auditd-config.c b/src/auditd-config.c
+index 921fdda..ccadcdd 100644
+--- a/src/auditd-config.c
++++ b/src/auditd-config.c
+@@ -619,11 +619,9 @@ static int log_file_parser(struct nv_pair *nv, int line,
+
+ fd = open(nv->value, mode);
+ if (fd < 0) {
+- if (errno == ENOENT) {
+- fd = create_log_file(nv->value);
+- if (fd < 0)
+- return 1;
+- } else {
++ if (errno == ENOENT)
++ goto finish_up; // Will create the log later
++ else {
+ audit_msg(LOG_ERR, "Unable to open %s (%s)",
nv->value,
+ strerror(errno));
+ return 1;
+@@ -652,6 +650,7 @@ static int log_file_parser(struct nv_pair *nv, int line,
+ audit_msg(LOG_WARNING, "audit log is not writable by owner");
+ }
+
++finish_up:
+ free((void *)config->log_file);
+ config->log_file = strdup(nv->value);
+ if (config->log_file == NULL)
+diff --git a/src/auditd-event.c b/src/auditd-event.c
+index dab9bd8..5944123 100644
+--- a/src/auditd-event.c
++++ b/src/auditd-event.c
+@@ -1120,6 +1120,9 @@ static int open_audit_log(void)
+ {
+ int flags, lfd;
+
++ if (config->write_logs == 0)
++ return 0;
++
+ flags = O_WRONLY|O_APPEND|O_NOFOLLOW;
+ if (config->flush == FT_DATA)
+ flags |= O_DSYNC;
- [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (e97a8c6bf29cb2b7d4b3fabe7d8e1ff9f2718fdb), Vlad Glagolev, 03/27/2018
Archive powered by MHonArc 2.6.24.