summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillert <>1996-09-02 21:26:09 +0000
committermillert <>1996-09-02 21:26:09 +0000
commit4acf17e801ae64ddfa46dcf0c66135f396195a2e (patch)
tree8ebedaca74c8ef3414bc575166bb20e2df09ee74
parent775d3a670a4620e3fcabe54a3cd83116e6768724 (diff)
downloadopenbsd-4acf17e801ae64ddfa46dcf0c66135f396195a2e.tar.gz
openbsd-4acf17e801ae64ddfa46dcf0c66135f396195a2e.tar.bz2
openbsd-4acf17e801ae64ddfa46dcf0c66135f396195a2e.zip
Looks at RSH envariable and calls rcmdsh() with that value if set.
-rw-r--r--src/lib/libc/net/rcmd.c13
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)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.15 1996/09/01 18:31:29 deraadt Exp $"; 37static 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()) {