fix from vdlinden@fwi.uva.nl (Frank van der Linden) to prevent null deref

This commit is contained in:
cgd 1994-02-18 18:34:24 +00:00
parent 0dff3c6f48
commit 90d79a8c10

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rshd.c 5.38 (Berkeley) 3/2/91";*/
static char rcsid[] = "$Id: rshd.c,v 1.3 1993/12/23 09:06:01 cgd Exp $";
static char rcsid[] = "$Id: rshd.c,v 1.4 1994/02/18 18:34:24 cgd Exp $";
#endif /* not lint */
/*
@ -459,7 +459,7 @@ fail:
errorstr = "Permission denied.\n";
/* log the (failed) rsh request, if paranoid */
if (paranoid || pwd->pw_uid == 0)
if (paranoid || (pwd && pwd->pw_uid == 0)) {
syslog(LOG_INFO|LOG_AUTH,
"rsh denied to %s@%s as %s: cmd='%s'; %s",
remuser, hostname, locuser, cmdbuf,