summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-03-20 22:08:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-03-20 22:08:06 +0000
commitd74787746028fe4b4130300bf549dc468b4002c6 (patch)
tree6fe13162d5b669068489372661bd483eafc0b434 /cpukit
parent3e0c94f0a31475290452e34dcf17b283515241e4 (diff)
downloadrtems-d74787746028fe4b4130300bf549dc468b4002c6.tar.bz2
2001-03-20 Till Straumann <strauman@SLAC.Stanford.EDU>
* PR158 * libc/rcmd.c, libc/rcmd.c: Enable the rcmd() library call by commenting out the parts that deal with signals. This enables RTEMS to 'rsh' command to a server connecting fd to remote stdio. The 'server-side' parts of this file which deal with authentication are disabled since they are not needed.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libnetworking/ChangeLog9
-rw-r--r--cpukit/libnetworking/libc/Makefile.am2
-rw-r--r--cpukit/libnetworking/libc/rcmd.c26
3 files changed, 35 insertions, 2 deletions
diff --git a/cpukit/libnetworking/ChangeLog b/cpukit/libnetworking/ChangeLog
index 58a13fe4b8..1a816f0d30 100644
--- a/cpukit/libnetworking/ChangeLog
+++ b/cpukit/libnetworking/ChangeLog
@@ -1,3 +1,12 @@
+2001-03-20 Till Straumann <strauman@SLAC.Stanford.EDU>
+
+ * PR158
+ * libc/rcmd.c, libc/rcmd.c: Enable the rcmd() library call by
+ commenting out the parts that deal with signals. This enables
+ RTEMS to 'rsh' command to a server connecting fd to remote stdio.
+ The 'server-side' parts of this file which deal with authentication
+ are disabled since they are not needed.
+
2002-02-27 Ilya Alexeev <ilya@continuum.ru>
* net/if_ppp.c, pppd/auth.c, pppd/chat.c, pppd/pppd.h,
diff --git a/cpukit/libnetworking/libc/Makefile.am b/cpukit/libnetworking/libc/Makefile.am
index 0c46f483c3..76dfaf0535 100644
--- a/cpukit/libnetworking/libc/Makefile.am
+++ b/cpukit/libnetworking/libc/Makefile.am
@@ -15,7 +15,7 @@ C_FILES = addr2ascii.c ascii2addr.c base64.c gethostbydns.c gethostbyht.c \
inet_pton.c linkaddr.c map_v4v6.c nsap_addr.c ns_name.c ns_netint.c \
ns_parse.c ns_print.c ns_ttl.c res_comp.c res_data.c res_debug.c \
res_init.c res_mkquery.c res_mkupdate.c res_query.c res_send.c \
- res_stubs.c res_update.c strsep.c
+ res_stubs.c res_update.c strsep.c rcmd.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
OBJS = $(C_O_FILES)
diff --git a/cpukit/libnetworking/libc/rcmd.c b/cpukit/libnetworking/libc/rcmd.c
index 32e4953e9b..b934fae5a5 100644
--- a/cpukit/libnetworking/libc/rcmd.c
+++ b/cpukit/libnetworking/libc/rcmd.c
@@ -59,13 +59,23 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <rpcsvc/ypclnt.h>
#endif
-extern int innetgr __P(( const char *, const char *, const char *, const char * ));
#define max(a, b) ((a > b) ? a : b)
+#ifdef __rtems
+int rresvport();
+#define bzero(a,s) memset((a),0,(s))
+#define bcmp memcmp
+#define bcopy(s,d,i) memcpy(d,s,i)
+#else /* __rtems */
+
+extern int innetgr __P(( const char *, const char *, const char *, const char * ));
+
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
static int __icheckhost __P((u_long, char *));
+#endif
+
int
rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
char **ahost;
@@ -76,7 +86,9 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
struct hostent *hp;
struct sockaddr_in sin, from;
fd_set reads;
+#ifndef __rtems
long oldmask;
+#endif
pid_t pid;
int s, lport, timo;
char c;
@@ -88,7 +100,9 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
return (-1);
}
*ahost = hp->h_name;
+#ifndef __rtems
oldmask = sigblock(sigmask(SIGURG));
+#endif
for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
s = rresvport(&lport);
if (s < 0) {
@@ -98,7 +112,9 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
else
(void)fprintf(stderr, "rcmd: socket: %s\n",
strerror(errno));
+#ifndef __rtems
sigsetmask(oldmask);
+#endif
return (-1);
}
fcntl(s, F_SETOWN, pid);
@@ -133,7 +149,9 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
continue;
}
(void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
+#ifndef __rtems
sigsetmask(oldmask);
+#endif
return (-1);
}
lport--;
@@ -221,14 +239,18 @@ again:
}
goto bad2;
}
+#ifndef __rtems
sigsetmask(oldmask);
+#endif
return (s);
bad2:
if (lport)
(void)close(*fd2p);
bad:
(void)close(s);
+#ifndef __rtems
sigsetmask(oldmask);
+#endif
return (-1);
}
@@ -264,6 +286,7 @@ rresvport(alport)
return (s);
}
+#ifndef __rtems
int __check_rhosts_file = 1;
char *__rcmd_errstr;
@@ -518,3 +541,4 @@ __icheckhost(raddr, lhost)
/* No match. */
return (0);
}
+#endif