summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-20 13:54:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-28 00:14:00 +0100
commitef827a4a5d3a677aeaf85c24253df5dd966dc565 (patch)
treec5e9fadbe240275008d198ed939fd22980648012
parent8d6afadf48d779b8d7e9ad69f66187cb773d8184 (diff)
downloadpoky-ef827a4a5d3a677aeaf85c24253df5dd966dc565.tar.gz
shadow-native: Simplify and fix syslog disable patch
Shadow is happily spamming the host syslog with messages and shouldn't be which suggests the patch isn't working. Redo it to work at the configure level which is simpler and hopefully more effective. This is a squashed cherry-pick of commit 8f181686 (shadow-native: Simplify and fix syslog disable patch) and commit e1f21d0d (shadow: Disable the use of syslog() for the native tools). (From OE-Core rev: d411ea3114cde55ae68a2d437e854c5b17f78131) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch150
1 files changed, 39 insertions, 111 deletions
diff --git a/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch b/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
index 95728bcd3f..628db42136 100644
--- a/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
+++ b/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
@@ -1,124 +1,52 @@
1From 30a3906a0a21120fa6bbc918b6258ab9303fbeaa Mon Sep 17 00:00:00 2001 1From 8b845fff891798a03bdf21354b52e4487c2c0200 Mon Sep 17 00:00:00 2001
2From: Scott Garman <scott.a.garman@intel.com> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 14 Apr 2016 12:28:57 +0200 3Date: Thu, 14 Apr 2022 23:11:53 +0000
4Subject: [PATCH] Disable use of syslog for sysroot 4Subject: [PATCH] Disable use of syslog for shadow-native tools
5 5
6Disable use of syslog to prevent sysroot user and group additions from 6Disable use of syslog to prevent sysroot user and group additions from
7writing entries to the host's syslog. This patch should only be used 7writing entries to the host's syslog. This patch should only be used
8with the shadow-native recipe. 8with the shadow-native recipe.
9 9
10Upstream-Status: Inappropriate [disable feature] 10Upstream-Status: Inappropriate [OE specific configuration]
11 11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12Signed-off-by: Scott Garman <scott.a.garman@intel.com>
13Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> 12Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
14Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
15 13
16--- 14---
17 src/groupadd.c | 3 +++ 15 configure.ac | 2 +-
18 src/groupdel.c | 3 +++ 16 src/login_nopam.c | 3 ++-
19 src/groupmems.c | 3 +++ 17 2 files changed, 3 insertions(+), 2 deletions(-)
20 src/groupmod.c | 3 +++
21 src/useradd.c | 3 +++
22 src/userdel.c | 4 ++++
23 src/usermod.c | 3 +++
24 7 files changed, 22 insertions(+)
25 18
26diff --git a/src/groupadd.c b/src/groupadd.c 19diff --git a/configure.ac b/configure.ac
27index d7f68b1..5fe5f43 100644 20index 5dcae19..b2c58f5 100644
28--- a/src/groupadd.c 21--- a/configure.ac
29+++ b/src/groupadd.c 22+++ b/configure.ac
30@@ -34,6 +34,9 @@ 23@@ -204,7 +204,7 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd",
31 24 [Path to passwd program.])
32 #ident "$Id$" 25
33 26 dnl XXX - quick hack, should disappear before anyone notices :).
34+/* Disable use of syslog since we're running this command against a sysroot */ 27-AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
35+#undef USE_SYSLOG 28+#AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
36+ 29 if test "$ac_cv_func_ruserok" = "yes"; then
37 #include <ctype.h> 30 AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
38 #include <fcntl.h> 31 AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
39 #include <getopt.h> 32diff --git a/src/login_nopam.c b/src/login_nopam.c
40diff --git a/src/groupdel.c b/src/groupdel.c 33index df6ba88..fc24e13 100644
41index 5c89312..2aefc5a 100644 34--- a/src/login_nopam.c
42--- a/src/groupdel.c 35+++ b/src/login_nopam.c
43+++ b/src/groupdel.c 36@@ -29,7 +29,6 @@
44@@ -34,6 +34,9 @@ 37 #ifndef USE_PAM
45
46 #ident "$Id$" 38 #ident "$Id$"
47 39
48+/* Disable use of syslog since we're running this command against a sysroot */ 40-#include "prototypes.h"
49+#undef USE_SYSLOG 41 /*
50+ 42 * This module implements a simple but effective form of login access
51 #include <ctype.h> 43 * control based on login names and on host (or domain) names, internet
52 #include <fcntl.h> 44@@ -57,6 +56,8 @@
53 #include <grp.h> 45 #include <netinet/in.h>
54diff --git a/src/groupmems.c b/src/groupmems.c 46 #include <arpa/inet.h> /* for inet_ntoa() */
55index 654a8f3..6b2026b 100644
56--- a/src/groupmems.c
57+++ b/src/groupmems.c
58@@ -32,6 +32,9 @@
59
60 #include <config.h>
61
62+/* Disable use of syslog since we're running this command against a sysroot */
63+#undef USE_SYSLOG
64+
65 #include <fcntl.h>
66 #include <getopt.h>
67 #include <grp.h>
68diff --git a/src/groupmod.c b/src/groupmod.c
69index acd6f35..a2c5247 100644
70--- a/src/groupmod.c
71+++ b/src/groupmod.c
72@@ -34,6 +34,9 @@
73
74 #ident "$Id$"
75
76+/* Disable use of syslog since we're running this command against a sysroot */
77+#undef USE_SYSLOG
78+
79 #include <ctype.h>
80 #include <fcntl.h>
81 #include <getopt.h>
82diff --git a/src/useradd.c b/src/useradd.c
83index 127177e..b80e505 100644
84--- a/src/useradd.c
85+++ b/src/useradd.c
86@@ -34,6 +34,9 @@
87
88 #ident "$Id$"
89
90+/* Disable use of syslog since we're running this command against a sysroot */
91+#undef USE_SYSLOG
92+
93 #include <assert.h>
94 #include <ctype.h>
95 #include <errno.h>
96diff --git a/src/userdel.c b/src/userdel.c
97index 79a7c89..c1e010a 100644
98--- a/src/userdel.c
99+++ b/src/userdel.c
100@@ -31,6 +31,10 @@
101 */
102
103 #include <config.h>
104+
105+/* Disable use of syslog since we're running this command against a sysroot */
106+#undef USE_SYSLOG
107+
108 #include <assert.h>
109 #include <dirent.h>
110 #include <errno.h>
111diff --git a/src/usermod.c b/src/usermod.c
112index 03bb9b9..e15fdd4 100644
113--- a/src/usermod.c
114+++ b/src/usermod.c
115@@ -34,6 +34,9 @@
116
117 #ident "$Id$"
118 47
119+/* Disable use of syslog since we're running this command against a sysroot */ 48+#include "prototypes.h"
120+#undef USE_SYSLOG
121+ 49+
122 #include <assert.h> 50 #if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64)
123 #include <ctype.h> 51 #undef MAXHOSTNAMELEN
124 #include <errno.h> 52 #define MAXHOSTNAMELEN 256