🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
133 messages
133 total messages Page 1 of 3 Started by Bart Crane Sun, 05 Jan 2003 01:33
Page 1 of 3 • 133 total messages
NNTP and YENC
#62793
Author: Bart Crane
Date: Sun, 05 Jan 2003 01:33
80 lines
4876 bytes
Hello,

I am having difficulty resolving this issue.  I have asked about it here
before, and was pointed to the news.software.readers group.  I
posted there in the hopes of convincing authors of newsposting
software to help, and I was pointed back to here.  It was also
suggested that I email yenc.org, but I had already done so and
received no response.  It is a ridiculously small thing, a 1-byte change
to the encoder-spec, and no change on the decoder.

The problem is that NNTP servers are forwarding YENC-encoded
data, but this data includes control-characters, one of which, 0x1A,
is interpreted within text-streams on DOS/Windows to mean "End
Of File."

This causes sed and grep to terminate early.  You can imagine my
consternation.

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)?
Or, if that is too onerous as a first step, could you please do so if the
article contains 0x1A???  Or, could you forcibly insert into the subject:
header a key phrase so I can grep -v those articles out of the listing?

That may sound extreme, but, RFC 977 says that the format of Response
Data is "textual".  Many people consider this to be a 7- vs. 8-bit issue,
but it is not.  It is a text- vs. control-character issue.

The difference is seen with the C runtime library function fopen(),
which takes an argument that can include a flag that indicates "binary"
mode: "rb" and "wb".  In this mode, the C runtime library does not
perform any interpretation of the data.

When this flag is absent, the stream is opened in "cooked-mode",
which is also the default mode for standard input.  In this mode, the
C runtime library maps the implementation details of how a particular
operating system defines a "text stream" to C logical constructs, such
 as '\n'.

Without this concept, text-processing utilities would need special-case
coding to account for how different operating systems implement
text-streams.  With this concept, one can write newsreader software in
portable C and expect it to compile and function properly on any
platform.  That has been my expectation and experience, until now.

This is not an 7- vs. 8-bit issue.  No matter the number of bits in
a byte, if the value is in the range of 0..31 or is -1, ANSI defines it
to be control character.  In a text-stream, a "control character" may
be interpreted specially.  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.

The NNTP authors were clearly talking about "stdin", but refrained
from naming it as such, so as to keep implementation details (Unix)
out of the spec.  Instead, they used wording to effect that the NNTP
server output was destined "for the user's terminal".

I would very much like to return to treating the output from NNTP
servers as "textual".  That was the original intent, that was the existing
practice, and of all of the reasons for using YENC, none preclude
continuing that practice.

It is a dark day indeed if a network protocol can be introduced and
adopted that is so clearly in violation of multiple pre-existing
standards, and does so in such a way that breaks pre-existing systems
based on those standards.  Okay, you got me: it breaks one pre-
existing system.  But that system is mine!!!

You may laugh at the idea of doing big-time data processing on a
DOS machine, but the world is not just one big bourne shell.  Okay,
I am ranting... time to turn it over for comments.  Thanks for reading!!

Bart.



Re: NNTP and YENC
#62796
Author: Russ Allbery
Date: Sun, 05 Jan 2003 01:49
66 lines
4076 bytes
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.

Control characters are routinely transferred via NNTP, and in fact are
required by some character encodings.

> 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?  Surely the problem should be born by the
people directly affected by it, and people who wish to use an operating
system with this problem can obtain better tools, or just avoid processing
articles with that octet.

> 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.

> 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.

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.

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.  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.

I'd much rather go the opposite direction and try to get all NNTP software
as close to binary-clean as possible.

> The NNTP authors were clearly talking about "stdin",

I doubt this quite a bit.

-- 
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.
Re: NNTP and YENC
#62798
Author: greg andruk
Date: Sun, 05 Jan 2003 02:22
15 lines
1831 bytes
Bart Crane wrote:

> The problem is that NNTP servers are forwarding YENC-encoded
> data, but this data includes control-characters, one of which, 0x1A,
> is interpreted within text-streams on DOS/Windows to mean "End
> Of File."

> This causes sed and grep to terminate early.  You can imagine my
> consternation.

This is a bug in the tools you are using.  The versions of grep and sed 
that I use with Windows do not choke on control characters, vertainly not 
the old CP/M EOF.  If you have the sources, try fixing them to open files 
in binary mode.
Re: NNTP and YENC
#62797
Author: Bart Crane
Date: Sun, 05 Jan 2003 02:48
59 lines
3065 bytes
"greg andruk" <gja@meowing.net> wrote in message
news:1prda3yvcm5x4.dlg@meowing.net...
> Bart Crane wrote:
>
> > The problem is that NNTP servers are forwarding YENC-encoded
> > data, but this data includes control-characters, one of which, 0x1A,
> > is interpreted within text-streams on DOS/Windows to mean "End
> > Of File."
>
> > This causes sed and grep to terminate early.  You can imagine my
> > consternation.
>
> This is a bug in the tools you are using.  The versions of grep and sed
> that I use with Windows do not choke on control characters, vertainly not
> the old CP/M EOF.  If you have the sources, try fixing them to open files
> in binary mode.

The point behind text- vs. binary-mode, cooked- vs. raw-mode, was so
that C progams can be written portably, using constructs like:

    if ('\n' == *p)

If there was no difference between text- vs. binary- mode, then text-
processing utilities would need special-casing on a per-platform basis:

#if defined(LINUX) || defined(UNIX)
    if ('\n' == *p)
#endif
#if defined(WIN32)
    if ('\r' == *p && '\n' == *(p+1))
#endif

What you suggest is to re-implement the C runtime library code in
every program, for every platform... doesn't that strike you as
counter-intuitive?

It is unreasonable to have to rewrite software written to published
standards because of the introduction of new software that ignores
those standards.  In this particular case, these programs compile
for multiple platforms, have no platform-dependent code, and have
functioned without error for 10+ years... and who knows where
the source is.

The immediate solution is a 1-byte change to YENC-encoders to
include 0x1A as a Critical Character.  The YENC spec requires
that every byte generated be examined.  If it is a Critical Character,
then it must be escaped.  This is not a big deal.

Oh, and no change to YENC decoders is required to fix my
CTRL-Z situation.

Thanks for the input.

Bart.



Re: NNTP and YENC
#62799
Author: Curt Welch
Date: Sun, 05 Jan 2003 02:58
121 lines
6328 bytes
"Bart Crane" <svcrane@attbi.com> wrote:
> It was also
> suggested that I email yenc.org, but I had already done so and
> received no response.  It is a ridiculously small thing, a 1-byte change
> to the encoder-spec, and no change on the decoder.

Hey, I talk with Juergen all the time.  And I asked him to fix the link to
my newsreader.com service on the yenc.org site which has been broken since
it was added and he's not gotten that done either.  We are all busy, some
things are more important than others.

Your suggestion that the yEnc spec be changed to say all encoders should
escape ^Z is questionable since it's only a minor problem for some people
(you) and would cause a size increase for _everything_ posted to Usenet in
yEnc.  How much does everyone not having problems with ^Z really owe you?

> The problem is that NNTP servers are forwarding YENC-encoded
> data, but this data includes control-characters, one of which, 0x1A,
> is interpreted within text-streams on DOS/Windows to mean "End
> Of File."
>
> This causes sed and grep to terminate early.  You can imagine my
> consternation.
>
> 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)?

You are funny.  So we should just reject all yEnc articles? :)  You do
understand that they all contain large numbers of control characters don't
you?

We have been working for years to get all of Usenet to transport 8bit data.
You are not going to get anywone to reject articles with control characters
- not even ^Z alone.

> Or, if that is too onerous as a first step, could you please do so if the
> article contains 0x1A???  Or, could you forcibly insert into the subject:
> header a key phrase so I can grep -v those articles out of the listing?

Nope.

> That may sound extreme, but, RFC 977 says

Good try.  Nope.

> Without this concept, text-processing utilities would need special-case
> coding to account for how different operating systems implement
> text-streams.

They do have special special-case coding.  What do you think "rb" and "wb"
is?

> With this concept, one can write newsreader software in
> portable C and expect it to compile and function properly on any
> platform.

There's no such thing as "portable C".  I've been writing in it for 25
years and have writen code that ran on over 250 different versions of Unix
and believe me, it's not portable.

> That has been my expectation and experience, until now.

You need to fix your code.  Don't ask the rest of the world to fix there's
because you can't program.

Nobody puts ^Z into files anymore to mean end-of-file.  If the stupid libc
routines you use can't read text files with ^Z in them, write your own that
can.

If for some god-forsaken reaon you are trying to store Usenet articles in
old CPM style "files" which have a length which is a multiple of 128 bytes
instead of having a modern byte length, then you need to encode the data as
you store it and escape the ^Z in the data to something else.

NNTP data is 8 bit binary data now.  Get used to that.  It's only going to
get worse.

> This is not an 7- vs. 8-bit issue.  No matter the number of bits in
> a byte, if the value is in the range of 0..31 or is -1, ANSI defines it
> to be control character.  In a text-stream, a "control character" may
> be interpreted specially.  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.

Sorry, the NNTP specs have nothing to do with Usenet.  The people that
write and run news servers are what control how their segement of Usenet
works and nobody is going to start blocking ^Z now.

> I would very much like to return to treating the output from NNTP
> servers as "textual".

Sorry.  Those days are gone.  Fix your code to deal with Usenet how it is
or don't call your code "usenset software".

> That was the original intent, that was the
> existing practice, and of all of the reasons for using YENC, none
> preclude continuing that practice.

> It is a dark day indeed if a network protocol can be introduced and
> adopted that is so clearly in violation of multiple pre-existing
> standards, and does so in such a way that breaks pre-existing systems
> based on those standards.  Okay, you got me: it breaks one pre-
> existing system.  But that system is mine!!!

What on earth is so hard about fixing your system so it works?

BTW, the last time you suggested this I changed my yEnc encoders so they
escape ^Z for you.  But don't ask me to go any further.

The odds of you getting yEnc changed, and getting everyone out there to
upgrade to a recent version of yEnc which escapes ^Z is about zero.  Your
only option is to figure out how to make your code work even if ^Z is in
the data.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: NNTP and YENC
#62801
Author: Jeffrey M. Vinocur
Date: Sun, 05 Jan 2003 03:27
15 lines
1338 bytes
In article <ylfzs8tlg7.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>
>in practice NNTP is completely 8-bit clean and nearly binary
>clean and is routinely used to transport articles containing
>control messages.
         ^^^^^^^^

Russ means "control characters" here, of course.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: NNTP and YENC
#62802
Author: greg andruk
Date: Sun, 05 Jan 2003 03:28
21 lines
2373 bytes
Bart Crane wrote:

..
> It is unreasonable to have to rewrite software written to published
> standards because of the introduction of new software that ignores
> those standards.  In this particular case, these programs compile
> for multiple platforms, have no platform-dependent code, and have
> functioned without error for 10+ years... and who knows where
> the source is.

In the case of grep and sed, the relevant standard is POSIX, and POSIX does 
not make a distinction between binary and text files.

