summaryrefslogtreecommitdiffstats
path: root/meta
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:08:06 +0100
commit9694c61d44ffc39063e93069f2b8cac0bfef4146 (patch)
tree17c41eb8bc9637fbbe9a734566682d13f9b6e6ad /meta
parente141072888eb107af57d168ac75176f80bb2722e (diff)
downloadpoky-9694c61d44ffc39063e93069f2b8cac0bfef4146.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). (From OE-Core rev: 3000840a271534fa907ce0684b81a6d278e64a44) 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')
-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 @@
1From 11290e897a49adddee215833944a518443d9b0d6 Mon Sep 17 00:00:00 2001
2From: Andrei Gherzan <andrei.gherzan@huawei.com>
3Date: Wed, 24 Aug 2022 00:54:47 +0200
4Subject: [PATCH] Drop nsswitch.conf message when not in place - eg. musl
5
6Upstream-Status: Inappropriate [issue reported at https://github.com/shadow-maint/shadow/issues/557]
7Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
8---
9 lib/nss.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/lib/nss.c b/lib/nss.c
13index 06fa48e..44245da 100644
14--- a/lib/nss.c
15+++ b/lib/nss.c
16@@ -59,7 +59,7 @@ void nss_init(const char *nsswitch_path) {
17 // subid: files
18 nssfp = fopen(nsswitch_path, "r");
19 if (!nssfp) {
20- fprintf(shadow_logfd, "Failed opening %s: %m\n", nsswitch_path);
21+ //fprintf(shadow_logfd, "Failed opening %s: %m\n", nsswitch_path);
22 atomic_store(&nss_init_completed, true);
23 return;
24 }
25--
262.25.1
27
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 = " \
25SRC_URI:append:class-native = " \ 25SRC_URI:append:class-native = " \
26 file://0001-Disable-use-of-syslog-for-sysroot.patch \ 26 file://0001-Disable-use-of-syslog-for-sysroot.patch \
27 file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ 27 file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
28 file://0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch \
28 " 29 "
29SRC_URI:append:class-nativesdk = " \ 30SRC_URI:append:class-nativesdk = " \
30 file://0001-Disable-use-of-syslog-for-sysroot.patch \ 31 file://0001-Disable-use-of-syslog-for-sysroot.patch \
31 " 32 "
32SRC_URI[sha256sum] = "9fdb73b5d2b44e8ba9fcee1b4493ac75dd5040bda35b9ac8b06570cd192e7ee3" 33SRC_URI[sha256sum] = "9fdb73b5d2b44e8ba9fcee1b4493ac75dd5040bda35b9ac8b06570cd192e7ee3"
33 34
35
34# Additional Policy files for PAM 36# Additional Policy files for PAM
35PAM_SRC_URI = "file://pam.d/chfn \ 37PAM_SRC_URI = "file://pam.d/chfn \
36 file://pam.d/chpasswd \ 38 file://pam.d/chpasswd \