]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
shadow-native: Disable syslog usage
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 28 Feb 2025 10:09:56 +0000 (10:09 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 3 Mar 2025 18:00:47 +0000 (18:00 +0000)
Spamming the build host's syslog with useradd information during image creation
isn't great. Add a patch to disable that.

It may be possible to convince upstream to make it a configure option but for
now the patch is trivial and reduces host impact to the logs.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/shadow/files/disable_syslog.patch [new file with mode: 0644]
meta/recipes-extended/shadow/shadow_4.17.2.bb

diff --git a/meta/recipes-extended/shadow/files/disable_syslog.patch b/meta/recipes-extended/shadow/files/disable_syslog.patch
new file mode 100644 (file)
index 0000000..7299a8e
--- /dev/null
@@ -0,0 +1,22 @@
+When building images using shadow-native, we shouldn't be spamming the host's
+log with lots of syslog messages which aren't relavent. Disable syslog use
+in the native case.
+
+Upstream-Status: Inappropriate [Would upstream accept a configure option?]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: shadow-4.17.2/lib/defines.h
+===================================================================
+--- shadow-4.17.2.orig/lib/defines.h
++++ shadow-4.17.2/lib/defines.h
+@@ -88,7 +88,9 @@
+ /* cleaner than lots of #ifdefs everywhere - use this as follows:
+    SYSLOG((LOG_CRIT, "user %s cracked root", user)); */
+-#ifdef ENABLE_NLS
++#if 1
++#define SYSLOG(x)
++#elif ENABLE_NLS
+ /* Temporarily set LC_TIME to "C" to avoid strange dates in syslog.
+    This is a workaround for a more general syslog(d) design problem -
+    syslogd should log the current system time for each event, and not
index 5459d4e57ffe0b3efecadffe74cb3b4732abdefa..19512f25941788779b5c9bda76e9d08faca437a1 100644 (file)
@@ -23,6 +23,7 @@ SRC_URI:append:class-target = " \
 
 SRC_URI:append:class-native = " \
            file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+           file://disable_syslog.patch \
            "
 SRC_URI[sha256sum] = "064a7c048e613ef5b5f3613e137d79d35d062ab434e89020f743e90844ec5c4f"
 UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"