This ia a patch to inn-1.5.1sec to upgrade to inn-1.5.1sec2.

To apply this patch cd to the top of your 1.5.1sec source tree and do:

        patch -p < inn-1.5.1sec-to-inn-1.5.1sec2.diff

You may need to change the '-p' to '-p0'.


---------------------------------------------------------------------------

diff -rc ../inn-1.5.1sec/README.1st ./README.1st
*** ../inn-1.5.1sec/README.1st	Tue Jul 29 17:21:02 1997
--- ./README.1st	Thu Jul 31 02:54:32 1997
***************
*** 1,9 ****
! This is 1.5.1sec. It is 1.5.1 patched to plug some security holes. There
! are no new features -- bug fixes only.
  
! There's a new library integrated into the kits, which is necessary if you
! *dont* have the function snprintf on your system. To go with this there are
! three new variables in config.dist
  
  	HAVE_SNPRINTF
  	LIBSNPRINTF
--- 1,10 ----
! This is 1.5.1sec2. It is 1.5.1sec with some bug fixes includes. There are
! no new features from 1.5.1sec (which had no new features from 1.5.1--only
! security fixes).
  
! There's a new (in 1.5.1sec) library integrated into the kits, which
! is necessary if you *dont* have the function snprintf on your
! system. To go with this there are three new variables in config.dist
  
  	HAVE_SNPRINTF
  	LIBSNPRINTF
diff -rc ../inn-1.5.1sec/config/config.dist ./config/config.dist
*** ../inn-1.5.1sec/config/config.dist	Mon Jul 28 14:58:43 1997
--- ./config/config.dist	Thu Jul 31 01:23:01 1997
***************
*** 55,60 ****
--- 55,63 ----
  ## On Solaris 2.5 and 2.5.1 (and maybe higher) with the Sun C compiler.
  ## you want
  ##		-Xc -Dsun -D__svr4__ -DBad_float_h
+ ## with gcc
+ ##              -Dsnprintf=__snprintf -Dvsnprintf=__vsnprintf
+ ## (that's 2 underscores) is reported to work.
  ##
  ##
  #### =()<SNPRINTF_CFLAGS	@<SNPRINTF_CFLAGS>@>()=
diff -rc ../inn-1.5.1sec/include/configdata.h ./include/configdata.h
*** ../inn-1.5.1sec/include/configdata.h	Mon Jul 28 11:52:51 1997
--- ./include/configdata.h	Wed Jul 30 13:45:02 1997
***************
*** 151,157 ****
  #define CTYPE(isXXXXX, c)	((isascii((c)) && isXXXXX((c))))
      /* If missing snprintf then use the xsnprintf supplied locally */
      /* =()<#define @<HAVE_SNPRINTF>@_HAVE_SNPRINTF>()= */
! #define DONT_HAVE_SNPRINTF
  #if ! defined (DO_HAVE_SNPRINTF)
  #define snprintf xsnprintf
  #define vsnprintf xvsnprintf
--- 151,157 ----
  #define CTYPE(isXXXXX, c)	((isascii((c)) && isXXXXX((c))))
      /* If missing snprintf then use the xsnprintf supplied locally */
      /* =()<#define @<HAVE_SNPRINTF>@_HAVE_SNPRINTF>()= */
! #define DO_HAVE_SNPRINTF
  #if ! defined (DO_HAVE_SNPRINTF)
  #define snprintf xsnprintf
  #define vsnprintf xvsnprintf
diff -rc ../inn-1.5.1sec/include/patchlevel.h ./include/patchlevel.h
*** ../inn-1.5.1sec/include/patchlevel.h	Fri Jul 25 17:01:34 1997
--- ./include/patchlevel.h	Thu Jul 31 02:34:42 1997
***************
*** 13,19 ****
  **  Try to avoid changing these.
  */
  #define RELEASE "1"
! #define PATCHLEVEL "5.1sec"
  #define DATE "25-Jul-1997"
  
  
--- 13,19 ----
  **  Try to avoid changing these.
  */
  #define RELEASE "1"
! #define PATCHLEVEL "5.1sec2"
  #define DATE "25-Jul-1997"
  
  
