From 3ff37e385bb15e608586b24278ba3dde9ea57151 Mon Sep 17 00:00:00 2001
From: Dirk Meyer <dinoex@FreeBSD.org>
Date: Mon, 4 Nov 2002 05:00:14 +0000
Subject: - reorder patches - use DIRENT - honor CFLAGS - fix missing includes

---
 news/nntp/Makefile                        |   2 +-
 news/nntp/files/patch-Makefile            |  31 +++
 news/nntp/files/patch-af                  |  22 --
 news/nntp/files/patch-ag                  | 386 ------------------------------
 news/nntp/files/patch-conf.h              | 163 +++++++++++++
 news/nntp/files/patch-doc-config.sh       |  32 +++
 news/nntp/files/patch-misc.c              |  36 ---
 news/nntp/files/patch-netaux.c            |  11 -
 news/nntp/files/patch-server-active.c     |  12 +
 news/nntp/files/patch-server-batch.c      |  12 +
 news/nntp/files/patch-server-common.h     |  30 +++
 news/nntp/files/patch-server-group.c      |  12 +
 news/nntp/files/patch-server-main.c       |  82 +++++++
 news/nntp/files/patch-server-misc.c       |  36 +++
 news/nntp/files/patch-server-msgidd.c     |  13 +
 news/nntp/files/patch-server-netaux.c     |  11 +
 news/nntp/files/patch-server-scandir.c    |  12 +
 news/nntp/files/patch-server-xauth.c      |  39 +++
 news/nntp/files/patch-server-xover.c      |  32 +++
 news/nntp/files/patch-xfer-Makefile       |  12 +
 news/nntp/files/patch-xfer-nntpxfer.c     |  24 ++
 news/nntp/files/patch-xmit-get_tcp_conn.c |  12 +
 news/nntp/files/patch-xmit-nntpxmit.c     |  24 ++
 news/nntp/files/patch-xmit-nntpxmit.h     |  10 +
 news/nntp/files/patch-xmit-remote.c       |  25 ++
 news/nntp/files/patch-xmit-shlock.c       |  21 ++
 26 files changed, 646 insertions(+), 456 deletions(-)
 create mode 100644 news/nntp/files/patch-Makefile
 delete mode 100644 news/nntp/files/patch-af
 delete mode 100644 news/nntp/files/patch-ag
 create mode 100644 news/nntp/files/patch-conf.h
 create mode 100644 news/nntp/files/patch-doc-config.sh
 delete mode 100644 news/nntp/files/patch-misc.c
 delete mode 100644 news/nntp/files/patch-netaux.c
 create mode 100644 news/nntp/files/patch-server-active.c
 create mode 100644 news/nntp/files/patch-server-batch.c
 create mode 100644 news/nntp/files/patch-server-common.h
 create mode 100644 news/nntp/files/patch-server-group.c
 create mode 100644 news/nntp/files/patch-server-main.c
 create mode 100644 news/nntp/files/patch-server-misc.c
 create mode 100644 news/nntp/files/patch-server-msgidd.c
 create mode 100644 news/nntp/files/patch-server-netaux.c
 create mode 100644 news/nntp/files/patch-server-scandir.c
 create mode 100644 news/nntp/files/patch-server-xauth.c
 create mode 100644 news/nntp/files/patch-server-xover.c
 create mode 100644 news/nntp/files/patch-xfer-Makefile
 create mode 100644 news/nntp/files/patch-xfer-nntpxfer.c
 create mode 100644 news/nntp/files/patch-xmit-get_tcp_conn.c
 create mode 100644 news/nntp/files/patch-xmit-nntpxmit.c
 create mode 100644 news/nntp/files/patch-xmit-nntpxmit.h
 create mode 100644 news/nntp/files/patch-xmit-remote.c
 create mode 100644 news/nntp/files/patch-xmit-shlock.c

(limited to 'news/nntp')

diff --git a/news/nntp/Makefile b/news/nntp/Makefile
index e214d7e540d3..878f89610fc5 100644
--- a/news/nntp/Makefile
+++ b/news/nntp/Makefile
@@ -7,7 +7,7 @@
 
 PORTNAME=	nntp
 PORTVERSION=	1.5.12.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	news
 MASTER_SITES=	ftp://ftp.academ.com/pub/nntp/server/
 DISTNAME=	${PORTNAME}.${PORTVERSION}
