#include "openbsd.h"
#include "doas.h"
+#include "insults.h"
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#endif
if (!user || !myname)
- errx(1, "Authentication failed");
+ authfail();
ret = pam_start(PAM_SERVICE_NAME, myname, &conv, &pamh);
if (ret != PAM_SUCCESS)
if (!nopass) {
if (!interactive)
- errx(1, "Authentication required");
+ authfail();
/* doas style prompt for pam */
char host[HOST_NAME_MAX + 1];
if (ret != PAM_SUCCESS) {
pamcleanup(ret, sess, cred);
syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
- errx(1, "Authentication failed");
+ authfail();
}
}
if (ret != PAM_SUCCESS) {
pamcleanup(ret, sess, cred);
syslog(LOG_AUTHPRIV | LOG_NOTICE, "failed auth for %s", myname);
- errx(1, "Authentication failed");
+ authfail();
}
/* set PAM_USER to the user we want to be */