diff -rc ../inn-1.5.1sec/innd/art.c ./innd/art.c
*** ../inn-1.5.1sec/innd/art.c	Sat Jul 26 00:47:05 1997
--- ./innd/art.c	Thu Jul 31 04:51:52 1997
***************
*** 592,610 ****
  	/* Install in header table; STRLEN("Lines: ") == 7. */
  	(void)strncpy(ARTheaders[_lines].Value, Data->Lines + 7,
                        MAXHEADERSIZE) ;
- 	ARTheaders[_lines].Value[ARTheaders[_lines].Length - 1] = '\0';
  	ARTheaders[_lines].Length = i - 7;
  	ARTheaders[_lines].Found = 1;
      }
  
! 	/* Install in header table; STRLEN("Xref: ") == 6. */
! 	HDR(_xref) = Xref.Data + 6;
! 	ARTheaders[_xref].Length = Xref.Used - 6;
! 	ARTheaders[_xref].Found = 1;
! 
! 	vp->iov_base = Xref.Data;
! 	vp->iov_len  = Xref.Used;
! 	size += (vp++)->iov_len;
  
      end = vp;
      vp->iov_base = NL;
--- 592,610 ----
  	/* Install in header table; STRLEN("Lines: ") == 7. */
  	(void)strncpy(ARTheaders[_lines].Value, Data->Lines + 7,
                        MAXHEADERSIZE) ;
  	ARTheaders[_lines].Length = i - 7;
+ 	ARTheaders[_lines].Value[ARTheaders[_lines].Length] = '\0';
  	ARTheaders[_lines].Found = 1;
      }
  
!         /* Install in header table; STRLEN("Xref: ") == 6. */
!         HDR(_xref) = Xref.Data + 6;
!         ARTheaders[_xref].Length = Xref.Used - 6;
!         ARTheaders[_xref].Found = 1;
! 
!         vp->iov_base = Xref.Data;
!         vp->iov_len  = Xref.Used;
!         size += (vp++)->iov_len;
  
      end = vp;
      vp->iov_base = NL;
***************
*** 1511,1518 ****
  	(void)snprintf(p, Xref.Size - Xref.Used,
  		" %s:%lu", ngp->Name, ngp->Filenum);
  	p += strlen(p);
      }
-     Xref.Used = p - Xref.Data;
      Xref.Data[Xref.Used++] = '\n';
  }
  
--- 1511,1518 ----
  	(void)snprintf(p, Xref.Size - Xref.Used,
  		" %s:%lu", ngp->Name, ngp->Filenum);
  	p += strlen(p);
+         Xref.Used = p - Xref.Data;
      }
      Xref.Data[Xref.Used++] = '\n';
  }
  
***************
*** 2255,2260 ****
--- 2255,2261 ----
  #endif	/* defined(DONT_HAVE_SYMLINK) */
  	    }
  	    *p++ = ' ';
+ 	    *p = '\0' ;
              strncpy(p, linkname,Files.Size - strlen(Files.Data) - 1);
  	    Files.Data[Files.Size - 1] = '\0';
  	    p += strlen(p);
diff -rc ../inn-1.5.1sec/innd/cc.c ./innd/cc.c
*** ../inn-1.5.1sec/innd/cc.c	Fri Jul 25 11:55:55 1997
--- ./innd/cc.c	Thu Jul 31 01:35:46 1997
***************
*** 795,803 ****
  	p += strlen(p);
  	break;
      }