If a POSIX program is built with a compiler and libraries that don't honor 
that standard, of course it's going to stand a good chance of being broken.  
So, the choices boil down to obtaining a copy of the programs with correct 
behavior, using a compiler and libraries with appropriate options to 
provide correct behavior (the MS Cs I've seen do offer this), or modify the 
sources to get the correct behavior (and thanks to activities like BSD and 
GNU, sources for these programs is indeed easy to obtain).
Re: NNTP and YENC
#62804
Author: greg andruk
Date: Sun, 05 Jan 2003 05:18
13 lines
2017 bytes
Pete the Plumber wrote:

> Looks like the MS C and C++ standard file I/O have this problem, adhering to 
> the ancient "Ctrl-Z == EOF" behavior.  I tried the program below, and it does 
> indeed terminate reading on the 0x1A character.  I went through all the MS 
> C/C++ compiler options and didn't find anything that would affect this.

> I'm not arguing the OP's case, just pointing out that the solution is going to 
> involve binary mode.

What about if you link with \lib\binmode.obj ?  That should force _fmode to 
_O_BINARY without changes in your source.
Re: NNTP and YENC
#62803
Author: Bart Crane
Date: Sun, 05 Jan 2003 09:44
320 lines
12780 bytes
"Curt Welch" <curt@kcwc.com> wrote in message
news:20030104215829.905$Rh@newsreader.com...
> "Bart Crane" <svcrane@attbi.com> wrote:
> > It was also
> > suggested that I email yenc.org, but I had already done so and
> > received no response.  It is a ridiculously small thing, a 1-byte change
> > to the encoder-spec, and no change on the decoder.
>
> Hey, I talk with Juergen all the time.  And I asked him to fix the link to
> my newsreader.com service on the yenc.org site which has been broken since
> it was added and he's not gotten that done either.  We are all busy, some
> things are more important than others.

There is nothing more important than the uninterrupted processing of
my NNTP-data!!!

There were five Critical Characters defined in YENC at one point,
and then there were four.  This indicates to me that there is some
question about what exactly should constitute a "Critical Character".
If there had been a Request For Comments, all this could have
been pointed out before it broke my system.

At the least, I would have been able to take action to prevent my
system from breaking, instead of the frustrating hours spent trying
to figure out what could possible be going wrong...


>
> Your suggestion that the yEnc spec be changed to say all encoders should
> escape ^Z is questionable since it's only a minor problem for some people
> (you) and would cause a size increase for _everything_ posted to Usenet in
> yEnc.  How much does everyone not having problems with ^Z really owe you?

In the quest to reduce overhead, he went 1 byte to far.  No big deal.  Fix
it.

One version of yenc had 5 Critical Characters.  The next had 4.  What is
the big deal?  Add CTRL-Z, and compatibility is restored.


>
> > The problem is that NNTP servers are forwarding YENC-encoded
> > data, but this data includes control-characters, one of which, 0x1A,
> > is interpreted within text-streams on DOS/Windows to mean "End
> > Of File."
> >
> > This causes sed and grep to terminate early.  You can imagine my
> > consternation.
> >
> > 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)?
>
> You are funny.  So we should just reject all yEnc articles? :)  You do
> understand that they all contain large numbers of control characters don't
> you?

Originally, I was concerned only with CTRL-Z.  Then, I realized, that was
as selfish a position as the one that caused this situation.  Thus, there
was
no choice but to include all non-textual characters.


>
> We have been working for years to get all of Usenet to transport 8bit
data.
> You are not going to get anywone to reject articles with control
characters
> - not even ^Z alone.

This is not a "7- to 8-bit" issue.  This is a text- vs. binary-stream issue.

The NNTP authors specifically state that the Response Data is "textual".

The ambiguity regarding the definition of "textual" is confused by the
8-bit issue.  It is not related.

The NNTP authors did not define what "textual" meant, because it would
link implementation with specification.  The implementation is operating-
system specific, and is manifested in whatever differences exist between
opening a file in "r" and "rb".

In DOS/Windows, CR LF is mapped to LF, and SUB is interpreted
as End Of File.  To maintain compatibility with DOS/Windows, only
SUB need be escaped.


>
> > Or, if that is too onerous as a first step, could you please do so if
the
> > article contains 0x1A???  Or, could you forcibly insert into the
subject:
> > header a key phrase so I can grep -v those articles out of the listing?
>
> Nope.
>
> > That may sound extreme, but, RFC 977 says
>
> Good try.  Nope.

RFC 977 says that Response Data is "textual".

Could you tell me what you define the difference between
textual and non-textual data to be?

What data would an NNTP server normally reject as not being
valid?  One answer I got was "00h".  That does not seem to
be a very useful definition.

Why not include 1Ah, since it has special meaning to text-streams,
and has for over 20 years?


>
> > Without this concept, text-processing utilities would need special-case
> > coding to account for how different operating systems implement
> > text-streams.
>
> They do have special special-case coding.  What do you think "rb" and "wb"
> is?

Application code is not aware of the underlying translation performed
on the data processed by fread() and fwrite().

This raw- vs. cooked-mode stuff, binary- vs. text-stream stuff is all very
old... I can see that the fact that CTRL-Z == EOF is not common
knowledge for the people in these groups.


>
> > With this concept, one can write newsreader software in
> > portable C and expect it to compile and function properly on any
> > platform.
>
> There's no such thing as "portable C".  I've been writing in it for 25
> years and have writen code that ran on over 250 different versions of Unix
> and believe me, it's not portable.

Writing text-processing utilities is fun, and portable!

That is because there is a spec regarding what constitutes a text-
stream, defined by the operating system, and the implementers of the
C runtime library for that operating system provide the translation
between '\n' and whatever the operating system uses as the end-of-line
delimiter.

It also does whatever is necessary to present the End Of File condition.
Some operating systems use a special character, like CTRL-Z,
and others use a size-value in the directory entry, and others use a
resource-fork -- just guessing here!!! -- you get the picture.

The end-result is that you can write filter programs that compile on
any platform with stdio.h.

Text-mode in Unix and Linux is not very different from binary-mode.
In fact, I can't think of a single difference.

Yet, there is this concept of data being "textual", of files being used in
"text-mode", of "text-streams", of NNTP Response Data being
"textual".

You may not be confident of what they meant by "textual", but I
am: it is whatever difference "r" has from "rb".

You can make 256 rows of byte-values, with a column for each
operating-system, and go through it byte by byte.  "Is this byte-value
in a text-stream interpreted specially by this operating system?"
You really only have to do it for the first 32 bytes, because everyone
has standardized on the ANSI definition of control-codes being
00..1F.

You will probably find only CTRL-Z is an issue.

This is all very old stuff.  I wish I had heard about this before version
1.4,
it is a teensy little change for CTRL-Z... the standards process is
designed to root out things like this.  The world is not one big unix box.


>
> > That has been my expectation and experience, until now.
>
> You need to fix your code.  Don't ask the rest of the world to fix there's
> because you can't program.

Text-processing utilities running under DOS/Windows interpret
CTRL-Z as End Of File.  This is not something I am making up.
This is not something I can change.

Don't expect the rest of the world to have the same computer
as you.  The world is not one big unix box.


>
> Nobody puts ^Z into files anymore to mean end-of-file.  If the stupid libc
> routines you use can't read text files with ^Z in them, write your own
that
> can.

If you are someone who operates an NNTP server, then I am asking you,
"why are you including CTRL-Z in the data?  Don't you know that that
means End Of File in DOS/Windows?"  I think the answer to that is
obviously "no", maybe "now I do.".


>
> If for some god-forsaken reaon you are trying to store Usenet articles in
> old CPM style "files" which have a length which is a multiple of 128 bytes
> instead of having a modern byte length, then you need to encode the data
as
> you store it and escape the ^Z in the data to something else.

Here is a shortened version of the pipeline:

echo 10984 | newsget netnews.attbi.com alt.test some | sed -f fixnews |
decode

So, you can see that the data is not stored, except as it exists in the
pipeline.

The problem is that embedded CTRL-Z's cause sed to terminate as
though it reached the End Of File.


>
> NNTP data is 8 bit binary data now.  Get used to that.  It's only going to
> get worse.

This is not an 8-bit problem.  This is a text- vs. binary-mode problem.


>
> > This is not an 7- vs. 8-bit issue.  No matter the number of bits in
> > a byte, if the value is in the range of 0..31 or is -1, ANSI defines it
> > to be control character.  In a text-stream, a "control character" may
> > be interpreted specially.  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.
>
> Sorry, the NNTP specs have nothing to do with Usenet.  The people that
> write and run news servers are what control how their segement of Usenet
> works and nobody is going to start blocking ^Z now.

It does seem as though you and others are trying to say that NNTP servers
are not bound by the NNTP spec anymore, but without actually saying that.


>
> > I would very much like to return to treating the output from NNTP
> > servers as "textual".
>
> Sorry.  Those days are gone.  Fix your code to deal with Usenet how it is
> or don't call your code "usenset software".

Interesting... was there a Request For Comments regarding dropping
the "textual" aspect of NNTP data?

Gee, I was angry at how YENC was introduced without "going through
channels", but it seems par for the course!!


>
> > That was the original intent, that was the
> > existing practice, and of all of the reasons for using YENC, none
> > preclude continuing that practice.
>
> > It is a dark day indeed if a network protocol can be introduced and
> > adopted that is so clearly in violation of multiple pre-existing
> > standards, and does so in such a way that breaks pre-existing systems
> > based on those standards.  Okay, you got me: it breaks one pre-
> > existing system.  But that system is mine!!!
>
> What on earth is so hard about fixing your system so it works?

It would be much harder than including CTRL-Z as a Critical Character
in the YENC spec.


>
> BTW, the last time you suggested this I changed my yEnc encoders so they
> escape ^Z for you.  But don't ask me to go any further.

Hey, thanks!!  That'll fix it for me!!!


>
> The odds of you getting yEnc changed, and getting everyone out there to
> upgrade to a recent version of yEnc which escapes ^Z is about zero.

Naturally.  That is why I am asking the NNTP server guys to help.

If all YENC-data containing CTRL-Z were rejected, because it
breaks compatibility with existing systems, I bet the spec would be
updated and encoders updated pretty quick!!


> Your
> only option is to figure out how to make your code work even if ^Z is in
> the data.

Another option is... ZENC!!!  That way we can post content once in
YENC, really fast.  Once again in ZENC, just as fast, but compatible
with all systems.  And once again in UUENCODE, for everyone else!!


>
> --
> Curt Welch
http://CurtWelch.Com/
> curt@kcwc.com                          Webmaster for
http://NewsReader.Com/

Bart.



Re: NNTP and YENC
#62805
Author: Bart Crane
Date: Sun, 05 Jan 2003 12:00
214 lines
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.


Re: NNTP and YENC
#62807
Author: Claus Färber
Date: Sun, 05 Jan 2003 12:03
11 lines
1371 bytes
greg andruk <gja@meowing.net> schrieb/wrote:
> In the case of grep and sed, the relevant standard is POSIX,...

Only for grep and sed on POSIX systems. For ports to other, non-POSIX   
systems, the relevant standard is not POSIX.

Claus
-- 
------------------------ http://www.faerber.muc.de/ ------------------------
OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
#62809
Author: Jeremy
Date: Sun, 05 Jan 2003 13:19
20 lines
1557 bytes
Bart Crane <svcrane@attbi.com> wrote:

> The problem is that NNTP servers are forwarding YENC-encoded
> data, but this data includes control-characters, one of which, 0x1A,
> is interpreted within text-streams on DOS/Windows to mean "End
> Of File."

After that long email discussion we had, I didn't budge you at all? :(

