diff -r -C2 --new-file NetKit-B-0.07/ChangeLog NetKit-B-0.07A/ChangeLog
*** NetKit-B-0.07/ChangeLog	Mon Jul 22 05:54:50 1996
--- NetKit-B-0.07A/ChangeLog	Fri Jul 26 00:44:35 1996
***************
*** 1,3 ****
! New in 0.07: (16-Jul-1996)
  - removed portmap; use Wietse Venema's portmap.
  - removed rdist; use rdist 6.x distributed separately.
--- 1,10 ----
! New in 0.07A: (25-Jul-1996)
! - fixed the top-level makefile.
! - removed old versions of rpcgen and slattach.
! - fixed a bug in telnet where the escape character was being ignored.
! - fixed a bug in telnetd; now uses the correct names for the last ptys
!   (that is, ptya0-ptyef, not ptyA0-ptyEf.)
! 
! New in 0.07: (23-Jul-1996)
  - removed portmap; use Wietse Venema's portmap.
  - removed rdist; use rdist 6.x distributed separately.
diff -r -C2 --new-file NetKit-B-0.07/MCONFIG NetKit-B-0.07A/MCONFIG
*** NetKit-B-0.07/MCONFIG	Mon Jul 22 05:46:24 1996
--- NetKit-B-0.07A/MCONFIG	Fri Jul 26 00:30:37 1996
***************
*** 46,49 ****
--- 46,55 ----
  #
  # On the PowerPC, you probably want to add -fsigned-char to CFLAGS.
+ #
+ # Note: if talk breaks because it can't find "unctrl.h", your ncurses 
+ # package is not installed correctly. Either link /usr/include/unctrl.h
+ # to /usr/include/ncurses/unctrl.h, fix /usr/include/ncurses/curses.h to
+ # include <ncurses/unctrl.h> instead of <unctrl.h>, or hack around the 
+ # problem by putting -I/usr/include/ncurses in the CFLAGS.
  
  CC=gcc
diff -r -C2 --new-file NetKit-B-0.07/Makefile NetKit-B-0.07A/Makefile
*** NetKit-B-0.07/Makefile	Sun Jul 21 04:25:54 1996
--- NetKit-B-0.07A/Makefile	Fri Jul 26 01:32:38 1996
***************
*** 14,19 ****
  # routed	(deprecated due to being totally broken beyond hope; use gated)
  # rup		(doesn't compile...)
- # rpcgen	(obsolete)
- # slattach	(obsolete)
  #
  # These programs are not supplied at all any more:
--- 14,17 ----
***************
*** 23,33 ****
  
  
! all:
! 	for i in $(SUB); do make -C  $$i; done
  
! install:
! 	for i in $(SUB); do make -C  $$i install; done
  
! clean:
! 	for i in $(SUB); do make -C  $$i clean; done
  
--- 21,34 ----
  
  
! %.build:
! 	$(MAKE)-C$(patsubst %.build, %, $@)
  
! %.install:
! 	$(MAKE)-C$(patsubst %.install, %, $@) install
  
! %.clean:
! 	$(MAKE)-C$(patsubst %.clean, %, $@) clean
  
+ all:     $(patsubst %, %.build, $(SUB))
+ install: $(patsubst %, %.install, $(SUB))
+ clean:   $(patsubst %, %.clean, $(SUB))
diff -r -C2 --new-file NetKit-B-0.07/README NetKit-B-0.07A/README
*** NetKit-B-0.07/README	Mon Jul 22 17:12:47 1996
--- NetKit-B-0.07A/README	Fri Jul 26 00:31:41 1996
***************
*** 1,6 ****
! This is NetKit-B-0.07.
  
  This is probably the last or next to last NetKit-B. NetKit-A has
  already officially ceased to exist.
  
  In the future the components of the NetKit packages will be available
--- 1,8 ----
! This is NetKit-B-0.07A.
  
  This is probably the last or next to last NetKit-B. NetKit-A has
  already officially ceased to exist.
+ 
+ NetKit-B-0.07A fixes some stupid bugs in NetKit-B-0.07.
  
  In the future the components of the NetKit packages will be available
