Bug in the [non-]propagation of control messages
Julien ÉLIE
julien at trigofacile.com
Sat Sep 15 07:15:49 UTC 2007
En réponse à Russ Allbery :
>> Indeed, control.newgroup is in the pattern "*, at local.*" so it is sent.
>> It does not care about the poison pattern here.
>
> Ah, yes, if you don't want to send all control messages to a remote host,
> you also have to exclude control.* from the feed.
All right. So I have to replace "*" by "*,!control.*" in my newsfeeds entries.
It is true that I read in the newsfeeds man page:
Control messages follow slightly different propagation rules than normal
articles; see innd(8) for the details. Note that most subscriptions should
have "!junk,!control*" in their pattern list due to those propagation rules.
And the innd man page explains that. But maybe an example is missing in
order to make it clearer (such as the example of a newgroup control message
posted to local.example with the "*, at local.*" pattern).
> I'm not sure if that's
> a feature or not, but I'm not sure how to change it without breaking
> feeding control.newgroup explicitly.
Neither do I. But well, we can consider it as a feature.
>> The article propagation is based on what there is in "groups" thanks
>> to ARTsendthegroup(*groups). And it is set by:
>> groups = data->Newsgroups.List;
>> just before.
>
> And then overridden in the LikeNewgroup code... so the change for
> checkgroups wouldn't have any real effect, would it? Maybe I'm missing
> something.
Yes it would have.
Suppose a checkgroups is sent to foo.admin and that you do not have
that group in your active (but you carry foo.* or, at least, you
receive a feed for foo.*). In the current implementation, it does:
if ((ngp = NGfind(p)) == NULL) {
GroupMissing = true;
if (LikeNewgroup && Approved) {
ARTsendthegroup(*groups);
Accepted = true;
} else
NonExist = true;
so the checkgroups is not propagated because of NonExist.
Indeed, we have after:
for (i = nSites, sp = Sites; --i >= 0; sp++) {
if (sp->Poison || (sp->ControlOnly && !IsControl)
|| (sp->DontWantNonExist && NonExist))
sp->Sendit = false;
}
And finally, the checkgroups is rejected (Unwanted newsgroup foo.admin).
Adding checkgroups in LikeNewgroup stuff (at the right place, after
the code which searches for a newsgroup name useful for newgroup/rmgroup)
causes ARTsendthegroup to be called and the acceptance of the checkgroups
control message. Then it can be propagated to the sites which need it,
and not blocked by the local news server.
So basically, the patch would only have one line of code now:
Index: innd/art.c
===================================================================
--- innd/art.c (révision 7651)
+++ innd/art.c (copie de travail)
@@ -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. */
@@ -2034,15 +2037,16 @@
for (GroupMissing = Accepted = false; (p = *groups) != NULL; groups++) {
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. */
+ /* Newgroup/rmgroup/checkgroups being sent to a group that doesn't
+ * exist. Assume it is being sent to the group being created or
+ * removed (or to the administrative group of a hierarchy in case
+ * of a checkgroups message), 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;
--
Julien ÉLIE
« Le style est l'homme même. » (Buffon)
More information about the inn-workers
mailing list