Subject: patches for linux 1.11.89 (fwd)

From: Thomas Riemer <[email-masked]>
Date: Wed, 08 Mar 1995 03:43:23 -0500

Subject: patches for linux 1.11.89

Here are patches for a clean build of linux 1.11.89.  Do with them as you
wish.  Happy hacking.
   -Tom 

>uname -a
Linux babbitt 1.1.89 #9 Sun Feb 26 22:05:42 EST 1995 i486
>gcc -v 
Reading specs from /usr/lib/gcc-lib/i486-linux/2.5.8/specs
gcc version 2.5.8

-------------------------------Cut here -----------------------
diff -c -r --new-file ./build ../newftpd/build
*** ./build	Fri Apr  1 14:03:59 1994
--- ../newftpd/build	Sat Mar  4 16:19:51 1995
***************
*** 10,15 ****
--- 10,16 ----
    dyn    : Dynix
    hpx    : HP-UX
    lnx    : Linux (tested on 0.99p8)
+   l11    : Linux 1.1.89
    nx2    : NeXTstep 2.x
    nx3    : NeXTstep 3.x
    osf    : OSF/1
***************
*** 68,76 ****
--- 69,80 ----
          echo ''
          echo "Linking Makefiles."
  		cd src
+ 		rm -f Makefile
  		ln makefiles/Makefile.$maketarget Makefile
+ 		rm -f config.h
  		ln config/config.$maketarget config.h
  		cd ../support
+ 		rm -f Makefile
  		ln makefiles/Makefile.$maketarget Makefile
          echo ''
          echo "Making support library."
diff -c -r --new-file ./src/access.c ../newftpd/src/access.c
*** ./src/access.c	Wed Apr 13 16:02:22 1994
--- ../newftpd/src/access.c	Sun Mar  5 14:14:20 1995
***************
*** 56,61 ****
--- 56,66 ----
  #include <fcntl.h>
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
+ 
  extern char remotehost[],
    remoteaddr[],
   *aclbuf;
diff -c -r --new-file ./src/acl.c ../newftpd/src/acl.c
*** ./src/acl.c	Wed Apr 13 16:02:25 1994
--- ../newftpd/src/acl.c	Sun Mar  5 14:17:04 1995
***************
*** 47,52 ****
--- 47,57 ----
  #include "pathnames.h"
  #include "extensions.h"
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
+ 
  char *aclbuf = NULL;
  static struct aclmember *aclmembers;
  