The bottom line is this: your argument is that we should permanently
cripple Usenet to accomodate a broken operating system, or badly designed
software running on a broken operating system.  No.

In addition, it's worth noting that *most* of the people currently using
yEnc are also using Windows, and somehow their software manages to deal
with it.

-- 
Jeremy  |  jeremy@exit109.com
Re: NNTP and YENC
#62814
Author: greg andruk
Date: Sun, 05 Jan 2003 14:19
10 lines
1717 bytes
Claus Färber wrote:

> greg andruk <gja@meowing.net> schrieb/wrote:
>> In the case of grep and sed, the relevant standard is POSIX,...

> Only for grep and sed on POSIX systems. For ports to other, non-POSIX   
> systems, the relevant standard is not POSIX.

Windows _is_ a POSIX system, among other things.  Next?
Re: NNTP and YENC
#62813
Author: Dr.Ruud
Date: Sun, 05 Jan 2003 16:17
45 lines
2165 bytes
Bart Crane skribis:

> 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.

Idea: find or create a dos2unix-filter and pipe through it.


See also:

CygWin

http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mercury-developers.9909/0119.html

google: setmode fileno O_BINARY (1200 hits)



>    while (EOF != (c= getchar()))
>        putchar(c);

First do something like this:

#ifdef WIN32
  if( setmode( fileno ( stdin ), O_BINARY ) == -1 ) {
    perror ( "Cannot set stdin to binary mode" );
    exit(-1);
  }

  if( setmode( fileno ( stdout ), O_BINARY ) == -1 ) {
    perror ( "Cannot set stdout to binary mode" );

    exit(-1);
  }
#endif


-- 
Affijn, Ruud


Re: NNTP and YENC
#62815
Author: David Magda
Date: Sun, 05 Jan 2003 16:19
34 lines
2501 bytes
"Bart Crane" <svcrane@attbi.com> writes:
[...]
> 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.

If the problem was "introduced by YENC", why should the solution be
changing the NNTP server? I do not see the logic in that conclusion.

[...]
> 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.
[...]

Isn't this is a design defect in DOS/Windows then? Or perhaps, a bad
assumption was made in the designing the OS, or in the designing of
the YENC spec.? (Most probably YENC.)

-- 
David Magda <dmagda at ee.ryerson.ca>
Because the innovator has for enemies all those who have done well under
the old conditions, and lukewarm defenders in those who may do well 
under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI
Re: NNTP and YENC
#62816
Author: David Magda
Date: Sun, 05 Jan 2003 16:35
54 lines
2912 bytes
"Bart Crane" <svcrane@attbi.com> writes:
[...]
> This is not a "7- to 8-bit" issue.  This is a text-
> vs. binary-stream issue.
[...]

The terms "text-stream" and "binary-stream" are highly open to debate
and interpretation. Is a particular shade of colour blue or cyan or
green?
 
> The NNTP authors specifically state that the Response Data is
> "textual".
> 
> The ambiguity regarding the definition of "textual" is confused by
> the 8-bit issue.  It is not related.
>
> The NNTP authors did not define what "textual" meant, because it
> would link implementation with specification.  The implementation
> is operating-[...]
[...]

Then it is up to the implementor of NNTP to determine what it means.

[...]
> That is because there is a spec regarding what constitutes a text-
> stream, defined by the operating system, and the implementers of the
[...]

Can you please post a reference/URL to this spec?

[...]
> Don't expect the rest of the world to have the same computer
> as you.  The world is not one big unix box.
[...]

We don't. But why should I worry about Windows boxes when I'm running
a Unix box? Microsoft is not making things easier for the rest of the
world. In many instances it works quite hard in making things more
difficult (e.g., "embracing-and-extending" standards like 
Kerberos 5 to break inter-operability). 

[...]
> It would be much harder than including CTRL-Z as a Critical Character
> in the YENC spec.
[...]

And it's easier to fix *every* *single* operating NNTP server?

-- 
David Magda <dmagda at ee.ryerson.ca>
Because the innovator has for enemies all those who have done well under
the old conditions, and lukewarm defenders in those who may do well 
under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI
Re: NNTP and YENC
#62817
Author: Jeffrey M. Vinocur
Date: Sun, 05 Jan 2003 16:54
78 lines
3600 bytes
In article <j8TR9.568229$WL3.160487@rwcrnsc54>,
Bart Crane <svcrane@attbi.com> wrote:
>
>There is nothing more important than the uninterrupted processing of
>my NNTP-data!!!

Well, to you, perhaps.  In which case some of the burden will
need to fall to you...


>In the quest to reduce overhead, he went 1 byte to far.  No big deal.  Fix
>it.

You can't.  It's too late.  You might be able to reduce the
number of posts that include ^Z somewhat, but you'll never get
rid of them.

There are a lot of things about yEnc in particular and NNTP in
general that would be different if you gave us a magic wand to
change the past.  But we don't have one, and that's just the way
it is.


>What data would an NNTP server normally reject as not being
>valid?  One answer I got was "00h".  That does not seem to
>be a very useful definition.

It's up to the implementation, I suppose.  Implementations in C
tend to have trouble with '\0' in character arrays.


>It does seem as though you and others are trying to say that NNTP servers
>are not bound by the NNTP spec anymore, but without actually saying that.

NNTP servers have never been bound by the specifications.  In
fact, the specifications are generally *based* on existing
implementations.


>Interesting... was there a Request For Comments regarding dropping
>the "textual" aspect of NNTP data?

NNTP servers were never enforcing any sort of ban on binary data.
If anybody posted it, it would have mostly worked.  It's just
that up until yEnc became popular, few people attempt to include
such things in their posts.

So no, certainly no RFC on that.


>> What on earth is so hard about fixing your system so it works?
>
>It would be much harder than including CTRL-Z as a Critical Character
>in the YENC spec.

You know, in the time you spent posting about this, you could
have fixed your code, installed a proxy server in between and
configured it to do the changes you require, or implemented a
variety of other solutions.


>> The odds of you getting yEnc changed, and getting everyone out there to
>> upgrade to a recent version of yEnc which escapes ^Z is about zero.
>
>Naturally.  That is why I am asking the NNTP server guys to help.
>
>If all YENC-data containing CTRL-Z were rejected, because it
>breaks compatibility with existing systems, I bet the spec would be
>updated and encoders updated pretty quick!!

Uh huh.  How exactly do you plan on getting all of the news
servers to do anything in unison?


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: NNTP and YENC
#62819
Author: Russ Allbery
Date: Sun, 05 Jan 2003 20:19
82 lines
4629 bytes
Bart Crane <svcrane@attbi.com> writes:
> "Russ Allbery" <rra@stanford.edu> wrote:

>> 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.

RFC 977 is not a useful specification for NNTP as it's used on Usenet.
There is no complete published specification; you have to look at what is
currently implemented.

I don't know how much clearer I can possibly be about this.

The current NNTP draft, which will become the next RFC replacing 977, is
somewhat better, although not complete.  On this topic, it says:

    Each response MUST start with a three-digit response code that is
    sufficient to distinguish all responses. Certain valid responses are
    defined to be multi-line; for all others, the response is contained in
    a single line. All multi-line responses MUST adhere to the following
    format:
     
    The response consists of a sequence of one or more "lines", each being
    a stream of octets ending with 0x0D 0x0A (US-ASCII CRLF).  Apart from
    those line endings, the stream MUST NOT include the octets 0x00, 0x0A,
    or 0x0D (US-ASCII NUL, LF, and CR).
              
    The first such line contains the response code as with a single line
    response.

    If any subsequent line begins with the "termination octet" (0x2E or
    US_ASCII "."), that line MUST be "byte-stuffed" by pre-pending an
    additional termination octet (0x2E) to that line of the response.

    The lines of the response MUST be followed by a terminating line
    consisting of a single termination octet (0x2E or US_ASCII
    ".")followed by CRLF in the normal way. Thus a multi-line response is
    always terminated with the five octets "CRLF.CRLF" (in US-ASCII).

    There is NO limit on the length of a line.

The term "textual" appears only once in the current NNTP draft, in the
description of the response to the HELP command.

A copy of that draft is available from:

    <ftp://ftp.academ.com/pub/nntp/ietf/nntpext.txt>

>> 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.

Not only do I not agree, I also don't consider that sufficient
justification to change anything if the specification you're referring to
is RFC 977.

> 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.

There are operating systems that are incapable of handling 8-bit
characters.  I'm not going to reject all articles containing 8-bit
characters because of them.

I'm sorry that you don't find this particularly helpful, but the short
summary of my position is that you should fix, replace, or work around
your broken operating system rather than making the rest of the world
cater to its bugs.

-- 
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.
Re: NNTP and YENC
#62821
Author: Claus Färber
Date: Sun, 05 Jan 2003 20:35
18 lines
1780 bytes
greg andruk <gja@meowing.net> schrieb/wrote:
> Windows _is_ a POSIX system, among other things.

Windows NT has a POSIX subsystem, which allows to run POSIX programmes  
on POSIX text files.
But most of the text files on a Windows system don't follow the POSIX
standard wrt line endings and ports of grep and sed tools to work with
these files do not use the POSIX subsystem.

Further, the POSIX.2 standard that specifies "grep" and "sed" is not  
implemented in the POSIX subsystem of Windows NT, which is implements  
only ISO/IEC IS 9945-1:1990 (also called POSIX.1).

Claus
-- 
------------------------ http://www.faerber.muc.de/ ------------------------
OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
#62822
Author: Curt Welch
Date: Sun, 05 Jan 2003 20:35
350 lines
17695 bytes
"Bart Crane" <svcrane@attbi.com> wrote:
> "Curt Welch" <curt@kcwc.com> wrote in message
> news:20030104215829.905$Rh@newsreader.com...
> > "Bart Crane" <svcrane@attbi.com> wrote:
> > > It was also
> > > suggested that I email yenc.org, but I had already done so and
> > > received no response.  It is a ridiculously small thing, a 1-byte
> > > change to the encoder-spec, and no change on the decoder.
> >
> > Hey, I talk with Juergen all the time.  And I asked him to fix the link
> > to my newsreader.com service on the yenc.org site which has been broken
> > since it was added and he's not gotten that done either.  We are all
> > busy, some things are more important than others.
>
> There is nothing more important than the uninterrupted processing of
> my NNTP-data!!!

I've been writting Usenet software for a long time and the one thing I know
about Usenet is that nothing you write will keep working.  Common practice
on Usenet is constantly evolving and you have to keep updating your
software or else it will stop working and become worthless.

If you lost your source code years ago, that's your problem isn't it?

If you are not a programmer and are forced to hire one to fix your
problems, that's your problem isn't it?

Why do you think it's resonable for 100,000 usenet server admins to change
their servers to help you deal with the fact that you can't fix your
software?

> There were five Critical Characters defined in YENC at one point,
> and then there were four.  This indicates to me that there is some
> question about what exactly should constitute a "Critical Character".

And it shows that reducing the number of characters is important because it
reduces the overhead which is the one thing yEnc has done.  I don't mind
cchanging my encoders to escape ^Z beause it's a minor change.  But
changing the yEnc spec to tell everyone they should do it is something you
need to look a little more at.

If 1 out of 256 characters in yEnc files turn out to be ^Z, then adding
that to the escaped character list will expand the size of most yEnc
articles by 1/256 of their current size.  Useent volume is about 600 GB/day
now.  If 30% of that is yEnc, then you are asking for a change which will
cause an increase in volume of 700 MB per day.

