}
void
-authfail(void)
+authfail(int opt)
{
#ifdef DOAS_INSULTS
- printf("%s\n", getinsult());
+ if (opt)
+ printf("%s\n", getinsult());
#endif
errx(1, "Authentication failed");
if (nflag)
errx(1, "Authentication required");
- shadowauth(mypw->pw_name, rule->options & PERSIST);
+ int ret = shadowauth(mypw->pw_name, rule->options & PERSIST);
+ if (ret == 5)
+ authfail(rule->options & INSULT);
}
#elif !defined(USE_PAM)
/* no authentication provider, only allow NOPASS rules */