summaryrefslogtreecommitdiff
path: root/libexec/rexecd
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2005-04-19 03:22:54 +0000
committerchristos <christos@NetBSD.org>2005-04-19 03:22:54 +0000
commitcce62d09524e16c7b7eeed063ff8df5141980145 (patch)
tree7b4519ce1910f157bc3d3192cbc26c9e6f7f87da /libexec/rexecd
parenteea147d9f9a46de628a5a441ad82fd629945dc0b (diff)
check pwd != NULL
Diffstat (limited to 'libexec/rexecd')
-rw-r--r--libexec/rexecd/rexecd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index 36924ad2ed2..b668e9b9add 100644
--- a/libexec/rexecd/rexecd.c
+++ b/libexec/rexecd/rexecd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rexecd.c,v 1.22 2005/03/30 01:07:47 christos Exp $ */
+/* $NetBSD: rexecd.c,v 1.23 2005/04/19 03:22:54 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "from: @(#)rexecd.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: rexecd.c,v 1.22 2005/03/30 01:07:47 christos Exp $");
+__RCSID("$NetBSD: rexecd.c,v 1.23 2005/04/19 03:22:54 christos Exp $");
#endif
#endif /* not lint */
@@ -219,7 +219,8 @@ doit(struct sockaddr *fromp)
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.");