If there are 100 full-feed servers in the world, then that change will
cause an extra 70GB of data to be transfered every day because of that
change.  If the number of people downloading from usenet servers is 5 times
the feed volume, then you are adding an additional 350GB per day the users
have to download because of this change.

Are you the only person in the world running into this problem?  Should the
rest of the world pay for the transfer of an extra 420 GB of data, every
day, just because you can't fix your software?

> If there had been a Request For Comments, all this could have
> been pointed out before it broke my system.

There was plenty of requests for comments in this group long before yEnc
ever went anywhere.  If you weren't here helping to shape the future of
Usenet, it's a bit late to fix now.  But if you were here, you would have
understood that for the past 10 years we have been talking about the issues
of moving binary data on Usenet instead of just text, and we have been
modifing servers to make them as 8-bit clean as possible.  Servers have
been moving files with ^Z in them for years.  Long before yEnc was talked
about.  It just wasn't common.

> At the least, I would have been able to take action to prevent my
> system from breaking, instead of the frustrating hours spent trying
> to figure out what could possible be going wrong...

So you had to spend a few hours hunting down your problem.  I've spent days
of my life depating these issues not to meantion years writing software and
tracking down untold "problems" caused by how Usenet has changed and broke
my software.  That's life.

> Thus, there
> was
> no choice but to include all non-textual characters.

Text is not just US english.  There are a lot of character sets in use
around the world to represent "text" in various languages and most require
more than US-ASCII 7 bit characters.  This, and the need to transport
binary more effecently is what has caused this conversion of Usenet from
simple ASCII text to binary.  It's been a long hard road to make this
happen.  People have spent years working to make this happen.  Now, you,
finally wake up and realize the boat left you behind think it's resonable
to un-do all those years of progress and go back to the way it was 10 years
ago?

I don't think so.

> This is not a "7- to 8-bit" issue.  This is a text- vs. binary-stream
> issue.

Exactly.  Usnet is not text anymore, its a pure binary stream.  Most Usenet
servers today transport pure 8 bit binary with no line length limitations.
The only issue left is the fact that some servers see LF as well as CR LF
as an end of line marker when looking for CR LF DOT CR LF so this means CRs
and LFs will be a problem maybe forever.  But other than not knowing for
sure what happens with CRs and LFs, all other characters, and all line
lengths, are now "expexted" on Usenet.  Any client software that deals with
NNTP servers must be able to deal with binary stream data in articles.
Sorry, but this is a decision that was made years ago and you weren't
around to debate it so it's too late now.

> The NNTP authors specifically state that the Response Data is "textual".

We changed that.  No one has written a new RFC yet.  Sorry.  Not my
problem.

The RFCs do not define Usenet.  Usenet is a system defined by common
practice.  The RFCs just attempt after the fact to define whats being done.

> The NNTP authors did not define what "textual" meant, because it would
> link implementation with specification.  The implementation is operating-
> system specific, and is manifested in whatever differences exist between
> opening a file in "r" and "rb".

Only in CP/M.  "text" in other systems in other languages means pure 8 bit
data.

> Could you tell me what you define the difference between
> textual and non-textual data to be?
>
> What data would an NNTP server normally reject as not being
> valid?  One answer I got was "00h".  That does not seem to
> be a very useful definition.

Most servers do not in fact reject NUL.  My server works fine with it.  My
server currently has over 48,000 articles in the spool with nulls in them.

Here one if you want to look at it:

  <9L%R9.18341$GF.8985164@twister.columbus.rr.com>

> Why not include 1Ah, since it has special meaning to text-streams,
> and has for over 20 years?

Because my server allows pure 8-bit binary.  The only thing it rejects are
articles containg the sequences: LF DOT CR LF, CR LF DOT LF, and LF DOT LF.
All other combinations of pure 8 bit binary data works fine.  I wrote it
that way on purpose and I'm not going back to the bad old days of "text"
NNTP becuse you can't fix your code.  No one else is going to either.

> Application code is not aware of the underlying translation performed
> on the data processed by fread() and fwrite().
>
> This raw- vs. cooked-mode stuff, binary- vs. text-stream stuff is all
> very old... I can see that the fact that CTRL-Z == EOF is not common
> knowledge for the people in these groups.

I used to program CP/M systems and old DEC systems where the convention
started so it's common knowledge to me.  I wrote Unix to CP/M conversion
sofware.  I wrote Medical billing systems that ran on both Unix and CP/M
systems that had to deal with cross-platform data issues.

Boy was I happy when Bill and the other kids came out with the new MS-DOS
and we were able to drop ^Z support and use "COPY" instead "PIP" move files
and the filesystem even supported directories instead of user spaces.  That
need to support ^Z vanished with that conversion and that was what 1980?  I
for sure am NOT going to support somthing now that I got rid of in 1980.

> Writing text-processing utilities is fun, and portable!

Sure, that's fine.  But there comes a time why you have to grow up and face
the fact that you have to write ugly code at times to get the job done.

> That is because there is a spec regarding what constitutes a text-
> stream, defined by the operating system, and the implementers of the
> C runtime library for that operating system provide the translation
> between '\n' and whatever the operating system uses as the end-of-line
> delimiter.

Do you have a clue that the world is a bit bigger now and the concept of a
"text" stream just isn't very useful anymore when it comes to trying to
help people communicate?

> It also does whatever is necessary to present the End Of File condition.
> Some operating systems use a special character, like CTRL-Z,

Nothing in common use for the past 20 years uses a "special character" to
mark end-of-file in-band.  That was a very very bad way to do thing and it
was fixed long ago.

> and others use a size-value in the directory entry, and others use a
> resource-fork -- just guessing here!!! -- you get the picture.

Yeah, I understand that you have no clue how all this really works.

> The end-result is that you can write filter programs that compile on
> any platform with stdio.h.

Guess what.  You can't.  You have now learned what the rest of us have know
for 20 years.

Only simple problem have simple answers.  Dealing with Usenet and a the
needs of a few million users is never simple.

> Text-mode in Unix and Linux is not very different from binary-mode.
> In fact, I can't think of a single difference.

There's not such thing as "text" mode on Unix.  "text" mode was a hack
added to the Unix standard IO packat to make Unix programs a little easier
to port to DOS systems.  Period. It's a hack which was known not to work
for all cases, just some of the simplest ones.  "text" mode is just a DOS
hack filter included in the stdio package to do what most people normally
needed to have done.  But it doens't work for everyone.

On Unix, people write \n terminated strings to binary files and the code
assumes that \n is 1 byte in length.  If you have a 10 character buffer
what needs to be \n terminated you assume it's got 9 chargers left.  But if
you writew your code like that, it breaks when you port it to DOS because
the stdio "text hack" doesn't deal with everything correctly.  So any
program that does anything besides read and write sequential text files
needs more complex code to deal with the difference between operation
systems.  C is not portable.

Your application just crossed over from the "simple" where the stdio "text
hack" was enought to make your code work to the "complex" where you are
going to have to write your own "hacks" to make it work.  Sorry.

> Yet, there is this concept of data being "textual", of files being used
> in "text-mode", of "text-streams", of NNTP Response Data being
> "textual".
>
> You may not be confident of what they meant by "textual", but I
> am: it is whatever difference "r" has from "rb".

I am very confident.  I also know we changed it years ago.

> Text-processing utilities running under DOS/Windows interpret
> CTRL-Z as End Of File.  This is not something I am making up.
> This is not something I can change.
>
> Don't expect the rest of the world to have the same computer
> as you.  The world is not one big unix box.

That's not the issue.  The issue is that USNET is no longer text.  It's
binary.  You will just have to stop using your text tools on Usenet article
data.  Sorry.

> If you are someone who operates an NNTP server, then I am asking you,
> "why are you including CTRL-Z in the data?  Don't you know that that
> means End Of File in DOS/Windows?"  I think the answer to that is
> obviously "no", maybe "now I do.".

I not only operate an NNTP server, I run an NNTP bussiness, and I wrote the
NNTP server I operate.  I've been writing software for 30 years.  I wrote
CP/M to Unix coversion utilites back in the 80's before you could even buy
a C complier for a CP/M box.  I wrote Unix utilites to read CP/M format
floppy disks on Unix machines.  I developed and sold CP/M to Unix
comunication software and CP/M emulators for Unix (MIMIX).  I wrote PC to
Unix communication tools (PCWorks/UniHost/Macline) to allow Unix and PCs to
share data.  I created a portable interpreted programming langauge to allow
cross-platform application development on Unix and CP/M boxes and had to
deal with all the issues of porting data between the two worlds.

I wrote a shit load of C code on Version 6 Unix before the stdio package
was even created, and many many years before the "DOS text hack" was
creates when C and the stdio package migrated to the DOS world.

> Here is a shortened version of the pipeline:
>
> echo 10984 | newsget netnews.attbi.com alt.test some | sed -f fixnews |
> decode
>
> So, you can see that the data is not stored, except as it exists in the
> pipeline.
>
> The problem is that embedded CTRL-Z's cause sed to terminate as
> though it reached the End Of File.

Data comming out of a NNTP stream is now binary.  Fix your "newsget"
applcation so it either deals with ^Z somehow, or get a version of sed
which doesn't stop on ^Z.

> > NNTP data is 8 bit binary data now.  Get used to that.  It's only going
> > to get worse.
>
> This is not an 8-bit problem.  This is a text- vs. binary-mode problem.

Yeah, and you are using text tools on a binary stream.  Use the right tool
for the job.  I'm sorry that this may have worked for the past 20 years,
but it doesn't any more and the rest of Usenet isn't going to change to fix
this for you.

> It does seem as though you and others are trying to say that NNTP servers
> are not bound by the NNTP spec anymore, but without actually saying that.

They never were bound by it.  Usenet never has worked that way.  Usenet is
mostly created by people doing whatever they want to.  Anything they can
"get away with" is OK.  Whatever works best is what gets used.

All the RFCs and "specs" were writtin after the fact in an attempt to
document how Usenet worked, and sometimes in an attempt to "clean things
up".  But mostly, Usenet seems to have it's own mind in terms of what will
happen next.  It's very much a mob-rules systems.

> > > I would very much like to return to treating the output from NNTP
> > > servers as "textual".
> >
> > Sorry.  Those days are gone.  Fix your code to deal with Usenet how it
> > is or don't call your code "usenset software".
>
> Interesting... was there a Request For Comments regarding dropping
> the "textual" aspect of NNTP data?

Yes.  It's been talked about over and over and over for years in places
like this group.

> Gee, I was angry at how YENC was introduced without "going through
> channels", but it seems par for the course!!

Exactly.  That's how Usenet works.  There are no "channels".  No one is in
charge of Usenet.  It lives it's own life.  Everybody throws in their
ideas, and some chatch on and some don't.

> It would be much harder than including CTRL-Z as a Critical Character
> in the YENC spec.

The issue of including CTRL-Z in the yEnc spec is the only one you have a
chance of making happen.  But there is no committe in charge of that.  It's
just something Juergen did.  And he's the only one you have to convience to
make it happen.  Don't waste your time asking us, talk to him.  If he
doesn't want to respond to you, well, that's life.

> > BTW, the last time you suggested this I changed my yEnc encoders so
> > they escape ^Z for you.  But don't ask me to go any further.
>
> Hey, thanks!!  That'll fix it for me!!!

