Article View: news.software.nntp
Article #62805Re: NNTP and YENC
From: Bart Crane
Date: Sun, 05 Jan 2003 12:00
Date: Sun, 05 Jan 2003 12:00
214 lines
8637 bytes
8637 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:ylfzs8tlg7.fsf@windlord.stanford.edu...
> Bart Crane <svcrane@attbi.com> writes:
>
> > So, I am posting here, so as to ask those who actually run news servers,
> > would you please reject any article that is posted to your server that
> > contains ANSI-defined control-characters (hex 00 to 1F and FF), except
> > those defined by the NNTP spec as allowed (CR, LF, TAB)?
>
> I don't agree with your interpretation of the NNTP specification, but I
> suppose it's arguable. More relevantly, though, the NNTP specification
> was written before any code was written, and is in general not a
> particularly good guide to what NNTP is used for in practice.
There is no argument that NNTP data is supposed to be in some
"text" format, because the spec defines it so.
(I am not an expert in this, I am merely trying to summarize the
results of my research into these matters, having suddenly
been required to do so, after the introduction of YENC.)
The man pages for fopen() on Linux/Unix define that "r" and "rb"
streams exist, and generally say that there is no difference in the
way binary- and text-streams are treated.
Thus, for Linux/Unix, one could say that "textual" data
ranges from 00 to FF.
The documentation for fopen() on DOS/Windows also
defines that "r" and "rb" streams exist, and also defines
the specific differences in how binary- and text-streams
are treated.
Thus, for DOS/Windows, one would say that "textual" data
ranges from 00 to FF, and excludes 0D, 0A and 1A.
Therefore, one would say that "textual" data ranges from
00 to FF, excluding 0D, 0A and 1A, so as to obtain the
largest range of compatibility with operating systems.
>
> Control characters are routinely transferred via NNTP, and in fact are
> required by some character encodings.
My research into the spec has been primarily to discover
why the CTRL-Z is not accepted, or otherwise prevented from
being included in the output.
I must ask, then, what is the state of RFC 977 on the subject
of alternate character sets?
What guiding document exists that would allow one to write
a well-behaved and robust nntp client?
>
> > Or, if that is too onerous as a first step, could you please do so if
> > the article contains 0x1A???
>
> Neither the operating system of my news server nor the operating system
> that I use have any difficulties with that character. Why should the
> server reject such articles?
Because it is not conformant to the spec.
> Surely the problem should be born by the
> people directly affected by it,
Better to correct the original oversight.
> system with this problem can obtain better tools,
In this case, it is not better tools, it is an operating system.
The tools are just sed, grep, more. If I ran my system on
a Unix machine, there would be no problem, because
there is no difference between a text- and a binary-stream
on those platforms.
> or just avoid processing
> articles with that octet.
Thus, the solution to the problem introduced by YENC is
to go ahead and download the article, and then throw it
away. This is the solution to problem caused by the
solution to the bandwidth problem -- waste bandwidth.
An alternate and more bandwidth-efficient solution is for
the nntp server to immediately reject any article that
includes CTRL-Z.
>
> > Or, could you forcibly insert into the subject: header a key phrase so I
> > can grep -v those articles out of the listing?
>
> Modifying articles in transit is considered to be one of the worst things
> that a server can do, since it breaks the one-to-one correspondance
> between articles and message IDs upon which Usenet rests. It means that a
> given article with a particular message ID may have different contents on
> different servers, which is really not acceptable.
Yes, you are right. Better to just report 437.
Maybe the absence of MODE READER could indicate a "dumb
client" that requires the server output to be a text-stream?
>
> > The NNTP authors explicitly allow only two control-characters, CR and
> > LF, and are vague on TAB. For good reason, because other control
> > characters have other meanings on other operating systems, such as 1A ==
> > End Of File.
>
> First off, RFC 977 is hopelessly obsolete.
RFC 2980 does not include any wording that changes the
definition of what constitutes valid Response Data.
>
> Second, you seem to be basing this interpretation entirely on the phrase
> "textual matter" in RFC 977, which does not appear to ever be defined.
What constitutes a text-stream can not be defined in the nntp
spec because it is defined by each operating-system.
The concept of text- vs. binary-stream is vague on Unix,
because there is no real difference in how the C runtime
treats files opened with "r" vs. "rb".
>
> If one particular news server wished to enforce this restrictive view of
> RFC 977, I wouldn't argue with that, but in practice NNTP is completely
> 8-bit clean and nearly binary clean and is routinely used to transport
> articles containing control messages.
Not being an expert, I appreciate input regarding how things
work beyond the spec.
But, you have it backwards. The restrictive view is that a text-stream
can consist of any data, except maybe 00h. This restricts compatibility
by excluding DOS/Windows computers from have stdio-based
software systems.
Like I said, there is no difference on Unix and Linux with regard to
text- vs. binary-streams. Big difference on DOS/Windows.
> I really don't see what purpose
> would be served by artificially restricting the range of applications for
> which NNTP can be used just because some command-line tools on one
> particular operating system, tools which are not directly involved in the
> NNTP protocol, cannot handle a particular octet.
Actually, you have it backwards. The range of applications for
which NNTP can be used is restricted to non-DOS/Windows
computers, just because... I don't know, you guys just don't
understand the difference between a text-stream and a
binary stream?
You don't believe me: okay, try this. Use telnet, capture
the output of an NNTP server to a file, and download a
YENC-data file.
Now use this program:
while (EOF != (c= getchar()))
putchar(c);
Compile the program on Unix/Linux and on DOS/Windows.
Now, run this command with input redirected from the
download file, and redirect the output to another file.
Run this command on a Unix computer, and a DOS computer.
Compare the output files. You will see that they DOS
file terminates early, just before what you will see in
the Unix file is a 0x1A.
>
> I'd much rather go the opposite direction and try to get all NNTP software
> as close to binary-clean as possible.
This is not an 8-bit issue.
>
> > The NNTP authors were clearly talking about "stdin",
>
> I doubt this quite a bit.
It seems rather clear to me, but then, this whole text-mode
vs. binary-mode is clear to me, having had to live with it
in the DOS/Windows world for many years.
Thanks for the input.
Bart.
>
> --
> Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
>
> Please post questions rather than mailing me directly.
> <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<e7VR9.570818$%m4.168983@rwcrnsc52.ops.asp.att.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mailReferences:
<BXLR9.432835$pN3.48082@sccrnsc03> <ylfzs8tlg7.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <e7VR9.570818$%m4.168983@rwcrnsc52.ops.asp.att.net> Subject: Re: NNTP and YENC Date: Sun, 05 Jan 2003 12:00:10 GMT From: "Bart Crane" <svcrane@attbi.com> References: <BXLR9.432835$pN3.48082@sccrnsc03> <ylfzs8tlg7.fsf@windlord.stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Newsgroups: news.software.nntp Lines: 213 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: 12.234.193.86 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52.ops.asp.att.net 1041768010 12.234.193.86 (Sun, 05 Jan 2003 12:00:10 GMT) NNTP-Posting-Date: Sun, 05 Jan 2003 12:00:10 GMT Organization: AT&T Broadband