INN commit: trunk (doc/pod/inn.conf.pod nnrpd/post.c)

INN Commit rra at isc.org
Tue Dec 29 22:10:20 UTC 2009


    Date: Tuesday, December 29, 2009 @ 14:10:20
  Author: iulius
Revision: 8872

Add support for the "POSTED" diag-keyword in nnrpd, as described
in RFC 5537.  In particular, nnrpd checks that the article does
not already contain a "POSTED" diag-keyword.

Modified:
  trunk/doc/pod/inn.conf.pod
  trunk/nnrpd/post.c

----------------------+
 doc/pod/inn.conf.pod |    4 ++++
 nnrpd/post.c         |   27 ++++++++++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)

Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod	2009-12-29 00:05:08 UTC (rev 8871)
+++ doc/pod/inn.conf.pod	2009-12-29 22:10:20 UTC (rev 8872)
@@ -833,6 +833,10 @@
 obfuscating the name of the client.  That has to be done with a user-written
 Perl filter, if desired.
 
+When this parameter is set to true, the FQDN (or, if unknown, the IP address)
+of the client is also added to the Path: header, after the C<!.POSTED>
+diagnostic.
+
 =item I<checkincludedtext>
 
 Whether to check local postings for the ratio of new to quoted text and

Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c	2009-12-29 00:05:08 UTC (rev 8871)
+++ nnrpd/post.c	2009-12-29 22:10:20 UTC (rev 8872)
@@ -415,6 +415,17 @@
 	if (VirtualPathlen > 0)
 	    addvirtual = true;
     } else {
+        /* Check that the article has not been injected yet. */
+        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 == HDR(HDR__PATH) || p[-1] == '!')) {
+                return "Path: header shows a previous injection of the article";
+            }
+        }
+
+        /* Check whether the virtual host name is required. */
 	if ((VirtualPathlen > 0) &&
 	    (p = strchr(HDR(HDR__PATH), '!')) != NULL) {
 	    *p = '\0';
@@ -424,9 +435,19 @@
 	} else if (VirtualPathlen > 0)
 	    addvirtual = true;
     }
+
+    if (newpath != NULL)
+        free(newpath);
+    if (PERMaccessconf->addinjectionpostinghost) {
+        newpath = concat(".POSTED.", Client.host, "!", HDR(HDR__PATH), (char *) 0);
+    } else {
+        newpath = concat(".POSTED!", HDR(HDR__PATH), (char *) 0);
+    }
+    HDR_SET(HDR__PATH, newpath);
+
     if (addvirtual) {
-	if (newpath != NULL)
-	    free(newpath);
+        if (newpath != NULL)
+            free(newpath);
         newpath = concat(VirtualPath, HDR(HDR__PATH), (char *) 0);
 	HDR_SET(HDR__PATH, newpath);
     }
@@ -450,7 +471,7 @@
 	    return error;
     }
 
-    /* Set the Organization: header. */
+    /* Set the Organizaion: header. */
     if (!ihave && HDR(HDR__ORGANIZATION) == NULL
      && (p = PERMaccessconf->organization) != NULL) {
 	strlcpy(orgbuff, p, sizeof(orgbuff));




More information about the inn-committers mailing list