INN commit: trunk (4 files)

INN Commit Russ_Allbery at isc.org
Sun Sep 16 07:08:53 UTC 2007


    Date: Sunday, September 16, 2007 @ 00:08:53
  Author: iulius
Revision: 7675

  * Checkgroups are now properly propagated even though the
    news server does not carry the groups they are posted to.
  * Improve documentation as for the use of "!control,!control.*"
    regarding the propagation of control articles.
  * Expand "control*" to "control,control.*" in documentation
    and samples for more accuracy.
  * control.cancel is mandatory for innd to start so cancel
    messages are not fed to control.

Modified:
  trunk/doc/pod/innd.pod
  trunk/doc/pod/newsfeeds.pod
  trunk/innd/art.c
  trunk/samples/newsfeeds.in

-----------------------+
 doc/pod/innd.pod      |   35 +++++++++++++++++++++++++++--------
 doc/pod/newsfeeds.pod |   29 +++++++++++++++--------------
 innd/art.c            |   26 +++++++++++++++++---------
 samples/newsfeeds.in  |    9 ++++++---
 4 files changed, 65 insertions(+), 34 deletions(-)

Modified: doc/pod/innd.pod
===================================================================
--- doc/pod/innd.pod	2007-09-15 21:49:08 UTC (rev 7674)
+++ doc/pod/innd.pod	2007-09-16 07:08:53 UTC (rev 7675)
@@ -224,13 +224,16 @@
 
 =head1 CONTROL MESSAGES
 
-Arriving articles that have a Control header are called "control
+Arriving articles that have a Control: header are called "control
 messages".  Except for cancel messages, these messages are handled by
 controlchan(8) via a feed set up in F<newsfeeds>.
 
 (Cancel messages update the history database, so they must be handled
 internally; the cost of syncing, locking, then unlocking would be too high
-given the number of cancel messages that are received.)
+given the number of cancel messages that are received.  Note that if an
+article is cancelled before it is received by the news server, it will
+be rejected when it arrives since the history database has been updated;
+it is useful for rejecting spam before it arrives.)
 
 The distribution of control messages is different than that of standard
 articles.  Control messages are normally filed into the pseudo-newsgroup
@@ -248,11 +251,14 @@
 given remote site (normally a bad idea), add C<control.cancel> to its
 subscription list.  Normally it's best to exclude the control newsgroups
 from feeds to keep from sending your peers more control messages than they
-care about.
+care about.  That's why the F<newsfeeds> pattern C<!control,!control.*>
+is as often as not specified (adding this pattern do not prevent control
+messages which affect the newsgroups fed to a site from being sent to it).
 
-newgroup and rmgroup control messages receive additional special
+checkgroups, newgroup and rmgroup control messages receive additional special
 treatment.  If one of these control messages is approved and posted to the
-newsgroup being created or removed, the message will be sent to all sites
+newsgroup being created or removed (or to the admin group to which the
+checkgroups is posted), the message will be sent to all sites
 whose subscription patterns would cause them to receive articles posted to
 that group.  For example, if a newgroup control message for a nonexistent
 newsgroup C<news.admin.meow> is received, it will be sent to any site
@@ -263,8 +269,21 @@
 newgroup messages to some "well-propagated" newsgroup; not only will this
 not actually improve their propagation to sites that want such control
 messages, but it will also cause sites that do not want those control
-messages to receive them.
+messages to receive them.  Therefore, assuming that a newgroup control
+message is sent to the group C<news.admin.meow> (specified in the
+Newsgroups: header) in order to create the group C<news.admin.meow>,
+the sites with the following subscription patterns will receive it:
 
+    *, at news.*
+    news.*
+    news.*,!control,!control.*
+    control,control.*
+
+but the sites with the following subscription patterns will not receive it:
+
+    *, at news.*,!control,!control.*
+    comp.*, at news.*
+
 If a control message is posted to a group whose name ends with the four
 characters C<.ctl>, this suffix is stripped off and the control message is
 propagated as if it were posted to the base group.  For example, a cancel