> > The odds of you getting yEnc changed, and getting everyone out there to
> > upgrade to a recent version of yEnc which escapes ^Z is about zero.
>
> Naturally.  That is why I am asking the NNTP server guys to help.
>
> If all YENC-data containing CTRL-Z were rejected, because it
> breaks compatibility with existing systems, I bet the spec would be
> updated and encoders updated pretty quick!!

And I'd loose most my customers in under a week when all the yEnc posts
vanished from my servers.  Good try, but it just can't happen.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: NNTP and YENC
#62826
Author: Dr.Ruud
Date: Sun, 05 Jan 2003 22:28
12 lines
1369 bytes
Curt Welch skribis:

> Only in CP/M.  "text" in other systems in other languages means pure 8 bit
> data.

Or 16-bit, or 32-bit, etc.

-- 
Affijn, Ruud


Re: NNTP and YENC
#62842
Author: Frank Slootweg
Date: Mon, 06 Jan 2003 13:54
39 lines
2540 bytes
Bart Crane <svcrane@attbi.com> wrote:
[much deleted]
> In DOS/Windows, CR LF is mapped to LF, and SUB is interpreted
> as End Of File.  To maintain compatibility with DOS/Windows, only
> SUB need be escaped.

  Well, I hate to break it to you but in "DOS/Windows", SUB (Ctrl-Z) is
*NOT* interpreted as End Of File. Perhaps in *your* "DOS" or *your*
"Windows" or *your* broken sed/grep, but not in "DOS/Windows" *in
general*!

  As others have posted, this (Ctrl-Z) 'problem' was just caused by a
bad design choice in early DOS, but since that time, people have solved
those problem, also *on* (not neccessarily *in*) DOS.

  Case in point: I just copied a file with a Ctrl-Z 'in the middle' from
UNIX to Windows (2000). I used stock Windows 'rcp' (both with "-a" and
"-b", made no difference), and stock Windows 'more' displayed the file
just fine, and stock 'find' (the *'DOS'* command, not the UNIX one)
could search past the Ctrl-Z just fine.

  So what we have here is a set of *Microsoft* (for crying out loud)
*'DOS'/Windows* programs which (*rightfully*) ignore/accept Ctrl-Z in
*text* files.

  And please no remarks about sed/grep on *DOS/Windows* 'having' to
terminate on Ctrl-Z. sed/grep are *UNIX*, or POSIX if you prefer,
standard utilities. They have to handle UNIX/POSIX text files. In UNIX
/POSIX text files, Ctrl-Z has no special meaning. Period.

  For example Cygwin (set of UNIX utilities for Windows) grep also could
search past the Ctrl-Z just fine.

  So if *your* DOS/Windows sed/grep can not handle Ctrl-Z in text files,
then, as the others have said many times, they are *broken* and *they*
should be fixed, not something else.

[much deleted]
Re: NNTP and YENC
#62843
Author: Frank Slootweg
Date: Mon, 06 Jan 2003 13:59
11 lines
1464 bytes
Claus F�rber <claus-usenet-20030105@faerber.muc.de> wrote:
> greg andruk <gja@meowing.net> schrieb/wrote:
>> In the case of grep and sed, the relevant standard is POSIX,...
> 
> Only for grep and sed on POSIX systems. For ports to other, non-POSIX   
> systems, the relevant standard is not POSIX.

  Of course it is. If grep/sed do not conform to POSIX (or SVID or XPG),
then they are *not conformant*, period. See my other response for
details.
Re: NNTP and YENC
#62845
Author: Claus Färber
Date: Mon, 06 Jan 2003 18:12
26 lines
2211 bytes
Frank Slootweg <franks@neth.hp.com> schrieb/wrote:
>   And please no remarks about sed/grep on *DOS/Windows* 'having' to
> terminate on Ctrl-Z. sed/grep are *UNIX*, or POSIX if you prefer,
> standard utilities. They have to handle UNIX/POSIX text files.

If and only if they are tools on a POSIX system, they have to handle
POSIX files. This is what the POSIX standard says.

The POSIX standard does neither say that programmes on other, non-POSIX
systems, must conform to the POSIX standard nor that they must not be
named "sed" or "grep".

Acutally, the whole idea behind a "port" (i.e. adaption) of a POSIX
standard utility to another system is that this other system does not  
conform to POSIX. So you *want* to behave it differently. For example, a  
Windows port certainly should recognize "\r\n" as a line ending or it  
would not be useful at all.

You can argue whether a port to Windows should terminate on Ctrl-Z (IMO
it should not) but it is not a question of POSIX conformance.

Claus
-- 
------------------------ http://www.faerber.muc.de/ ------------------------
OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
#62853
Author: Phil
Date: Mon, 06 Jan 2003 23:03
64 lines
3683 bytes
David Magda <dmagda+usenet@ee.ryerson.ca> wrote in message
news:86n0mflgcc.fsf@number6.magda.ca...
> "Bart Crane" <svcrane@attbi.com> writes:
> [...]
> > 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.
>
> If the problem was "introduced by YENC", why should the solution be
> changing the NNTP server? I do not see the logic in that conclusion.

This change to NNTP servers is merely to enforce compliance with the NNTP
spec, so that the data can be processed using text-processing utilities on
operating systems other than Unix.

That is the point behind the definition of "textual" in the NNTP spec:
fopen() in "r" vs. "rb" mode.

The problem was introduced by YENC because, until that time, NNTP clients
were respecting the NNTP spec (perhaps unwittingly), and ensuring that all
data was textual.  Thus, NNTP servers were observed to conform to the spec,
whereas they actually were not enforcing it.


>
> [...]
> > 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.
> [...]
>
> Isn't this is a design defect in DOS/Windows then? Or perhaps, a bad
> assumption was made in the designing the OS, or in the designing of
> the YENC spec.? (Most probably YENC.)

Text-streams are well-defined, and implemented in every C compiler/library
that I have ever encountered (not that many, but 100% of them).

Unix programmers tend to be unaware of the difference between text- and
binary-mode, because there is no difference when using fopen() in "r" vs.
"rb" mode.   The man-pages for fopen() even have a note about that.  Other
operating systems can and do treat text-streams different from
binary-streams.  This is nothing new.


>
> --
> David Magda <dmagda at ee.ryerson.ca>
> Because the innovator has for enemies all those who have done well under
> the old conditions, and lukewarm defenders in those who may do well
> under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI


Re: NNTP and YENC
#62852
Author: Russ Allbery
Date: Mon, 06 Jan 2003 23:06
18 lines
1761 bytes
Phil <PeepingUnder@TheCovers.org> writes:

> That is the point behind the definition of "textual" in the NNTP spec:
> fopen() in "r" vs. "rb" mode.

Are you Phil Lapsley?

If you are, I'll take that as canonical.  :)  If you're not, then no
disrespect intended, but I'd prefer to hear from either him or Brian
Kantor rather than take random people's word on what the intention of the
NNTP spec was.

-- 
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.
Re: NNTP and YENC
#62854
Author: Phil
Date: Mon, 06 Jan 2003 23:26
94 lines
4142 bytes
David Magda <dmagda+usenet@ee.ryerson.ca> wrote in message
news:86isx3lflt.fsf@number6.magda.ca...
> "Bart Crane" <svcrane@attbi.com> writes:
> [...]
> > This is not a "7- to 8-bit" issue.  This is a text-
> > vs. binary-stream issue.
> [...]
>
> The terms "text-stream" and "binary-stream" are highly open to debate
> and interpretation. Is a particular shade of colour blue or cyan or
> green?

The difference is documented for fopen(), "r" vs. "rb" mode.


>
> > The NNTP authors specifically state that the Response Data is
> > "textual".
> >
> > The ambiguity regarding the definition of "textual" is confused by
> > the 8-bit issue.  It is not related.
> >
> > The NNTP authors did not define what "textual" meant, because it
> > would link implementation with specification.  The implementation
> > is operating-[...]
> [...]
>
> Then it is up to the implementor of NNTP to determine what it means.

Yes.  It is a question of compatibility.  Being compatible with DOS/Windows
means not allowing CTRL-Z into the text-stream.

The NNTP authors defined the output stream to be "textual" so that the data
could be processed on other operating systems with the same,
source-compatible, text-processing utilities.


>
> [...]
> > That is because there is a spec regarding what constitutes a text-
> > stream, defined by the operating system, and the implementers of the
> [...]
>
> Can you please post a reference/URL to this spec?

Here's an interesting doc:
http://www.cs.vsu.ru/~koval/DOCs/glibc/library_157.html

Here is another one:
http://www.sas.com/service/library/onlinedoc/sasc/doc/lr1/lrv1ch3.htm


>
> [...]
> > Don't expect the rest of the world to have the same computer
> > as you.  The world is not one big unix box.
> [...]
>
> We don't. But why should I worry about Windows boxes when I'm running
> a Unix box? Microsoft is not making things easier for the rest of the
> world. In many instances it works quite hard in making things more
> difficult (e.g., "embracing-and-extending" standards like
> Kerberos 5 to break inter-operability).

This text- vs. binary-mode thing is very old, fully documented, etc... it is
really a no-brainer, I am very surprised that there is so little
understanding of the differences between the two modes.


>
> [...]
> > It would be much harder than including CTRL-Z as a Critical Character
> > in the YENC spec.
> [...]
>
> And it's easier to fix *every* *single* operating NNTP server?

If NNTP servers were written to accept any value as "textual", then they
would need to be fixed.

If they were written to be configured as to what values are rejected, then
including 1Ah will restore compatibility with DOS/Windows.


>
> --
> David Magda <dmagda at ee.ryerson.ca>
> Because the innovator has for enemies all those who have done well under
> the old conditions, and lukewarm defenders in those who may do well
> under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI


Re: NNTP and YENC
#62855
Author: Phil
Date: Mon, 06 Jan 2003 23:56
133 lines
5819 bytes
Jeffrey M. Vinocur <jeff@litech.org> wrote in message
news:av9o02$1i9$1@puck.litech.org...
> In article <j8TR9.568229$WL3.160487@rwcrnsc54>,
> Bart Crane <svcrane@attbi.com> wrote:
> >
> >There is nothing more important than the uninterrupted processing of
> >my NNTP-data!!!
>
> Well, to you, perhaps.  In which case some of the burden will
> need to fall to you...

Indeed it has, and before complaining about this, I did research to verify
that my expectations that NNTP data be in text-stream format were not the
result of a a happy coincidence all these years), and discovered that the
NNTP spec does indeed define that.

Before that, I did quite a bit of analysis in order to determine the
problem.  Remember, the failure mode is not a crash, not an exception, just
early termination... as though it ran out of data... like out of
disk-space... stable, perfect problems failing quietly... gad, a
programmer's nightmare!!  That meant quite a bit of monitoring what is
normally a lengthy background process, to see if some script was in a an
endless loop.

Since then, I have done some workarounds (grep -v yenc), and considered new
architectures, including a back-end to newsget that does yenc-to-uuencode in
binary-mode, or a front-end via a proxy to do the conversion.


>
>
> >In the quest to reduce overhead, he went 1 byte to far.  No big deal.
Fix
> >it.
>
> You can't.  It's too late.  You might be able to reduce the
> number of posts that include ^Z somewhat, but you'll never get
> rid of them.

If NNTP servers were to conform to the NNTP spec, then they would reject
articles that include CTRL-Z, and vendors of NNTP clients would then fix
their implementations to conform to the NNTP spec.


