pam_strerror(pamh, pamret), pamret);
}
}
-#endif /* ENABLE_PAM */
+#else
+# define login_pam_end(pamh) ((void)0)
+#endif
static void get_username_or_die(char *buf, int size_buf)
{
* to know _why_ login failed */
syslog(LOG_WARNING, "pam_%s call failed: %s (%d)", failed_msg,
pam_strerror(pamh, pamret), pamret);
+ login_pam_end(pamh);
safe_strncpy(username, "UNKNOWN", sizeof(username));
#else /* not PAM */
pw = getpwnam(username);
if (child_pid < 0)
bb_perror_msg("vfork");
else {
- if (safe_waitpid(child_pid, NULL, 0) == -1)
- bb_perror_msg("waitpid");
+ wait_for_exitstatus(child_pid);
update_utmp_DEAD_PROCESS(child_pid);
}
IF_PAM(login_pam_end(pamh);)