summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillert <>1996-09-05 02:37:27 +0000
committermillert <>1996-09-05 02:37:27 +0000
commit6ccd11af3cd7d43e326c19b784584d1972bdebbf (patch)
tree2300257abd1b00066eb84b239cdf002f99986c58
parent0bc1041d392f8fa484899a0946b75b84c78e29ad (diff)
downloadopenbsd-6ccd11af3cd7d43e326c19b784584d1972bdebbf.tar.gz
openbsd-6ccd11af3cd7d43e326c19b784584d1972bdebbf.tar.bz2
openbsd-6ccd11af3cd7d43e326c19b784584d1972bdebbf.zip
ignore $RSH if we are setuid
-rw-r--r--src/lib/libc/net/rcmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 01554868d6..16ea9bc95b 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.17 1996/09/03 10:53:37 deraadt Exp $"; 37static char *rcsid = "$OpenBSD: rcmd.c,v 1.18 1996/09/05 02:37:27 millert Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
@@ -76,7 +76,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
76 char c, *p; 76 char c, *p;
77 77
78 /* call rcmdsh() with specified remote shell if appropriate. */ 78 /* call rcmdsh() with specified remote shell if appropriate. */
79 if ((p = getenv("RSH"))) { 79 if (!issetugid() && (p = getenv("RSH"))) {
80 struct servent *sp = getservbyname("shell", "tcp"); 80 struct servent *sp = getservbyname("shell", "tcp");
81 81
82 if (sp && sp->s_port == rport) 82 if (sp && sp->s_port == rport)