***************
*** 153,159 ****
      if (finfo.st_size == 0) {
          aclbuf = (char *) calloc(1, 1);
      } else {
!         if (!(aclbuf = malloc((unsigned) finfo.st_size + 1))) {
              syslog(LOG_ERR, "could not malloc aclbuf (%d bytes)", finfo.st_size + 1);
              return (0);
          }
--- 158,164 ----
      if (finfo.st_size == 0) {
          aclbuf = (char *) calloc(1, 1);
      } else {
!         if (!(aclbuf = (char *)malloc((unsigned) finfo.st_size + 1))) {
              syslog(LOG_ERR, "could not malloc aclbuf (%d bytes)", finfo.st_size + 1);
              return (0);
          }
diff -c -r --new-file ./src/config/config.l11 ../newftpd/src/config/config.l11
*** ./src/config/config.l11	Wed Dec 31 19:00:00 1969
--- ../newftpd/src/config/config.l11	Sun Mar  5 14:05:37 1995
***************
*** 0 ****
--- 1,44 ----
+ #undef  BSD
+ #define HAVE_DIRENT
+ #define HAVE_FLOCK
+ #define HAVE_FTW
+ #undef  HAVE_GETCWD
+ #define HAVE_GETDTABLESIZE
+ #undef  HAVE_PSTAT
+ #define HAVE_ST_BLKSIZE
+ #undef  HAVE_SYSINFO
+ #define HAVE_UT_UT_HOST
+ #define HAVE_VPRINTF
+ #define LINUX
+ #define LINUX11
+ #define OVERWRITE
+ #undef  REGEX
+ #define SETPROCTITLE
+ #undef  SHADOW_PASSWORD
+ #define UPLOAD
+ #undef  USG
+ #define SVR4
+ 
+ /* use FACILITY for a 3 parameters openlog (triemer 3/5/95) */
+ #define FACILITY LOG_DAEMON
+ 
+ /* stupid linux header file defines NULL as (char *)0; */
+ 
+ #include <varargs.h>
+ #ifdef LINUX11
+ #include <bsd/bsd.h>
+ #else
+ #include <bsd.h>
+ #endif
+ 
+ #ifndef LINUX11
+ typedef	int	mode_t;
+ #endif
+ typedef void SIGNAL_TYPE;
+ #undef NULL
+ #define NULL (0)
+ #define NEEDNULLDEF
+ #include "../config.h"
+ 
+ 
+ 
diff -c -r --new-file ./src/edit ../newftpd/src/edit
*** ./src/edit	Wed Dec 31 19:00:00 1969
--- ../newftpd/src/edit	Sun Mar  5 18:38:25 1995
***************
*** 0 ****
--- 1 ----
+ 9
diff -c -r --new-file ./src/extensions.c ../newftpd/src/extensions.c
*** ./src/extensions.c	Wed Apr 13 16:02:46 1994
--- ../newftpd/src/extensions.c	Sun Mar  5 14:12:18 1995
***************
*** 66,71 ****
--- 66,76 ----
  #include <libgen.h>
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL 0
+ #endif
+ 
  extern int fnmatch(),
    type,
    transflag,
diff -c -r --new-file ./src/ftpcmd.y ../newftpd/src/ftpcmd.y
*** ./src/ftpcmd.y	Wed Apr 13 16:02:56 1994
--- ../newftpd/src/ftpcmd.y	Sun Mar  5 14:17:36 1995
***************
*** 68,73 ****
--- 68,78 ----
  #include "extensions.h"
  #include "pathnames.h"
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
+ 
  extern  int dolreplies;
  extern  char ls_long[50];
  extern  char ls_short[50];
***************
*** 694,700 ****
  
  password:   /* empty */
          = {
!             $$ = malloc(1);
              $$[0] = '\0';
          }
      |   STRING
--- 699,705 ----
  
  password:   /* empty */
          = {
!             $$ = (char *)malloc(1);
              $$[0] = '\0';
          }
      |   STRING
***************
*** 1308,1314 ****
  {
      char *p;
  
!     p = malloc((unsigned) strlen(s) + 1);
      if (p == NULL)
          fatal("Ran out of memory.");
      (void) strcpy(p, s);
--- 1313,1319 ----
  {
      char *p;
  
!     p = (char *)malloc((unsigned) strlen(s) + 1);
      if (p == NULL)
          fatal("Ran out of memory.");
      (void) strcpy(p, s);
diff -c -r --new-file ./src/ftpcount.c ../newftpd/src/ftpcount.c
*** ./src/ftpcount.c	Wed Apr 13 16:03:02 1994
--- ../newftpd/src/ftpcount.c	Sun Mar  5 14:09:11 1995
***************
*** 55,60 ****
--- 55,65 ----
  #include <fcntl.h>
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL 0
+ #endif
+ 
  struct c_list {
      char *class;
      struct c_list *next;
diff -c -r --new-file ./src/ftpd.c ../newftpd/src/ftpd.c
*** ./src/ftpd.c	Wed Apr 13 16:17:18 1994
--- ../newftpd/src/ftpd.c	Sun Mar  5 18:36:41 1995
***************
*** 124,129 ****
--- 124,133 ----
  #define  FALSE  !TRUE
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL 0
+ #endif
  /* File containing login names NOT to be used on this machine. Commonly used
   * to disallow uucp. */
  extern int errno;
diff -c -r --new-file ./src/ftpshut.c ../newftpd/src/ftpshut.c
*** ./src/ftpshut.c	Fri Apr  1 14:03:42 1994
--- ../newftpd/src/ftpshut.c	Sun Mar  5 14:06:08 1995
***************
*** 47,52 ****
--- 47,57 ----
  #include <sys/file.h>
  #include <sys/param.h>
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL 0
+ #endif
+ 
  #include "pathnames.h"
  
  #define  WIDTH  70
diff -c -r --new-file ./src/glob.c ../newftpd/src/glob.c
*** ./src/glob.c	Fri Apr  1 14:03:42 1994
--- ../newftpd/src/glob.c	Sun Mar  5 14:13:38 1995
***************
*** 645,651 ****
  strspl(cp, dp)
  	register char *cp, *dp;
  {
! 	register char *ep = malloc((unsigned)(strlen(cp) + strlen(dp) + 1));
  
  	if (ep == (char *)0)
  		fatal("Out of memory");
--- 645,651 ----
  strspl(cp, dp)
  	register char *cp, *dp;
  {
! 	register char *ep = (char *)malloc((unsigned)(strlen(cp) + strlen(dp) + 1));
  
  	if (ep == (char *)0)
  		fatal("Out of memory");
diff -c -r --new-file ./src/hostacc.c ../newftpd/src/hostacc.c
*** ./src/hostacc.c	Fri Apr  1 14:03:44 1994
--- ../newftpd/src/hostacc.c	Sun Mar  5 14:16:38 1995
***************
*** 21,30 ****
--- 21,40 ----
   */
  
  #include "config.h"
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
+ 
  
  #ifdef  HOST_ACCESS
  
  #include "hostacc.h"
+ 
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
  
  static  char    linbuf[MAXLEN];  /* Buffer to hold one line of config-file  */
  static  char    unibuf[MAXLEN];  /* Buffer to hold unified line             */
diff -c -r --new-file ./src/makefiles/Makefile.l11 ../newftpd/src/makefiles/Makefile.l11
*** ./src/makefiles/Makefile.l11	Wed Dec 31 19:00:00 1969
--- ../newftpd/src/makefiles/Makefile.l11	Sat Mar  4 16:54:39 1995
***************
*** 0 ****
--- 1,51 ----
+ CC       = gcc
+ IFLAGS   = -I.. -I../support 
+ LFLAGS   = -L../support
+ CFLAGS   = -O -DDEBUG ${IFLAGS} ${LFLAGS}
+ LIBES    = -lsupport -lbsd
+ LIBC     = /usr/lib/libc.a
+ LINTFLAGS=	
+ LKERB    = -lauth -lckrb -lkrb -ldes
+ MKDEP    = ../util/mkdep
+ 
+ SRCS   = ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c access.c extensions.c \
+ 		 realpath.c acl.c private.c authenticate.c conversions.c hostacc.c
+ OBJS   = ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o access.o extensions.o \
+ 		 realpath.o acl.o private.o authenticate.o conversions.o hostacc.o
+ 
+ all: ftpd ftpcount ftpshut ckconfig
+ 
+ ftpcount:	ftpcount.c pathnames.h
+ 	${CC} ${CFLAGS} -o $@ ftpcount.c vers.o ${LIBES}
+ 
+ ftpshut:    ftpshut.c pathnames.h
+ 	${CC} ${CFLAGS} -o $@ ftpshut.c vers.o ${LIBES}
+ 
+ ftpd: ${OBJS} ${LIBC}
+ 	${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBES}
+ 
+ ckconfig:   ckconfig.c
+ 	${CC} ${CFLAGS} -o $@ ckconfig.c
+ 
+ index:	index.o ${LIBC}
+ 	${CC} -Bstatic -o $@ index.o
+ 
+ vers.o: ftpd.c ftpcmd.y
+ 	sh newvers.sh
+ 	${CC} ${CFLAGS} -c vers.c
+ 
+ clean:
+ 	rm -f ${OBJS} ftpd ftpcmd.c ftpshut ftpshut.o ftpcount ftpcount.o
+ 	rm -f core index index.o
+ 
+ cleandir: clean
+ 	rm -f tags .depend
+ 
+ depend: ${SRCS}
+ 	${MKDEP} ${CFLAGS} ${SRCS}
+ 
+ lint: ${SRCS}
+ 	lint ${CFLAGS} ${LINTFLAGS} ${SRCS}
+ 
+ tags: ${SRCS}
+ 	ctags ${SRCS}
diff -c -r --new-file ./src/private.c ../newftpd/src/private.c
*** ./src/private.c	Wed Apr 13 16:03:53 1994
--- ../newftpd/src/private.c	Sun Mar  5 14:10:34 1995
***************
*** 164,170 ****
      if (finfo.st_size == 0) {
          passbuf = (char *) calloc(1, 1);
      } else {
!         if (!(passbuf = malloc((unsigned) finfo.st_size + 1))) {
              (void) syslog(LOG_ERR, "could not malloc passbuf (%d bytes)",
                            finfo.st_size + 1);
              return;
--- 164,170 ----
      if (finfo.st_size == 0) {
          passbuf = (char *) calloc(1, 1);
      } else {
!         if (!(passbuf = (char *)malloc((unsigned) finfo.st_size + 1))) {
              (void) syslog(LOG_ERR, "could not malloc passbuf (%d bytes)",
                            finfo.st_size + 1);
              return;
diff -c -r --new-file ./src/realpath.c ../newftpd/src/realpath.c
*** ./src/realpath.c	Fri Apr  1 14:03:45 1994
--- ../newftpd/src/realpath.c	Sun Mar  5 14:11:52 1995
***************
*** 41,46 ****
--- 41,51 ----
  #define lstat stat
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL (0)
+ #endif
+ 
  char *
  realpath(char *pathname, char *result)
  {
diff -c -r --new-file ./src/vers.c ../newftpd/src/vers.c
*** ./src/vers.c	Wed Apr 13 16:38:41 1994
--- ../newftpd/src/vers.c	Sun Mar  5 18:38:25 1995
***************
*** 1 ****
! char version[] = "Version wu-2.4(1) Wed Apr 13 16:38:41 CDT 1994";
--- 1 ----
! char version[] = "Version wu-2.4(9) Sun Mar 5 18:38:25 EST 1995";
diff -c -r --new-file ./support/ftw.c ../newftpd/support/ftw.c
*** ./support/ftw.c	Fri Apr  1 14:03:54 1994
--- ../newftpd/support/ftw.c	Sun Mar  5 18:37:24 1995
***************
*** 44,49 ****
--- 44,54 ----
  # define lstat stat
  #endif
  
+ #ifdef NEEDNULLDEF
+ #undef NULL
+ #define NULL 0
+ #endif
+ 
  #define	ISDIR(sb)	((sb.st_mode&S_IFMT) == S_IFDIR)
  #define	ISDOT(dp) \
  	(dp->d_name[0] == '.' && (!dp->d_name[1] || \
diff -c -r --new-file ./support/makefiles/Makefile.l11 ../newftpd/support/makefiles/Makefile.l11
*** ./support/makefiles/Makefile.l11	Wed Dec 31 19:00:00 1969
--- ../newftpd/support/makefiles/Makefile.l11	Sat Mar  4 16:23:22 1995
***************
*** 0 ****
--- 1,48 ----
+ CC     = gcc 
+ AR     = ar cq
+ RANLIB = ranlib
+ LIBC   = /lib/libc.a
+ IFLAGS = 
+ LFLAGS = 
+ CFLAGS = -O -DDEBUG ${IFLAGS} ${LFLAGS}
+ 
+ SRCS   = getusershell.c fnmatch.c strcasestr.c strerror.c authuser.c ftw.c
+ OBJS   = getusershell.o fnmatch.o strcasestr.o strerror.o authuser.o ftw.o
+  
+ all: $(OBJS)
+ 	-rm -f libsupport.a
+ 	${AR} libsupport.a $(OBJS)
+ 	${RANLIB} libsupport.a
+  
+ clean:
+ 	-rm -f *.o libsupport.a
+ 
+ ftp.h:
+ 	install -c -m 444 ftp.h /usr/include/arpa
+ 
+ paths.h:
+ 	install -c -m 444 paths.h /usr/include
+ 
+ fnmatch.o: fnmatch.c
+ 	${CC} ${CFLAGS} -c fnmatch.c
+ 
+ getusershell.o: getusershell.c
+ 	${CC} ${CFLAGS} -c getusershell.c
+ 
+ strerror.o: strerror.c
+ 	${CC} ${CFLAGS} -c strerror.c
+ 
+ strdup.o: strdup.c
+ 	${CC} ${CFLAGS} -c strdup.c
+ 
+ strcasestr.o: strcasestr.c
+ 	${CC} ${CFLAGS} -c strcasestr.c
+ 
+ strsep.o: strsep.c
+ 	${CC} ${CFLAGS} -c strsep.c
+ 
+ authuser.o: authuser.c
+ 	${CC} ${CFLAGS} -c authuser.c
+ 
+ ftw.o: ftw.c
+ 	${CC} ${CFLAGS} -c ftw.c