INN commit: trunk/innd (nc.c)

INN Commit Russ_Allbery at isc.org
Sat Apr 18 12:42:18 UTC 2009


    Date: Saturday, April 18, 2009 @ 05:42:17
  Author: iulius
Revision: 8420

Return 501 and not 435 in response to a HEAD or STAT command
when the argument is not a valid message-ID.

Note that we still keep 435 for IHAVE.  We want to reject
the article so that it is considered as an unwanted article
by the other site.

Modified:
  trunk/innd/nc.c

------+
 nc.c |   33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

Modified: nc.c
===================================================================
--- nc.c	2009-04-13 09:10:38 UTC (rev 8419)
+++ nc.c	2009-04-18 12:42:17 UTC (rev 8420)
@@ -181,21 +181,6 @@
 
 
 /*
-**  If a Message-ID is bad, write a reject message and return true.
-*/
-static bool
-NCbadid(CHANNEL *cp, char *p)
-{
-    if (ARTidok(p))
-	return false;
-
-    NCwritereply(cp, NNTP_HAVEIT_BADID);
-    syslog(L_NOTICE, "%s bad_messageid %s", CHANname(cp), MaxLength(p, p));
-    return true;
-}
-
-
-/*
 **  We have an entire article collected; try to post it.  If we're
 **  not running, drop the article or just pause and reschedule.
 */
@@ -309,8 +294,12 @@
     for (p = cp->In.data + cp->Start + strlen("head"); ISWHITE(*p); p++)
 	continue;
     cp->Start = cp->Next;
-    if (NCbadid(cp, p))
+
+    if (!ARTidok(p)) {
+        NCwritereply(cp, NNTP_SYNTAX_USE);
+        syslog(L_NOTICE, "%s bad_messageid %s", CHANname(cp), MaxLength(p, p));
 	return;
+    }
 
     if (Mode == OMthrottled) {
         NCwriteshutdown(cp, ModeReason);
@@ -360,8 +349,12 @@
     for (p = cp->In.data + cp->Start + strlen("stat"); ISWHITE(*p); p++)
 	continue;
     cp->Start = cp->Next;
-    if (NCbadid(cp, p))
+
+    if (!ARTidok(p)) {
+        NCwritereply(cp, NNTP_SYNTAX_USE);
+        syslog(L_NOTICE, "%s bad_messageid %s", CHANname(cp), MaxLength(p, p));
 	return;
+    }
 
     if (Mode == OMthrottled) {
         NCwriteshutdown(cp, ModeReason);
@@ -502,8 +495,12 @@
     for (p = cp->In.data + cp->Start + strlen("ihave"); ISWHITE(*p); p++)
 	continue;
     cp->Start = cp->Next;
-    if (NCbadid(cp, p))
+
+    if (!ARTidok(p)) {
+        NCwritereply(cp, NNTP_HAVEIT_BADID);
+        syslog(L_NOTICE, "%s bad_messageid %s", CHANname(cp), MaxLength(p, p));
 	return;
+    }
 
     if (Mode == OMthrottled) {
         NCwriteshutdown(cp, ModeReason);




More information about the inn-committers mailing list