--- pop_user.c.orig Fri Jul 10 03:44:08 1998 +++ pop_user.c Tue Oct 2 20:55:26 2001 @@ -40,6 +40,12 @@ #include "popper.h" +#ifdef OPIE +#include +int pwok, af_pwok; +struct opie opiestate; +#endif /* OPIE */ + /* * user: Prompt for the user name at the start of a POP session */ @@ -62,6 +68,9 @@ struct stat st; datum key, value; # endif +#ifdef OPIE + char prompt[OPIE_CHALLENGE_MAX + 1]; +#endif /* OPIE */ #ifdef KERBEROS if (p->kerberos && strcmp(p->pop_parm[1], p->user)) { @@ -167,6 +176,18 @@ #endif /* APOP */ /* Tell the user that the password is required */ +#ifdef OPIE + if (opiechallenge(&opiestate, p->user, prompt) == 0) { + pw = getpwnam(p->user); + pwok = (pw != NULL) && af_pwok && opiealways(pw->pw_dir); + return (pop_msg(p,POP_SUCCESS,"OTP response %s %s for %s.", prompt, + pwok ? "requested" : "required", p->user)); + } else { + pwok = 1; + return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user)); + } +#else /* OPIE */ return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user)); +#endif /* OPIE */ }