diff -r -C2 --new-file NetKit-B-0.07/rexecd/rexecd.c NetKit-B-0.07A/rexecd/rexecd.c
*** NetKit-B-0.07/rexecd/rexecd.c	Tue Jul 23 20:15:54 1996
--- NetKit-B-0.07A/rexecd/rexecd.c	Fri Jul 26 00:51:50 1996
***************
*** 40,44 ****
   */
  char rcsid[] = 
!   "$Id: rexecd.c,v 1.9 1996/07/24 00:15:51 dholland Exp $";
  
  
--- 40,44 ----
   */
  char rcsid[] = 
!   "$Id: rexecd.c,v 1.10 1996/07/26 04:51:44 dholland Exp $";
  
  
***************
*** 310,318 ****
  		}
  	    }
- #endif /* !USE_PAM */
  	    fclose(fp);
  	}
  	else syslog(LOG_ERR, "cannot open /etc/ftpusers");
  #endif
  
  	/* Log successful attempts. */
--- 310,318 ----
  		}
  	    }
  	    fclose(fp);
  	}
  	else syslog(LOG_ERR, "cannot open /etc/ftpusers");
  #endif
+ #endif /* !USE_PAM */
  
  	/* Log successful attempts. */
diff -r -C2 --new-file NetKit-B-0.07/rlogind/Makefile NetKit-B-0.07A/rlogind/Makefile
*** NetKit-B-0.07/rlogind/Makefile	Tue Jul 23 04:19:13 1996
--- NetKit-B-0.07A/rlogind/Makefile	Fri Jul 26 00:53:04 1996
***************
*** 8,13 ****
  ifeq ($(USE_PAM),1)
  CFLAGS += -DUSE_PAM
! LDFLAGS += -ldl -lpam
! OBJS += pamconv.o
  endif
  
--- 8,12 ----
  ifeq ($(USE_PAM),1)
  CFLAGS += -DUSE_PAM
! LIBS += -ldl -lpam -lpam_misc
  endif
  
