Subject: Re: lib/30923
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: zafer <zafer@p15158991.pureserver.info>
List: netbsd-bugs
Date: 08/26/2005 19:22:03
The following reply was made to PR lib/30923; it has been noted by GNATS.

From: zafer@p15158991.pureserver.info (zafer)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/30923
Date: Fri, 26 Aug 2005 20:59:13 +0200

       When you don't have telnetd do authenication, then it calls
  /usr/bin/login to do it, making login the guilty party here.  When
  login gets PAM_AUTH_ERROR from pam_authenticate(), it simply prints
  "Login incorrect" and loops back for another try.  When it gets
  PAM_AUTH_ERROR (or just about any other error) from pam_acct_mgmt(), it
  calls a PAM_END macro,  This macro makes a syslog entry with the the
  information from pam_strerror(), calls warnx() with same, and exits
  after a five second delay.  The solution is to treat PAM_AUTH_ERROR
  >from pam_acct_mgmt() the same as from pam_authenticate().  Here is a
  patch:
  
  --- login_pam.c.orig    2005-08-11 03:46:45.000000000 -0700
  +++ login_pam.c 2005-08-11 03:48:27.000000000 -0700
  @@ -388,6 +388,12 @@
                                          PAM_END("pam_chauthtok");
                                  break;
  
  +                       case PAM_AUTH_ERR:
  +                       case PAM_USER_UNKNOWN:
  +                       case PAM_MAXTRIES:
  +                               auth_passed = 0;
  +                               break;
  +
                          default:
                                  PAM_END("pam_acct_mgmt");
                                  break;