diff mbox series

[scarthgap,38/55] shadow-native: Disable syslog usage

Message ID 8f136272878dea4e0540e2f53491a2b5c37821f3.1793405493.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [scarthgap,01/55] scripts/install-buildtools: Update to 5.0.21 | expand

Commit Message

Yoann Congal Oct. 31, 2026, 12:14 a.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

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>
(cherry picked from commit a52572886e60e4aff9d54b57bf45a301e1dec1ee)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 .../shadow/files/disable_syslog.patch         | 22 +++++++++++++++++++
 meta/recipes-extended/shadow/shadow.inc       |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-extended/shadow/files/disable_syslog.patch
diff mbox series

Patch

diff --git a/meta/recipes-extended/shadow/files/disable_syslog.patch b/meta/recipes-extended/shadow/files/disable_syslog.patch
new file mode 100644
index 00000000000..7299a8e61cd
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/disable_syslog.patch
@@ -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
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index a308ea00d24..37aa7b1f17c 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -24,6 +24,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] = "a305edf5d19bddbdf5e836d2d609fa8bff2d35458819de4d9f06306a1cf24342"