diff --git a/news/nntp/files/patch-Makefile b/news/nntp/files/patch-Makefile
new file mode 100644
index 000000000000..c6bd394338ff
--- /dev/null
+++ b/news/nntp/files/patch-Makefile
@@ -0,0 +1,31 @@
+--- Makefile.orig	Tue Jan  9 08:30:24 1996
++++ Makefile	Sun Jan  9 09:35:59 2000
+@@ -4,7 +4,7 @@
+ # The program that knows how to deal with makefiles. [Uncomment if needed.]
+ # MAKE=make
+ # set CFLAGS to be -Ipath/to/special/includes if needed
+-CFLAGS= -O 
++CFLAGS+= -I/usr/local/include
+ #Uncomment the following for Solaris (and similiar SVR4 systems)
+ #NETLIBS   = -lsocket -lnsl 
+ #Uncomment the following if the previous one does not work
+@@ -13,6 +13,7 @@
+ #DBLIBS	= -ldbz
+ #DBLIBS	= /usr/local/lib/dbz.o #/usr/local/lib/dbzdbm.o
+ #DBLIBS	= -ldbm
++DBLIBS	= /usr/local/lib/libcnews.a -lcrypt -lutil
+ # add the resolver library if needed
+ #RESLIB = -lresolv
+ # add the kmem library if needed 
+@@ -21,9 +21,9 @@
+ #Uncomment the following for Solaris (and similiar SVR4 systems)
+ #KVMLIB = -lelf
+ # Where nntpd is going to live
+-ETCDIR = /etc
++ETCDIR = /usr/local/sbin
+ # Where nntpxmit and nntpxfer is going to live
+-BINDIR = /usr/local/bin
++BINDIR = /usr/local/news/cnewsbin
+ # Where manual pages live
+ MANDIR = /usr/local/man
+ #
diff --git a/news/nntp/files/patch-af b/news/nntp/files/patch-af
deleted file mode 100644
index 9f3931371879..000000000000
--- a/news/nntp/files/patch-af
+++ /dev/null
@@ -1,22 +0,0 @@
---- xmit/nntpxmit.c.orig	Sun Jan  9 10:36:02 2000
-+++ xmit/nntpxmit.c	Sun Jan  9 10:37:50 2000
-@@ -448,7 +448,7 @@
- 			/* Hmph. The file didn't exist. */
- 			error = sendcmd(".");
- 		} else {
--			error = !sendfile(fp);
-+			error = !my_sendfile(fp);
- 			/* Leave this open in case we need to requeue it. */
- 		}
- 		if (error) {
---- xmit/remote.c.orig	Tue Jan  9 08:28:03 1996
-+++ xmit/remote.c	Sun Jan  9 10:37:03 2000
-@@ -403,7 +403,7 @@
- ** with appropriate RFC822 filtering (e.g. CRLF line termination,
- ** and dot escaping). Return FALSE if something went wrong.
- */
--sendfile(fp)
-+my_sendfile(fp)
- FILE	*fp;
- {
- 	register int	c;
diff --git a/news/nntp/files/patch-ag b/news/nntp/files/patch-ag
deleted file mode 100644
index e725316ad233..000000000000
--- a/news/nntp/files/patch-ag
+++ /dev/null
@@ -1,386 +0,0 @@
---- xfer/Makefile.orig	Thu Nov 17 19:15:22 1994
-+++ xfer/Makefile	Sun Jan  9 10:21:54 2000
-@@ -28,7 +28,8 @@
- nntpxfer.o: nntpxfer.c ../conf.h ../server/fakesyslog.h
- 
- install: nntpxfer
--	cp nntpxfer ${BINDIR}
-+	cp nntpxfer ${BINDIR}/nntpxfer
-+	chmod 755 ${BINDIR}/nntpxfer
- 
- clean:
- 	-rm -f *.o nntpxfer make*.out *.BAK *.CKP *~
---- Makefile.orig	Tue Jan  9 08:30:24 1996
-+++ Makefile	Sun Jan  9 09:35:59 2000
-@@ -4,7 +4,7 @@
- # The program that knows how to deal with makefiles. [Uncomment if needed.]
- # MAKE=make
- # set CFLAGS to be -Ipath/to/special/includes if needed
--CFLAGS= -O 
-+CFLAGS= -O -I/usr/local/include
- #Uncomment the following for Solaris (and similiar SVR4 systems)
- #NETLIBS   = -lsocket -lnsl 
- #Uncomment the following if the previous one does not work
-@@ -13,6 +13,7 @@
- #DBLIBS	= -ldbz
- #DBLIBS	= /usr/local/lib/dbz.o #/usr/local/lib/dbzdbm.o
- #DBLIBS	= -ldbm
-+DBLIBS	= /usr/local/lib/libcnews.a -lcrypt -lutil
- # add the resolver library if needed
- #RESLIB = -lresolv
- # add the kmem library if needed 
-@@ -21,9 +21,9 @@
- #Uncomment the following for Solaris (and similiar SVR4 systems)
- #KVMLIB = -lelf
- # Where nntpd is going to live
--ETCDIR = /etc
-+ETCDIR = /usr/local/sbin
- # Where nntpxmit and nntpxfer is going to live
--BINDIR = /usr/local/bin
-+BINDIR = /usr/local/news/cnewsbin
- # Where manual pages live
- MANDIR = /usr/local/man
- #
---- server/common.h.orig	Thu Nov 17 19:15:18 1994
-+++ server/common.h	Sun Jan  9 09:30:03 2000
-@@ -161,7 +161,11 @@
- void debugup(), debugdown();
- #endif
- #ifdef SETPROCTITLE
-+#ifdef HAVE_PROCTITLE
-+#include <libutil.h>
-+#else
- void setproctitle();
-+#endif
- #endif
- 
- extern	char	spooldir[];
---- conf.h.orig	Sun Jan  9 09:30:02 2000
-+++ conf.h	Sun Jan  9 10:02:19 2000
-@@ -8,10 +8,12 @@
-  */
-   
- 
--#undef	ALONE		/* True if we're running without inetd */
-+#define	ALONE		/* True if we're running without inetd */
- 
- #ifdef ALONE
--#undef	FASTFORK        /* True if we don't want to read active file on start*/
-+#define	FASTFORK        /* True if we don't want to read active file on start*/
-+#define NEWS_GID 8
-+#define NEWS_UID 8
- #endif
- 
- #define LOAD 5	        /* Loadav above which server refuses connections */
-@@ -40,23 +42,23 @@
- #undef TLI		/* Define this if you want to use TLI instead of */
- 			/* sockets */
- 
--#define NDBM		/* Use new-style (4.3) ndbm(3x) libraries */
-+#undef NDBM		/* Use new-style (4.3) ndbm(3x) libraries */
- 
- #undef	DBM		/* True if we want to use the old dbm(3x) libraries */
- 			/* IF YOU DEFINE THIS, change CFLAGS in makefile to */
- 			/* be -ldbm */
- 
--#undef	DBZ		/* True if we want to use dbz libraries */
-+#define	DBZ		/* True if we want to use dbz libraries */
- 			/* IF YOU DEFINE THIS, change CFLAGS in makefile to */
- 			/* be /usr/lib/dbz.o and install dbz.h */
- 
- #undef	USGHIST		/* Use USG style history file (no DBM) */
- 			/* IF YOU DO NOT DEFINE NDBM or DBM, this is DEFAULT!*/
- 
--#undef CNEWS		/* define this if you are running C News */
--#undef CNEWS_CLEARTEXT	/* define this if you have a modern C News that handles
-+#define CNEWS		/* define this if you are running C News */
-+#define CNEWS_CLEARTEXT	/* define this if you have a modern C News that handles
- 				input files ending in ".t" as cleartext */
--#undef BATCHED_INPUT	/* define if you want to support C News style 
-+#define BATCHED_INPUT	/* define if you want to support C News style 
- 				batched input (not supported by B-NEWS)  */
- #undef MSGID		/* define this if you want to run msgidd to keep
- 				track of recent msgids via daemon */
-@@ -70,7 +72,7 @@
- 			/* typedefs for u_long */
- #define VOIDSIG		/* Newfangled signal() returns void, old returns int */
- 
--#undef MMAP		/* if your OS supports mmap() */
-+#define MMAP		/* if your OS supports mmap() */
- 
- #undef DIRENT		/* If you have <dirent.h> define this */
- 
-@@ -89,7 +91,8 @@
- /*#define MINFILES  MINFREE/4*/
- 			/* NNTP will not allow an XFER if there is less */
- 			/* than this many inodes on the SPOOLDIR filesystem */
--#undef SETPROCTITLE	/* if you want status visable via ps */
-+#define SETPROCTITLE	/* if you want status visable via ps */
-+#define HAVE_PROCTITLE	/* if the OS has setproctitle() */
- 
- #undef	IHAVE_DEBUG	/* Copious debugging output from ihave */
- 
-@@ -110,7 +113,7 @@
-  * if you are running BNEWS. At least, not yet. :-)
-  */
- 
--/* #define UMASK 022 */
-+#define UMASK 022
- 
- /*
-  * If you have the syslog library routine, define SYSLOG to
-@@ -177,13 +180,13 @@
- #define XOVER		/* xover -- Return .overview data */
- #define OVER_XREFS	/* overview files have xref data in them */
- #define OVER_XREF_PREFIX /* the xref field (if present) includes xref: */
--#define OVER_FMT_FILE	"/usr/lib/news/overview.fmt"
-+#define OVER_FMT_FILE	"/usr/local/news/lib/overview.fmt"
- 
- /* Leave this undefined to indicate that overview files go in the spool
-  * directory.  However, if you want a separate hierarchy of overview
-  * files, define it here.
-  */
--/*#define OVERVIEW_DIR "/usr/spool/overviews"	/* base directory */
-+#define OVERVIEW_DIR "/var/news/over.view"	/* base directory */
- 
- #define XROVER		/* xrover -- Return reference overview data */
- 
-@@ -191,10 +194,10 @@
-  * spool directory.  However, if you want a separate hierarchy of rover
-  * files, define it here.
-  */
--/*#define ROVER_DIR "/usr/spool/overviews"	/* base directory */
-+/*define ROVER_DIR "/var/news/r.over"	/* base directory */
- 
- #undef XINDEX		/* Optional support for tin's index files */
--#define XINDEX_DIR	"/usr/spool/news/.index"
-+#define XINDEX_DIR	"/var/news/.index"
- 
- /* XTHREAD defines:  if XTHREAD is defined, THREAD_DIR controls where the
-  * thread files will be read from.
-@@ -244,27 +247,27 @@
- /*
-  * This file is where access information is stored
-  */
--#define ACCESS_FILE	"/usr/lib/news/nntp_access"
-+#define ACCESS_FILE	"/usr/local/news/lib/nntp_access"
- 
- /*
-  * The file where the newgroup creation times are kept.  If you don't
-  * have C News or INN, you can run acttimes (see the support directory)
-  * to maintain an active.times file.
-  */
--#define ACTIVE_TIMES_FILE	"/usr/lib/news/active.times"
-+#define ACTIVE_TIMES_FILE	"/usr/local/news/lib/active.times"
- 
- /*
-  * Some commonly used programs and files.
-  */
- 
--#define	ACTIVE_FILE	"/usr/lib/news/active"
--#define DISTRIBUTIONS_FILE	"/usr/lib/news/distributions"
--#define SUBSCRIPTIONS_FILE	"/usr/lib/news/subscriptions"
--#define NEWSGROUPS_FILE	"/usr/lib/news/newsgroups"
--#define HISTORY_FILE	"/usr/lib/news/history"
--#define	SPOOLDIR	"/usr/spool/news"
--#define INEWS		"/usr/lib/news/inews"
--#define RNEWS		"/usr/bin/rnews"		/* Link to inews? */
-+#define	ACTIVE_FILE	"/usr/local/news/lib/active"
-+#define DISTRIBUTIONS_FILE	"/usr/local/news/lib/distributions"
-+#define SUBSCRIPTIONS_FILE	"/usr/local/news/lib/subscriptions"
-+#define NEWSGROUPS_FILE	"/usr/local/news/lib/newsgroups"
-+#define HISTORY_FILE	"/usr/local/news/lib/history"
-+#define	SPOOLDIR	"/var/news"
-+#define INEWS		"/usr/local/news/lib/inews"
-+#define RNEWS		"/usr/local/bin/rnews"		/* Link to inews? */
- 
- /*
-  * Support for C News style batching 
-@@ -277,15 +280,15 @@
- #else
- #define TOOBIG 300000L		/* batch > TOOBIG bytes, kick rnews */
- #define TOOMANY 1024		/* batch > TOOMANY articles, kick rnews */
--#define NEWSRUN			"/usr/lib/newsbin/input/newsrun"
-+#define NEWSRUN			"/usr/local/news/cnewsbin/input/newsrun"
- #endif
- #define TOOOLD (5*60)		/* batch > TOOOLD seconds old, kick rnews */
- #define COPYSIZE 8192		/* bytes to copy at one time */
- #define MAXDIGITS 25		/* lg(maxlongint) + epsilon */
- #define MAXSTR 1024
--#define INDIR			"/usr/spool/news/in.coming"
-+#define INDIR			"/var/news/in.coming"
- /* You may wish to delete the pathname from the front of BATCH_FILE */
--#define BATCH_FILE		"/usr/spool/news/in.coming/nntp.XXXXXX"
-+#define BATCH_FILE		"/var/news/in.coming/nntp.XXXXXX"
- 
- /************************************************************************/
- /* We don't recommend that you make changes in anything after this line */
---- doc/config.sh.orig	Tue Nov  1 06:36:57 1994
-+++ doc/config.sh	Sun Jan  9 09:30:03 2000
-@@ -11,11 +11,11 @@
- # (modify these lines to suit your system)
- #
- # the location of inetd on your system (usually /etc/inetd)
--MINETD=/etc/inetd
-+MINETD=/usr/sbin/inetd
- # the location of the inetd configuration file (usually /etc/inetd.conf)
- MINETDCONFIG=/etc/inetd.conf
- # the location of nntpd following installation (usually /etc/nntpd)
--MNNTPD=/etc/nntpd
-+MNNTPD=/usr/local/sbin/nntpd
- # the location of the hosts file (usually /etc/hosts)
- MHOSTFILE=/etc/hosts
- # the location of the services file (usually /etc/services)
-@@ -23,12 +23,12 @@
- # the location of the networks file (usually /etc/networks)
- MNETWORKFILE=/etc/networks
- # The location of the news spool directory (usually /usr/spool/news)
--MNEWSSPOOL=/usr/spool/news
-+MNEWSSPOOL=/var/news
- # The location of the news library directory (usually /usr/lib/news)
--MNEWSLIB=/usr/lib/news
-+MNEWSLIB=/usr/local/news/lib
- # The location of the file containing the name of the nntp server machine
- # (usually /usr/local/lib/rn/server)
--MSERVERFILE=/usr/local/lib/rn/server
-+MSERVERFILE=/usr/local/etc/nntpserver
- # The location of rn's local library (usually /usr/local/lib/rn)
- MRNLIB=/usr/local/lib/rn
- #
---- server/main.c.orig	Thu Nov 17 19:15:19 1994
-+++ server/main.c	Sun Jan  9 09:30:03 2000
-@@ -35,8 +35,10 @@
- #endif
- 
- #ifdef SETPROCTITLE
-+#ifndef HAVE_PROCTITLE
- char	**Argv = NULL;		/* pointer to argument vector */
- char	*LastArgv = NULL;	/* end of argv */
-+#endif
- #endif /* SETPROCTITLE */
- 
- int
-@@ -81,6 +83,22 @@
- 
- #ifndef EXCELAN
- 	sockt = get_socket();		/* should be fd 4 or 5 */
-+	if ( getuid() == 0 ) {  /* Running as root */
-+
-+		if (setgid((gid_t) NEWS_GID) == -1) {
-+#ifdef SYSLOG
-+			syslog(LOG_ERR, "setgid: %m");
-+#endif
-+			exit(1);
-+		}
-+
-+		if (setuid((uid_t) NEWS_UID) == -1) {
-+#ifdef SYSLOG
-+			syslog(LOG_ERR, "setuid: %m");
-+#endif
-+			exit(1);
-+		}
-+	}
- #ifdef USG
- 	(void) signal(SIGCLD, SIG_IGN);
- #else /* !USG */
-@@ -101,6 +119,7 @@
- #endif /* EXCELAN */
- 
- #ifdef SETPROCTITLE
-+#ifndef HAVE_PROCTITLE
- 	/*
- 	 *  Save start and extent of argv for setproctitle.
- 	 */
-@@ -113,6 +132,7 @@
- 		envp++;
- 	LastArgv = envp[-1] + strlen(envp[-1]);
- #endif /*SDD*/
-+#endif
- #endif /* SETPROCTITLE */
- #if defined(LOAD) && defined(SETPROCTITLE)
- 	/* If LOAD and SETPROCTITLE, display load before first accept() */
-@@ -243,6 +263,7 @@
- 	}
- #endif /* LOAD */
- #ifdef SETPROCTITLE
-+#ifndef HAVE_PROCTITLE
- 	/*
- 	 *  Save start and extent of argv for setproctitle.
- 	 */
-@@ -255,6 +276,7 @@
- 		envp++;
- 	LastArgv = envp[-1] + strlen(envp[-1]);
- #endif /*SDD*/
-+#endif
- #endif /* SETPROCTITLE */
- 
- #ifdef USG
-@@ -271,6 +293,7 @@
-  * stolen from sendmail
-  */
- #ifdef SETPROCTITLE
-+#ifndef HAVE_PROCTITLE
- #if defined(sun) || defined(hpux)
- /*VARARGS*/
- void
-@@ -330,4 +353,5 @@
- 		*p++ = ' ';
- }
- #endif /* hpux */
-+#endif
- #endif /* SETPROCTITLE */
---- xfer/nntpxfer.c.orig	Tue Jan  9 08:28:03 1996
-+++ xfer/nntpxfer.c	Sun Jan  9 09:30:03 2000
-@@ -60,6 +60,9 @@
- #include <sys/time.h>
- #endif
- 
-+#ifdef BSD_44
-+#define _ANSI_SOURCE
-+#endif
- #include <stdio.h>
- #include <errno.h>
- #include <ctype.h>
---- xmit/nntpxmit.c.orig	Sat Dec  3 23:37:58 1994
-+++ xmit/nntpxmit.c	Sun Jan  9 10:13:10 2000
-@@ -64,6 +64,9 @@
- */
- 
- #include "../conf.h"
-+#ifdef BSD_44
-+#define _ANSI_SOURCE
-+#endif
- #include <stdio.h>
- #include <errno.h>
- #include <ctype.h>
---- xmit/nntpxmit.h.orig	Thu Nov  3 04:51:34 1994
-+++ xmit/nntpxmit.h	Sun Jan  9 09:30:04 2000
-@@ -7,6 +7,7 @@
- */
- 
- #ifdef MMAP
-+#include <sys/types.h>
- #include <sys/mman.h>
- #include <sys/stat.h>
- #endif
---- xmit/shlock.c.orig	Tue Nov  1 06:54:32 1994
-+++ xmit/shlock.c	Sun Jan  9 09:30:04 2000
-@@ -28,7 +28,6 @@
- ** Erik E. Fair <fair@apple.com>, November 12, 1989
- */
- 
--#include <stdio.h>
- #include <sys/types.h>
- #include <fcntl.h>			/* Needed on hpux */
- #include <sys/file.h>
-@@ -36,6 +35,10 @@
- #ifdef NNTPSRC
- #include "../conf.h"
- #endif
-+#ifdef BSD_44
-+#define _ANSI_SOURCE
-+#endif
-+#include <stdio.h>
- 
- #define	LOCK_SET	0
- #define	LOCK_FAIL	1
diff --git a/news/nntp/files/patch-conf.h b/news/nntp/files/patch-conf.h
new file mode 100644
index 000000000000..fa5b03194db8
--- /dev/null
+++ b/news/nntp/files/patch-conf.h
@@ -0,0 +1,163 @@
+--- conf.h.orig	Mon Nov  4 04:55:08 2002
++++ conf.h	Mon Nov  4 04:55:43 2002
+@@ -8,10 +8,12 @@
+  */
+   
+ 
+-#undef	ALONE		/* True if we're running without inetd */
++#define	ALONE		/* True if we're running without inetd */
+ 
+ #ifdef ALONE
+-#undef	FASTFORK        /* True if we don't want to read active file on start*/
++#define	FASTFORK        /* True if we don't want to read active file on start*/
++#define NEWS_GID 8
++#define NEWS_UID 8
+ #endif
+ 
+ #define LOAD 5	        /* Loadav above which server refuses connections */
+@@ -40,23 +42,23 @@
+ #undef TLI		/* Define this if you want to use TLI instead of */
+ 			/* sockets */
+ 
+-#define NDBM		/* Use new-style (4.3) ndbm(3x) libraries */
++#undef NDBM		/* Use new-style (4.3) ndbm(3x) libraries */
+ 
+ #undef	DBM		/* True if we want to use the old dbm(3x) libraries */
+ 			/* IF YOU DEFINE THIS, change CFLAGS in makefile to */
+ 			/* be -ldbm */
+ 
+-#undef	DBZ		/* True if we want to use dbz libraries */
++#define	DBZ		/* True if we want to use dbz libraries */
+ 			/* IF YOU DEFINE THIS, change CFLAGS in makefile to */
+ 			/* be /usr/lib/dbz.o and install dbz.h */
+ 
+ #undef	USGHIST		/* Use USG style history file (no DBM) */
+ 			/* IF YOU DO NOT DEFINE NDBM or DBM, this is DEFAULT!*/
+ 
+-#undef CNEWS		/* define this if you are running C News */
+-#undef CNEWS_CLEARTEXT	/* define this if you have a modern C News that handles
++#define CNEWS		/* define this if you are running C News */
++#define CNEWS_CLEARTEXT	/* define this if you have a modern C News that handles
+ 				input files ending in ".t" as cleartext */
+-#undef BATCHED_INPUT	/* define if you want to support C News style 
++#define BATCHED_INPUT	/* define if you want to support C News style 
+ 				batched input (not supported by B-NEWS)  */
+ #undef MSGID		/* define this if you want to run msgidd to keep
+ 				track of recent msgids via daemon */
+@@ -70,9 +72,9 @@
+ 			/* typedefs for u_long */
+ #define VOIDSIG		/* Newfangled signal() returns void, old returns int */
+ 
+-#undef MMAP		/* if your OS supports mmap() */
++#define MMAP		/* if your OS supports mmap() */
+ 
+-#undef DIRENT		/* If you have <dirent.h> define this */
++#define DIRENT		/* If you have <dirent.h> define this */
+ 
+ /*
+  * If you DON'T have vfork, make this "#define vfork fork"
+@@ -89,7 +91,8 @@
+ /*#define MINFILES  MINFREE/4*/
+ 			/* NNTP will not allow an XFER if there is less */
+ 			/* than this many inodes on the SPOOLDIR filesystem */
+-#undef SETPROCTITLE	/* if you want status visable via ps */
++#define SETPROCTITLE	/* if you want status visable via ps */
++#define HAVE_PROCTITLE	/* if the OS has setproctitle() */
+ 
+ #undef	IHAVE_DEBUG	/* Copious debugging output from ihave */
+ 
+@@ -110,7 +113,7 @@
+  * if you are running BNEWS. At least, not yet. :-)
+  */
+ 
+-/* #define UMASK 022 */
++#define UMASK 022
+ 
+ /*
+  * If you have the syslog library routine, define SYSLOG to
+@@ -177,13 +180,13 @@
+ #define XOVER		/* xover -- Return .overview data */
+ #define OVER_XREFS	/* overview files have xref data in them */
+ #define OVER_XREF_PREFIX /* the xref field (if present) includes xref: */
+-#define OVER_FMT_FILE	"/usr/lib/news/overview.fmt"
++#define OVER_FMT_FILE	"/usr/local/news/lib/overview.fmt"
+ 
+ /* Leave this undefined to indicate that overview files go in the spool
+  * directory.  However, if you want a separate hierarchy of overview
+  * files, define it here.
+  */
+-/*#define OVERVIEW_DIR "/usr/spool/overviews"	/* base directory */
++#define OVERVIEW_DIR "/var/news/over.view"	/* base directory */
+ 
+ #define XROVER		/* xrover -- Return reference overview data */
+ 
+@@ -191,10 +194,10 @@
+  * spool directory.  However, if you want a separate hierarchy of rover
+  * files, define it here.
+  */
+-/*#define ROVER_DIR "/usr/spool/overviews"	/* base directory */
++/*define ROVER_DIR "/var/news/r.over"	/* base directory */
+ 
+ #undef XINDEX		/* Optional support for tin's index files */
+-#define XINDEX_DIR	"/usr/spool/news/.index"
++#define XINDEX_DIR	"/var/news/.index"
+ 
+ /* XTHREAD defines:  if XTHREAD is defined, THREAD_DIR controls where the
+  * thread files will be read from.
+@@ -244,27 +247,27 @@
+ /*
+  * This file is where access information is stored
+  */
+-#define ACCESS_FILE	"/usr/lib/news/nntp_access"
++#define ACCESS_FILE	"/usr/local/news/lib/nntp_access"
+ 
+ /*
+  * The file where the newgroup creation times are kept.  If you don't
+  * have C News or INN, you can run acttimes (see the support directory)
+  * to maintain an active.times file.
+  */
+-#define ACTIVE_TIMES_FILE	"/usr/lib/news/active.times"
++#define ACTIVE_TIMES_FILE	"/usr/local/news/lib/active.times"
+ 
+ /*
+  * Some commonly used programs and files.
+  */
+ 
+-#define	ACTIVE_FILE	"/usr/lib/news/active"
+-#define DISTRIBUTIONS_FILE	"/usr/lib/news/distributions"
+-#define SUBSCRIPTIONS_FILE	"/usr/lib/news/subscriptions"
+-#define NEWSGROUPS_FILE	"/usr/lib/news/newsgroups"
+-#define HISTORY_FILE	"/usr/lib/news/history"
+-#define	SPOOLDIR	"/usr/spool/news"
+-#define INEWS		"/usr/lib/news/inews"
+-#define RNEWS		"/usr/bin/rnews"		/* Link to inews? */
++#define	ACTIVE_FILE	"/usr/local/news/lib/active"
++#define DISTRIBUTIONS_FILE	"/usr/local/news/lib/distributions"
++#define SUBSCRIPTIONS_FILE	"/usr/local/news/lib/subscriptions"
++#define NEWSGROUPS_FILE	"/usr/local/news/lib/newsgroups"
++#define HISTORY_FILE	"/usr/local/news/lib/history"
++#define	SPOOLDIR	"/var/news"
++#define INEWS		"/usr/local/news/lib/inews"
++#define RNEWS		"/usr/local/bin/rnews"		/* Link to inews? */
+ 
+ /*
+  * Support for C News style batching 
+@@ -277,15 +280,15 @@
+ #else
+ #define TOOBIG 300000L		/* batch > TOOBIG bytes, kick rnews */
+ #define TOOMANY 1024		/* batch > TOOMANY articles, kick rnews */
+-#define NEWSRUN			"/usr/lib/newsbin/input/newsrun"
++#define NEWSRUN			"/usr/local/news/cnewsbin/input/newsrun"
+ #endif
+ #define TOOOLD (5*60)		/* batch > TOOOLD seconds old, kick rnews */
+ #define COPYSIZE 8192		/* bytes to copy at one time */
+ #define MAXDIGITS 25		/* lg(maxlongint) + epsilon */
+ #define MAXSTR 1024
+-#define INDIR			"/usr/spool/news/in.coming"
++#define INDIR			"/var/news/in.coming"
+ /* You may wish to delete the pathname from the front of BATCH_FILE */
+-#define BATCH_FILE		"/usr/spool/news/in.coming/nntp.XXXXXX"
++#define BATCH_FILE		"/var/news/in.coming/nntp.XXXXXX"
+ 
+ /************************************************************************/
+ /* We don't recommend that you make changes in anything after this line */
diff --git a/news/nntp/files/patch-doc-config.sh b/news/nntp/files/patch-doc-config.sh
new file mode 100644
index 000000000000..fbd31f3ce223
--- /dev/null
+++ b/news/nntp/files/patch-doc-config.sh
@@ -0,0 +1,32 @@
+--- doc/config.sh.orig	Tue Nov  1 06:36:57 1994
++++ doc/config.sh	Sun Jan  9 09:30:03 2000
+@@ -11,11 +11,11 @@
+ # (modify these lines to suit your system)
+ #
+ # the location of inetd on your system (usually /etc/inetd)
+-MINETD=/etc/inetd
++MINETD=/usr/sbin/inetd
+ # the location of the inetd configuration file (usually /etc/inetd.conf)
+ MINETDCONFIG=/etc/inetd.conf
+ # the location of nntpd following installation (usually /etc/nntpd)
+-MNNTPD=/etc/nntpd
++MNNTPD=/usr/local/sbin/nntpd
+ # the location of the hosts file (usually /etc/hosts)
+ MHOSTFILE=/etc/hosts
+ # the location of the services file (usually /etc/services)
+@@ -23,12 +23,12 @@
+ # the location of the networks file (usually /etc/networks)
+ MNETWORKFILE=/etc/networks
+ # The location of the news spool directory (usually /usr/spool/news)
+-MNEWSSPOOL=/usr/spool/news
++MNEWSSPOOL=/var/news
+ # The location of the news library directory (usually /usr/lib/news)
+-MNEWSLIB=/usr/lib/news
++MNEWSLIB=/usr/local/news/lib
+ # The location of the file containing the name of the nntp server machine
+ # (usually /usr/local/lib/rn/server)
+-MSERVERFILE=/usr/local/lib/rn/server
++MSERVERFILE=/usr/local/etc/nntpserver
+ # The location of rn's local library (usually /usr/local/lib/rn)
+ MRNLIB=/usr/local/lib/rn
+ #
diff --git a/news/nntp/files/patch-misc.c b/news/nntp/files/patch-misc.c
deleted file mode 100644
index 68210ecbd9e5..000000000000
--- a/news/nntp/files/patch-misc.c
+++ /dev/null
@@ -1,36 +0,0 @@
---- server/misc.c.orig	Tue Jan  9 08:28:04 1996
-+++ server/misc.c	Fri Jan 25 06:16:44 2002
-@@ -965,6 +965,27 @@
- **		none.
- */
- 
-+
-+#if defined(BSD_44)
-+#include <stdlib.h>
-+
-+int
-+getla( void )
-+{
-+	double avenrun[3];
-+	int rc;
-+
-+        rc = getloadavg( avenrun, 1 );
-+	if ( rc == -1 )
-+		return 1;
-+# ifdef FSCALE
-+	return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
-+# else
-+	return ((int) (avenrun[0] + 0.5));
-+# endif
-+}
-+
-+#else
- #if defined(USG) && !defined(SVR4)
- int
- getla()
-@@ -1058,4 +1079,5 @@
- # endif
- }
- #endif
-+#endif /* BSD_44 */
- #endif /* LOAD */
diff --git a/news/nntp/files/patch-netaux.c b/news/nntp/files/patch-netaux.c
deleted file mode 100644
index f606f444ecd7..000000000000
--- a/news/nntp/files/patch-netaux.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- server/netaux.c.orig	Tue Jun  4 21:22:30 2002
-+++ server/netaux.c	Tue Jun  4 21:23:10 2002
-@@ -261,7 +261,7 @@
- 
- reaper()
- {
--#ifndef USG
-+#if !defined(USG) && !defined(BSD_44)
- 	union wait	status;
- 
- 	while (wait3(&status, WNOHANG, (struct rusage *)0) > 0)
diff --git a/news/nntp/files/patch-server-active.c b/news/nntp/files/patch-server-active.c
new file mode 100644
index 000000000000..5cd6c344c365
--- /dev/null
+++ b/news/nntp/files/patch-server-active.c
@@ -0,0 +1,12 @@
+--- server/active.c.orig	Tue Nov  1 06:40:09 1994
++++ server/active.c	Mon Nov  4 05:38:42 2002
+@@ -34,7 +34,9 @@
+ 	register int	i;
+ 	register int	act_fd;
+ 	register char	*cp, *end;
++#ifndef __FreeBSD__
+ 	char		*malloc();
++#endif
+ 	struct stat	statbuf;
+ 
+ 	/*
diff --git a/news/nntp/files/patch-server-batch.c b/news/nntp/files/patch-server-batch.c
new file mode 100644
index 000000000000..31613c663306
--- /dev/null
+++ b/news/nntp/files/patch-server-batch.c
@@ -0,0 +1,12 @@
+--- server/batch.c.orig	Fri Dec  9 03:52:44 1994
++++ server/batch.c	Mon Nov  4 05:45:49 2002
+@@ -31,7 +31,9 @@
+ 
+ /* imports */
+ extern time_t time();
++#ifndef __FreeBSD__
+ extern char *malloc(), *mktemp(), *index(), *rindex();
++#endif
+ /* forwards */
+ static char *strsave();
+ #ifdef XFER_TIMEOUT
diff --git a/news/nntp/files/patch-server-common.h b/news/nntp/files/patch-server-common.h
new file mode 100644
index 000000000000..457a129d19da
--- /dev/null
+++ b/news/nntp/files/patch-server-common.h
@@ -0,0 +1,30 @@
+--- server/common.h.orig	Thu Nov 17 19:15:18 1994
++++ server/common.h	Mon Nov  4 05:32:45 2002
+@@ -148,10 +148,15 @@
+ 
+ #define	putline(s)	fputs((s), stdout); putchar('\r'); putchar('\n');
+ 
++#ifdef __FreeBSD__
++#include <stdlib.h>
++#include <unistd.h>
++#else
+ extern	int	errno;
+ 
+ extern	char	*gets(), *fgets();
+ extern	char	*mktemp();
++#endif
+ extern	FILE	*open_valid_art();
+ extern	FILE	*openartbyid();
+ extern	char	*gethistent();
+@@ -161,7 +166,11 @@
+ void debugup(), debugdown();
+ #endif
+ #ifdef SETPROCTITLE
++#ifdef HAVE_PROCTITLE
++#include <libutil.h>
++#else
+ void setproctitle();
++#endif
+ #endif
+ 
+ extern	char	spooldir[];
diff --git a/news/nntp/files/patch-server-group.c b/news/nntp/files/patch-server-group.c
new file mode 100644
index 000000000000..0c881fa3328a
--- /dev/null
+++ b/news/nntp/files/patch-server-group.c
@@ -0,0 +1,12 @@
+--- server/group.c.orig	Sat Dec  3 22:54:51 1994
++++ server/group.c	Mon Nov  4 05:43:39 2002
+@@ -11,7 +11,9 @@
+ extern void close_xfiles();
+ #endif
+ 
++#ifndef __FreeBSD__
+ extern char *malloc();
++#endif
+ 
+ /*
+  * GROUP newsgroup
diff --git a/news/nntp/files/patch-server-main.c b/news/nntp/files/patch-server-main.c
new file mode 100644
index 000000000000..380f44cfbeb8
--- /dev/null
+++ b/news/nntp/files/patch-server-main.c
@@ -0,0 +1,82 @@
+--- server/main.c.orig	Thu Nov 17 19:15:19 1994
++++ server/main.c	Mon Nov  4 05:34:17 2002
+@@ -35,8 +35,10 @@
+ #endif
+ 
+ #ifdef SETPROCTITLE
++#ifndef HAVE_PROCTITLE
+ char	**Argv = NULL;		/* pointer to argument vector */
+ char	*LastArgv = NULL;	/* end of argv */
++#endif
+ #endif /* SETPROCTITLE */
+ 
+ int
+@@ -81,6 +83,22 @@
+ 
+ #ifndef EXCELAN
+ 	sockt = get_socket();		/* should be fd 4 or 5 */
++	if ( getuid() == 0 ) {  /* Running as root */
++
++		if (setgid((gid_t) NEWS_GID) == -1) {
++#ifdef SYSLOG
++			syslog(LOG_ERR, "setgid: %m");
++#endif
++			exit(1);
++		}
++
++		if (setuid((uid_t) NEWS_UID) == -1) {
++#ifdef SYSLOG
++			syslog(LOG_ERR, "setuid: %m");
++#endif
++			exit(1);
++		}
++	}
+ #ifdef USG
+ 	(void) signal(SIGCLD, SIG_IGN);
+ #else /* !USG */
+@@ -101,6 +119,7 @@
+ #endif /* EXCELAN */
+ 
+ #ifdef SETPROCTITLE
++#ifndef HAVE_PROCTITLE
+ 	/*
+ 	 *  Save start and extent of argv for setproctitle.
+ 	 */
+@@ -113,6 +132,7 @@
+ 		envp++;
+ 	LastArgv = envp[-1] + strlen(envp[-1]);
+ #endif /*SDD*/
++#endif
+ #endif /* SETPROCTITLE */
+ #if defined(LOAD) && defined(SETPROCTITLE)
+ 	/* If LOAD and SETPROCTITLE, display load before first accept() */
+@@ -243,6 +263,7 @@
+ 	}
+ #endif /* LOAD */
+ #ifdef SETPROCTITLE
++#ifndef HAVE_PROCTITLE
+ 	/*
+ 	 *  Save start and extent of argv for setproctitle.
+ 	 */
+@@ -255,6 +276,7 @@
+ 		envp++;
+ 	LastArgv = envp[-1] + strlen(envp[-1]);
+ #endif /*SDD*/
++#endif
+ #endif /* SETPROCTITLE */
+ 
+ #ifdef USG
+@@ -271,6 +293,7 @@
+  * stolen from sendmail
+  */
+ #ifdef SETPROCTITLE
++#ifndef HAVE_PROCTITLE
+ #if defined(sun) || defined(hpux)
+ /*VARARGS*/
+ void
+@@ -330,4 +353,5 @@
+ 		*p++ = ' ';
+ }
+ #endif /* hpux */
++#endif
+ #endif /* SETPROCTITLE */
diff --git a/news/nntp/files/patch-server-misc.c b/news/nntp/files/patch-server-misc.c
new file mode 100644
index 000000000000..68210ecbd9e5
--- /dev/null
+++ b/news/nntp/files/patch-server-misc.c
@@ -0,0 +1,36 @@
+--- server/misc.c.orig	Tue Jan  9 08:28:04 1996
++++ server/misc.c	Fri Jan 25 06:16:44 2002
+@@ -965,6 +965,27 @@
+ **		none.
+ */
+ 
++
++#if defined(BSD_44)
++#include <stdlib.h>
++
++int
++getla( void )
++{
++	double avenrun[3];
++	int rc;
++
++        rc = getloadavg( avenrun, 1 );
++	if ( rc == -1 )
++		return 1;
++# ifdef FSCALE
++	return ((int) (avenrun[0] + FSCALE/2) >> FSHIFT);
++# else
++	return ((int) (avenrun[0] + 0.5));
++# endif
++}
++
++#else
+ #if defined(USG) && !defined(SVR4)
+ int
+ getla()
+@@ -1058,4 +1079,5 @@
+ # endif
+ }
+ #endif
++#endif /* BSD_44 */
+ #endif /* LOAD */
diff --git a/news/nntp/files/patch-server-msgidd.c b/news/nntp/files/patch-server-msgidd.c
new file mode 100644
index 000000000000..70d6b13066e0
--- /dev/null
+++ b/news/nntp/files/patch-server-msgidd.c
@@ -0,0 +1,13 @@
+--- server/msgidd.c.orig	Fri Dec  9 03:53:01 1994
++++ server/msgidd.c	Mon Nov  4 05:51:18 2002
+@@ -34,8 +34,10 @@
+ #define dprintf (void)
+ #endif
+ 
++#ifndef __FreeBSD__
+ char *malloc();
+ extern int errno;
++#endif
+ 
+ int log = 0, flags = 0;
+ time_t hold_time = MAX_AGE * 60;
diff --git a/news/nntp/files/patch-server-netaux.c b/news/nntp/files/patch-server-netaux.c
new file mode 100644
index 000000000000..f606f444ecd7
--- /dev/null
+++ b/news/nntp/files/patch-server-netaux.c
@@ -0,0 +1,11 @@
+--- server/netaux.c.orig	Tue Jun  4 21:22:30 2002
++++ server/netaux.c	Tue Jun  4 21:23:10 2002
+@@ -261,7 +261,7 @@
+ 
+ reaper()
+ {
+-#ifndef USG
++#if !defined(USG) && !defined(BSD_44)
+ 	union wait	status;
+ 
+ 	while (wait3(&status, WNOHANG, (struct rusage *)0) > 0)
diff --git a/news/nntp/files/patch-server-scandir.c b/news/nntp/files/patch-server-scandir.c
new file mode 100644
index 000000000000..b23f679a43e9
--- /dev/null
+++ b/news/nntp/files/patch-server-scandir.c
@@ -0,0 +1,12 @@
+--- server/scandir.c.orig	Sat Nov  5 07:04:53 1994
++++ server/scandir.c	Mon Nov  4 05:44:47 2002
+@@ -21,7 +21,9 @@
+  */
+ 
+ extern	int	intcmp();
++#ifndef __FreeBSD__
+ extern char *malloc(), *realloc();
++#endif
+ 
+ int
+ scan_dir(low_msg, high_msg)
diff --git a/news/nntp/files/patch-server-xauth.c b/news/nntp/files/patch-server-xauth.c
new file mode 100644
index 000000000000..fbd81b7e010d
--- /dev/null
+++ b/news/nntp/files/patch-server-xauth.c
@@ -0,0 +1,39 @@
+--- server/xauth.c.orig	Fri Dec  9 03:53:20 1994
++++ server/xauth.c	Mon Nov  4 05:48:08 2002
+@@ -30,7 +30,7 @@
+ extern char	Host[];
+ 
+ /* forward declarations */
+-void getpass();
++void my_getpass();
+ void getuser();
+ 
+  
+@@ -59,7 +59,9 @@
+ 	union wait status;
+ #endif
+ 	struct stat stb;
++#ifndef __FreeBSD__
+ 	char *malloc();
++#endif
+ 
+ 	av += 2;
+ 
+@@ -249,7 +251,7 @@
+ 			fflush(stdout);
+ 			return;
+ 		}
+-		getpass(argv[2]);
++		my_getpass(argv[2]);
+ 		return;
+ 	}
+ #ifdef GENAUTH
+@@ -301,7 +303,7 @@
+ 
+ /* password */
+ void
+-getpass(p)
++my_getpass(p)
+ char *p;
+ {
+ 	static char pass[10];
diff --git a/news/nntp/files/patch-server-xover.c b/news/nntp/files/patch-server-xover.c
new file mode 100644
index 000000000000..543dc0236c30
--- /dev/null
+++ b/news/nntp/files/patch-server-xover.c
@@ -0,0 +1,32 @@
+--- server/xover.c.orig	Tue Nov  1 07:09:24 1994
++++ server/xover.c	Mon Nov  4 05:50:22 2002
+@@ -213,7 +213,9 @@
+ 		} while (c != EOF && c != '\n' && c != '\t');
+ 		printf("\r\n");
+ 	} else {
++#ifndef __FreeBSD__
+ 		char		*malloc(), *realloc();
++#endif
+ 		register int	size = 1024;
+ 		buf = malloc(size);
+ 		if (buf) {
+@@ -248,7 +250,9 @@
+ 	register char	*cp, *cp2;
+ 	register int	hdr;
+ 	char		*array[OVER_FIELD_COUNT];
++#ifndef __FreeBSD__
+ 	char		*malloc(), *realloc();
++#endif
+ 
+ 	(void) sprintf(line, "%d", artnum);
+ 	fp = fopen(line, "r");
+@@ -359,7 +363,9 @@
+ 	register FILE	*fp;
+ 	register char	*cp, *cp2;
+ 	char		*references = NULL;
++#ifndef __FreeBSD__
+ 	char		*malloc(), *realloc();
++#endif
+ 
+ #ifdef XOVER
+ 	if (over_is_cheap(artnum, artnum)) {
diff --git a/news/nntp/files/patch-xfer-Makefile b/news/nntp/files/patch-xfer-Makefile
new file mode 100644
index 000000000000..fe4087c46f6a
--- /dev/null
+++ b/news/nntp/files/patch-xfer-Makefile
@@ -0,0 +1,12 @@
+--- xfer/Makefile.orig	Thu Nov 17 19:15:22 1994
++++ xfer/Makefile	Sun Jan  9 10:21:54 2000
+@@ -28,7 +28,8 @@
+ nntpxfer.o: nntpxfer.c ../conf.h ../server/fakesyslog.h
+ 
+ install: nntpxfer
+-	cp nntpxfer ${BINDIR}
++	cp nntpxfer ${BINDIR}/nntpxfer
++	chmod 755 ${BINDIR}/nntpxfer
+ 
+ clean:
+ 	-rm -f *.o nntpxfer make*.out *.BAK *.CKP *~
diff --git a/news/nntp/files/patch-xfer-nntpxfer.c b/news/nntp/files/patch-xfer-nntpxfer.c
new file mode 100644
index 000000000000..c29c37bdbe4d
--- /dev/null
+++ b/news/nntp/files/patch-xfer-nntpxfer.c
@@ -0,0 +1,24 @@
+--- xfer/nntpxfer.c.orig	Mon Nov  4 05:18:32 2002
++++ xfer/nntpxfer.c	Mon Nov  4 05:25:19 2002
+@@ -60,6 +60,9 @@
+ #include <sys/time.h>
+ #endif
+ 
++#ifdef BSD_44
++#define _ANSI_SOURCE
++#endif
+ #include <stdio.h>
+ #include <errno.h>
+ #include <ctype.h>
+@@ -107,7 +110,11 @@
+ char	*rindex();
+ u_long	inet_addr();
+ 
++#ifdef __FreeBSD__
++#include <unistd.h>
++#else
+ extern int errno;
++#endif
+ char *artlist[MAX_ARTICLES];
+ int server;			/* stream socket to the nntp server */
+ FILE * rd_fp, * wr_fp;
diff --git a/news/nntp/files/patch-xmit-get_tcp_conn.c b/news/nntp/files/patch-xmit-get_tcp_conn.c
new file mode 100644
index 000000000000..ea4b956e858b
--- /dev/null
+++ b/news/nntp/files/patch-xmit-get_tcp_conn.c
@@ -0,0 +1,12 @@
+--- xmit/get_tcp_conn.c.orig	Thu Nov 17 19:15:22 1994
++++ xmit/get_tcp_conn.c	Mon Nov  4 05:19:55 2002
+@@ -24,6 +24,9 @@
+ #include <netinet/in.h>
+ #include <ctype.h>
+ #include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <stdlib.h>
+ #include "get_tcp_conn.h"
+ #ifndef	NONETDB
+ #include <netdb.h>
diff --git a/news/nntp/files/patch-xmit-nntpxmit.c b/news/nntp/files/patch-xmit-nntpxmit.c
new file mode 100644
index 000000000000..c713d21288eb
--- /dev/null
+++ b/news/nntp/files/patch-xmit-nntpxmit.c
@@ -0,0 +1,24 @@
+--- xmit/nntpxmit.c.orig	Sat Dec  3 23:37:58 1994
++++ xmit/nntpxmit.c	Mon Nov  4 05:55:31 2002
+@@ -64,8 +64,12 @@
+ */
+ 
+ #include "../conf.h"
++#ifdef BSD_44
++#define _ANSI_SOURCE
++#endif
+ #include <stdio.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include <ctype.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+@@ -445,7 +449,7 @@
+ 			/* Hmph. The file didn't exist. */
+ 			error = sendcmd(".");
+ 		} else {
+-			error = !sendfile(fp);
++			error = !my_sendfile(fp);
+ 			/* Leave this open in case we need to requeue it. */
+ 		}
+ 		if (error) {
diff --git a/news/nntp/files/patch-xmit-nntpxmit.h b/news/nntp/files/patch-xmit-nntpxmit.h
new file mode 100644
index 000000000000..3da3316e7ebb
--- /dev/null
+++ b/news/nntp/files/patch-xmit-nntpxmit.h
@@ -0,0 +1,10 @@
+--- xmit/nntpxmit.h.orig	Thu Nov  3 04:51:34 1994
++++ xmit/nntpxmit.h	Sun Jan  9 09:30:04 2000
+@@ -7,6 +7,7 @@
+ */
+ 
+ #ifdef MMAP
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+ #endif
diff --git a/news/nntp/files/patch-xmit-remote.c b/news/nntp/files/patch-xmit-remote.c
new file mode 100644
index 000000000000..a3f72ffd5722
--- /dev/null
+++ b/news/nntp/files/patch-xmit-remote.c
@@ -0,0 +1,25 @@
+--- xmit/remote.c.orig	Tue Jan  9 08:28:03 1996
++++ xmit/remote.c	Mon Nov  4 05:59:42 2002
+@@ -71,7 +71,13 @@
+ char	*sfgets();
+ char	*rfgets();
+ 
++#ifdef __FreeBSD__
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++#else
+ extern	int	errno;
++#endif
+ extern	char	Debug;
+ extern	char	*errmsg();
+ extern	char	*strcpy();
+@@ -403,7 +409,7 @@
+ ** with appropriate RFC822 filtering (e.g. CRLF line termination,
+ ** and dot escaping). Return FALSE if something went wrong.
+ */
+-sendfile(fp)
++my_sendfile(fp)
+ FILE	*fp;
+ {
+ 	register int	c;
diff --git a/news/nntp/files/patch-xmit-shlock.c b/news/nntp/files/patch-xmit-shlock.c
new file mode 100644
index 000000000000..ab52bd715699
--- /dev/null
+++ b/news/nntp/files/patch-xmit-shlock.c
@@ -0,0 +1,21 @@
+--- xmit/shlock.c.orig	Tue Nov  1 06:54:32 1994
++++ xmit/shlock.c	Sun Jan  9 09:30:04 2000
+@@ -28,7 +28,6 @@
+ ** Erik E. Fair <fair@apple.com>, November 12, 1989
+ */
+ 
+-#include <stdio.h>
+ #include <sys/types.h>
+ #include <fcntl.h>			/* Needed on hpux */
+ #include <sys/file.h>
+@@ -36,6 +35,10 @@
+ #ifdef NNTPSRC
+ #include "../conf.h"
+ #endif
++#ifdef BSD_44
++#define _ANSI_SOURCE
++#endif
++#include <stdio.h>
+ 
+ #define	LOCK_SET	0
+ #define	LOCK_FAIL	1
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0