From 7005e6aa8544eadc1e8aeba7771e13bdd05a93cf Mon Sep 17 00:00:00 2001 From: millert Date: Thu, 5 Sep 1996 02:37:27 +0000 Subject: [PATCH] ignore $RSH if we are setuid --- lib/libc/net/rcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 01554868d64..16ea9bc95ba 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmd.c,v 1.17 1996/09/03 10:53:37 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rcmd.c,v 1.18 1996/09/05 02:37:27 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -76,7 +76,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) char c, *p; /* call rcmdsh() with specified remote shell if appropriate. */ - if ((p = getenv("RSH"))) { + if (!issetugid() && (p = getenv("RSH"))) { struct servent *sp = getservbyname("shell", "tcp"); if (sp && sp->s_port == rport) -- 2.20.1