INN commit: trunk/nnrpd (post.c)

INN Commit rra at isc.org
Thu Dec 31 09:25:42 UTC 2009


    Date: Thursday, December 31, 2009 @ 01:25:42
  Author: iulius
Revision: 8878

Injection-Info: header body is improperly folded with CRLF
when created.  At this point in the nnrpd code, a bare LF must
be used.  It is converted to CRLF afterwards.
It was breaking mail moderation (two new lines were added,
so the end of the headers appeared in the mail body).

Thanks to Ray Banana for the bug report.


Also fix how the Path: header body should be scanned for
".POSTED".  Same bug as above:  LF begins a FWS, and not CR.

Modified:
  trunk/nnrpd/post.c

--------+
 post.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Modified: post.c
===================================================================
--- post.c	2009-12-30 13:04:53 UTC (rev 8877)
+++ post.c	2009-12-31 09:25:42 UTC (rev 8878)
@@ -413,7 +413,7 @@
         for (p = HDR(HDR__PATH); *p != '\0'; p++) {
             if (*p == '.' && strncasecmp(p, ".POSTED", 7) == 0
                 && (p[7] == '.' || p[7] == '!' || p[7] == ' ' || p[7] == '\t'
-                    || p[7] == '\r')
+                    || p[7] == '\r' || p[7] == '\n')
                 && (p == HDR(HDR__PATH) || p[-1] == '!')) {
                 return "Path: header shows a previous injection of the article";
             }
@@ -531,8 +531,9 @@
         }
     }
 
+    /* ARTpost() will convert bare LF to CRLF.  Do not use CRLF here.*/
     snprintf(injectioninfobuff, sizeof(injectioninfobuff),
-             "%s%s;\r\n\tlogging-data=\"%ld\"; mail-complaints-to=\"%s\"",
+             "%s%s;\n\tlogging-data=\"%ld\"; mail-complaints-to=\"%s\"",
              pathidentitybuff,
              PERMaccessconf->addinjectionpostinghost ? postinghostbuff : "",
              (long) pid, complaintsbuff);




More information about the inn-committers mailing list