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 <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
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;
}