improperly remembered rejects

BARRY BOUWSMA IS A TRADITIONAL DNS BIGOT pedophile at fluffy.gets.an.54.2.0.10.IN-ADDR.ARPA.int.tele.dk.INT.TELE.DK
Wed Apr 19 11:31:46 UTC 2000


Moin moin!!!

I just downloaded the latest 2.3 master BETA k0deZ to offer to my
replacement, and I did a quick look through it, and noticed that
a bugfix I applied to one of my test swervers seems to be missing.

This Real Ugly K0de prevents articles received from a peer that
should not be sending them from being added to history (and thus
never accepted when later offered from other peers).  This had
been causing huge gaps...

Would someone care to tell me if there's anythng wrong with the
logic?  Other than my naming totally reeks.  It's been running
for several days with no problems, seems to be working as intended,
and I'd like to see it in the release so that my replacement
doesn't experience this problem.

The diffs to innd/art.c that I have added, as they would apply to
the 2.3 source, are included below for review.

Merci buckets,
barry bouwsma, News Manager[tm]


--- art.c.orig	Tue Apr 18 12:03:34 2000
+++ art.c	Tue Apr 18 20:54:30 2000
@@ -2229,7 +2229,7 @@
      * of code, j will have the needed length, the appropriate site
      * entries will have their Sendit and ng fields set, and GroupPointers
      * will have pointers to the relevant newsgroups. */
-    ToGroup = FALSE;
+    ToGroup = NoHistoryUpdate = FALSE;
     p = HDR(_approved);
     Approved = *p != '\0';
     ngptr = GroupPointers;
@@ -2296,8 +2296,12 @@
 	   poisoning.  This means that articles that we accept from them will
 	   be handled correctly if they're crossposted. */
 	canpost = RCcanpost(cp, p);
-	if (!canpost)
+	if (!canpost) {  /* At least one group cannot be fed by this peer.
+	 		    If we later reject the post as unwanted group,
+			    don't remember it.  If we accept, do remember */
+	    NoHistoryUpdate = TRUE;
 	    continue;
+	}
 	else if (canpost < 0) {
 	    (void)sprintf(buff, "%d Won't accept posts in \"%s\"",
 		NNTP_REJECTIT_VAL, p);
@@ -2361,13 +2365,19 @@
      * under junk so that downstream feeds can get it. */
     if (!Accepted || ngptr == GroupPointers) {
 	if (!Accepted) {
+	    if (NoHistoryUpdate) {
+		(void)sprintf(buff, "%d Can't post to \"%s\"",
+		    NNTP_REJECTIT_VAL,
+		    MaxLength(HDR(_newsgroups), HDR(_newsgroups)));
+	    } else {
 	    (void)sprintf(buff, "%d Unwanted newsgroup \"%s\"",
 		NNTP_REJECTIT_VAL,
 		MaxLength(HDR(_newsgroups), HDR(_newsgroups)));
+	    }
 	    ARTlog(&Data, ART_REJECT, buff);
 	    if (!innconf->wanttrash) {
 		if (innconf->remembertrash && (Mode == OMrunning) &&
-			!HISremember(hash))
+			!NoHistoryUpdate && !HISremember(hash))
 		    syslog(L_ERROR, "%s cant write history %s %m",
                        LogName, Data.MessageID);
 		if (distributions)


-- 

     *** This was posted with the express permission of ***
     ******************************************************
     **  HIS HIGHNESS KAAZMANN LORD AND MASTER OF USENET **
     ******************************************************
     ********* We are simple servants of his will *********




More information about the inn-workers mailing list