summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2022-08-24 11:42:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-25 11:07:33 +0100
commit3000840a271534fa907ce0684b81a6d278e64a44 (patch)
tree43161a1e2e929a28099919072b03f29a0fe93230 /meta/recipes-extended
parentb474d7598d0803ba92b01944b961b28beec3bfe2 (diff)
downloadopenembedded-core-contrib-3000840a271534fa907ce0684b81a6d278e64a44.tar.gz
shadow: Avoid nss warning/error with musl
The libnss configuration file is only installed when glibc is used. The inexistence of it on a musl-based rootfs, will make shadow complain about it: Failed opening /etc/nsswitch.conf This is because shadow will try to use nsswich when dealing with subordinate IDs and the message is just a warning as the tool will still generate them correctly in subuid/subgid files. We drop this log message for class native to avoid an error when rootfs logs are checked ('Failed' will match the regex bitbake is using to check for rootfs generation errors). Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/shadow/files/0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch27
-rw-r--r--meta/recipes-extended/shadow/shadow.inc2
2 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-extended/shadow/files/0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch b/meta/recipes-extended/shadow/files/0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch
new file mode 100644
index 0000000000..21c9a1415c
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch
@@ -0,0 +1,27 @@
+From 11290e897a49adddee215833944a518443d9b0d6 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei.gherzan@huawei.com>
+Date: Wed, 24 Aug 2022 00:54:47 +0200
+Subject: [PATCH] Drop nsswitch.conf message when not in place - eg. musl
+
+Upstream-Status: Inappropriate [issue reported at https://github.com/shadow-maint/shadow/issues/557]
+Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
+---
+ lib/nss.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/nss.c b/lib/nss.c
+index 06fa48e..44245da 100644
+--- a/lib/nss.c
++++ b/lib/nss.c
+@@ -59,7 +59,7 @@ void nss_init(const char *nsswitch_path) {
+ // subid: files
+ nssfp = fopen(nsswitch_path, "r");
+ if (!nssfp) {
+- fprintf(shadow_logfd, "Failed opening %s: %m\n", nsswitch_path);
++ //fprintf(shadow_logfd, "Failed opening %s: %m\n", nsswitch_path);
+ atomic_store(&nss_init_completed, true);
+ return;
+ }
+--
+2.25.1
+
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index b2f82e9ac7..414bf467ba 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -25,12 +25,14 @@ SRC_URI:append:class-target = " \
SRC_URI:append:class-native = " \
file://0001-Disable-use-of-syslog-for-sysroot.patch \
file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+ file://0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch \
"
SRC_URI:append:class-nativesdk = " \
file://0001-Disable-use-of-syslog-for-sysroot.patch \
"
SRC_URI[sha256sum] = "9fdb73b5d2b44e8ba9fcee1b4493ac75dd5040bda35b9ac8b06570cd192e7ee3"
+
# Additional Policy files for PAM
PAM_SRC_URI = "file://pam.d/chfn \
file://pam.d/chpasswd \