Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,27 @@ nss_init(const char *nsswitch_path) {
}
p = NULL;
while (getline(&line, &len, nssfp) != -1) {
if (stpsep(line, "\n") == NULL) {
fprintf(log_get_logfd(), "%s: Non-text file.\n", nsswitch_path);
Comment thread
alejandro-colomar marked this conversation as resolved.
goto null_subid;
}
if (strprefix(line, "#"))
continue;
if (strlen(line) < 8)
if (strlen(line) < 7)
continue;
if (!strcaseprefix(line, "subid:"))
continue;
p = &line[6];
p = stpspn(p, " \t\n");
p = stpspn(p, " \t");
if (!streq(p, ""))
break;
p = NULL;
}
if (p == NULL) {
goto null_subid;
}
if (stpsep(p, " \t\n") == NULL) {
stpsep(p, " \t");
if (streq(p, "")) {
fprintf(log_get_logfd(), "No usable subid NSS module found, using files\n");
Comment thread
alejandro-colomar marked this conversation as resolved.
// subid_nss has to be null here, but to ease reviews:
goto null_subid;
Expand Down
Loading