Skip to content

Commit

Permalink
libnss_mxshadow: set errno on NSS_STATUS_NOTFOUND
Browse files Browse the repository at this point in the history
A table in the glibc manual indicates, that errno should be set to
ENOENT for NSS_STATUS_NOTFOUND if the requested entry is not available.
  • Loading branch information
donald committed May 7, 2021
1 parent c33baec commit e1f00f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libnss_mxshadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ enum nss_status _nss_mxshadow_getspnam_r(const char *name, struct spwd *spwd, ch
}
strcpy(buffer, line);

if (buffer[0] == '\0')
if (buffer[0] == '\0') {
errno = ENOENT;
return NSS_STATUS_NOTFOUND;
}

char *p;

Expand Down

0 comments on commit e1f00f1

Please sign in to comment.