@@ -275,11 +294,11 @@
 C<.ctl> suffix may be removed in a future version of INN.
 
 Finally, articles posted to newsgroups beginning with C<to.> are treated
-specially.  Provided that either that newsgroup exists in the active file
+specially.  Provided that either that newsgroup exists in the F<active> file
 or I<mergetogroups> is set in F<inn.conf>, the remainder of the newsgroup
 is taken to be a site name, as configured in F<newsfeeds>, and the article
 is sent to that site.  If I<mergetogroups> is set, the article will be
-filed in the group named C<to> (which must exist in the active file).  For
+filed in the group named C<to> (which must exist in the F<active> file).  For
 example, with I<mergetogroups> set, an article posted to C<to.uunet> will
 be filed in C<to> and sent to the site C<uunet>.
 

Modified: doc/pod/newsfeeds.pod
===================================================================
--- doc/pod/newsfeeds.pod	2007-09-15 21:49:08 UTC (rev 7674)
+++ doc/pod/newsfeeds.pod	2007-09-16 07:08:53 UTC (rev 7675)
@@ -123,9 +123,11 @@
 
 Control messages follow slightly different propagation rules than normal
 articles; see innd(8) for the details.  Note that most subscriptions
-should have C<!junk,!control*> in their pattern list due to those
+should have C<!junk,!control,!control.*> in their pattern list due to those
 propagation rules (and since junk is a special internal newsgroup; see
-I<wanttrash> in inn.conf(5) for more details on what it's used for).
+I<wanttrash> in inn.conf(5) for more details on what it's used for) and
+that the best way to keep control messages local to a site is with a
+distribution.
 
 A subscription can be further modified by specifying distributions that
 the site should or should not receive.  The default is to send all
@@ -182,7 +184,7 @@
 the names specified in that exclusion sub-field appear in their Path:
 headers.  If the C<ME> entry has a subscription list, that list is
 prepended to the subscription list of all other entries.  For example,
-C<*,!control*,!junk,!foo.*> could be used to set the default subscription
+C<*,!control,!control.*,!junk,!foo.*> could be used to set the default subscription
 list for all other feeds so that local postings are not propagated unless
 C<foo.*> explicitly appears in the site's subscription list.  This feature
 tends to be somewhat confusing since the default subscription is prepended
@@ -440,7 +442,7 @@
 The newsgroup the article is in; if cross-posted, then the first of the
 groups to which the article was posted that this site gets.  (The
 difference from C<G> is that this sends the newsgroup to which the article
-was posted even if it's a control message.)
+was posted even if it is a control message.)
 
 =item h
 
@@ -646,7 +648,7 @@
 
 The former look like this:
 
-    feed.example.com:*,!control*,!junk:Tf,Wnm:
+    feed.example.com:*,!control,!control.*,!junk:Tf,Wnm:
 
 which generates a file named I<pathoutgoing>/feed.example.com containing
 one line per article consisting of the storage API token, a space, and the
@@ -654,12 +656,12 @@
 
 The latter look like this:
 
-    feed.example.com:*,!control*,!junk:Tm:innfeed!
+    feed.example.com:*,!control,!control.*,!junk:Tm:innfeed!
 
 Very similar, except that this is the input to a funnel feed named
 C<innfeed!>.  One could also write this as:
 
-    example/feed.example.com:*,!control*,!junk:Ap,Tm:innfeed!
+    example/feed.example.com:*,!control,!control.*,!junk:Ap,Tm:innfeed!
 
 (note the B<Ap> so that articles that contain just C<example> in the Path:
 header will still be sent), which is completely equivalent except that
@@ -729,15 +731,14 @@
 This program only wants information about articles posted to a control
 newsgroup other than control.cancel, which due to the sorting of control
 messages described in innd(8) will send it all control messages except for
-cancel messages provided that control.cancel exists.  In this case, we
-also exclude any article with a distribution of C<collabra-internal>.
-B<controlchan> gets the storage API token, the name of the sending site
-(for processing old-style ihave and sendme control messages, be sure to
-read about I<logipaddr> in controlchan(8)), and the message ID for each
-article.
+cancel messages.  In this case, we also exclude any article with a
+distribution of C<collabra-internal>.  B<controlchan> gets the storage
+API token, the name of the sending site (for processing old-style ihave
+and sendme control messages, be sure to read about I<logipaddr> in
+controlchan(8)), and the message ID for each article.
 
 For many other examples, including examples of the special C<ME> site
-entry, see the example newsfeeds file distributed with INN.  Also see the
+entry, see the example F<newsfeeds> file distributed with INN.  Also see the
 install documentation that comes with INN for information about setting up
 the standard newsfeeds entries used by most sites.
 

Modified: innd/art.c
===================================================================
--- innd/art.c	2007-09-15 21:49:08 UTC (rev 7674)
+++ innd/art.c	2007-09-16 07:08:53 UTC (rev 7675)
@@ -2014,6 +2014,9 @@
       if (data->Followcount == 0)
 	data->Followcount = data->Groupcount;
     }