>
> There are a lot of things about yEnc in particular and NNTP in
> general that would be different if you gave us a magic wand to
> change the past.  But we don't have one, and that's just the way
> it is.
>
>
> >What data would an NNTP server normally reject as not being
> >valid?  One answer I got was "00h".  That does not seem to
> >be a very useful definition.
>
> It's up to the implementation, I suppose.  Implementations in C
> tend to have trouble with '\0' in character arrays.

Then include 1Ah in the same way.  There, compatibility, and conformance to
the spec, restored.


>
>
> >It does seem as though you and others are trying to say that NNTP servers
> >are not bound by the NNTP spec anymore, but without actually saying that.
>
> NNTP servers have never been bound by the specifications.  In
> fact, the specifications are generally *based* on existing
> implementations.
>
>
> >Interesting... was there a Request For Comments regarding dropping
> >the "textual" aspect of NNTP data?
>
> NNTP servers were never enforcing any sort of ban on binary data.
> If anybody posted it, it would have mostly worked.  It's just
> that up until yEnc became popular, few people attempt to include
> such things in their posts.
>
> So no, certainly no RFC on that.
>
>
> >> What on earth is so hard about fixing your system so it works?
> >
> >It would be much harder than including CTRL-Z as a Critical Character
> >in the YENC spec.
>
> You know, in the time you spent posting about this, you could
> have fixed your code, installed a proxy server in between and
> configured it to do the changes you require, or implemented a
> variety of other solutions.

Not true.  There is no "fixing" the code.  The code is not broken.  The
source of the data is broken.

I could hack in a "see CTRL-Z, apply YENC-escape", but, from what I am
hearing, there is no plan to prevent any other encoder from also inserting
End Of File into the data stream... applying a YENC-escape could cause worse
problems.

There is not a variety of other solutions.  I have to restore
"text-mode-ness" to the stream, before it enters the pipeline.  This means
adding yenc-knowledge to software that is not aware of encoding formats.
The decoder is the last stage in the pipeline.


>
>
> >> The odds of you getting yEnc changed, and getting everyone out there to
> >> upgrade to a recent version of yEnc which escapes ^Z is about zero.
> >
> >Naturally.  That is why I am asking the NNTP server guys to help.
> >
> >If all YENC-data containing CTRL-Z were rejected, because it
> >breaks compatibility with existing systems, I bet the spec would be
> >updated and encoders updated pretty quick!!
>
> Uh huh.  How exactly do you plan on getting all of the news
> servers to do anything in unison?

By posting here, of course!!


>
>
> --
> Jeffrey M. Vinocur
> jeff@litech.org


Re: NNTP and YENC
#62859
Author: Phil
Date: Tue, 07 Jan 2003 01:47
84 lines
4278 bytes
Jeremy <jeremy@exit109.com> wrote in message
news:1041772747.319829@ok-corral.gunslinger.net...
> Bart Crane <svcrane@attbi.com> wrote:
>
> > The problem is that NNTP servers are forwarding YENC-encoded
> > data, but this data includes control-characters, one of which, 0x1A,
> > is interpreted within text-streams on DOS/Windows to mean "End
> > Of File."
>
> After that long email discussion we had, I didn't budge you at all? :(

Hello, Jeremy.

Not much!!

The ambiguous part was, what does "textual" mean?

I gave up on linking "textual" with "display on the user's terminal", and
decided to illustrate the difference between "textual" and "non-textual"
using fopen() with "r" vs. "rb" example.  I did not want to continue taking
up your time, so I posted it to the group.

The test is taking a piece of C code using stdio.h, compile it on
DOS/Windows or Unix/Linux, and running it on both.  The result should be
identical.  It is not.  On Unix/Linux, the entire data-set comes through.
On On DOS/Windows, every after the 1Ah is not processed.

It does not seem right that this bit of major functionality be tossed out.
Command-line programs get included in scripts.  Change one program, you
probably have to change a bunch of others.

I am not averse to programming a solution to this.  After all, I did write
all the software involved.  The amount of time I have available is not
great, so, so I had to bring it up, just in case someone responded with "we
broke compatibility with DOS/Windows??? Omigosh, we will fix it right
away!!!".  Yeah, right!!!


>
> The bottom line is this: your argument is that we should permanently
> cripple Usenet to accomodate a broken operating system, or badly designed
> software running on a broken operating system.  No.

Nothing presented here indicates that including 1Ah as a Critical Character
in YENC will "cripple Usenet".

Of course I was being facetious about asking everyone to reject every
YENC-encoded article!!!  But, in case someone was looking for a reason to
stop the madness, this is one: it violates the NNTP spec.

Ultimately, as evidenced by the lack of a hard definition of "textual", it
comes down to "how compatible do you want to be?"  It would be pretty
difficult to be compatible with an operating system that uses 0D as the End
Of File indicator.  Any NNTP implementor would have to decide for
themselves.


>
> In addition, it's worth noting that *most* of the people currently using
> yEnc are also using Windows, and somehow their software manages to deal
> with it.

No doubt they are not using command-line tools compiled 10+ years ago!!!
Maybe I have been living on borrowed time...

So, I am bringing this up, not to force anyone to change how news servers
are being run, but in case no one was aware of the fact that it breaks
text-processing on DOS/Windows.

I don't know, it just seems wrong to me.  I received the responses of "buy a
new computer", "get a better operating system", "rewrite all your software
to binary mode", "buy new software".

But thanks for your input, and everyone's.

Bart.

>
> --
> Jeremy  |  jeremy@exit109.com


Re: NNTP and YENC
#62860
Author: Phil
Date: Tue, 07 Jan 2003 01:53
55 lines
3221 bytes
Hello,

I don't know what you mean by "this does not happen"... because it does!!!

Software that does not terminate on CTRL-Z is treating its input as binary,
not text.

Thanks anyway!!

Bart.


Frank Slootweg <franks@neth.hp.com> wrote in message
news:avc1qb$or1$1@support.neth.hp.com...
> Bart Crane <svcrane@attbi.com> wrote:
> [much deleted]
> > In DOS/Windows, CR LF is mapped to LF, and SUB is interpreted
> > as End Of File.  To maintain compatibility with DOS/Windows, only
> > SUB need be escaped.
>
>   Well, I hate to break it to you but in "DOS/Windows", SUB (Ctrl-Z) is
> *NOT* interpreted as End Of File. Perhaps in *your* "DOS" or *your*
> "Windows" or *your* broken sed/grep, but not in "DOS/Windows" *in
> general*!
>
>   As others have posted, this (Ctrl-Z) 'problem' was just caused by a
> bad design choice in early DOS, but since that time, people have solved
> those problem, also *on* (not neccessarily *in*) DOS.
>
>   Case in point: I just copied a file with a Ctrl-Z 'in the middle' from
> UNIX to Windows (2000). I used stock Windows 'rcp' (both with "-a" and
> "-b", made no difference), and stock Windows 'more' displayed the file
> just fine, and stock 'find' (the *'DOS'* command, not the UNIX one)
> could search past the Ctrl-Z just fine.
>
>   So what we have here is a set of *Microsoft* (for crying out loud)
> *'DOS'/Windows* programs which (*rightfully*) ignore/accept Ctrl-Z in
> *text* files.
>
>   And please no remarks about sed/grep on *DOS/Windows* 'having' to
> terminate on Ctrl-Z. sed/grep are *UNIX*, or POSIX if you prefer,
> standard utilities. They have to handle UNIX/POSIX text files. In UNIX
> /POSIX text files, Ctrl-Z has no special meaning. Period.
>
>   For example Cygwin (set of UNIX utilities for Windows) grep also could
> search past the Ctrl-Z just fine.
>
>   So if *your* DOS/Windows sed/grep can not handle Ctrl-Z in text files,
> then, as the others have said many times, they are *broken* and *they*
> should be fixed, not something else.
>
> [much deleted]


Re: NNTP and YENC
#62861
Author: Russ Allbery
Date: Tue, 07 Jan 2003 01:56
21 lines
1973 bytes
Bart Crane <bcrane@iready.com> writes:

> Oh, sorry, this was me, using some weird name!!

Okay.  I was wondering for a moment, since one of the authors of the NNTP
spec is actually named Phil.  :)

Really, though, textual could mean a lot of different things.  I happen to
know that Brian Kantor is an old-time Unix hacker, so I'm somewhat
doubtful that the semantics of text files on DOS systems was at the
forefront of his thoughts, but I really don't know for sure.

I'm getting more and more tempted to just ask him if he remembers what
they meant by textual.  :)

-- 
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.
Re: NNTP and YENC
#62868
Author: Bart Crane
Date: Tue, 07 Jan 2003 01:56
7 lines
1186 bytes
Oh, sorry, this was me, using some weird name!!

Bart.



Re: NNTP and YENC
#62863
Author: Bart Crane
Date: Tue, 07 Jan 2003 02:00
30 lines
2119 bytes
Oh, yes, this is just surmisal on my part.  A useful starting point, as
opposed to "the authors did not define textual, so therefore we don't know
what it means."

Bart.



Russ Allbery <rra@stanford.edu> wrote in message
news:ylsmw5yj2d.fsf@windlord.stanford.edu...
> Phil <PeepingUnder@TheCovers.org> writes:
>
> > That is the point behind the definition of "textual" in the NNTP spec:
> > fopen() in "r" vs. "rb" mode.
>
> Are you Phil Lapsley?
>
> If you are, I'll take that as canonical.  :)  If you're not, then no
> disrespect intended, but I'd prefer to hear from either him or Brian
> Kantor rather than take random people's word on what the intention of the
> NNTP spec was.
>
> --
> 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.


Re: NNTP and YENC
#62864
Author: Bart Crane
Date: Tue, 07 Jan 2003 02:01
98 lines
4620 bytes
This is me, Bart, again... I must have been in some other newsgroup last
week!!!