diff -r -C2 --new-file NetKit-B-0.07/rlogind/pamconv.c NetKit-B-0.07A/rlogind/pamconv.c
*** NetKit-B-0.07/rlogind/pamconv.c	Tue Jul 23 03:42:50 1996
--- NetKit-B-0.07A/rlogind/pamconv.c	Wed Dec 31 19:00:00 1969
***************
*** 1,157 ****
- /*
-  * Modifications for Linux-PAM: Al Longyear <longyear@netcom.com>
-  *   General code clean up: Andrew Morgan <morgan@physics.ucla.edu>
-  *   Re-built with #ifdef USE_PAM: Michael K. Johnson <johnsonm@redhat.com>,
-  *   Red Hat Software
-  *
-  *   The Linux-PAM mailing list (25JUN96) <pam-list@redhat.com>
-  */
- 
- #ifdef USE_PAM
- /* conversation function and static variables for communication */
- 
- /*
-  * A generic conversation function for text based applications
-  *
-  * Written by Andrew Morgan <morgan@physics.ucla.edu>
-  *
-  */
- 
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- 
- #include <security/pam_appl.h>
- 
- #define INPUTSIZE PAM_MAX_MSG_SIZE
- 
- #define CONV_ECHO_ON  1
- 
- #define CONV_ECHO_OFF 0
- 
- #define _pam_overwrite(x) \
- { \
-      register char *xx; \
-      if ((xx=x)) \
-           while (*xx) \
-                *xx++ = '\0'; \
- }
- 
- static char *read_string(int echo, const char *remark)
- {
-      char buffer[INPUTSIZE];
-      char *text,*tmp;
- 
-      if (!echo) {
-          tmp = getpass(remark);
-          text = strdup(tmp);       /* get some space for this text */
-          _pam_overwrite(tmp);       /* overwrite the old record of
-                                      * the password */
-      } else {
-          fprintf(stderr,"%s",remark);
-          text = fgets(buffer,INPUTSIZE-1,stdin);
-          if (text) {
-               tmp = buffer + strlen(buffer);
-               while (tmp > buffer && (*--tmp == '\n'))
-                    *tmp = '\0';
-               text = strdup(buffer);  /* get some space for this text */
-          }
-      }
- 
-      return (text);
- }
- 
- #define REPLY_CHUNK 5
- 
- static void drop_reply(struct pam_response *reply, int replies)
- {
-      int i;
- 
-      for (i=0; i<replies; ++i) {
-          _pam_overwrite(reply[i].resp);      /* might be a password */
-          free(reply[i].resp);
-      }
-      if (reply)
-          free(reply);
- }
- 
- int misc_conv(int num_msg, const struct pam_message **msgm,
-                     struct pam_response **response, void *appdata_ptr)
- {
-      int count=0,replies=0,space=0;
-      struct pam_response *reply=NULL;
-      char *string=NULL;
- 
-      for (count=0; count < num_msg; ++count) {
-          switch (msgm[count]->msg_style) {
-          case PAM_PROMPT_ECHO_OFF:
-               string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
-               if (string == NULL) {
-                    drop_reply(reply,replies);
-                    return (PAM_CONV_ERR);
-               }
-               break;
-          case PAM_PROMPT_ECHO_ON:
-               string = read_string(CONV_ECHO_ON,msgm[count]->msg);
-               if (string == NULL) {
-                    drop_reply(reply,replies);
-                    return (PAM_CONV_ERR);
-               }
-               break;
-          case PAM_ERROR_MSG:
-               fprintf(stderr,"%s\n",msgm[count]->msg);
-               break;
-          case PAM_TEXT_INFO:
-               fprintf(stderr,"%s\n",msgm[count]->msg);
-               break;
-          default:
-               fprintf(stderr, "erroneous conversation (%d)\n"
-                       ,msgm[count]->msg_style);
-               drop_reply(reply,replies);
-               return (PAM_CONV_ERR);
-          }
- 
-          if (string) {     /* must add to reply array */
-               struct pam_response *ptmp;
- 
-               /* do we need a larger reply array ? */
- 
-               if (space <= replies) {
-                    space += REPLY_CHUNK;
-                    ptmp = (struct pam_response *)
-                         realloc(reply, space*sizeof(struct pam_response));
-                    if (ptmp == NULL) {
-                         drop_reply(reply,replies);
-                        return PAM_CONV_ERR;        /* ran out of memory */
-                    }
-                    reply = ptmp;                       /* enlarged array*/
-               }
- 
-               /* add string to list of responses */
- 
-               reply[replies].resp_retcode = 0;
-               reply[replies++].resp = string;
-               string = NULL;
-          }
-      }
- 
-      /* do we need to bother with a response? */
-      if (reply) {
- 
-          /* note, this pam_response structure (array) will be
-           * free()'d by the module */
- 
-          *response = reply;
-      }
- 
-      return PAM_SUCCESS;
- }
- 
- struct pam_conv conv = {
- 	misc_conv,
- 	NULL
- };
- 
- #endif /* USE_PAM */
- 
--- 0 ----
diff -r -C2 --new-file NetKit-B-0.07/rlogind/rlogind.c NetKit-B-0.07A/rlogind/rlogind.c
*** NetKit-B-0.07/rlogind/rlogind.c	Tue Jul 23 04:19:00 1996
--- NetKit-B-0.07A/rlogind/rlogind.c	Fri Jul 26 01:08:21 1996
***************
*** 50,54 ****
   */
  char rcsid[] = 
!   "$Id: rlogind.c,v 1.11 1996/07/23 08:18:58 dholland Exp $";
  
  /*
--- 50,54 ----
   */
  char rcsid[] = 
!   "$Id: rlogind.c,v 1.13 1996/07/26 05:08:18 dholland Exp $";
  
  /*
***************
*** 75,78 ****
--- 75,79 ----
  
  #include <pwd.h>
+ #include <grp.h>
  #include <syslog.h>
  #include <errno.h>
***************
*** 83,88 ****
  
  #ifdef USE_PAM
! #include <grp.h>
  #include <security/pam_appl.h>
  #endif
  
--- 84,90 ----
  
  #ifdef USE_PAM
! #include <sys/types.h>
  #include <security/pam_appl.h>
+ #include <security/pam_misc.h>
  #endif
  
***************
*** 134,137 ****
--- 136,140 ----
  	int on = 1, fromlen;
  	struct sockaddr_in from;
+ 	_check_rhosts_file = 1;     /* default */
  
  	openlog("rlogind", LOG_PID | LOG_CONS, LOG_AUTH);
***************
*** 311,321 ****
  			}
  #ifdef USE_PAM
