aboutsummaryrefslogtreecommitdiff
path: root/news
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2003-07-25 17:19:05 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2003-07-25 17:19:05 +0000
commit92414a3ea2521491d592c6ae016eed0295076770 (patch)
treebef9bef12e4dc8ee06d260eba91fee10f3673480 /news
parent5f64c809314abd688b8252e4bbe33df172df9d42 (diff)
downloadports-92414a3ea2521491d592c6ae016eed0295076770.tar.gz
ports-92414a3ea2521491d592c6ae016eed0295076770.zip
Notes
Diffstat (limited to 'news')
-rw-r--r--news/nntp/Makefile2
-rw-r--r--news/nntp/files/patch-xmit-nntpxmit.c214
-rw-r--r--news/nntp/files/patch-xmit-remote.c80
3 files changed, 291 insertions, 5 deletions
diff --git a/news/nntp/Makefile b/news/nntp/Makefile
index b46013eceef4..d4f7cac36d19 100644
--- a/news/nntp/Makefile
+++ b/news/nntp/Makefile
@@ -7,7 +7,7 @@
PORTNAME= nntp
PORTVERSION= 1.5.12.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= news
MASTER_SITES= ftp://ftp.academ.com/pub/nntp/server/
DISTNAME= ${PORTNAME}.${PORTVERSION}
diff --git a/news/nntp/files/patch-xmit-nntpxmit.c b/news/nntp/files/patch-xmit-nntpxmit.c
index 710816315ccb..4809629a4d38 100644
--- a/news/nntp/files/patch-xmit-nntpxmit.c
+++ b/news/nntp/files/patch-xmit-nntpxmit.c
@@ -1,5 +1,5 @@
--- xmit/nntpxmit.c.orig Sat Dec 3 23:37:58 1994
-+++ xmit/nntpxmit.c Tue Dec 3 05:02:55 2002
++++ xmit/nntpxmit.c Fri Jul 25 19:14:34 2003
@@ -66,6 +66,7 @@
#include "../conf.h"
#include <stdio.h>
@@ -19,6 +19,15 @@
#include <fcntl.h>
#include <signal.h>
#ifdef USG
+@@ -105,7 +109,7 @@
+ SIGRET catchsig();
+ void restsig();
+ void logstats();
+-void log();
++void nntpdlog();
+ int interrupted();
+
+ /*
@@ -148,6 +152,7 @@
double Tbegin, Tend; /* transfer timestamps */
@@ -35,7 +44,38 @@
main(ac, av)
int ac;
-@@ -445,7 +451,7 @@
+@@ -298,10 +304,10 @@
+ "%s stats %lu offered %lu accepted %lu rejected %lu failed",
+ Host, Stats.offered, Stats.accepted, Stats.rejected,
+ Stats.failed);
+- log(L_INFO, buf);
++ nntpdlog(L_INFO, buf);
+ sprintf(buf, "%s xmit user %.3f system %.3f elapsed %.3f",
+ Host, (user - ouser), (sys - osys), (Tend - Tbegin));
+- log(L_INFO, buf);
++ nntpdlog(L_INFO, buf);
+ /* reset reference point */
+ Tbegin = Tend;
+ ouser = user;
+@@ -336,7 +342,7 @@
+ char buf[BUFSIZ];
+
+ sprintf(buf, E_fopen, file, mode, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ return(FALSE);
+ }
+
+@@ -437,7 +443,7 @@
+ if (fp == NULL && errno != ENOENT) {
+ /* Worse than "No such file or directory"? */
+ sprintf(buf, E_fopen, file, "r", errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ goodbye(DONT_WAIT);
+ exit(EX_OSERR);
+ }
+@@ -445,13 +451,13 @@
/* Hmph. The file didn't exist. */
error = sendcmd(".");
} else {
@@ -44,6 +84,46 @@
/* Leave this open in case we need to requeue it. */
}
if (error) {
+ sprintf(buf, "%s xfer: sendfile: %s",
+ host, errmsg(errno));
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ Stats.failed++;
+ if (fp) { (void) fclose(fp); fp = NULL; }
+ return(FALSE);
+@@ -466,12 +472,12 @@
+ if (code < 0) {
+ if (errno > 0) {
+ sprintf(buf, e_xfer, host, errmsg(errno));
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ } else {
+ char errbuf[BUFSIZ];
+
+ sprintf(errbuf, e_xfer, host, buf);
+- log(L_NOTICE, errbuf);
++ nntpdlog(L_NOTICE, errbuf);
+ }
+ if (fp) { (void) fclose(fp); fp = NULL; }
+ return(FALSE);
+@@ -495,14 +501,14 @@
+ if (code < 0) {
+ if (errno > 0) {
+ sprintf(buf, e_xfer, host, errmsg(errno));
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ } else {
+ sprintf(buf, e_xfer, host, "ihave");
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ }
+ } else {
+ sprintf(buf, "%s improper response to IHAVE: %d while offering %s", host, code, Article);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ if (fp) { (void) fclose(fp); fp = NULL; }
+ }
+ return(FALSE);
@@ -515,8 +521,10 @@
errmsg(code)
int code;
@@ -55,3 +135,133 @@
static char ebuf[6+5+1];
if (code > sys_nerr || code < 0) {
+@@ -769,13 +777,13 @@
+ ** communications with the remote either.
+ */
+ sprintf(buf, "%s: message-id missing!", Article);
+- log(L_DEBUG, buf);
++ nntpdlog(L_DEBUG, buf);
+ return(ERR_GOTIT);
+ }
+
+ if (!msgid_ok(id)) {
+ sprintf(buf, "%s: message-id syntax error: %s", Article, id);
+- log(L_DEBUG, buf);
++ nntpdlog(L_DEBUG, buf);
+ return(ERR_GOTIT);
+ }
+
+@@ -856,7 +864,7 @@
+ char buf[BUFSIZ];
+
+ sprintf(buf, E_unlk, Qfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ }
+ FCLOSE(Qfp);
+@@ -925,7 +933,7 @@
+
+ if ((tmpfp = fopen(tempfile, mode)) == (FILE *)NULL) {
+ sprintf(buf, E_fopen, tempfile, mode, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ FCLOSE(Qfp);
+ return;
+ }
+@@ -962,12 +970,12 @@
+ */
+ if (ferror(tmpfp)) {
+ sprintf(buf, "rewrite(): copy to %s failed", tempfile);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ (void) fclose(tmpfp);
+ FCLOSE(Qfp);
+ if (unlink(tempfile) < 0) {
+ sprintf(buf, E_unlk, tempfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ requeue((char *)NULL,(char *)NULL); /* reset */
+ return;
+@@ -978,12 +986,12 @@
+ rewind(Qfp);
+ if (ftruncate(fileno(Qfp), (off_t)0) < 0) {
+ sprintf(buf, "ftruncate(%s, 0): %s", Qfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ FCLOSE(Qfp);
+ (void) fclose(tmpfp);
+ if (unlink(tempfile) < 0) {
+ sprintf(buf, E_unlk, tempfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ requeue((char *)NULL,(char *)NULL); /* reset */
+ return;
+@@ -992,11 +1000,11 @@
+ FCLOSE(Qfp); /* we just nuked our lock here (lockfd) */
+ if ((Qfp = fopen(Qfile, mode)) == (FILE *)NULL) {
+ sprintf(buf, E_fopen, Qfile, mode, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ (void) fclose(tmpfp);
+ if (unlink(tempfile) < 0) {
+ sprintf(buf, E_unlk, tempfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ requeue((char *)NULL,(char *)NULL); /* reset */
+ return;
+@@ -1012,13 +1020,13 @@
+ (void) fflush(Qfp);
+ if (ferror(Qfp)) {
+ sprintf(buf, "rewrite(): copy to %s failed", Qfile);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ (void) fclose(tmpfp);
+ FCLOSE(Qfp);
+ if (unlink(tempfile) < 0) {
+ sprintf(buf, E_unlk, tempfile, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ requeue((char *)NULL,(char *)NULL); /* reset */
+ dprintf(stderr, "%s: rewrite(%s): done\n", Pname, Qfile);
+@@ -1040,7 +1048,7 @@
+ catchsig(SIG_IGN); /* for System V - hope we're quick enough */
+ #endif /* RELSIG */
+ sprintf(buf, "%s signal %d", Host, sig);
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ requeue(Article,(char *)NULL);
+ cleanup();
+ if (Report_Stats)
+@@ -1092,7 +1100,7 @@
+ ** log stuff
+ */
+ void
+-log(importance, error)
++nntpdlog(importance, error)
+ int importance;
+ char *error;
+ {
+@@ -1131,7 +1139,7 @@
+ if (lockf(fd, (non_blocking ? F_TLOCK : F_LOCK), 0) < 0) {
+ if (errno != EACCES) {
+ sprintf(buf, "lockf(%s): %s\n", file, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ return(FALSE);
+ }
+@@ -1141,7 +1149,7 @@
+ if (flock(fd, LOCK_EX|(non_blocking ? LOCK_NB : 0)) < 0) {
+ if (errno != EWOULDBLOCK) {
+ sprintf(buf, "flock(%s): %s\n", file, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ }
+ return(FALSE);
+ }
diff --git a/news/nntp/files/patch-xmit-remote.c b/news/nntp/files/patch-xmit-remote.c
index a3f72ffd5722..9b7dcb4ada35 100644
--- a/news/nntp/files/patch-xmit-remote.c
+++ b/news/nntp/files/patch-xmit-remote.c
@@ -1,6 +1,6 @@
--- 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 @@
++++ xmit/remote.c Fri Jul 25 19:17:30 2003
+@@ -71,11 +71,17 @@
char *sfgets();
char *rfgets();
@@ -14,6 +14,73 @@
extern char Debug;
extern char *errmsg();
extern char *strcpy();
+-extern void log();
++extern void nntpdlog();
+
+ /*
+ ** send cmd to remote, terminated with a CRLF.
+@@ -207,7 +213,7 @@
+ }
+ break;
+ #else
+- log(L_WARNING, "no DECNET support compiled in");
++ nntpdlog(L_WARNING, "no DECNET support compiled in");
+ return(FAIL);
+ #endif
+ case T_FD:
+@@ -220,29 +226,29 @@
+ switch(socket0) {
+ case NOHOST:
+ sprintf(buf, "%s host unknown", host);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ return(FAIL);
+ case NOSERVICE:
+ sprintf(buf, "%s service unknown: %s", host, service);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ return(FAIL);
+ case FAIL:
+ sprintf(buf, "%s hello: %s", host, errmsg(errno));
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ return(FAIL);
+ }
+ }
+
+ if ((socket1 = dup(socket0)) < 0) {
+ sprintf(buf, "dup(%d): %s", socket0, errmsg(errno));
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ (void) close(socket0);
+ return(FAIL);
+ }
+
+ if ((rmt_rd = fdopen(socket0, rmode)) == (FILE *)NULL) {
+ sprintf(buf, e_fdopen, socket0, rmode);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ (void) close(socket0);
+ (void) close(socket1);
+ return(FAIL);
+@@ -250,7 +256,7 @@
+
+ if ((rmt_wr = fdopen(socket1, wmode)) == (FILE *)NULL) {
+ sprintf(buf, e_fdopen, socket1, wmode);
+- log(L_WARNING, buf);
++ nntpdlog(L_WARNING, buf);
+ (void) fclose(rmt_rd);
+ rmt_rd = (FILE *)NULL;
+ (void) close(socket1);
+@@ -270,7 +276,7 @@
+ char err[BUFSIZ];
+
+ sprintf(err, "%s greeted us with %s", host, buf);
+- log(L_NOTICE, err);
++ nntpdlog(L_NOTICE, err);
+ }
+ goodbye(DONT_WAIT);
+ return(FAIL);
@@ -403,7 +409,7 @@
** with appropriate RFC822 filtering (e.g. CRLF line termination,
** and dot escaping). Return FALSE if something went wrong.
@@ -23,3 +90,12 @@
FILE *fp;
{
register int c;
+@@ -440,7 +446,7 @@
+ mbufr = mmap (0, sbuf.st_size, PROT_READ, MAP_PRIVATE, fileno(fp), 0);
+ if(mbufr == (char *) -1){
+ sprintf(buf, "sendfile: mmap failed: %s", errmsg(errno));
+- log(L_NOTICE, buf);
++ nntpdlog(L_NOTICE, buf);
+ return(FALSE);
+ }
+