Phil <PeepingUnder@TheCovers.org> wrote in message
news:BiqS9.160$wz1.152433@news.uswest.net...
>
> Jeremy <jeremy@exit109.com> wrote in message
> news:1041772747.319829@ok-corral.gunslinger.net...
> > Bart Crane <svcrane@attbi.com> wrote:
> >
> > > The problem is that NNTP servers are forwarding YENC-encoded
> > > data, but this data includes control-characters, one of which, 0x1A,
> > > is interpreted within text-streams on DOS/Windows to mean "End
> > > Of File."
> >
> > After that long email discussion we had, I didn't budge you at all? :(
>
> Hello, Jeremy.
>
> Not much!!
>
> The ambiguous part was, what does "textual" mean?
>
> I gave up on linking "textual" with "display on the user's terminal", and
> decided to illustrate the difference between "textual" and "non-textual"
> using fopen() with "r" vs. "rb" example.  I did not want to continue
taking
> up your time, so I posted it to the group.
>
> The test is taking a piece of C code using stdio.h, compile it on
> DOS/Windows or Unix/Linux, and running it on both.  The result should be
> identical.  It is not.  On Unix/Linux, the entire data-set comes through.
> On On DOS/Windows, every after the 1Ah is not processed.
>
> It does not seem right that this bit of major functionality be tossed out.
> Command-line programs get included in scripts.  Change one program, you
> probably have to change a bunch of others.
>
> I am not averse to programming a solution to this.  After all, I did write
> all the software involved.  The amount of time I have available is not
> great, so, so I had to bring it up, just in case someone responded with
"we
> broke compatibility with DOS/Windows??? Omigosh, we will fix it right
> away!!!".  Yeah, right!!!
>
>
> >
> > The bottom line is this: your argument is that we should permanently
> > cripple Usenet to accomodate a broken operating system, or badly
designed
> > software running on a broken operating system.  No.
>
> Nothing presented here indicates that including 1Ah as a Critical
Character
> in YENC will "cripple Usenet".
>
> Of course I was being facetious about asking everyone to reject every
> YENC-encoded article!!!  But, in case someone was looking for a reason to
> stop the madness, this is one: it violates the NNTP spec.
>
> Ultimately, as evidenced by the lack of a hard definition of "textual", it
> comes down to "how compatible do you want to be?"  It would be pretty
> difficult to be compatible with an operating system that uses 0D as the
End
> Of File indicator.  Any NNTP implementor would have to decide for
> themselves.
>
>
> >
> > In addition, it's worth noting that *most* of the people currently using
> > yEnc are also using Windows, and somehow their software manages to deal
> > with it.
>
> No doubt they are not using command-line tools compiled 10+ years ago!!!
> Maybe I have been living on borrowed time...
>
> So, I am bringing this up, not to force anyone to change how news servers
> are being run, but in case no one was aware of the fact that it breaks
> text-processing on DOS/Windows.
>
> I don't know, it just seems wrong to me.  I received the responses of "buy
a
> new computer", "get a better operating system", "rewrite all your software
> to binary mode", "buy new software".
>
> But thanks for your input, and everyone's.
>
> Bart.
>
> >
> > --
> > Jeremy  |  jeremy@exit109.com
>
>


Re: NNTP and YENC
#62865
Author: Bart Crane
Date: Tue, 07 Jan 2003 02:19
43 lines
2551 bytes
Russ Allbery <rra@stanford.edu> wrote in message
news:ylof6tvi2s.fsf@windlord.stanford.edu...
> Bart Crane <bcrane@iready.com> writes:
>
> > Oh, sorry, this was me, using some weird name!!
>
> Okay.  I was wondering for a moment, since one of the authors of the NNTP
> spec is actually named Phil.  :)
>
> Really, though, textual could mean a lot of different things.  I happen to
> know that Brian Kantor is an old-time Unix hacker, so I'm somewhat
> doubtful that the semantics of text files on DOS systems was at the
> forefront of his thoughts, but I really don't know for sure.

Not necessarily DOS, because there are other operating systems that have
different text-stream semantics.

It just sounds like a giant step backwards that the latest-and-greatest
breaks something as simple as this:

    telnet news.server.com 119 < commands > data
    more < data

You can still do this on Unix and Linux, but not on my machine anymore.

>
> I'm getting more and more tempted to just ask him if he remembers what
> they meant by textual.  :)

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.


Re: NNTP and YENC
#62866
Author: Russ Allbery
Date: Tue, 07 Jan 2003 02:49
20 lines
2000 bytes
Bart Crane <bcrane@iready.com> writes:

> It just sounds like a giant step backwards that the latest-and-greatest
> breaks something as simple as this:

>     telnet news.server.com 119 < commands > data
>     more < data

> You can still do this on Unix and Linux, but not on my machine anymore.

Other people have posted that this works fine under Windows as well on
their systems.  (Well, the telnet part of that may not work quite the way
that you want, but that's not because of text-mode stuff.)

-- 
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.
Re: NNTP and YENC
#62867
Author: Bart Crane
Date: Tue, 07 Jan 2003 03:42
47 lines
2958 bytes
Russ Allbery <rra@stanford.edu> wrote in message
news:ylisx3xsbd.fsf@windlord.stanford.edu...
> Bart Crane <svcrane@attbi.com> writes:
> > "Russ Allbery" <rra@stanford.edu> wrote:
>
> The current NNTP draft, which will become the next RFC replacing 977, is
> somewhat better, although not complete.  On this topic, it says:
>
>     Each response MUST start with a three-digit response code that is
>     sufficient to distinguish all responses. Certain valid responses are
>     defined to be multi-line; for all others, the response is contained in
>     a single line. All multi-line responses MUST adhere to the following
>     format:
>
>     The response consists of a sequence of one or more "lines", each being
>     a stream of octets ending with 0x0D 0x0A (US-ASCII CRLF).  Apart from
>     those line endings, the stream MUST NOT include the octets 0x00, 0x0A,
>     or 0x0D (US-ASCII NUL, LF, and CR).

Please include 0x1A in this list!!!!


> I'm sorry that you don't find this particularly helpful, but the short
> summary of my position is that you should fix, replace, or work around
> your broken operating system rather than making the rest of the world
> cater to its bugs.

I don't know why you call it a bug, or the operating system as "broken".
This situation is fully documented, and the software involved has been
working perfectly for years.

I think you mean "broken" as in "it does not work like it does on my Unix
machine".  That is the situation: the exact same source code, run against
the exact same data, on your machine it works, but not on mine.

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.


Re: NNTP and YENC
#62871
Author: Klaas
Date: Tue, 07 Jan 2003 05:00
12 lines
1476 bytes
After careful consideration, Phil muttered:


> Of course I was being facetious about asking everyone to reject every
> YENC-encoded article!!!  But, in case someone was looking for a reason
> to stop the madness, this is one: it violates the NNTP spec.

I hope you're being facetious there, too.  Where have you /been/ for the 
last decade?

-Mike
Re: NNTP and YENC
#62872
Author: Russ Allbery
Date: Tue, 07 Jan 2003 05:04
21 lines
2046 bytes
Bart Crane <bcrane@iready.com> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>>     The response consists of a sequence of one or more "lines", each
>>     being a stream of octets ending with 0x0D 0x0A (US-ASCII CRLF).
>>     Apart from those line endings, the stream MUST NOT include the
>>     octets 0x00, 0x0A, or 0x0D (US-ASCII NUL, LF, and CR).

> Please include 0x1A in this list!!!!

I don't agree with your rationale to do so, so I'm unwilling to advocate
this position.  You're of course free to subscribe to the NNTP working
group mailing list and advocate it yourself, although I expect that you'll
encounter a similar reaction to that you encountered here.

-- 
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.
Re: NNTP and YENC
#62874
Author: Zem
Date: Tue, 07 Jan 2003 05:26
32 lines
2204 bytes
"Bart Crane" <bcrane@iready.com> wrote in
news:QZrS9.133$ds6.237079@news.uswest.net: 

> Russ Allbery <rra@stanford.edu> wrote in message
> news:ylisx3xsbd.fsf@windlord.stanford.edu...
>>
>> I'm sorry that you don't find this particularly helpful, but the
>> short summary of my position is that you should fix, replace, or work
>> around your broken operating system rather than making the rest of
>> the world cater to its bugs.
> 
> I don't know why you call it a bug, or the operating system as
> "broken". This situation is fully documented, and the software
> involved has been working perfectly for years.
> 
> I think you mean "broken" as in "it does not work like it does on my
> Unix machine".  That is the situation: the exact same source code, run
> against the exact same data, on your machine it works, but not on
> mine. 

The NNTP protocol defines the platform independent interaction between NNTP 
hosts. Implementations deal with any platform specific issues.

0x1A interpreted as an EOF is a well known and documented platform specific 
issue. It is the responsibility of the implementations for the affected 
platforms to handle.

Your implementation is broken, not because it treats 0x1A as an EOF, but 
because it does not handle its platform specific issues.
-- 
zem.
Re: NNTP and YENC
#62876
Author: Bart Crane
Date: Tue, 07 Jan 2003 06:00
108 lines
4140 bytes
"Dr.Ruud" <'t.leven.is.fijn@life.i$.great> wrote in message
news:av9peu.1eo.1@news.isolution.nl...
> Bart Crane skribis:
>
> > 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.
>
> Idea: find or create a dos2unix-filter and pipe through it.

Hello,

Another filter seems like the ideal solution, one that converts
the binary stream to a text-stream... but, how do you know
what to do with the ctrl-z?

If the filter knew that the data it was processing at that
moment was in yenc-format, it could do the right thing by
escaping it according to the yenc-spec.

But, new, competing protocols can be introduced at any
time, and escaping ctrl-z via the yenc-spec could easily
be inappropriate.

The nntp-client itself is not aware of any encoding formats
for the data it carries.  It implements nntp as though it
is just a transport protocol.  It is not appropriate for it
to examine and modify the data it is transporting.  It can
only send properly formatted requests, detect transport-
level errors, and produce the data from the nntp-server
on stdout.

The data from the nntp-server is piped to a stream
editor which manipulates the data before decoding:
filenames can be re-written, multi-part fixups are
made.

This is where the failure occurs, because the stream
editor (similar in functionality as the Unix "sed", but
nowhere near as functional) receives End Of File,
and so only part of the data to the decoder.

Only the decoder knows the format of the encoded
data, so only the decoder could convert the ctrl-z,
but by then it is too late.

I could modify the decoder to have special command-
line options to set stdin to binary and do only the
ctrl-z escaping... it could run between the nntp-client
and before the stream editor.

But, then I am would have to implement each and
every new protocol, or the ctrl-z could slip in and
terminate the rest of the processing.

This is a viable workaround.  Using a yenc-to-
uuencode proxy/filter would also be a quick fix,
but it also has the same "must implement each new
protocol" problem.

Thanks!!!

Bart.


>
>
> See also:
>
> CygWin
>
>
http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mer
cury-developers.9909/0119.html
>
> google: setmode fileno O_BINARY (1200 hits)
>
>
>
> >    while (EOF != (c= getchar()))
> >        putchar(c);
>
> First do something like this:
>
> #ifdef WIN32
>   if( setmode( fileno ( stdin ), O_BINARY ) == -1 ) {
>     perror ( "Cannot set stdin to binary mode" );
>     exit(-1);
>   }
>
>   if( setmode( fileno ( stdout ), O_BINARY ) == -1 ) {
>     perror ( "Cannot set stdout to binary mode" );
>
>     exit(-1);
>   }
> #endif
>
>
> --
> Affijn, Ruud
>
>


Re: NNTP and YENC
#62877
Author: Bart Crane
Date: Tue, 07 Jan 2003 06:11
25 lines
2090 bytes
"Frank Slootweg" <franks@neth.hp.com> wrote in message
news:avc235$or1$2@support.neth.hp.com...
> Claus F�rber <claus-usenet-20030105@faerber.muc.de> wrote:
> > greg andruk <gja@meowing.net> schrieb/wrote:
> >> In the case of grep and sed, the relevant standard is POSIX,...
> >
> > Only for grep and sed on POSIX systems. For ports to other, non-POSIX
> > systems, the relevant standard is not POSIX.
>
>   Of course it is. If grep/sed do not conform to POSIX (or SVID or XPG),
> then they are *not conformant*, period. See my other response for
> details.

I did not mean to imply that the grep and sed being used were purchased as
some sort of POSIX-compliant system add-on, they are my versions of the
popular Unix utilities

Or, are you saying that there is some sort of Windows Update to make my
system posix-compliant, which fixes the situation?




Re: NNTP and YENC
#62886
Author: Curt Welch
Date: Tue, 07 Jan 2003 06:17
13 lines
1693 bytes
"Phil" <PeepingUnder@TheCovers.org> wrote:
> There is not a variety of other solutions.  I have to restore
> "text-mode-ness" to the stream, before it enters the pipeline.  This
> means adding yenc-knowledge to software that is not aware of encoding
> formats. The decoder is the last stage in the pipeline.

Could you give us more details about what the ultimate goal of all these
pipelines are?

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: NNTP and YENC
#62885
Author: Bart Crane
Date: Tue, 07 Jan 2003 06:35
62 lines
3236 bytes
"Zem" <invalid@invalid.invalid> wrote in message
news:Xns92FBF0F662B2CZemZemZem@66.150.105.46...
> "Bart Crane" <bcrane@iready.com> wrote in
> news:QZrS9.133$ds6.237079@news.uswest.net:
>
> > Russ Allbery <rra@stanford.edu> wrote in message
> > news:ylisx3xsbd.fsf@windlord.stanford.edu...
> >>
> >> I'm sorry that you don't find this particularly helpful, but the
> >> short summary of my position is that you should fix, replace, or work
> >> around your broken operating system rather than making the rest of
> >> the world cater to its bugs.
> >
> > I don't know why you call it a bug, or the operating system as
> > "broken". This situation is fully documented, and the software
> > involved has been working perfectly for years.
> >
> > I think you mean "broken" as in "it does not work like it does on my
> > Unix machine".  That is the situation: the exact same source code, run
> > against the exact same data, on your machine it works, but not on
> > mine.
>
> The NNTP protocol defines the platform independent interaction between
NNTP
> hosts. Implementations deal with any platform specific issues.
>
> 0x1A interpreted as an EOF is a well known and documented platform
specific
> issue. It is the responsibility of the implementations for the affected
> platforms to handle.
>
> Your implementation is broken, not because it treats 0x1A as an EOF, but
> because it does not handle its platform specific issues.

Hello,

There are no platform-specific issues in this program, yet if you
compile and pipe the output from an nntp-server to it, you may
get different results on different operating systems, depending
on the data being transported.

#include <stdio.h>
int    main(int argc, char** argv)
{
    int    c;
    while (EOF != (c= getchar()))
        putchar(c);
    return 0;
}

If your response is "use binary mode", then my response is "the
spec says text-mode", and your response will be "we don't
follow the spec"... and I don't have a good comeback to that!!!

Bart.

> --
> zem.


Re: NNTP and YENC
#62878
Author: greg andruk
Date: Tue, 07 Jan 2003 06:37
16 lines
2191 bytes
Russ Allbery wrote:

> If you are, I'll take that as canonical.  :)  If you're not, then no
> disrespect intended, but I'd prefer to hear from either him or Brian
> Kantor rather than take random people's word on what the intention of the
> NNTP spec was.

We have that.
<http://www.academ.com/pipermail/ietf-nntp/1998-January/000904.html>

Summary: NNTP isn't really suitable for binary transfers as is; it's for 
text as defined in SMTP, which allows the entire ASCII set in message 
bodies.  That makes ^Z perfectly legal, but the high bit stripping business 
in both 821 and 977 would be bad news for yenc if there was such a thing as 
a strictly conforming NNTP server =)
Re: NNTP and YENC
#62879
Author: Bart Crane
Date: Tue, 07 Jan 2003 07:08
55 lines
3187 bytes
"greg andruk" <gja@meowing.net> wrote in message
news:1whhai4ut01zx.dlg@meowing.net...
> Russ Allbery wrote:
>
> > If you are, I'll take that as canonical.  :)  If you're not, then no
> > disrespect intended, but I'd prefer to hear from either him or Brian
> > Kantor rather than take random people's word on what the intention of
the
> > NNTP spec was.
>
> We have that.
> <http://www.academ.com/pipermail/ietf-nntp/1998-January/000904.html>
>
> Summary: NNTP isn't really suitable for binary transfers as is; it's for
> text as defined in SMTP, which allows the entire ASCII set in message
> bodies.  That makes ^Z perfectly legal, but the high bit stripping
business
> in both 821 and 977 would be bad news for yenc if there was such a thing
as
> a strictly conforming NNTP server =)