! 			pam_end(pamh, PAM_AUTH_ERR);
! /* I gather that PAM precludes dropping to straight login or something. (?) */
! #else
  			execl(_PATH_LOGIN, "login", "-p",
  			      "-h", hp->h_name, lusername, 0);
  			/* should not return... */
- #endif
  		}
  		fatal(STDERR_FILENO, _PATH_LOGIN, 1);
--- 314,322 ----
  			}
  #ifdef USE_PAM
! 			pam_end(pamh, PAM_SUCCESS);
! #endif
  			execl(_PATH_LOGIN, "login", "-p",
  			      "-h", hp->h_name, lusername, 0);
  			/* should not return... */
  		}
  		fatal(STDERR_FILENO, _PATH_LOGIN, 1);
***************
*** 508,512 ****
  		logwtmp(p, "", "");
  #ifdef USE_PAM
-        pam_close_session(pamh, 0);
         pam_end (pamh, PAM_SUCCESS);
  #endif
--- 509,512 ----
***************
*** 554,558 ****
  
  #ifdef USE_PAM
- 	pam_close_session(pamh, 0);
  	pam_end (pamh, PAM_SUCCESS);
  #endif
--- 554,557 ----
***************
*** 566,570 ****
  #ifdef USE_PAM
  	char c;
! 	extern struct pam_conv conv;
          int retval;
  #endif /* USE_PAM */
--- 565,572 ----
  #ifdef USE_PAM
  	char c;
! 	static struct pam_conv conv = {
! 	  misc_conv,
! 	  NULL
! 	};
          int retval;
  #endif /* USE_PAM */
***************
*** 600,608 ****
                 if (retval == PAM_SUCCESS)
                         break;
!                if (retval == PAM_AUTHTOKEN_REQD)
                         retval = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
!        } while (retval == PAM_SUCCESS);
  
!        if (retval == PAM_SUCCESS) {
                 if (setgid(pwd->pw_gid) != 0) {
                         fprintf(stderr, "cannot assume gid\n");
--- 602,621 ----
                 if (retval == PAM_SUCCESS)
                         break;
!                if (retval == PAM_AUTHTOKEN_REQD) {
                         retval = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
! 	               if(retval == PAM_SUCCESS)
! 			 /* Try authentication again if passwd change
! 			    succeeded.  Don't try again if it didn't;
! 			    sysadmin might not want passwords changed
! 			    over the next, and might have set password
! 			    to pam_deny.so to disable it... */
! 			 continue;
! 	       }
!        } while (0); /* We have the while(0) here because it is either using
! 		       that and the breaks, or goto's */
! 	/* eww. -dah */
! 
  
! 	if (retval == PAM_SUCCESS) {
                 if (setgid(pwd->pw_gid) != 0) {
                         fprintf(stderr, "cannot assume gid\n");
***************
*** 616,630 ****
  
                 retval = pam_setcred(pamh, PAM_CRED_ESTABLISH);
!        }
  
!        if (retval == PAM_SUCCESS)
!                retval = pam_open_session(pamh,0);
!        return (retval ^ PAM_SUCCESS);
! #else
  
  	if (pwd->pw_uid == 0)
  		return(-1);
  	return(ruserok(host, 0, rusername, lusername));
! #endif /* USE_PAM */
  }
  
--- 629,647 ----
  
                 retval = pam_setcred(pamh, PAM_CRED_ESTABLISH);
! 	}
  
! 	if (retval != PAM_SUCCESS) {
! 		syslog(LOG_ERR,"PAM authentication failed for in.rlogind");
! 		fatal(STDERR_FILENO, "login failed", 0);
! 		/* no return */
! 	}
! 	return 0;
! 
! #else /* !USE_PAM */
  
  	if (pwd->pw_uid == 0)
  		return(-1);
  	return(ruserok(host, 0, rusername, lusername));
! #endif /* PAM */
  }
  
diff -r -C2 --new-file NetKit-B-0.07/rpc.rusersd/Makefile NetKit-B-0.07A/rpc.rusersd/Makefile
*** NetKit-B-0.07/rpc.rusersd/Makefile	Sat Jul 20 16:52:53 1996
--- NetKit-B-0.07A/rpc.rusersd/Makefile	Fri Jul 26 01:31:15 1996
***************
*** 8,11 ****
--- 8,13 ----
  #  .endif
  
