diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/Makefile netstd/rshd/Makefile
*** netstd.orig/rshd.orig/Makefile	Thu Jan  1 01:00:00 1970
--- netstd/rshd/Makefile	Sun Apr  9 15:39:28 1995
***************
*** 0 ****
--- 1,18 ----
+ CFLAGS = -O2 -fomit-frame-pointer -m486 \
+ 	-include /usr/include/bsd/bsd.h -I/usr/include/bsd \
+ # -DKERBEROS -DCRYPT
+ LDLIBS = -lbsd # -lutil -lkrb -ldes
+ LDFLAGS = -s -v
+ 
+ rshd: rshd.o rcmd.o # des_rw.o
+ 
+ install: rshd
+ 	install -o root -g root -m 0755 rshd ${DEBDIR}/usr/sbin/in.rshd
+ 	install -o root -g root -m 0644 rshd.8 ${DEBDIR}/usr/man/man8
+ 	install -o root -g root -m 0644 in.rshd.8 ${DEBDIR}/usr/man/man8
+ 	install -o root -g root -m 0644 rhosts.5 ${DEBDIR}/usr/man/man5
+ 	install -o root -g root -m 0644 hosts.equiv.5 ${DEBDIR}/usr/man/man5
+ 
+ clean:
+ 	rm -f *.o rshd
+ 
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/README.Debian netstd/rshd/README.Debian
*** netstd.orig/rshd.orig/README.Debian	Thu Jan  1 01:00:00 1970
--- netstd/rshd/README.Debian	Fri Jan 27 03:57:16 1995
***************
*** 0 ****
--- 1,10 ----
+ Last update: 01/27/95
+ 
+ The following things have been changed for the Debian distribution:
+ 
+ - applied a patch from Florian La Roche <rzsfl@rz.uni-sb.de>
+ - changed the makefile (install target)
+ - added a fixed version of the libc rcmd.c
+ 
+ 
+ Peter Tobias <tobias@et-inf.fho-emden.de>
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/hosts.equiv.5 netstd/rshd/hosts.equiv.5
*** netstd.orig/rshd.orig/hosts.equiv.5	Thu Jan  1 01:00:00 1970
--- netstd/rshd/hosts.equiv.5	Thu Feb 16 18:29:43 1995
***************
*** 0 ****
--- 1,43 ----
+ .\" Copyright (c) 1995 Peter Tobias <tobias@et-inf.fho-emden.de>
+ .\" This file may be distributed under the GNU General Public License.
+ .TH HOSTS.EQUIV 5 "29 Jan 1995" "Linux" "Linux Programmer's Manual"
+ .SH NAME
+ /etc/hosts.equiv \- list of hosts and users that are granted "trusted"
+ \fBr\fP command access to your system
+ .SH DESCRIPTION
+ The \fBhosts.equiv\fP file allows or denies hosts and users to use
+ the \fBr\fP-commands (e.g. \fBrlogin\fP, \fBrsh\fP or \fBrcp\fP) without
+ supplying a password.
+ .PP
+ The file uses the following format:
+ .TP
+ \fI[ + | - ]\fP \fI[hostname]\fP \fI[username]\fP
+ .PP
+ The \fIhostname\fP is the name of a host which is logically equivalent
+ to the local host. Users logged into that hosts are allowed to access
+ like-named user accounts on the local host without supplying a password.
+ The \fIhostname\fP may be (optionally) preceeded by a plus (+) sign.
+ If the plus sign is used alone it allows any host to access your system.
+ You can expicitly deny access to a host by preceeding the \fIhostname\fP
+ by a minus (-) sign. Users from that host must always supply a password.
+ For security reasons you should always use the FQDN of the hostname and
+ not the short hostname.
+ .PP
+ The \fIusername\fP entry grants a specific user access to all user
+ accounts (except root) without supplying a password. That means the
+ user is NOT restricted to like-named accounts. The \fIusername\fP may
+ be (optionally) preceeded by a plus (+) sign. You can also explicitly
+ deny access to a specific user by preceeding the \fIusername\fP by
+ a minus (-) sign. This says that the user is not trusted no matter
+ what other entries for that host exist.
+ .PP
+ Netgroups can be specified by preceeding the netgroup by an @ sign.
+ .PP
+ Be extremly careful when using the plus (+) sign. A simple typographical
+ error could result in a standalone plus sign. A standalone plus sign is
+ a wildcard character that means "any host"!
+ .PP
+ .SH FILES
+ /etc/hosts.equiv
+ .SH "SEE ALSO"
+ .BR rhosts "(5), " rshd "(8), " rlogind (8)
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/in.rshd.8 netstd/rshd/in.rshd.8
*** netstd.orig/rshd.orig/in.rshd.8	Thu Jan  1 01:00:00 1970
--- netstd/rshd/in.rshd.8	Thu May 12 14:18:13 1994
***************
*** 0 ****
--- 1 ----
+ .so man8/rshd.8
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/inetprivate.h netstd/rshd/inetprivate.h
*** netstd.orig/rshd.orig/inetprivate.h	Thu Jan  1 01:00:00 1970
--- netstd/rshd/inetprivate.h	Wed Jul 19 19:05:13 1995
***************
*** 0 ****
--- 1,49 ----
+ #include <sys/types.h>
+ #include <sys/uio.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <ctype.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <sys/time.h>
+ #include <arpa/inet.h>
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ 
+ #include <net/if.h>
+ #include <linux/sockios.h>
+ 
+ extern void _sethtent(int f);
+ extern void _endhtent(void);
+ extern struct hostent *_gethtent(void);
+ extern struct hostent *_gethtbyname(const char *name);
+ extern struct hostent *_gethtbyaddr(const char *addr, int len,
+ 		 int type);
+ extern int _validuser(FILE *hostf, const char *rhost,
+ 		 const char *luser, const char *ruser, int baselen);
+ extern int _checkhost(const char *rhost, const char *lhost, int len);
+ 
+ #ifndef __linux__
+ /* see resolv.h */
+ extern u_short _getshort(u_char *msgp);
+ extern u_long _getlong(u_char *msgp);
+ extern void putlong(u_long l, u_char *msgp);
+ extern void p_query(char *msg);
+ extern void fp_query(char *msg, FILE *file);
+ extern char *p_cdname(char *cp, char *msg, FILE *file);
+ extern char *p_rr(char *cp, char *msg, FILE *file);
+ extern char *p_type(int type);
+ extern char * p_class(int class);
+ extern char *p_time(u_long value);
+ #endif
+ 
+ extern void putshort(u_short l, u_char *msgp);
+ extern char * hostalias(const char *name);
+ extern void sethostfile(char *name);
+ extern void _res_close (void);
+ extern void ruserpass(const char *host, char **aname, char **apass);
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/rcmd.c netstd/rshd/rcmd.c
*** netstd.orig/rshd.orig/rcmd.c	Thu Jan  1 01:00:00 1970
--- netstd/rshd/rcmd.c	Fri Jan 27 03:49:07 1995
***************
*** 0 ****
--- 1,418 ----
+ /*
+  * Copyright (c) 1983 Regents of the University of California.
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms are permitted
+  * provided that the above copyright notice and this paragraph are
+  * duplicated in all such forms and that any documentation,
+  * advertising materials, and other materials related to such
+  * distribution and use acknowledge that the software was developed
+  * by the University of California, Berkeley.  The name of the
+  * University may not be used to endorse or promote products derived
+  * from this software without specific prior written permission.
+  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+  */
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)rcmd.c	5.17 (Berkeley) 6/27/88";
+ #endif /* LIBC_SCCS and not lint */
+ 
+ #include "inetprivate.h"
+ #include <pwd.h>
+ #include <sys/file.h>
+ #include <sys/signal.h>
+ #include <sys/stat.h>
+ 
+ #if NLS
+ #include "nl_types.h"
+ #endif
+ 
+ int
+ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
+ 	char **ahost;
+ 	unsigned short rport;
+ 	const char *locuser, *remuser, *cmd;
+ 	int *fd2p;
+ {
+ 	int s, timo = 1;
+ #ifdef F_SETOWN
+ 	pid_t pid;
+ #endif
+ #ifdef _POSIX_SOURCE
+ 	sigset_t set, oset;
+ #else
+ 	long oldmask;
+ #endif
+ 	struct sockaddr_in sin, from;
+ 	char c;
+ 	int lport = IPPORT_RESERVED - 1;
+ 	struct hostent *hp;
+ 
+ #if NLS
+ 	libc_nls_init();
+ #endif
+ 
+ #ifdef F_SETOWN
+ 	pid = getpid();
+ #endif
+ 	hp = gethostbyname(*ahost);
+ 	if (hp == 0) {
+ #if NLS
+ 		fprintf(stderr, "%s: %s\n", *ahost,
+                               catgets(_libc_cat, HerrorListSet,
+ 				      2, "unknown host"));
+ #else
+ 		fprintf(stderr, "%s: unknown host\n", *ahost);
+ #endif
+ 		return (-1);
+ 	}
+ 	*ahost = hp->h_name;
+ #ifdef SIGURG
+ #ifdef _POSIX_SOURCE
+ 	sigemptyset (&set);
+ 	sigaddset (&set, SIGURG);
+ 	sigprocmask (SIG_BLOCK, &set, &oset);
+ #else
+ 	oldmask = sigblock(sigmask(SIGURG));
+ #endif
+ #endif
+ 	for (;;) {
+ 		s = rresvport(&lport);
+ 		if (s < 0) {
+ 			if (errno == EAGAIN)
+ #if NLS
+ 				fprintf(stderr, "socket: %s\n",
+ 					catgets(_libc_cat, NetMiscSet,
+ 						NetMiscAllPortsInUse,
+ 						"All ports in use"));
+ #else
+ 				fprintf(stderr, "socket: All ports in use\n");
+ #endif
+ 			else
+ #if NLS
+ 				perror(catgets(_libc_cat, NetMiscSet,
+ 					       NetMiscRcmdSocket,
+ 					       "rcmd: socket"));
+ #else
+ 				perror("rcmd: socket");
+ #endif
+ #ifdef SIGURG
+ #ifdef _POSIX_SOURCE
+ 			 sigprocmask (SIG_SETMASK, &oset,
+ 				(sigset_t *)NULL);
+ #else
+ 			sigsetmask(oldmask);
+ #endif
+ #endif
+ 			return (-1);
+ 		}
+ #ifdef F_SETOWN
+ 		fcntl(s, F_SETOWN, pid);
+ #endif
+ 		sin.sin_family = hp->h_addrtype;
+ 		bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, hp->h_length);
+ 		sin.sin_port = rport;
+ 		if (connect(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0)
+ 			break;
+ 		(void) close(s);
+ 		if (errno == EADDRINUSE) {
+ 			lport--;
+ 			continue;
+ 		}
+ 		if (errno == ECONNREFUSED && timo <= 16) {
+ 			sleep(timo);
+ 			timo *= 2;
+ 			continue;
+ 		}
+ 		if (hp->h_addr_list[1] != NULL) {
+ 			int oerrno = errno;
+ 
+ 			fprintf(stderr,
+ #if NLS
+ 				"%s %s: ", catgets(_libc_cat, NetMiscSet,
+ 						   NetMiscAllPortsInUse,
+ 						   "connect to address"),
+ 					   inet_ntoa(sin.sin_addr));
+ 
+ #else
+ 
+ 			    "connect to address %s: ", inet_ntoa(sin.sin_addr));
+ #endif
+ 			errno = oerrno;
+ 			perror(0);
+ 			hp->h_addr_list++;
+ 			bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr,
+ 			    hp->h_length);
+ 
+ #if NLS
+ 			fprintf(stderr, catgets(_libc_cat, NetMiscSet,
+ 						NetMiscTrying,
+ 						"Trying %s...\n"),
+ #else
+ 			fprintf(stderr,	"Trying %s...\n",
+ #endif
+ 				inet_ntoa(sin.sin_addr));
+ 			continue;
+ 		}
+ 		perror(hp->h_name);
+ #ifdef SIGURG
+ #ifdef _POSIX_SOURCE
+ 		sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
+ #else
+ 		sigsetmask(oldmask);
+ #endif
+ #endif
+ 		return (-1);
+ 	}
+ 	lport--;
+ 	if (fd2p == 0) {
+ 		write(s, "", 1);
+ 		lport = 0;
+ 	} else {
+ 		char num[8];
+ 		int s2 = rresvport(&lport), s3;
+ 		int len = sizeof (from);
+ 
+ 		if (s2 < 0)
+ 			goto bad;
+ 		listen(s2, 1);
+ 		(void) sprintf(num, "%d", lport);
+ 		if (write(s, num, strlen(num)+1) != strlen(num)+1) {
+ #if NLS
+ 			perror(catgets(_libc_cat, NetMiscSet,
+ 				       NetMiscSettingUpStderr,
+ 				       "write: setting up stderr"));
+ #else
+ 			perror("write: setting up stderr");
+ #endif
+ 			(void) close(s2);
+ 			goto bad;
+ 		}
+ 		s3 = accept(s2, (struct sockaddr *)&from, &len);
+ 		(void) close(s2);
+ 		if (s3 < 0) {
+ #if NLS
+ 			perror(catgets(_libc_cat, NetMiscSet,
+ 				       NetMiscAccept,
+ 				       "accept"));
+ #else
+ 			perror("accept");
+ #endif
+ 			lport = 0;
+ 			goto bad;
+ 		}
+ 		*fd2p = s3;
+ 		from.sin_port = ntohs((u_short)from.sin_port);
+ 		if (from.sin_family != AF_INET ||
+ 		    from.sin_port >= IPPORT_RESERVED) {
+ 			fprintf(stderr,
+ #if NLS
+ 				"%s\n",
+ 				catgets(_libc_cat, NetMiscSet,
+ 					NetMiscProtocolFailure,
+ 					"socket: protocol failure in circuit setup."));
+ #else
+ 			    "socket: protocol failure in circuit setup.\n");
+ #endif
+ 			goto bad2;
+ 		}
+ 	}
+ 	(void) write(s, locuser, strlen(locuser)+1);
+ 	(void) write(s, remuser, strlen(remuser)+1);
+ 	(void) write(s, cmd, strlen(cmd)+1);
+ 	if (read(s, &c, 1) != 1) {
+ 		perror(*ahost);
+ 		goto bad2;
+ 	}
+ 	if (c != 0) {
+ 		while (read(s, &c, 1) == 1) {
+ 			(void) write(2, &c, 1);
+ 			if (c == '\n')
+ 				break;
+ 		}
+ 		goto bad2;
+ 	}
+ #ifdef SIGURG
+ #ifdef _POSIX_SOURCE
+ 	sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
+ #else
+ 	sigsetmask(oldmask);
+ #endif
+ #endif
+ 	return (s);
+ bad2:
+ 	if (lport)
+ 		(void) close(*fd2p);
+ bad:
+ 	(void) close(s);
+ #ifdef SIGURG
+ #ifdef _POSIX_SOURCE
+ 	sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL);
+ #else
+ 	sigsetmask(oldmask);
+ #endif
+ #endif
+ 	return (-1);
+ }
+ 
+ int
+ rresvport(alport)
+ 	int *alport;
+ {
+ 	struct sockaddr_in sin;
+ 	int s;
+ 
+ 	sin.sin_family = AF_INET;
+ 	sin.sin_addr.s_addr = INADDR_ANY;
+ 	s = socket(AF_INET, SOCK_STREAM, 0);
+ 	if (s < 0)
+ 		return (-1);
+ 	for (;;) {
+ 		sin.sin_port = htons((u_short)*alport);
+ 		if (bind(s, (struct sockaddr *)&sin, sizeof (sin)) >= 0)
+ 			return (s);
+ 		if (errno != EADDRINUSE) {
+ 			(void) close(s);
+ 			return (-1);
+ 		}
+ 		(*alport)--;
+ 		if (*alport == IPPORT_RESERVED/2) {
+ 			(void) close(s);
+ 			errno = EAGAIN;		/* close */
+ 			return (-1);
+ 		}
+ 	}
+ }
+ 
+ int
+ ruserok(const char *rhost, int superuser, const char *ruser,
+ 	const char *luser)
+ {
+ 	FILE *hostf;
+ 	char fhost[MAXHOSTNAMELEN];
+ 	int first = 1;
+ 	register const char *sp;
+ 	register char *p;
+ 	int baselen = -1;
+ 	uid_t saveuid;
+ 
+ 	saveuid = geteuid();
+ 	sp = rhost;
+ 	p = fhost;
+ 	while (*sp) {
+ 		if (*sp == '.') {
+ 			if (baselen == -1)
+ 				baselen = sp - rhost;
+ 			*p++ = *sp++;
+ 		} else {
+ 			*p++ = isupper(*sp) ? tolower(*sp++) : *sp++;
+ 		}
+ 	}
+ 	*p = '\0';
+ 	hostf = superuser ? (FILE *)0 : fopen(_PATH_HEQUIV, "r");
+ again:
+ 	if (hostf) {
+ 		if (!_validuser(hostf, fhost, luser, ruser, baselen)) {
+ 			(void) fclose(hostf);
+ 			seteuid(saveuid);
+ 			return(0);
+ 		}
+ 		(void) fclose(hostf);
+ 	}
+ 	if (first == 1) {
+ 		struct stat sbuf;
+ 		struct passwd *pwd;
+ 		char pbuf[MAXPATHLEN];
+ 
+ 		first = 0;
+ 		if ((pwd = getpwnam(luser)) == NULL)
+ 			return(-1);
+ 		(void)strcpy(pbuf, pwd->pw_dir);
+ 		(void)strcat(pbuf, "/.rhosts");
+ 		(void)seteuid(pwd->pw_uid);
+ 		if ((hostf = fopen(pbuf, "r")) == NULL) {
+ 			seteuid(saveuid);
+ 			return(-1);
+ 		}
+ 		(void)fstat(fileno(hostf), &sbuf);
+ 		if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid) {
+ 			fclose(hostf);
+ 			seteuid(saveuid);
+ 			return(-1);
+ 		}
+ 		goto again;
+ 	}
+ 	seteuid(saveuid);
+ 	return (-1);
+ }
+ 
+ int
+ _validuser(FILE *hostf, const char *rhost, const char *luser,
+ 	const char *ruser, int baselen)
+ {
+ 	char *user;
+ 	char ahost[MAXHOSTNAMELEN];
+ 	register char *p;
+ 
+ 	while (fgets(ahost, sizeof (ahost), hostf)) {
+ 		p = ahost;
+ 		while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
+ 			*p = isupper(*p) ? tolower(*p) : *p;
+ 			p++;
+ 		}
+ 		if (*p == ' ' || *p == '\t') {
+ 			*p++ = '\0';
+ 			while (*p == ' ' || *p == '\t')
+ 				p++;
+ 			user = p;
+ 			while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0')
+ 				p++;
+ 		} else
+ 			user = p;
+ 		*p = '\0';
+ 		if (_checkhost(rhost, ahost, baselen) &&
+ 		    !strcmp(ruser, *user ? user : luser)) {
+ 			return (0);
+ 		}
+ 	}
+ 	return (-1);
+ }
+ 
+ int
+ _checkhost(const char *rhost, const char *lhost, int len)
+ {
+ 	static char ldomain[MAXHOSTNAMELEN + 1];
+ 	static char *domainp = NULL;
+ 	static int nodomain = 0;
+ 	static struct hostent *hp;
+ 	register char *cp;
+ 
+ 	if (len == -1)
+ 		return(!strcmp(rhost, lhost));
+ 	if (strncmp(rhost, lhost, len))
+ 		return(0);
+ 	if (!strcmp(rhost, lhost))
+ 		return(1);
+ 	if (*(lhost + len) != '\0')
+ 		return(0);
+ 	if (nodomain)
+ 		return(0);
+ 	if (!domainp) {
+ 		if (gethostname(ldomain, sizeof(ldomain)) == -1) {
+ 			nodomain = 1;
+ 			return(0);
+ 		}
+ 		if ((hp = gethostbyname(ldomain)) == NULL)
+ 			return(0);
+ 		if ((domainp = index(hp->h_name, '.')) == (char *)NULL) {
+ 			nodomain = 1;
+ 			return(0);
+ 		}
+ 		for (cp = ++domainp; *cp; ++cp)
+ 			if (isupper(*cp))
+ 				*cp = tolower(*cp);
+ 	}
+ 	return(!strcmp(domainp, rhost + len +1));
+ }
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/rhosts.5 netstd/rshd/rhosts.5
*** netstd.orig/rshd.orig/rhosts.5	Thu Jan  1 01:00:00 1970
--- netstd/rshd/rhosts.5	Mon Jan 30 00:36:17 1995
***************
*** 0 ****
--- 1,27 ----
+ .\" Copyright (c) 1995 Peter Tobias <tobias@et-inf.fho-emden.de>
+ .\" This file may be distributed under the GNU General Public License.
+ .TH RHOSTS 5 "29 Jan 1995" "Linux" "Linux Programmer's Manual"
+ .SH NAME
+ $HOME/.rhosts \- grants or denies password-free \fBr\fP-command access
+ to a specific user account
+ .SH DESCRIPTION
+ The \fB.rhosts\fP file allows or denies a user who has an account on the
+ local host to use the \fBr\fP-commands (e.g. \fBrlogin\fP, \fBrsh\fP or
+ \fBrcp\fP) without supplying a password.
+ .PP
+ The file uses the following format:
+ .TP
+ \fIhostname\fP \fI[username]\fP
+ .PP
+ Such an entry grants password-free \fBr\fP-command access for the user with
+ the login name \fIusername\fP from the remote host \fIhostname\fP.
+ If no user name is specified, the user must have the same login name on
+ the remote host and the local host. For security reasons you should always
+ use the FQDN of the hostname and not the short hostname.
+ .PP
+ Netgroups can be specified by preceeding the netgroup by an @ sign.
+ .PP
+ .SH FILES
+ $HOME/.rhosts
+ .SH "SEE ALSO"
+ .BR hosts.equiv "(5), " rshd "(8), " rlogind (8)
diff -c -P --recursive --exclude=COPYRIGHT --exclude=COPYING netstd.orig/rshd.orig/rshd.c netstd/rshd/rshd.c
*** netstd.orig/rshd.orig/rshd.c	Thu Dec 23 20:56:18 1993
--- netstd/rshd/rshd.c	Sat Apr 16 22:36:34 1994
***************
*** 193,199 ****
  char	path[100] = "PATH=";
  char	*envinit[] =
  	    {homedir, shell, path, username, 0};
