Send inn-workers mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."
Today's Topics:
1. Re: Inews and long headers (Julien ?LIE)
2. Re: Inews and long headers (Kamil =?iso-8859-2?Q?Jo=F1ca?=)
----------------------------------------------------------------------
Message: 1
Date: Fri, 7 Jul 2017 22:50:21 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: Inews and long headers
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Jeffery and Kamil,
>> Header-name: aaaaaaa
>> bbbbbbbb
>> ....
>>
>> No single line is 998 bytes long, but concatenated are.
>> I am not sure if 998 limit concerns single line or whole header. I
>> thought that only single line should be checked, not whole header?
>
> Indeed, that's an inews bug. The length check should be for a single
> line, not for the whole header field.
I suggest the following patch for inews. Do you happen to have
the possibility to test it and report if it solves your issue?
I've done tests, and it seems to work fine (reject of too long lines,
and accept headers whose length exceeds 998 bytes but are properly
wrapped):
% cat testarticle | mailpost trigofacile.test
inews failed: inews: header line too long inews: article not posted
--- frontends/inews.c (r?vision 10159)
+++ frontends/inews.c (copie de travail)
@@ -198,13 +198,22 @@
static char *
NextHeader(char *p)
{
- for ( ; ; p++) {
- if ((p = strchr(p, '\n')) == NULL)
+ char *q;
+ for (q = p; ; p++) {
+ if ((p = strchr(p, '\n')) == NULL) {
die("article is all headers");
- if (!ISWHITE(p[1])) {
- *p = '\0';
- return p + 1;
- }
+ }
+ /* Check the maximum length of a single line. */
+ if (p - q + 1 > HEADER_STRLEN) {
+ die("header line too long");
+ }
+ /* Check if there is a continuation line for the header. */
+ if (ISWHITE(p[1])) {
+ q = p + 1;
+ continue;
+ }
+ *p = '\0';
+ return p + 1;
}
}
@@ -1026,13 +1035,6 @@
/* Do final checks. */
if (i == 0 && HDR(_control) == NULL)
die("article is empty");
- for (hp = Table; hp < ARRAY_END(Table); hp++)
- if (hp->Value && (int)strlen(hp->Value) + hp->Size > HEADER_STRLEN)
- die("%s header is too long", hp->Name);
- for (i = 0; i < OtherCount; i++)
- if ((int)strlen(OtherHeaders[i]) > HEADER_STRLEN)
- die("header too long (maximum length is %d): %.40s...",
- HEADER_STRLEN, OtherHeaders[i]);
if (Dump) {
/* Write the headers and a blank line. */
--
Julien ?LIE
? O fortunatos nimium, sua si bona norint, agricolas. ? (Virgile)
------------------------------
Message: 2
Date: Sat, 08 Jul 2017 11:07:14 +0200
From: [email protected] (Kamil =?iso-8859-2?Q?Jo=F1ca?=)
To: [email protected]
Subject: Re: Inews and long headers
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-2
Julien ?LIE <[email protected]> writes:
> Jeffery and Kamil,
>
>>> Header-name: aaaaaaa
>>> bbbbbbbb
>>> ....
>>>
>>> No single line is 998 bytes long, but concatenated are.
>>> I am not sure if 998 limit concerns single line or whole header. I
>>> thought that only single line should be checked, not whole header?
>>
>> Indeed, that's an inews bug. The length check should be for a single
>> line, not for the whole header field.
>
> I suggest the following patch for inews. Do you happen to have
> the possibility to test it and report if it solves your issue?
>
It looks it is better now.
Now I have problem with lines
--8<---------------cut here---------------start------------->8---
Header-name:
aaaaa
--8<---------------cut here---------------end--------------->8---
but I am not sure if this is properly formatted line.
KJ
--
http://stopstopnop.pl/stop_stopnop.pl_o_nas.html
"Uchodzi? za idiot? w oczach kretyna - to rozkosz dla smakosza"
[Georges Courteline]
------------------------------
Subject: Digest Footer
_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers
------------------------------
End of inn-workers Digest, Vol 96, Issue 2
******************************************