+ RPCGEN=../rpcgen.new/rpcgen
+ 
  # Doesn't compile cleanly with -Wall
  CFLAGS = -O2 -D__USE_BSD_SIGNAL -I../include
***************
*** 17,32 ****
  
  rusers.h: ../include/rpcsvc/rusers.x
! 	../rpcgen.new/rpcgen -h -o rusers.h ../include/rpcsvc/rusers.x
  
  rusers_xdr.c: ../include/rpcsvc/rusers.x
! 	../rpcgen.new/rpcgen -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  
  rnusers_xdr.o: rnusers_xdr.c rnusers.h
  
  rnusers.h: ../include/rpcsvc/rnusers.x
! 	../rpcgen.new/rpcgen -h -o rnusers.h ../include/rpcsvc/rnusers.x
  
  rnusers_xdr.c: ../include/rpcsvc/rnusers.x
! 	../rpcgen.new/rpcgen -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  
  install: rusersd
--- 19,34 ----
  
  rusers.h: ../include/rpcsvc/rusers.x
! 	$(RPCGEN) -h -o rusers.h ../include/rpcsvc/rusers.x
  
  rusers_xdr.c: ../include/rpcsvc/rusers.x
! 	$(RPCGEN) -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  
  rnusers_xdr.o: rnusers_xdr.c rnusers.h
  
  rnusers.h: ../include/rpcsvc/rnusers.x
! 	$(RPCGEN) -h -o rnusers.h ../include/rpcsvc/rnusers.x
  
  rnusers_xdr.c: ../include/rpcsvc/rnusers.x
! 	$(RPCGEN) -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  
  install: rusersd
diff -r -C2 --new-file NetKit-B-0.07/rshd/Makefile NetKit-B-0.07A/rshd/Makefile
*** NetKit-B-0.07/rshd/Makefile	Mon Jul 22 05:43:58 1996
--- NetKit-B-0.07A/rshd/Makefile	Fri Jul 26 01:03:51 1996
***************
*** 8,13 ****
  ifeq ($(USE_PAM),1)
  CFLAGS += -DUSE_PAM
! LDFLAGS += -ldl -lpam
! OBJS += pamconv.o
  endif
  
--- 8,12 ----
  ifeq ($(USE_PAM),1)
  CFLAGS += -DUSE_PAM
! LIBS += -ldl -lpam -lpam_misc
  endif
  