! char	**environ;
  
  doit(fromp)
  	struct sockaddr_in *fromp;
--- 193,199 ----
  char	path[100] = "PATH=";
  char	*envinit[] =
  	    {homedir, shell, path, username, 0};
! extern	char	**environ;
  
  doit(fromp)
  	struct sockaddr_in *fromp;
***************
*** 203,209 ****
  	struct passwd *pwd;
  	int s;
  	struct hostent *hp;
! 	char *hostname, *errorstr = NULL, *errorhost;
  	u_short port;
  	int pv[2], pid, cc;
  	int nfd;
--- 203,210 ----
  	struct passwd *pwd;
  	int s;
  	struct hostent *hp;
! 	const char *hostname, *errorhost;
! 	char *errorstr = NULL;
  	u_short port;
  	int pv[2], pid, cc;
  	int nfd;
***************
*** 452,458 ****
  #endif
  
  		if (errorstr ||
- 		    pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' &&
  		    ruserok(hostname, pwd->pw_uid == 0, remuser, locuser) < 0) {
  fail:
  			if (errorstr == NULL)
--- 453,458 ----
***************
*** 624,630 ****
  			    FD_ISSET(pv[0], &readfrom));
  			exit(0);
  		}
! 		setpgrp(0, getpid());
  		(void) close(s); (void) close(pv[0]);
  #ifdef CRYPT
  #ifdef KERBEROS
--- 624,630 ----
  			    FD_ISSET(pv[0], &readfrom));
  			exit(0);
  		}
! 		setpgrp();
  		(void) close(s); (void) close(pv[0]);
  #ifdef CRYPT
  #ifdef KERBEROS
