diff -c2 ftpd.orig/Makefile ftpd/Makefile
*** ftpd.orig/Makefile	Thu Nov 10 19:02:09 1988
--- ftpd/Makefile	Wed Nov  9 19:52:33 1988
***************
*** 17,25 ****
  #	@(#)Makefile	5.8 (Berkeley) 9/22/88
  #
! CFLAGS=	-O
  LIBC=	/lib/libc.a
! SRCS=	ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c
! OBJS=	ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o
  MAN=	ftpd.0
  
  all: ftpd
--- 17,28 ----
  #	@(#)Makefile	5.8 (Berkeley) 9/22/88
  #
! DEFINES= -DBSD=42
! INCLUDE=-I/usr/global/include
! CFLAGS=	-O ${INCLUDE} ${DEFINES}
  LIBC=	/lib/libc.a
! SRCS=	ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c nsyslog.c
! OBJS=	ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o nsyslog.o
  MAN=	ftpd.0
+ LIBS=	-lresolv
  
  all: ftpd
***************
*** 26,31 ****
  
  ftpd: ${OBJS} ${LIBC}
! 	${CC} -o $@ ${OBJS}
  
  vers.o: ftpd.c ftpcmd.y
  	sh newvers.sh
--- 29,37 ----
  
  ftpd: ${OBJS} ${LIBC}
! 	${CC} -o $@ ${OBJS} ${LIBS}
  
+ nsyslog.o: nsyslog.c
+ 	${CC} -c ${CFLAGS} -DLOG_IPC nsyslog.c
+ 
  vers.o: ftpd.c ftpcmd.y
  	sh newvers.sh
***************
*** 42,46 ****
  
  install:
! 	install -s -o bin -g bin -m 755 ftpd ${DESTDIR}/etc/ftpd
  
  lint: ${SRCS}
--- 48,52 ----
  
  install:
! 	install -s -o bin -g bin -m 755 ftpd ${DESTDIR}/usr/etc/in.ftpd
  
  lint: ${SRCS}
diff -c2 ftpd.orig/ftpd.c ftpd/ftpd.c
*** ftpd.orig/ftpd.c	Thu Nov 10 19:02:16 1988
--- ftpd/ftpd.c	Wed Nov  9 19:34:57 1988
***************
*** 79,83 ****
  int	debug;
  int	timeout = 900;    /* timeout after 15 minutes of inactivity */
! int	logging;
  int	guest;
  int	wtmp;
--- 79,83 ----
  int	debug;
  int	timeout = 900;    /* timeout after 15 minutes of inactivity */
! int	logging=1;	/* local default */
  int	guest;
  int	wtmp;
***************
*** 129,133 ****
--- 129,137 ----
  	data_source.sin_port = htons(ntohs(ctrl_addr.sin_port) - 1);
  	debug = 0;
+ #ifdef LOG_DAEMON
  	openlog("ftpd", LOG_PID, LOG_DAEMON);
