Source-Changes-HG archive

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

[src/netbsd-3]: src/libexec/rexecd Pull up revision 1.23 (requested by lukem ...



details:   https://anonhg.NetBSD.org/src/rev/fb97f3f7f369
branches:  netbsd-3
changeset: 576495:fb97f3f7f369
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jul 05 21:41:43 2005 +0000

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

diffstat:

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

diffs (28 lines):

diff -r bd33d5ebdff2 -r fb97f3f7f369 libexec/rexecd/rexecd.c
--- a/libexec/rexecd/rexecd.c   Tue Jul 05 21:40:29 2005 +0000
+++ b/libexec/rexecd/rexecd.c   Tue Jul 05 21:41:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rexecd.c,v 1.21.2.1 2005/07/05 21:40:29 tron Exp $     */
+/*     $NetBSD: rexecd.c,v 1.21.2.2 2005/07/05 21:41:43 tron Exp $     */
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "from: @(#)rexecd.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: rexecd.c,v 1.21.2.1 2005/07/05 21:40:29 tron Exp $");
+__RCSID("$NetBSD: rexecd.c,v 1.21.2.2 2005/07/05 21:41:43 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -219,7 +219,8 @@
        getstr(pass, sizeof(pass), "password");
        getstr(cmdbuf, sizeof(cmdbuf), "command");
        (void)alarm(0);
-       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0) {
+       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0 ||
+           pwd == NULL) {
                if (dolog)
                        syslog(LOG_ERR, "no such user %s", user);
                rexecd_errx(EXIT_FAILURE, "Login incorrect.");



Home | Main Index | Thread Index | Old Index