fix from vdlinden@fwi.uva.nl (Frank van der Linden) to prevent null deref
This commit is contained in:
parent
0dff3c6f48
commit
90d79a8c10
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user