Source-Changes-HG archive

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

[src/netbsd-3]: src/libexec/rshd Pull up revision 1.43 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/ff255755cdf3
branches:  netbsd-3
changeset: 576518:ff255755cdf3
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 09 22:48:00 2005 +0000

description:
Pull up revision 1.43 (requested by lukem in ticket #532):
check pwd != NULL

diffstat:

 libexec/rshd/rshd.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 024d6098f2e1 -r ff255755cdf3 libexec/rshd/rshd.c
--- a/libexec/rshd/rshd.c       Sat Jul 09 22:45:30 2005 +0000
+++ b/libexec/rshd/rshd.c       Sat Jul 09 22:48:00 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rshd.c,v 1.40.2.2 2005/07/09 22:45:30 tron Exp $       */
+/*     $NetBSD: rshd.c,v 1.40.2.3 2005/07/09 22:48:00 tron Exp $       */
 
 /*
  * Copyright (C) 1998 WIDE Project.
@@ -69,7 +69,7 @@
 #if 0
 static char sccsid[] = "@(#)rshd.c     8.2 (Berkeley) 4/6/94";
 #else
-__RCSID("$NetBSD: rshd.c,v 1.40.2.2 2005/07/09 22:45:30 tron Exp $");
+__RCSID("$NetBSD: rshd.c,v 1.40.2.3 2005/07/09 22:48:00 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -483,7 +483,8 @@
        }
 #endif /* USE_PAM */
        setpwent();
-       if (getpwnam_r(locuser, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0) {
+       if (getpwnam_r(locuser, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0 ||
+           pwd == NULL) {
                syslog(LOG_INFO|LOG_AUTH,
                    "%s@%s as %s: unknown login. cmd='%.80s'",
                    remuser, hostname, locuser, cmdbuf);



Home | Main Index | Thread Index | Old Index