Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/login Pull up revision 1.6 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/9131bf714ed8
branches:  netbsd-3
changeset: 576512:9131bf714ed8
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 09 22:40:44 2005 +0000

description:
Pull up revision 1.6 (requested by lukem in ticket #531):
Don't report that we don't know the username. We don't want to give out
more information that we need to.

diffstat:

 usr.bin/login/login_pam.c |  29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diffs (57 lines):

diff -r e2400a2faa75 -r 9131bf714ed8 usr.bin/login/login_pam.c
--- a/usr.bin/login/login_pam.c Sat Jul 09 22:38:07 2005 +0000
+++ b/usr.bin/login/login_pam.c Sat Jul 09 22:40:44 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: login_pam.c,v 1.4.2.1 2005/07/09 22:38:07 tron Exp $       */
+/*     $NetBSD: login_pam.c,v 1.4.2.2 2005/07/09 22:40:44 tron Exp $       */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)login.c    8.4 (Berkeley) 4/2/94";
 #endif
-__RCSID("$NetBSD: login_pam.c,v 1.4.2.1 2005/07/09 22:38:07 tron Exp $");
+__RCSID("$NetBSD: login_pam.c,v 1.4.2.2 2005/07/09 22:40:44 tron Exp $");
 #endif /* not lint */
 
 /*
@@ -322,12 +322,11 @@
                if (have_ss)
                        PAM_SET_ITEM(PAM_SOCKADDR, &ss); 
 
-               if (getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf),
-                   &pwd) != 0) {
-                       pam_end(pamh, PAM_SUCCESS);
-                       syslog(LOG_ERR, "Cannot find user `%s'", username);
-                       errx(EXIT_FAILURE, "Cannot find user `%s'", username);
-               }
+               /*
+                * Don't check for errors, because we don't want to give
+                * out any information.
+                */
+               (void)getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf), &pwd);
 
                /*
                 * Establish the class now, before we might goto
@@ -366,14 +365,12 @@
                                PAM_END("pam_get_item(PAM_USER)");
 
                        username = (char *)newuser;
-                       if (getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf),
-                           &pwd) != 0) {
-                               pam_end(pamh, PAM_SUCCESS);
-                               syslog(LOG_ERR, "Cannot find user `%s'",
-                                   username);
-                               errx(EXIT_FAILURE, "Cannot find user `%s'",
-                                   username);
-                       }
+                       /*
+                        * Don't check for errors, because we don't want to give
+                        * out any information.
+                        */
+                       (void)getpwnam_r(username, &pwres, pwbuf, sizeof(pwbuf),
+                           &pwd);
                        lc = login_getpwclass(pwd);
                        auth_passed = 1;
 



Home | Main Index | Thread Index | Old Index