🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #88636

Re: INN/inews behavior on \r\n

#88636
From: Russ Allbery
Date: Fri, 26 Feb 2021 20:49
30 lines
2003 bytes
Mike Glover <mglover@pobox.com> writes:

> But, still, what's the benefit to treating \r as folding whitespace in
> this case?

It's not.  It uses ISWHITE for folding whitespace, which only accepts \t
and space.

The problem is that it's not recognizing a line consisting of \r\n as a
blank line because of this check at the end of StripOffHeaders:

        /* Get start of next header; if it's a blank line, we hit the end. */
        p = NextHeader(p);
        if (*p == '\n')
            break;

*p is \r here, so it thinks there's another header.  I think it then tries
to parse \r\n as a header line and then errors out because there's no
colon.  It was clearly never tested with CRLF line endings.

It may make sense to check if the first line of the input ends in \r\n
and, if so, call wire_to_native on the input buffer before processing it.
inews isn't really designed to accept arbitrary line endings, but it looks
easy enough to make it compatible with CRLF line endings.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87im6eh7vb.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <s1715o$e99$1@dont-email.me> <s17ahp$2a8u$1@gal.iecc.com> <s1bm5h$dp7$1@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <87im6eh7vb.fsf@hope.eyrie.org>
Subject: Re: INN/inews behavior on \r\n
Date: Fri, 26 Feb 2021 12:49:44 -0800
From: Russ Allbery <eagle@eyrie.org>
References: <s1715o$e99$1@dont-email.me> <s17ahp$2a8u$1@gal.iecc.com> <s1bm5h$dp7$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: hope.eyrie.org; logging-data="1044"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:m0pSegzPgkbOL8+qfvdC8AE2f0Q=