summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-09-05 02:37:28 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-09-05 02:37:28 +0000
commite9d43506d76574367c9b65523d7945817e2682ef (patch)
treea9b099cee248bd17fec0e7693f6654d115bf84ec /lib/libc/net
parent622f87d7b9b65aa5038aae99fcb1bad2abfdbffc (diff)
ignore $RSH if we are setuid
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/rcmd.c4
1 files 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 <sys/param.h>
@@ -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)