Bug in the [non-]propagation of control messages
Julien ÉLIE
julien at trigofacile.com
Fri Sep 14 22:20:35 UTC 2007
En réponse à Russ Allbery :
>> There is a bug when I send a newgroup control article to local.example:
>> if the newsfeeds pattern of a site is "*, at local.*", the control article
>> is sent to that site! Such a leak is not very good...
>
> What was the control message for? If it wasn't for a local.* group, that
> sounds correct to me. Control messages should propagate according to the
> superset of the affected group and the Newsgroups header.
It was a control message for the creation of local.example
(Newsgroups: local.example).
It is sent by art.c at line 2136:
/* Control messages not filed in "to" get filed only in control.name
* or control. */
if (IsControl && Accepted && !ToGroup) {
ControlStore = true;
controlgroup = concat("control.", ControlWord, (char *) 0);
if ((ngp = NGfind(controlgroup)) == NULL)
ngp = NGfind(ARTctl);
free(controlgroup);
ngp->PostCount = 0;
ngptr = GroupPointers;
*ngptr++ = ngp;
for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++) {
if (*isp >= 0) {
sp = &Sites[*isp];
SITEmark(sp, ngp);
}
}
}
Indeed, control.newgroup is in the pattern "*, at local.*" so it is sent.
It does not care about the poison pattern here.
> The best way to keep control messages local to a site is with a
> distribution.
Sure.
> I don't think the checkgroups part is right. That code requires that
> there be an argument to the control command specifying the affected group,
> and it does article propagation based on that argument. checkgroups takes
> no argument, so that doesn't work.
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.
Note that the definition of LikeNewgroup is not done as the same time.
Perhaps the whole code would be better to understand:
groups = data->Newsgroups.List;
/* Parse the Control header. */
LikeNewgroup = false;
if (HDR_FOUND(HDR__CONTROL)) {
IsControl = true;
/* Nip off the first word into lowercase. */
strlcpy(ControlWord, HDR(HDR__CONTROL), sizeof(ControlWord));
for (p = ControlWord; *p && !ISWHITE(*p); p++)
if (CTYPE(isupper, *p))
*p = tolower(*p);
*p = '\0';
LikeNewgroup = (strcmp(ControlWord, "newgroup") == 0
|| strcmp(ControlWord, "rmgroup") == 0);
if (innconf->ignorenewsgroups && LikeNewgroup) {
for (p++; *p && ISWHITE(*p); p++);
groupbuff[0] = p;
for (p++; *p; p++) {
if (NG_ISSEP(*p)) {
*p = '\0';
break;
}
}
p = groupbuff[0];
for (p++; *p; p++) {
if (ISWHITE(*p)) {
*p = '\0';
break;
}
}
groupbuff[1] = NULL;
groups = groupbuff;
data->Groupcount = 2;
if (data->Followcount == 0)
data->Followcount = data->Groupcount;
}
LikeNewgroup = (LikeNewgroup || strcmp(ControlWord, "checkgroups") == 0);
[...]
--
Julien ÉLIE
« Le style est l'homme même. » (Buffon)
More information about the inn-workers
mailing list