From d74787746028fe4b4130300bf549dc468b4002c6 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 20 Mar 2002 22:08:06 +0000 Subject: 2001-03-20 Till Straumann * 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. --- c/src/exec/libnetworking/ChangeLog | 9 +++++++++ c/src/exec/libnetworking/libc/Makefile.am | 2 +- c/src/exec/libnetworking/libc/rcmd.c | 26 +++++++++++++++++++++++++- c/src/libnetworking/ChangeLog | 9 +++++++++ c/src/libnetworking/libc/Makefile.am | 2 +- c/src/libnetworking/libc/rcmd.c | 26 +++++++++++++++++++++++++- cpukit/libnetworking/ChangeLog | 9 +++++++++ cpukit/libnetworking/libc/Makefile.am | 2 +- cpukit/libnetworking/libc/rcmd.c | 26 +++++++++++++++++++++++++- 9 files changed, 105 insertions(+), 6 deletions(-) diff --git a/c/src/exec/libnetworking/ChangeLog b/c/src/exec/libnetworking/ChangeLog index 58a13fe4b8..1a816f0d30 100644 --- a/c/src/exec/libnetworking/ChangeLog +++ b/c/src/exec/libnetworking/ChangeLog @@ -1,3 +1,12 @@ +2001-03-20 Till Straumann + + * 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 * net/if_ppp.c, pppd/auth.c, pppd/chat.c, pppd/pppd.h, diff --git a/c/src/exec/libnetworking/libc/Makefile.am b/c/src/exec/libnetworking/libc/Makefile.am index 0c46f483c3..76dfaf0535 100644 --- a/c/src/exec/libnetworking/libc/Makefile.am +++ b/c/src/exec/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/c/src/exec/libnetworking/libc/rcmd.c b/c/src/exec/libnetworking/libc/rcmd.c index 32e4953e9b..b934fae5a5 100644 --- a/c/src/exec/libnetworking/libc/rcmd.c +++ b/c/src/exec/libnetworking/libc/rcmd.c @@ -59,13 +59,23 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include #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 diff --git a/c/src/libnetworking/ChangeLog b/c/src/libnetworking/ChangeLog index 58a13fe4b8..1a816f0d30 100644 --- a/c/src/libnetworking/ChangeLog +++ b/c/src/libnetworking/ChangeLog @@ -1,3 +1,12 @@ +2001-03-20 Till Straumann + + * 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 * net/if_ppp.c, pppd/auth.c, pppd/chat.c, pppd/pppd.h, diff --git a/c/src/libnetworking/libc/Makefile.am b/c/src/libnetworking/libc/Makefile.am index 0c46f483c3..76dfaf0535 100644 --- a/c/src/libnetworking/libc/Makefile.am +++ b/c/src/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/c/src/libnetworking/libc/rcmd.c b/c/src/libnetworking/libc/rcmd.c index 32e4953e9b..b934fae5a5 100644 --- a/c/src/libnetworking/libc/rcmd.c +++ b/c/src/libnetworking/libc/rcmd.c @@ -59,13 +59,23 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include #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 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 + + * 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 * 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 #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 -- cgit v1.2.3