diff options
-rw-r--r-- | src/lib/libc/net/rcmd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index df555a51d6..44c516da04 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) |
37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.15 1996/09/01 18:31:29 deraadt Exp $"; | 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.16 1996/09/02 21:26:09 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> |
@@ -72,7 +72,16 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) | |||
72 | int oldmask; | 72 | int oldmask; |
73 | pid_t pid; | 73 | pid_t pid; |
74 | int s, lport, timo; | 74 | int s, lport, timo; |
75 | char c; | 75 | char c, *p; |
76 | |||
77 | /* call rcmdsh() with specified remote shell if appropriate. */ | ||
78 | if ((p = getenv("RSH"))) { | ||
79 | struct servent *sp = getservbyname("shell", "tcp"); | ||
80 | |||
81 | if (sp && sp->s_port == rport) | ||
82 | return (rcmdsh(ahost, rport, locuser, remuser, | ||
83 | cmd, p)); | ||
84 | } | ||
76 | 85 | ||
77 | /* use rsh(1) if non-root and remote port is shell. */ | 86 | /* use rsh(1) if non-root and remote port is shell. */ |
78 | if (geteuid()) { | 87 | if (geteuid()) { |