diff -r -C2 --new-file NetKit-B-0.07/rshd/pamconv.c NetKit-B-0.07A/rshd/pamconv.c
*** NetKit-B-0.07/rshd/pamconv.c	Tue Jul 23 03:42:50 1996
--- NetKit-B-0.07A/rshd/pamconv.c	Wed Dec 31 19:00:00 1969
***************
*** 1,157 ****
- /*
-  * Modifications for Linux-PAM: Al Longyear <longyear@netcom.com>
-  *   General code clean up: Andrew Morgan <morgan@physics.ucla.edu>
-  *   Re-built with #ifdef USE_PAM: Michael K. Johnson <johnsonm@redhat.com>,
-  *   Red Hat Software
-  *
-  *   The Linux-PAM mailing list (25JUN96) <pam-list@redhat.com>
-  */
- 
- #ifdef USE_PAM
- /* conversation function and static variables for communication */
- 
- /*
-  * A generic conversation function for text based applications
-  *
-  * Written by Andrew Morgan <morgan@physics.ucla.edu>
-  *
-  */
- 
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- 
- #include <security/pam_appl.h>
- 
- #define INPUTSIZE PAM_MAX_MSG_SIZE
- 
- #define CONV_ECHO_ON  1
- 
- #define CONV_ECHO_OFF 0
- 
- #define _pam_overwrite(x) \
- { \
-      register char *xx; \
-      if ((xx=x)) \
-           while (*xx) \
-                *xx++ = '\0'; \
- }
- 
- static char *read_string(int echo, const char *remark)
- {
-      char buffer[INPUTSIZE];
-      char *text,*tmp;
- 
-      if (!echo) {
-          tmp = getpass(remark);
-          text = strdup(tmp);       /* get some space for this text */
-          _pam_overwrite(tmp);       /* overwrite the old record of
-                                      * the password */
-      } else {
-          fprintf(stderr,"%s",remark);
-          text = fgets(buffer,INPUTSIZE-1,stdin);
-          if (text) {
-               tmp = buffer + strlen(buffer);
-               while (tmp > buffer && (*--tmp == '\n'))
-                    *tmp = '\0';
-               text = strdup(buffer);  /* get some space for this text */
-          }
-      }
- 
-      return (text);
- }
- 
- #define REPLY_CHUNK 5
- 
- static void drop_reply(struct pam_response *reply, int replies)
- {
-      int i;
- 
-      for (i=0; i<replies; ++i) {
-          _pam_overwrite(reply[i].resp);      /* might be a password */
-          free(reply[i].resp);
-      }
-      if (reply)
-          free(reply);
- }
- 
- int misc_conv(int num_msg, const struct pam_message **msgm,
-                     struct pam_response **response, void *appdata_ptr)
- {
-      int count=0,replies=0,space=0;
-      struct pam_response *reply=NULL;
-      char *string=NULL;
- 
-      for (count=0; count < num_msg; ++count) {
-          switch (msgm[count]->msg_style) {
-          case PAM_PROMPT_ECHO_OFF:
-               string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
-               if (string == NULL) {
-                    drop_reply(reply,replies);
-                    return (PAM_CONV_ERR);
-               }
-               break;
-          case PAM_PROMPT_ECHO_ON:
-               string = read_string(CONV_ECHO_ON,msgm[count]->msg);
-               if (string == NULL) {
-                    drop_reply(reply,replies);
-                    return (PAM_CONV_ERR);
-               }
-               break;
-          case PAM_ERROR_MSG:
-               fprintf(stderr,"%s\n",msgm[count]->msg);
-               break;
-          case PAM_TEXT_INFO:
-               fprintf(stderr,"%s\n",msgm[count]->msg);
-               break;
-          default:
-               fprintf(stderr, "erroneous conversation (%d)\n"
-                       ,msgm[count]->msg_style);
-               drop_reply(reply,replies);
-               return (PAM_CONV_ERR);
-          }
- 
-          if (string) {     /* must add to reply array */
-               struct pam_response *ptmp;
- 
-               /* do we need a larger reply array ? */
- 
-               if (space <= replies) {
-                    space += REPLY_CHUNK;
-                    ptmp = (struct pam_response *)
-                         realloc(reply, space*sizeof(struct pam_response));
-                    if (ptmp == NULL) {
-                         drop_reply(reply,replies);
-                        return PAM_CONV_ERR;        /* ran out of memory */
-                    }
-                    reply = ptmp;                       /* enlarged array*/
-               }
- 
-               /* add string to list of responses */
- 
-               reply[replies].resp_retcode = 0;
-               reply[replies++].resp = string;
-               string = NULL;
-          }
-      }
- 
-      /* do we need to bother with a response? */
-      if (reply) {
- 
-          /* note, this pam_response structure (array) will be
-           * free()'d by the module */
- 
-          *response = reply;
-      }
- 
-      return PAM_SUCCESS;
- }
- 
- struct pam_conv conv = {
- 	misc_conv,
- 	NULL
- };
- 
- #endif /* USE_PAM */
- 
--- 0 ----
diff -r -C2 --new-file NetKit-B-0.07/rshd/rshd.c NetKit-B-0.07A/rshd/rshd.c
*** NetKit-B-0.07/rshd/rshd.c	Tue Jul 23 20:16:41 1996
--- NetKit-B-0.07A/rshd/rshd.c	Fri Jul 26 01:05:44 1996
***************
*** 43,47 ****
   * From: @(#)rshd.c	5.38 (Berkeley) 3/2/91
   */
! char rcsid[] = "$Id: rshd.c,v 1.7 1996/07/24 00:16:36 dholland Exp $";
  
  /*
--- 43,47 ----
   * From: @(#)rshd.c	5.38 (Berkeley) 3/2/91
   */
! char rcsid[] = "$Id: rshd.c,v 1.8 1996/07/26 05:05:41 dholland Exp $";
  
  /*
***************
*** 79,82 ****
--- 79,83 ----
  #ifdef USE_PAM
  #include <security/pam_appl.h>
+ #include <security/pam_misc.h>
  static pam_handle_t *pamh;
  static int retcode;
***************
*** 104,108 ****
  	int ch, on = 1, fromlen;
  	struct sockaddr_in from;
! 
  	openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
  
--- 105,109 ----
  	int ch, on = 1, fromlen;
  	struct sockaddr_in from;
! 	_check_rhosts_file=1;
  	openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
  
***************
*** 201,205 ****
  	char remotehost[2 * MAXHOSTNAMELEN + 1];
  #ifdef USE_PAM
!        extern struct pam_conv conv;
  #endif /* USE_PAM */
  
--- 202,210 ----
  	char remotehost[2 * MAXHOSTNAMELEN + 1];
  #ifdef USE_PAM
! 	char c;
! 	static struct pam_conv conv = {
! 	  misc_conv,
! 	  NULL
! 	};
  #endif /* USE_PAM */
  
***************
*** 384,418 ****
          (void) pam_set_item (pamh, PAM_RHOST, hostname);
          (void) pam_set_item (pamh, PAM_TTY,   "/dev/tty");
!         do {
!                 retcode = pam_authenticate(pamh, 0);
!                 if (retcode == PAM_SUCCESS)
!                         retcode = pam_acct_mgmt(pamh, 0);
!                 if (retcode == PAM_SUCCESS)
!                         break;
! 
!                 if (retcode == PAM_AUTHTOKEN_REQD)
!                         retcode = pam_chauthtok (pamh,PAM_CHANGE_EXPIRED_AUTHTOK);
!         } while (retcode == PAM_SUCCESS);
  
! 	if (retcode != PAM_SUCCESS) {
! 		pam_end(pamh,PAM_AUTH_ERR);
! 		exit (1);
  	}
-         if (setgid(pwd->pw_gid) != 0) {
-                 fprintf(stderr, "cannot assume gid\n");
-                 exit (1);
-         }
- 
-  	if (initgroups(locuser, pwd->pw_gid) != 0) {
-                 fprintf(stderr, "cannot initgroups\n");
-                 exit (1);
-         }
- 
- 	retcode = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  
  	if (retcode != PAM_SUCCESS) {
! 		pam_end(pamh,PAM_CRED_ERR);
  	}
! 	retcode = pam_open_session(pamh,0);
  #endif
  
--- 389,417 ----
          (void) pam_set_item (pamh, PAM_RHOST, hostname);
          (void) pam_set_item (pamh, PAM_TTY,   "/dev/tty");
! 	retcode = pam_authenticate(pamh, 0);
! 	if (retcode == PAM_SUCCESS)
! 	  retcode = pam_acct_mgmt(pamh, 0);
! 	if (retcode == PAM_SUCCESS) {
! 	  if (setgid(pwd->pw_gid) != 0) {
! 	    fprintf(stderr, "Permission denied.\n");
! 	    pam_end(pamh,PAM_SYSTEM_ERR);
! 	    exit (1);
! 	  }
  
! 	  if (initgroups(locuser, pwd->pw_gid) != 0) {
! 	    fprintf(stderr, "Permission denied.\n");
! 	    pam_end(pamh,PAM_SYSTEM_ERR);
! 	    exit (1);
! 	  }
! 	  retcode = pam_setcred(pamh, PAM_CRED_ESTABLISH);
  	}
  
+ 	if (retcode == PAM_SUCCESS)
+ 	  retcode = pam_open_session(pamh,0);
  	if (retcode != PAM_SUCCESS) {
! 		pam_end(pamh,retcode);
! 		exit (1);
  	}
! 
  #endif
  
***************
*** 520,527 ****
  			remuser, hostname, locuser, cmdbuf);
  	}
