From: Alejandro Colomar Date: Tue, 3 Mar 2026 14:33:34 +0000 (+0100) Subject: lib/nss.c: Fix incorrect handling of white space X-Git-Tag: 4.20.0-rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49104901380ac047eb5feaa3ee9f9095f19db580;p=thirdparty%2Fshadow.git lib/nss.c: Fix incorrect handling of white space Having trailing white space in a line doesn't remove the need for a trailing '\n'. Let's fail if a line doesn't have it, regardless of how much trailing white space there is. Fixes: 8492dee6 (2021-04-16; "subids: support nsswitch") Cc: Serge Hallyn Signed-off-by: Alejandro Colomar --- diff --git a/lib/nss.c b/lib/nss.c index c487800e2..7455babc9 100644 --- a/lib/nss.c +++ b/lib/nss.c @@ -94,11 +94,12 @@ nss_init(const char *nsswitch_path) { if (p == NULL) { goto null_subid; } - if (stpsep(p, " \t\n") == NULL) { + if (stpsep(p, "\n") == NULL) { fprintf(log_get_logfd(), "No usable subid NSS module found, using files\n"); // subid_nss has to be null here, but to ease reviews: goto null_subid; } + stpsep(p, " \t"); if (streq(p, "files")) { goto null_subid; }