Article View: news.software.nntp
Article #82708Re: unrelated possible bug with C flag?
From: Julien ÉLIE
Date: Sat, 30 Jan 2010 20:12
Date: Sat, 30 Jan 2010 20:12
114 lines
5718 bytes
5718 bytes
Hi Dieter,
> I thought that's what I did in my proposal earlier....
>
> i = number of groups, NOT number of commas. Therefore poster => i=1.
Then the (complete) patch is the following:
Index: include/inn/libinn.h
===================================================================
--- include/inn/libinn.h (révision 8880)
+++ include/inn/libinn.h (copie de travail)
@@ -157,6 +157,7 @@
extern bool IsValidMessageID(const char *string, bool stripspaces);
extern bool IsValidHeaderName(const char *string);
extern const char * skip_cfws(const char *p);
+extern const char * skip_fws(const char *p);
extern void HeaderCleanFrom(char *from);
extern struct _DDHANDLE * DDstart(FILE *FromServer, FILE *ToServer);
extern void DDcheck(struct _DDHANDLE *h, char *group);
Index: innd/art.c
===================================================================
--- innd/art.c (révision 8911)
+++ innd/art.c (copie de travail)
@@ -2159,13 +2159,25 @@
}
if (HDR_FOUND(HDR__FOLLOWUPTO)) {
- for (i = 0, p = HDR(HDR__FOLLOWUPTO) ; (p = strchr(p, ',')) != NULL ;
- i++, p++)
- continue;
+ for (i = 1, p = HDR(HDR__FOLLOWUPTO) ; (p = strchr(p, ',')) != NULL ;
+ i++, p++) ;
+
data->Followcount = i;
+
+ /* When "poster" is the only value, then it is not a followup. */
+ if (i == 1) {
+ /* Skip leading whitespaces. */
+ p = (char *) skip_fws(HDR(HDR__FOLLOWUPTO));
+
+ if (strncasecmp(p, "poster", 6) == 0
+ && (p[6] == ' ' || p[6] == '\t' || p[6] == '\0'
+ || p[6] == '\r' || p[6] == '\n')) {
+ data->Followcount = 0;
+ }
+ }
+ } else {
+ data->Followcount = data->Groupcount;
}
- if (data->Followcount == 0)
- data->Followcount = data->Groupcount;
groups = data->Newsgroups.List;
/* Parse the Control header. */
Index: lib/headers.c
===================================================================
--- lib/headers.c (révision 8880)
+++ lib/headers.c (copie de travail)
@@ -86,3 +86,32 @@
}
return p;
}
+
+
+/*
+** Skip any amount of FWS (folding whitespace), the RFC 5322 grammar term
+** for whitespace and CRLF pairs. We also allow simple newlines since we don't
+** always deal with wire-format messages. Note that we do not attempt to
+** ensure that CRLF or a newline is followed by whitespace. Returns the new
+** position of the pointer.
+*/
+const char *
+skip_fws(const char *p)
+{
+ for (; *p != '\0'; p++) {
+ switch (*p) {
+ case ' ':
+ case '\t':
+ case '\n':
+ break;
+ case '\r':
+ if (p[1] != '\n')
+ return p;
+ break;
+ default:
+ return p;
+ }
+ }
+ return p;
+}
+
>>> Why did we accept such an article to begin with?
>>
>> Because not all injecting agents enforce such rules.
>> Not all injecting agents are (and probably will be) compliant with RFC 5537.
>
> Did RFC 1036 say differently? If not, then these have been errors for 22
> years.
RFC 1036 did not go as deep as RFC 5537 does regarding the duties of
all the agents involved in Netnews. In particular here, the injecting agents.
--
Julien ÉLIE
« Les mathématiques peuvent être définies comme une science
dans laquelle on ne sait jamais de quoi on parle, ni si ce qu'on dit
est vrai. » (Bertrand Russell)
Technical Details
Message-ID:
<hk23qr$dok$1@news.trigofacile.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!.POSTED.aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr!not-for-mailReferences:
<hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <hk23qr$dok$1@news.trigofacile.com> Subject: Re: unrelated possible bug with C flag? Date: Sat, 30 Jan 2010 21:12:12 +0100 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!.POSTED.aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr!not-for-mail Newsgroups: news.software.nntp Organization: TrigoFACILE -- http://www.trigofacile.com/ Lines: 114 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 8bit Injection-Date: Sat, 30 Jan 2010 20:12:12 +0000 (UTC) Injection-Info: news.trigofacile.com; posting-host="aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr:83.114.8.10"; logging-data="14100"; mail-complaints-to="abuse@trigofacile.com" In-Reply-To: <hk002q$lni$1@snarked.org> X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005