- 
- #ifdef USE_PAM
-        pam_end(pamh, PAM_SUCCESS);
- #endif USE_PAM
  
  	execl(pwd->pw_shell, cp, "-c", cmdbuf, 0);
--- 519,522 ----
diff -r -C2 --new-file NetKit-B-0.07/rusers/Makefile NetKit-B-0.07A/rusers/Makefile
*** NetKit-B-0.07/rusers/Makefile	Mon Jul 15 17:31:13 1996
--- NetKit-B-0.07A/rusers/Makefile	Fri Jul 26 01:32:10 1996
***************
*** 4,9 ****
--- 4,12 ----
  include ../MRULES
  
+ /* Doesn't compile cleanly with -Wall */
  CFLAGS = -O2 -I ../include
  
+ RPCGEN = ../rpcgen.new/rpcgen
+ 
  rusers: rusers.o rusers_xdr.o rnusers_xdr.o
  	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
***************
*** 19,33 ****
  
  rusers.h: ../include/rpcsvc/rusers.x
! 	../rpcgen.new/rpcgen -h -o rusers.h ../include/rpcsvc/rusers.x
  
  rusers_xdr.c: ../include/rpcsvc/rusers.x
! 	../rpcgen.new/rpcgen -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  
  rnusers_xdr.o: rnusers_xdr.c rnusers.h
  
  rnusers.h: ../include/rpcsvc/rnusers.x