Thus it again comes down to the meaning of the quoted-phrase in 2.4.1,
"textual matter".

I vote for the common definition found on all machines with a C compiler:
fopen() "r" vs. "rb".

Of course, I may be granting the NNTP authors wisdom that is not their
due.  It could be pure coincidence that my system has worked perfectly
for years.

But, I believe that they wanted news to be available on as many machines
as possible, and so purposely chose the term "textual" to indicate that
data exists that is non-textual, quoted it to imply that the definition of
the
terms is made by the operating system, and purposely separated the
concept of "textual matter" with meaning "7-bit".

It is easy for me to grant them all that foresight, because I have been
using it for years!!

I believe that the confusion arises mostly because they refrained from
casting the concept of "textual" in terms linking it with any particular
operating system and programming language.

Or, I could be wrong.  Maybe in their minds "textual" meant
"every value except 0".

Bart.




Re: NNTP and YENC
#62881
Author: greg andruk
Date: Tue, 07 Jan 2003 07:32
35 lines
2775 bytes
Bart Crane wrote:


> Thus it again comes down to the meaning of the quoted-phrase in 2.4.1,
> "textual matter".

> I vote for the common definition found on all machines with a C compiler:
> fopen() "r" vs. "rb".

I vote for what the relevant RFCs acrtually stated.  As noted in the 
messaged linked before, the intention is that "text" is as defined in the 
mail standards.  SMTP does not really define what characters are allowed in 
a message body, but 822 does do that.

822, 3.1.3:

  For some fields, such as "Subject" and "Comments",  no
  structuring  is assumed, and they are treated simply as
  <text>s, as in the message body.

So, how is that <text> defined?

     text        =  <any CHAR, including bare    ; => atoms, specials,
                     CR & bare LF, but NOT       ;  comments and
                     including CRLF>             ;  quoted-strings are
                                                 ;  NOT recognized.

And what is a CHAR?

     CHAR        =  <any ASCII character>        ; (  0-177,  0.-127.)


"any ASCII character" means any ASCII character.  ^Z is an ASCII characer.  
It's a part of the text stream in Internet messages, not an EOF marker.
Re: NNTP and YENC
#62882
Author: George Ruof
Date: Tue, 07 Jan 2003 07:35
20 lines
1637 bytes
Frank Slootweg <franks@neth.hp.com> wrote:

>  So what we have here is a set of *Microsoft* (for crying out loud)
>*'DOS'/Windows* programs which (*rightfully*) ignore/accept Ctrl-Z in
>*text* files.

I'm using Windows XP Pro and a standard CMD prompt.

MORE and FIND read past the ctrl-z.  TYPE and SORT don't.

What does that prove?  Pretty much nothing. :)

If I was Bart I'd just fix my version of SED to do what I needed and
quit trying to change everyone else.


-- 
George Ruof
gruof@pacificnet.net
Re: NNTP and YENC
#62883
Author: Bart Crane
Date: Tue, 07 Jan 2003 08:22
65 lines
3605 bytes
"greg andruk" <gja@meowing.net> wrote in message
news:6vch63wrrekk$.dlg@meowing.net...
> Bart Crane wrote:
>
>
> > Thus it again comes down to the meaning of the quoted-phrase in 2.4.1,
> > "textual matter".
>
> > I vote for the common definition found on all machines with a C
compiler:
> > fopen() "r" vs. "rb".
>
> I vote for what the relevant RFCs acrtually stated.  As noted in the
> messaged linked before, the intention is that "text" is as defined in the
> mail standards.  SMTP does not really define what characters are allowed
in
> a message body, but 822 does do that.

I have considered that, but in the same section that the term
"textual matter" is used, 2.4.1, there follows the  phrase "text
messages will usually be displayed on the user's terminal",
which pretty much rules that out.

They could not define in advance what kind of data needs to
be excluded so that the readability of the news is
compromised, so they lumped it into the vague term "textual matter".

I believe that what they meant was that the nntp-server should
send only data that does not affect the readability of news
messages.  This means control-codes that set the foreground
and background terminal colors the same should not be
sent.  These values are not "textual matter".

Similarly for 1Ah.  It definitely affects the readability of
the news messages.  All remaining messages are lost
after reading one message with YENC-encoded data.

Bart.


>
> 822, 3.1.3:
>
>   For some fields, such as "Subject" and "Comments",  no
>   structuring  is assumed, and they are treated simply as
>   <text>s, as in the message body.
>
> So, how is that <text> defined?
>
>      text        =  <any CHAR, including bare    ; => atoms, specials,
>                      CR & bare LF, but NOT       ;  comments and
>                      including CRLF>             ;  quoted-strings are
>                                                  ;  NOT recognized.
>
> And what is a CHAR?
>
>      CHAR        =  <any ASCII character>        ; (  0-177,  0.-127.)
>
>
> "any ASCII character" means any ASCII character.  ^Z is an ASCII characer.
> It's a part of the text stream in Internet messages, not an EOF marker.


Re: NNTP and YENC
#62884
Author: Zem
Date: Tue, 07 Jan 2003 09:15
47 lines
2696 bytes
"Bart Crane" <svcrane@attbi.com> wrote in
news:zyuS9.467090$pN3.50832@sccrnsc03: 

> 
> "Zem" <invalid@invalid.invalid> wrote in message
> news:Xns92FBF0F662B2CZemZemZem@66.150.105.46...
>> The NNTP protocol defines the platform independent interaction
>> betweenNNTP hosts. Implementations deal with any platform specific
>> issues. 
>>
>> 0x1A interpreted as an EOF is a well known and documented platform
>> specific issue. It is the responsibility of the implementations for
>> the affected platforms to handle.
>>
>> Your implementation is broken, not because it treats 0x1A as an EOF,
>> but because it does not handle its platform specific issues.
> 
> There are no platform-specific issues in this program, yet if you
> compile and pipe the output from an nntp-server to it, you may
> get different results on different operating systems, depending
> on the data being transported.
> 
> #include <stdio.h>
> int    main(int argc, char** argv)
> {
>     int    c;
>     while (EOF != (c= getchar()))
>         putchar(c);
>     return 0;
> }

The difference in behavior is due to platform specific issues. 

> If your response is "use binary mode", then my response is "the
> spec says text-mode", and your response will be "we don't
> follow the spec"... and I don't have a good comeback to that!!!

The mechanics of overcomming platform specific issues is irrelevent.

The spec doesn't define any special treatment for 0x1A. Within the
context of an NNTP stream, 0x1A is just another character. If an 
implementation treats 0x1A as an end of data marker, it violates the NNTP 
protocol which defines the end of data marker as CRLF.CRLF . 

-- 
zem.
Re: NNTP and YENC
#62887
Author: greg andruk
Date: Tue, 07 Jan 2003 09:43
20 lines
2432 bytes
Bart Crane wrote:


> I have considered that, but in the same section that the term
> "textual matter" is used, 2.4.1, there follows the  phrase "text
> messages will usually be displayed on the user's terminal",
> which pretty much rules that out.

No, in fact that supports the inclusion of SUB, because its very purpose is 
to facilitate the display of "dïfficult" text.  That DRI managed to get 
this completely wrong is inconsequential.

> They could not define in advance what kind of data needs to
> be excluded so that the readability of the news is
> compromised, so they lumped it into the vague term "textual matter".

That's beyond silly, since the requirements were in fact well known by the 
time NNTP appeared.  Usenet had already been in operation for over six 
years, and predated MS-DOS by two.
Page 1 of 3 • 133 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads