diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-02 21:26:10 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-02 21:26:10 +0000 |
commit | 725e98c9b80c026cc881f47e7e5a4bad384c21f2 (patch) | |
tree | d60e65053cfde1241bf0830528973e3b5ca46018 /lib/libc | |
parent | 12dfdc56b5b94160a4a1140de985dabf3b6f38e0 (diff) |
Looks at RSH envariable and calls rcmdsh() with that value if set.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/rcmd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index df555a51d68..44c516da040 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.15 1996/09/01 18:31:29 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rcmd.c,v 1.16 1996/09/02 21:26:09 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -72,7 +72,16 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) int oldmask; pid_t pid; int s, lport, timo; - char c; + char c, *p; + + /* call rcmdsh() with specified remote shell if appropriate. */ + if ((p = getenv("RSH"))) { + struct servent *sp = getservbyname("shell", "tcp"); + + if (sp && sp->s_port == rport) + return (rcmdsh(ahost, rport, locuser, remuser, + cmd, p)); + } /* use rsh(1) if non-root and remote port is shell. */ if (geteuid()) { |