+    
+    LikeNewgroup = (LikeNewgroup || strcmp(ControlWord, "checkgroups") == 0);
+    
     /* Control messages to "foo.ctl" are treated as if they were
      * posted to "foo".  I should probably apologize for all the
      * side-effects in the if. */
@@ -2035,14 +2038,15 @@
     if ((ngp = NGfind(p)) == NULL) {
       GroupMissing = true;
       if (LikeNewgroup && Approved) {
-	/* Newgroup/rmgroup being sent to a group that doesn't exist.  Assume
-	 * it is being sent to the group being created or removed, nd send the
-	 * group to all sites that would or would have had the group if it were
-	 * created. */
-	ARTsendthegroup(*groups);
-	Accepted = true;
+        /* Checkgroups/newgroup/rmgroup being sent to a group that doesn't
+         * exist.  Assume it is being sent to the group being created or
+         * removed (or to the admin group to which the checkgroups is posted),
+         * and send it to all sites that would or would have had the group
+         * if it were created. */
+        ARTsendthegroup(*groups);
+        Accepted = true;
       } else
-	NonExist = true;
+        NonExist = true;
       ARTpoisongroup(*groups);
 
       if (innconf->mergetogroups) {
@@ -2146,8 +2150,12 @@
     *ngptr++ = ngp;
     for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++) {
       if (*isp >= 0) {
-	sp = &Sites[*isp];
-	SITEmark(sp, ngp);
+        /* Checkgroups/newgroup/rmgroup posted to local.example
+         * will still be sent with the newsfeeds patterns
+         * "*,!local.*" and "*, at local.*".  So as not to propagate
+         * them, "!control,!control.*" should be added. */
+        sp = &Sites[*isp];
+        SITEmark(sp, ngp);
       }
     }
   }

Modified: samples/newsfeeds.in
===================================================================
--- samples/newsfeeds.in	2007-09-15 21:49:08 UTC (rev 7674)
+++ samples/newsfeeds.in	2007-09-16 07:08:53 UTC (rev 7675)
@@ -82,8 +82,11 @@
 
 # A real-time feed through innfeed.  Don't send articles with a distribution
 # of "foo", since those articles are internal.
+# Note that control messages will be sent even though "!control,!control.*"
+# is specified.  It is useful not to forget that pattern since control
+# messages for local.* would still be sent with "*, at local.*" only.
 #news.uu.net/uunet\
-#	:*,!junk,!control*/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tm:innfeed!
 
 # Create a batch file in @SPOOLDIR@/outgoing for all articles
@@ -91,13 +94,13 @@
 # be named nic.near.net, the default file name, and either nntpsend or
 # send-nntp can send articles from that spool file.
 #nic.near.net\
-#	:*,!junk,!control*/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tf,Wnm:
 
 # A UUCP feed, where we try to keep the "batching" between 4 KB and 1 KB.
 # You can use send-uucp(8) to process these batch files.
 #ihnp4\
-#	:*,!junk,!control/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tf,Wnb,B4096/1024:
 
 



More information about the inn-committers mailing list