! 	../rpcgen.new/rpcgen -h -o rnusers.h ../include/rpcsvc/rnusers.x
  
  rnusers_xdr.c: ../include/rpcsvc/rnusers.x
! 	../rpcgen.new/rpcgen -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  
--- 22,36 ----
  
  rusers.h: ../include/rpcsvc/rusers.x
! 	$(RPCGEN) -h -o rusers.h ../include/rpcsvc/rusers.x
  
  rusers_xdr.c: ../include/rpcsvc/rusers.x
! 	$(RPCGEN) -c -C -o rusers_xdr.c ../include/rpcsvc/rusers.x
  
  rnusers_xdr.o: rnusers_xdr.c rnusers.h
  
  rnusers.h: ../include/rpcsvc/rnusers.x
! 	$(RPCGEN) -h -o rnusers.h ../include/rpcsvc/rnusers.x
  
  rnusers_xdr.c: ../include/rpcsvc/rnusers.x
! 	$(RPCGEN) -c -C -o rnusers_xdr.c ../include/rpcsvc/rnusers.x
  
diff -r -C2 --new-file NetKit-B-0.07/telnet/externs.h NetKit-B-0.07A/telnet/externs.h
*** NetKit-B-0.07/telnet/externs.h	Sat Jul 20 15:47:49 1996
--- NetKit-B-0.07A/telnet/externs.h	Fri Jul 26 00:06:05 1996
***************
*** 32,36 ****
   *
   *	from: @(#)externs.h	5.3 (Berkeley) 3/22/91
!  *	$Id: externs.h,v 1.3 1996/07/20 19:47:39 dholland Exp $
   */
  
--- 32,36 ----
   *
   *	from: @(#)externs.h	5.3 (Berkeley) 3/22/91
!  *	$Id: externs.h,v 1.4 1996/07/26 04:05:03 dholland Exp $
   */
  
***************
*** 71,74 ****
--- 71,78 ----
  #endif
  #include <strings.h>
+ 
+ #ifdef __linux__
+ #include <unistd.h>   /* get _POSIX_VDISABLE */
+ #endif
  
  #ifndef	_POSIX_VDISABLE
diff -r -C2 --new-file NetKit-B-0.07/telnetd/sys_term.c NetKit-B-0.07A/telnetd/sys_term.c
*** NetKit-B-0.07/telnetd/sys_term.c	Tue Jul 16 04:58:31 1996
--- NetKit-B-0.07A/telnetd/sys_term.c	Fri Jul 26 00:39:30 1996
***************
*** 36,40 ****
   */
  char st_rcsid[] = 
!   "$Id: sys_term.c,v 1.4 1996/07/16 08:58:22 dholland Exp $";
  
  #include "telnetd.h"
--- 36,40 ----
   */
  char st_rcsid[] = 
!   "$Id: sys_term.c,v 1.5 1996/07/26 04:39:19 dholland Exp $";
  
  #include "telnetd.h"
***************
*** 450,457 ****
  		struct stat stb;
  
! 		*p1 = "pqrstuvwxyzABCDE"[i];
  		*p2 = '0';
  		if (stat(line, &stb) < 0)
! 			break;
  		for (j = 0; j < 16; j++) {
  			*p2 = "0123456789abcdef"[j];
--- 450,457 ----
  		struct stat stb;
  
! 		*p1 = "pqrstuvwxyzabcde"[i];
  		*p2 = '0';
  		if (stat(line, &stb) < 0)
! 			continue;
  		for (j = 0; j < 16; j++) {
  			*p2 = "0123456789abcdef"[j];
