Warn if failed to read existing /etc/nsswitch.conf
Commit90424e7c
("Don't warn when failed to open /etc/nsswitch.conf") removed the logging for failing to read /etc/nsswitch.conf to reduce the noise in the case the file does not exists (e.g. musl based systems). Reintroduce a warning if /etc/nsswitch.conf exists but we failed to read it (e.g. permission denied). Improves:90424e7c
("Don't warn when failed to open /etc/nsswitch.conf")
This commit is contained in:
parent
609c641323
commit
1d936c968a
@ -59,6 +59,9 @@ void nss_init(const char *nsswitch_path) {
|
|||||||
// subid: files
|
// subid: files
|
||||||
nssfp = fopen(nsswitch_path, "r");
|
nssfp = fopen(nsswitch_path, "r");
|
||||||
if (!nssfp) {
|
if (!nssfp) {
|
||||||
|
if (errno != ENOENT)
|
||||||
|
fprintf(shadow_logfd, "Failed opening %s: %m\n", nsswitch_path);
|
||||||
|
|
||||||
atomic_store(&nss_init_completed, true);
|
atomic_store(&nss_init_completed, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user