INN commit: branches/2.5 (doc/pod/news.pod innd/art.c)

INN Commit rra at isc.org
Tue Sep 13 18:47:24 UTC 2011


    Date: Tuesday, September 13, 2011 @ 11:47:23
  Author: iulius
Revision: 9378

skip leading whitespace in Xref: header fields when running as a slave

Fix a regression that occurred in INN 2.5.0 when leading whitespace
have been made significant in header field bodies.  It could lead INN to
drop articles and throttle itself when running as a slave because Xref:
header fields generated by other news servers, or even INN 2.4.6,
could contain (valid) leading whitespace.

Thanks to Matija Nalis for having caught this bug.

Modified:
  branches/2.5/doc/pod/news.pod
  branches/2.5/innd/art.c

------------------+
 doc/pod/news.pod |    9 +++++++++
 innd/art.c       |   15 +++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2011-09-13 18:44:33 UTC (rev 9377)
+++ doc/pod/news.pod	2011-09-13 18:47:23 UTC (rev 9378)
@@ -52,6 +52,15 @@
 
 =item *
 
+Fixed a regression that occurred in S<INN 2.5.0> when leading whitespace
+have been made significant in header field bodies.  It could lead INN to
+drop articles and throttle itself when running as a slave because Xref:
+header fields generated by other news servers, or even S<INN 2.4.6>,
+could contain (valid) leading whitespace.  Thanks to Matija Nalis for
+having caught this bug.
+
+=item *
+
 It is now possible to properly generate daily statistics with B<sendinpaths>
 thanks to the new B<-k> and B<-r> flags that permit to control the interval
 of days for processing dump files.  The new B<-c> flag permits to send a

Modified: innd/art.c
===================================================================
--- innd/art.c	2011-09-13 18:44:33 UTC (rev 9377)
+++ innd/art.c	2011-09-13 18:47:23 UTC (rev 9378)
@@ -506,7 +506,7 @@
 	  iov[iovcnt++].iov_len = data->XrefLength - 2;
 	  arth.len += data->XrefLength - 2;
 	  /* next to write */
-	  /* this points where trailing "\r\n" of orginal Xref header exists */
+	  /* this points where trailing "\r\n" of original Xref: header exists */
 	  p = HDR(HDR__XREF) + HDR_LEN(HDR__XREF);
 	}
 	break;
@@ -694,8 +694,15 @@
   } else {
     /* We need to remove leading and trailing spaces for
      * message-IDs; otherwise, history hashes may not be
-     * correctly computed. */
-    if (i == HDR__MESSAGE_ID || i == HDR__SUPERSEDES) {
+     * correctly computed.
+     * We also do it for Xref: header fields because
+     * a few parts of the code currently assume that no
+     * leading whitespace exists for this header (when
+     * parsing it to find the newsgroups in which the article
+     * is stored).  Only when INN does not generate it (that is
+     * to say in xrefslave mode). */
+    if (i == HDR__MESSAGE_ID || i == HDR__SUPERSEDES ||
+        (innconf->xrefslave && i == HDR__XREF)) {
       for (p = colon + 1 ; (p < header + size - 2) &&
            (ISWHITE(*p)) ; p++);
       hc->Value = p;
@@ -1478,7 +1485,7 @@
 }
 
 /*
-**  Parse the data from the xref header and assign the numbers.
+**  Parse the data from the Xref: header and assign the numbers.
 **  This involves replacing the GroupPointers entries.
 */
 static bool




More information about the inn-committers mailing list