-     *p++ = '\n';
      if (RejectReason) {
!         strncpy(p, "Rejecting ", sizeof(buff) - strlen(buff) - 1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
          strncpy(p, RejectReason, sizeof(buff) - strlen(buff) - 1);
--- 795,802 ----
  	p += strlen(p);
  	break;
      }
      if (RejectReason) {
!         strncpy(p, "\nRejecting ", sizeof(buff) - strlen(buff) - 1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
          strncpy(p, RejectReason, sizeof(buff) - strlen(buff) - 1);
***************
*** 805,811 ****
  	p += strlen(p);
      }
      else {
!         strncpy(p, "Allowing remote connections",
                  sizeof(buff) - strlen(buff) - 1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
--- 804,810 ----
  	p += strlen(p);
      }
      else {
!         strncpy(p, "\nAllowing remote connections",
                  sizeof(buff) - strlen(buff) - 1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
***************
*** 814,822 ****
      /* Server parameters. */
      for (i = 0, h = 0; CHANiter(&h, CTnntp) != NULL; )
  	i++;
-     *p++ = '\n';
      (void)snprintf(p, sizeof(buff) - strlen(buff),
! 	    "Parameters c %ld i %d (%d) l %ld o %d t %ld H %d T %d X %d %s %s",
  	    (long)Cutoff / (24L * 60L * 60L),
  	    MaxIncoming, i,
  	    LargestArticle, MaxOutgoing, (long)TimeOut.tv_sec,
--- 813,820 ----
      /* Server parameters. */
      for (i = 0, h = 0; CHANiter(&h, CTnntp) != NULL; )
  	i++;
      (void)snprintf(p, sizeof(buff) - strlen(buff),
! 	    "\nParameters c %ld i %d (%d) l %ld o %d t %ld H %d T %d X %d %s %s",
  	    (long)Cutoff / (24L * 60L * 60L),
  	    MaxIncoming, i,
  	    LargestArticle, MaxOutgoing, (long)TimeOut.tv_sec,
***************
*** 826,846 ****
      p += strlen(p);
  
      /* Reservation. */
-     *p++ = '\n';
      if (Reservation) {
  	(void)snprintf(p, sizeof(buff) - strlen(buff),
! 		"Reserved %s", Reservation);
  	p += strlen(p);
      }
      else {
!         strncpy(p, "Not reserved", sizeof(buff)-strlen(buff)-1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
      }
  
      /* Newsreaders. */
!     *p++ = '\n';
!     strncpy(p, "Readers ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (NNRPFollows) {
--- 824,842 ----
      p += strlen(p);
  
      /* Reservation. */
      if (Reservation) {
  	(void)snprintf(p, sizeof(buff) - strlen(buff),
! 		"\nReserved %s", Reservation);
  	p += strlen(p);
      }
      else {
!         strncpy(p, "\nNot reserved", sizeof(buff)-strlen(buff)-1);
  	buff[sizeof(buff) - 1] = '\0';
  	p += strlen(p);
      }
  
      /* Newsreaders. */
!     strncpy(p, "\nReaders ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (NNRPFollows) {
***************
*** 863,870 ****
      }
  
  #if defined(DO_TCL)
!     *p++ = '\n';
!     strncpy(p, "Tcl filtering ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (TCLFilterActive) {
--- 859,865 ----
      }
  
  #if defined(DO_TCL)
!     strncpy(p, "\nTcl filtering ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (TCLFilterActive) {
***************
*** 878,885 ****
      }
  #endif /* defined(DO_TCL) */
  #if defined(DO_PERL)
!     *p++ = '\n';
!     strncpy(p, "Perl filtering ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (PerlFilterActive) {
--- 873,879 ----
      }
  #endif /* defined(DO_TCL) */
  #if defined(DO_PERL)
!     strncpy(p, "\nPerl filtering ", sizeof(buff) - strlen(buff) - 1);
      buff[sizeof(buff) - 1] = '\0';
      p += strlen(p);
      if (PerlFilterActive) {
diff -rc ../inn-1.5.1sec/innd/site.c ./innd/site.c
*** ../inn-1.5.1sec/innd/site.c	Fri Jul 25 18:57:00 1997
--- ./innd/site.c	Thu Jul 31 01:37:30 1997
***************
*** 1086,1091 ****
--- 1086,1092 ----
  	if (fsp != sp && fsp->FNLwantsnames) {
  	    p = buff + strlen(buff);
  	    *p++ = ' ';
+ 	    *p = '\0' ;
  	    (void)strncpy(p, sp->Name, sizeof(buff) - strlen(buff) - 2);
  	    buff[sizeof(buff) - 1] = '\0';
  	}
***************
*** 1216,1222 ****
  	}
  	break;
      }
!     *p++ = '\n';
      if (Verbose) {
  	sep = "\t";
  	if (sp->Buffered && sp->Flushpoint) {
--- 1217,1224 ----
  	}
  	break;
      }
!     if (p < (buff + sizeof(buff) - 1))
!         *p++ = '\n';
      if (Verbose) {
  	sep = "\t";
  	if (sp->Buffered && sp->Flushpoint) {
***************
*** 1239,1245 ****
  	    sep = "; ";
  	}
  	if (sep[0] != '\t')
! 	    *p++ = '\n';
  	if (sp->Spooling && sp->SpoolName) {
  	    (void)snprintf(p, sizeof(buff) - strlen(buff),
  		"\tSpooling to \"%s\"\n", sp->SpoolName);
--- 1241,1248 ----
  	    sep = "; ";
  	}
  	if (sep[0] != '\t')
! 	    if (p < (buff + sizeof(buff) - 1))
! 	        *p++ = '\n';
  	if (sp->Spooling && sp->SpoolName) {
  	    (void)snprintf(p, sizeof(buff) - strlen(buff),
  		"\tSpooling to \"%s\"\n", sp->SpoolName);
diff -rc ../inn-1.5.1sec/innd/tcl.c ./innd/tcl.c
*** ../inn-1.5.1sec/innd/tcl.c	Thu Jul 24 23:08:02 1997
--- ./innd/tcl.c	Wed Jul 30 20:31:53 1997
***************
*** 162,168 ****
  {
      char buf[100];
  
!     snprintf(buf, sizeof(buff), "%08x",
  	    makechecksum(TCLCurrData->Body,
  			 &TCLCurrArticle->Data[TCLCurrArticle->Used] - 
  			 TCLCurrData->Body));
--- 162,168 ----
  {
      char buf[100];
  
!     snprintf(buf, sizeof(buf), "%08x",
  	    makechecksum(TCLCurrData->Body,
  			 &TCLCurrArticle->Data[TCLCurrArticle->Used] - 
  			 TCLCurrData->Body));
diff -rc ../inn-1.5.1sec/nnrpd/article.c ./nnrpd/article.c
*** ../inn-1.5.1sec/nnrpd/article.c	Thu Jul 24 23:13:29 1997
--- ./nnrpd/article.c	Wed Jul 30 10:25:16 1997
***************
*** 516,522 ****
      char	*av[];
  {
      char	buff[SPOOLNAMEBUFF];
!     char	idbuff[SMBUF];
      int		save;
      BOOL	next;
      int		delta;
--- 516,522 ----
      char	*av[];
  {
      char	buff[SPOOLNAMEBUFF];
!     char	idbuff[BIG_BUFFER];
      int		save;
      BOOL	next;
      int		delta;
diff -rc ../inn-1.5.1sec/nnrpd/post.c ./nnrpd/post.c
*** ../inn-1.5.1sec/nnrpd/post.c	Fri Jul 25 12:35:10 1997
--- ./nnrpd/post.c	Thu Jul 31 01:03:00 1997
***************
*** 933,939 ****
      SendQuit(FromServer, ToServer);
      if (idbuff) {
  	(void)strncpy(idbuff, HDR(_messageid), SMBUF - 1);
! 	idbuff[BIG_BUFFER - 1] = '\0';
      }
      return NULL;
  }
--- 933,939 ----
      SendQuit(FromServer, ToServer);
      if (idbuff) {
  	(void)strncpy(idbuff, HDR(_messageid), SMBUF - 1);
! 	idbuff[SMBUF - 1] = '\0';
      }
      return NULL;
  }
diff -rc ../inn-1.5.1sec/sample-configs/config.data-solaris2.3-4 ./sample-configs/config.data-solaris2.3-4
*** ../inn-1.5.1sec/sample-configs/config.data-solaris2.3-4	Tue Jul 29 17:11:20 1997
--- ./sample-configs/config.data-solaris2.3-4	Thu Jul 31 01:22:48 1997
***************
*** 44,50 ****
  ##
  ## On Solaris 2.5 and 2.5.1 (and maybe higher) with the Sun C compiler.
  ## you want
! ##		-Xc -Dsun -D__svr4__ -DBad_float_h
  ##
  ##
  #### =()<SNPRINTF_CFLAGS	@<SNPRINTF_CFLAGS>@>()=
--- 44,53 ----
  ##
  ## On Solaris 2.5 and 2.5.1 (and maybe higher) with the Sun C compiler.
  ## you want
! ##              -Xc -Dsun -D__svr4__ -DBad_float_h
! ## with gcc
! ##              -Dsnprintf=__snprintf -Dvsnprintf=__vsnprintf 
! ## (that's 2 underscores) is reported to work.
  ##
  ##
  #### =()<SNPRINTF_CFLAGS	@<SNPRINTF_CFLAGS>@>()=
diff -rc ../inn-1.5.1sec/samples/version ./samples/version
*** ../inn-1.5.1sec/samples/version	Fri Jul 25 17:01:06 1997
--- ./samples/version	Thu Jul 31 02:34:28 1997
***************
*** 7,13 ****
  ##  =()<. @<_PATH_PARSECTL>@ "$@">()=
  . /var/news/etc/parsecontrol "$@"
  
! VERSION="INN 1.5.1sec"
  
  WHERE=`innconfval pathhost`
  
--- 7,13 ----
  ##  =()<. @<_PATH_PARSECTL>@ "$@">()=
  . /var/news/etc/parsecontrol "$@"
  
! VERSION="INN 1.5.1sec2"
  
  WHERE=`innconfval pathhost`
  
diff -rc ../inn-1.5.1sec/snprintf/Makefile ./snprintf/Makefile
*** ../inn-1.5.1sec/snprintf/Makefile	Sat Jul 26 02:00:36 1997
--- ./snprintf/Makefile	Wed Jul 30 13:45:06 1997
***************
*** 15,21 ****
  ##  =()<PERLINC = @<PERL_INC>@>()=
  PERLINC = 
  ##  =()<CFLAGS  = @<CFLAGS>@ $(SNPRINTF_CFLAGS)>()=
! CFLAGS  = $(DEFS) -g  $(SNPRINTF_CFLAGS)
  ##  =()<DBZCFLAGS       = @<DBZCFLAGS>@>()=
  DBZCFLAGS       = $(CFLAGS)
  ##  =()<LDFLAGS = @<LDFLAGS>@>()=
--- 15,21 ----
  ##  =()<PERLINC = @<PERL_INC>@>()=
  PERLINC = 
  ##  =()<CFLAGS  = @<CFLAGS>@ $(SNPRINTF_CFLAGS)>()=
! CFLAGS  = $(DEFS) -g $(SNPRINTF_CFLAGS)
  ##  =()<DBZCFLAGS       = @<DBZCFLAGS>@>()=
  DBZCFLAGS       = $(CFLAGS)
  ##  =()<LDFLAGS = @<LDFLAGS>@>()=
***************
*** 25,31 ****
  ##  =()<PROF    = @<PROF>@>()=
  PROF    = -pg
  ##  =()<SNPRINTF_CFLAGS = @<SNPRINTF_CFLAGS>@>()=
! SNPRINTF_CFLAGS	=
  
  ##  =()<RANLIB  = @<RANLIB>@>()=
  RANLIB  = ranlib
--- 25,31 ----
  ##  =()<PROF    = @<PROF>@>()=
  PROF    = -pg
  ##  =()<SNPRINTF_CFLAGS = @<SNPRINTF_CFLAGS>@>()=
! SNPRINTF_CFLAGS = 
  
  ##  =()<RANLIB  = @<RANLIB>@>()=
  RANLIB  = ranlib
diff -rc ../inn-1.5.1sec/snprintf/vfprintf.c ./snprintf/vfprintf.c
*** ../inn-1.5.1sec/snprintf/vfprintf.c	Fri Jul 25 16:32:28 1997
--- ./snprintf/vfprintf.c	Thu Jul 31 01:49:58 1997
***************
*** 46,51 ****
--- 46,56 ----
  
  #include <sys/types.h>
  
+ #ifdef AUX
+ #include <values.h>
+ #include <nan.h>
+ #endif
+ 
  #include <limits.h>
  #include "xstdio.h"
  #include <stdlib.h>
***************
*** 473,486 ****
--- 478,499 ----
  				prec = DEFPREC;
  fp_begin:		_double = va_arg(ap, double);
  			/* do this before tricky precision changes */
+ #ifdef AUX
+ 			if (INF(_double)) {
+ #else
  			if (isinf(_double)) {
+ #endif
  				if (_double < 0)
  					sign = '-';
  				cp = "Inf";
  				size = 3;
  				break;
  			}
+ #ifdef AUX
+ 			if (INF(_double)) {
+ #else
  			if (isnan(_double)) {
+ #endif
  				cp = "NaN";
  				size = 3;
  				break;
