diff options
author | Andrei Gherzan <andrei.gherzan@huawei.com> | 2022-08-25 18:30:41 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-03 13:09:49 +0100 |
commit | 5f3999c41a4b4a5457d5a486f747b607adddb61c (patch) | |
tree | 4162bc75b24544652f2bfef7e1a69b6fec44ac4d /meta/recipes-extended | |
parent | c917d00ea33b90109ca38ebc964f9b9cce5cf2b5 (diff) | |
download | poky-5f3999c41a4b4a5457d5a486f747b607adddb61c.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: e5ce33228858fcc12051548399c71ce10346bf5b)
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Steve Sakoman <steve@sakoman.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.patch | 27 | ||||
-rw-r--r-- | meta/recipes-extended/shadow/shadow.inc | 2 |
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..6c04769713 --- /dev/null +++ b/meta/recipes-extended/shadow/files/0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From aed5a184401fbbe901cb825be4004ced885b6f9a Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei.gherzan@huawei.com> | ||
3 | Date: Wed, 24 Aug 2022 00:54:47 +0200 | ||
4 | Subject: [PATCH] Drop nsswitch.conf message when not in place - eg. musl | ||
5 | |||
6 | Upstream-Status: Inappropriate [issue reported at https://github.com/shadow-maint/shadow/issues/557] | ||
7 | Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> | ||
8 | --- | ||
9 | lib/nss.c | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/lib/nss.c b/lib/nss.c | ||
13 | index af3e95a..74e0e16 100644 | ||
14 | --- a/lib/nss.c | ||
15 | +++ b/lib/nss.c | ||
16 | @@ -57,7 +57,7 @@ void nss_init(char *nsswitch_path) { | ||
17 | // subid: files | ||
18 | nssfp = fopen(nsswitch_path, "r"); | ||
19 | if (!nssfp) { | ||
20 | - fprintf(shadow_logfd, "Failed opening %s: %m", nsswitch_path); | ||
21 | + //fprintf(shadow_logfd, "Failed opening %s: %m", nsswitch_path); | ||
22 | atomic_store(&nss_init_completed, true); | ||
23 | return; | ||
24 | } | ||
25 | -- | ||
26 | 2.25.1 | ||
27 | |||
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc index b3ae2b4874..5106b95571 100644 --- a/meta/recipes-extended/shadow/shadow.inc +++ b/meta/recipes-extended/shadow/shadow.inc | |||
@@ -26,6 +26,7 @@ SRC_URI:append:class-target = " \ | |||
26 | SRC_URI:append:class-native = " \ | 26 | SRC_URI:append:class-native = " \ |
27 | file://0001-Disable-use-of-syslog-for-sysroot.patch \ | 27 | file://0001-Disable-use-of-syslog-for-sysroot.patch \ |
28 | file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ | 28 | file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ |
29 | file://0001-Drop-nsswitch.conf-message-when-not-in-place-eg.-musl.patch \ | ||
29 | " | 30 | " |
30 | SRC_URI:append:class-nativesdk = " \ | 31 | SRC_URI:append:class-nativesdk = " \ |
31 | file://0001-Disable-use-of-syslog-for-sysroot.patch \ | 32 | file://0001-Disable-use-of-syslog-for-sysroot.patch \ |
@@ -33,6 +34,7 @@ SRC_URI:append:class-nativesdk = " \ | |||
33 | 34 | ||
34 | SRC_URI[sha256sum] = "f262089be6a1011d50ec7849e14571b7b2e788334368f3dccb718513f17935ed" | 35 | SRC_URI[sha256sum] = "f262089be6a1011d50ec7849e14571b7b2e788334368f3dccb718513f17935ed" |
35 | 36 | ||
37 | |||
36 | # Additional Policy files for PAM | 38 | # Additional Policy files for PAM |
37 | PAM_SRC_URI = "file://pam.d/chfn \ | 39 | PAM_SRC_URI = "file://pam.d/chfn \ |
38 | file://pam.d/chpasswd \ | 40 | file://pam.d/chpasswd \ |