+ #else
+ 	openlog("ftpd", LOG_PID);
+ #endif /* LOG_DAEMON */	
  	argc--, argv++;
  	while (argc > 0 && *argv[0] == '-') {
***************
*** 843,846 ****
--- 847,851 ----
  	if ((shell = p->pw_shell) == NULL || *shell == 0)
  		shell = "/bin/sh";
+ #if BSD >= 43
  	while ((cp = getusershell()) != NULL)
  		if (strcmp(cp, shell) == 0)
***************
*** 847,850 ****
--- 852,858 ----
  			break;
  	endusershell();
+ #else
+ 	cp = shell;
+ #endif
  	if (cp == NULL)
  		return (0);
diff -c2 ftpd.orig/nsyslog.c ftpd/nsyslog.c
*** ftpd.orig/nsyslog.c	Thu Nov 10 19:04:15 1988
--- ftpd/nsyslog.c	Wed Nov  9 19:41:47 1988
***************
*** 0 ****
--- 1,269 ----
+ #include <syslog.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sgtty.h>
+ #ifdef LOG_IPC
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #endif LOG_IPC
+ 
+ static char	SccsId[] =	"@(#)nsyslog.c	(from Berkeley)	18/01/88";
+ 
+ 
+ /*
+ **  SYSLOG -- print message on log file
+ **
+ **	This routine looks a lot like printf, except that it
+ **	outputs to the log file instead of the standard output.
+ **	Also, it prints the module name in front of lines,
+ **	and has some other formatting types (or will sometime).
+ **	Also, it adds a newline on the end of messages.
+ **
+ **	The output of this routine is intended to be read by
+ **	/etc/syslog, which will add timestamps.
+ **
+ **	Parameters:
+ **		pri -- the message priority.
+ **		fmt -- the format string.
+ **		p0 -- the first of many parameters.
+ **
+ **	Returns:
+ **		none
+ **
+ **	Side Effects:
+ **		output to log.
+ */
+ 
+ #define MAXLINE		1000		/* maximum line length */
+ #define BUFSLOP		20		/* space to allow for "extra stuff" */
+ #define NULL		0		/* manifest */
+ 
+ static int	SyslogFile	= -1;		/* fd for log */
+ static int	SyslogStat	= 0;		/* status bits; see below */
+ static char	*SyslogTag	= NULL;		/* tag for each entry */
+ static int	SyslogMask	= LOG_DEBUG;	/* lowest priority logged */
+ #ifdef LOG_IPC
+ static struct sockaddr_in	SyslogAddr;	/* address of syslog daemon */
+ static char	*SyslogHost	= LOG_HOST;	/* name of this host */
+ #endif LOG_IPC
+ 
+ syslog(pri, fmt, p0, p1, p2, p3, p4)
+ 	int pri;
+ 	char *fmt;
+ {
+ 	char buf[MAXLINE+BUFSLOP];
+ 	register char *b;
+ 	char *f;
+ 	int prec;
+ 	int len;
+ 	register char c;
+ 	register char *p;
+ 	int i;
+ 	extern int errno;
+ 	extern int sys_nerr;
+ 	extern char *sys_errlist[];
+ 	extern char *logcvt();
+ 	char outline[MAXLINE + 1];
+ 
+ 	/* if we have no log, open it */
+ 	if (SyslogFile < 0)
+ 		openlog(0, 0);
+ 
+ 	/* see if we should just throw out this message */
+ 	if (pri > SyslogMask)
+ 		return;
+ 
+ 	f = fmt;
+ 
+ 	while (*f != '\0')
+ 	{
+ 		/* beginning of line */
+ 		b = buf;
+ 
+ 		/* insert priority code */
+ 		if (pri > 0 && (SyslogStat & LOG_COOLIT) == 0)
+ 		{
+ 			*b++ = '<';
+ 			*b++ = pri + '0';
+ 			*b++ = '>';
+ 		}
+ 
+ 		/* output current process ID */
+ 		if ((SyslogStat & LOG_PID) != 0)
+ 		{
+ 			sprintf(b, "%d ", getpid());
+ 			b += strlen(b);
+ 		}
+ 
+ 		/* and module name */
+ 		if (SyslogTag != 0)
+ 		{
+ 			for (p = SyslogTag; *p != '\0'; )
+ 				*b++ = *p++;
+ 			*b++ = ':';
+ 			*b++ = ' ';
+ 		}
+ 		while ((c = *f++) != '\0' && c != '\n')
+ 		{
+ 			/* output character directly if not interpolated */
+ 			if (c != '%')
+ 			{
+ 				*b++ = c;
+ 				continue;
+ 			}
+ 			c = *f++;
+ 			switch (c)
+ 			{
+ 			  case 'm':	/* output error code */
+ 				if (errno < 0 || errno > sys_nerr)
+ 					sprintf(b, "error %d", errno);
+ 				else
+ 					sprintf(b, "%s", sys_errlist[errno]);
+ 				break;
+ 
+ 			  default:
+ 				*b++ = '%';
+ 				*b++ = c;
+ 				*b = '\0';
+ 				break;
+ 			}
+ 			b += strlen(b);
+ 			if (b >= &buf[MAXLINE])
+ 				break;
+ 		}
+ 		if (c == '\0')
+ 			f--;
+ 
+ 		/* add trailing newline */
+ 		*b++ = '\n';
+ 		*b = '\0';
+ 		
+ 		/* output string */
+ 		sprintf(outline, buf, p0, p1, p2, p3, p4);
+ #ifdef LOG_IPC
+ 		if (SyslogStat & LOG_DGRAM)
+ 		{
+ 			register int r;
+ 
+ 			r = sendto(SyslogFile, outline, strlen(outline), 0,
+ 				   &SyslogAddr, sizeof SyslogAddr);
+ #ifdef DEBUG
+ 			if (r < 0)
+ 				perror("syslog: send");
+ #endif DEBUG
+ 		}
+ 		else
+ #endif LOG_IPC
+ 			write(SyslogFile, outline, strlen(outline));
+ 	}
+ }
+ /*
+ **  OPENLOG -- open system log
+ **
+ **	This happens automatically with reasonable defaults if you
+ **	do nothing.
+ **
+ **	Parameters:
+ **		ident -- the name to be printed as a header for
+ **			all messages.
+ **		logstat -- a status word, interpreted as follows:
+ **			LOG_PID -- log the pid with each message.
+ **
+ **	Returns:
+ **		0 -- success.
+ **		-1 -- failure; logging on /dev/console instead.
+ **
+ **	Side Effects:
+ **		Several global variables get set.
+ */
+ 
+ openlog(ident, logstat)
+ 	char *ident;
+ 	int logstat;
+ {
+ 	register int i;
+ 	register int fd;
+ 	struct stat st;
+ #ifdef LOG_IPC
+ 	struct servent *sp;
+ 	struct hostent *hp;
+ #endif LOG_IPC
+ 
+ 	SyslogTag = ident;
+ 	SyslogStat = logstat;
+ 
+ 	if (SyslogFile >= 0)
+ 		return;
+ #ifdef LOG_IPC
+ 	sp = getservbyname("syslog", "udp");
+ 	hp = gethostbyname(SyslogHost);
+ 	if (sp != NULL && hp != NULL)
+ 	{
+ 		bzero(&SyslogAddr, sizeof SyslogAddr);
+ 		SyslogAddr.sin_family = AF_INET;
+ 		SyslogFile = socket(AF_INET, SOCK_DGRAM, 0, 0);
+ 		if (SyslogFile >= 0 && bind(SyslogFile, &SyslogAddr, sizeof SyslogAddr, 0) < 0)
+ 		{
+ 			close(SyslogFile);
+ 			SyslogFile = -1;
+ 		}
+ #ifdef DEBUG
+ 		if (SyslogFile < 0)
+ 			perror("syslog: socket");
+ #endif DEBUG
+ 		SyslogAddr.sin_port = sp->s_port;
+ 		bcopy(hp->h_addr, (char *) &SyslogAddr.sin_addr, hp->h_length);
+ 		SyslogStat |= LOG_DGRAM;
+ 	}
+ #else LOG_IPC
+ 	SyslogFile = open("/dev/log", 1);
+ #endif LOG_IPC
+ 	if (SyslogFile < 0)
+ 	{
+ 	  nolog:
+ 		SyslogStat |= LOG_COOLIT;
+ 		SyslogStat &= ~LOG_DGRAM;
+ 		SyslogMask = LOG_CRIT;
+ 		SyslogFile = open("/dev/console", 1);
+ 		if (SyslogFile < 0)
+ 		{
+ 			perror("syslog: cannot open /dev/console");
+ 			SyslogFile = 2;
+ 		}
+ 	}
+ #ifndef LOG_IPC
+ 	if (fstat(SyslogFile, &st) < 0)
+ 		goto nolog;
+ 	switch (st.st_mode & S_IFMT)
+ 	{
+ 	  case S_IFREG:
+ 	  case S_IFDIR:
+ 		(void) close(SyslogFile);
+ 		goto nolog;
+ 	}
+ 
+ #ifdef FIOCLEX
+ 	/* have it close automatically on exec */
+ 	ioctl(SyslogFile, FIOCLEX, NULL);
+ #endif FIOCLEX
+ #endif LOG_IPC
+ }
+ /*
+ **  CLOSELOG -- close the system log
+ **
+ **	Parameters:
+ **		none.
+ **
+ **	Returns:
+ **		none.
+ **
+ **	Side Effects:
+ **		The system log is closed.
+ */
+ 
+ closelog()
+ {
+ 	(void) close(SyslogFile);
+ 	SyslogFile = -1;
+ }
Only in ftpd: nsyslog.o
diff -c2 ftpd.orig/popen.c ftpd/popen.c
*** ftpd.orig/popen.c	Thu Nov 10 19:02:21 1988
--- ftpd/popen.c	Wed Nov  9 18:44:07 1988
***************
*** 34,37 ****
--- 34,40 ----
   * command.
   */
+ #if BSD < 43
+ typedef u_short uid_t;
+ #endif
  static uid_t *pids;
  static int fds;
