} else {
struct passwd *pwd;
_unix_getpwnam(pamh, user, 1, 1, &pwd);
+ if (pwd == NULL) {
+ _log_err(LOG_DEBUG, pamh,
+ "user \"%s\" has corrupted passwd entry",
+ user);
+ return PAM_USER_UNKNOWN;
+ }
if (!_unix_shadowed(pwd) &&
(strchr(pwd->pw_passwd, '*') != NULL)) {
_log_err(LOG_DEBUG, pamh,
}
memset(*ret, '\0', buflen);
- (*ret)->pw_uid = strtol(suid, &p, 0);
+ (*ret)->pw_uid = strtol(suid, &p, 10);
if ((strlen(sgid) == 0) || (*p != '\0')) {
free(*ret);
*ret = NULL;
return matched;
}
- (*ret)->pw_gid = strtol(sgid, &p, 0);
+ (*ret)->pw_gid = strtol(sgid, &p, 10);
if ((strlen(sgid) == 0) || (*p != '\0')) {
free(*ret);
*ret = NULL;