Clear errno before calling getpw*.

This commit is contained in:
Jamie Gritton 2016-01-16 18:13:28 +00:00
parent 2aa4a62da3
commit fcc43d065a

View File

@ -877,6 +877,7 @@ get_user_info(struct cfjail *j, const char *username,
{
const struct passwd *pwd;
errno = 0;
*pwdp = pwd = username ? getpwnam(username) : getpwuid(getuid());
if (pwd == NULL) {
if (errno)