Thread View: news.software.nntp
133 messages
133 total messages
Page 3 of 3
Started by Bart Crane
Sun, 05 Jan 2003 01:33
Page 3 of 3 • 133 total messages
Re: NNTP and YENC
Author: Frank Slootweg
Date: Thu, 09 Jan 2003 10:14
Date: Thu, 09 Jan 2003 10:14
16 lines
1686 bytes
1686 bytes
Curt Welch <curt@kcwc.com> wrote: > Pete the Plumber <none@none.invalid> wrote: >> Frank Slootweg <franks@neth.hp.com> wrote: >> Actually I'm wondering why I went to all this effort, since Bart seems >> more interested in arguing than solving his problem. > > None of us would have dreamed of asking "Usenet" to change if we had > similar problems. We would have simply changed our code so it worked an > moved on with our lives. Building a custom set of libc routines would not > have been by first approach, but it's one of many that would work just > fine. Would probably not even be neccessary: My 1988 Turbo C documentation indicates that setting the global variable _fmode to O_BINARY is sufficient.
Re: NNTP and YENC
Author: Bart Crane
Date: Thu, 09 Jan 2003 10:38
Date: Thu, 09 Jan 2003 10:38
104 lines
4815 bytes
4815 bytes
"Jeremy" <jeremy@exit109.com> wrote in message news:1042007522.340079@ok-corral.gunslinger.net... > Phil <PeepingUnder@TheCovers.org> wrote: > > > 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. > > But whatever gave you that idea? C code isn't inherently portable; you > have to make it portable by working around platform-specific quirks. I used fopen() "r" vs. "rb" to illustrate the difference between text- and binary-modes. The programs in question use stdin, which defaults to "r" mode. I am surprised at how many unix people here are saying that text- filters are not stdio.h-compatible. They sure are in my experience. > In your case, this is one of them. If you want to process data from > Usenet, you're going to have to open it in binary mode. Which, in > fact, *would* be pretty portable, since Unix systems ignore the "b". Yes, the consensus seems to be that "textual" == "binary". This is a true statement, on Unix computers. > > > 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. > > What functionality would you be tossing out by using binary mode for > the datastream? It seems to me that you'd simply be regaining the > functionality you lost by switching to DOS in the first place. There was no loss switching to DOS. This software has been running perfectly for years. > > I have existing shell scripts using command-line tools like that which > expect to be able to handle raw NNTP data on stdin. It works fine. Because on Unix, "r" == "rb". Not all computers are Unix computers. > > > I am not averse to programming a solution to this. After all, I did write > > all the software involved. > > Then it seems the solution is both simple and clear -- fix the software. > yEnc didn't break it; it was always broken, you just didn't notice until > now. Nothing was broken, except my interpretation that textual == !binary. But, my perception is not broken... textual != binary, except on Unix. > > >> 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". > > The goal is to make NNTP 8-bit clean. Right now, you can't use nulls, > but much software has been made able to deal with them, so we're on our > way to getting rid of that problem. You can't use CR or LF because that's > special to the data. There are a couple of other, more obscure special > cases. But that's the direction we're going, and you're asking for a > step backwards. The point is to *not* have anything that's forbidden in > the data. Unfortunately for your goals, you will always need to escape something, because it is a text protocol, not a binary protocol. Just look at the DOT DOT situation. If the authors had the entire 7-bit range to choose from, why did they pick something that is commonly typed? Why not 01h? Why not 04h? Because it needed to be displayed, and anything in 00h..1Fh would have screwed up the user's terminal. It's been interesting... thanks. Bart. > > -- > Jeremy | jeremy@exit109.com
Re: NNTP and YENC
Author: Bart Crane
Date: Thu, 09 Jan 2003 10:51
Date: Thu, 09 Jan 2003 10:51
48 lines
2842 bytes
2842 bytes
Oh, one last thing. In RFC 2980, Common NNTP Extensions,
this seems relevant. This command will return "binary data", and
gives the response code of 288 to mean "Binary data to follow."
This is a solution I can use. Is this a standard practice, using 288
to notify nntp-clients that non-textual data follows?
Bart.
XTHREAD [DBINIT|THREAD]
The XTHREAD command is used to retrieve threading information
in format of originally created for use by the TRN[6] news
reader.
The command XTHREAD DBINIT may be issued prior to entering
any groups to see if a thread database exists. If it does,
the database's byte order and version number are returned
as binary data.
If no parameter is given, XTHREAD THREAD is assumed.
To use XTHREAD THREAD, a news group must have been selected
earlier, else a 412 error response is returned.
A 502 response will be returned if the client only has
permission to transfer articles. A 503 response is returned
if the threading files are not available.
The format of the trn-style thread format is discussed in
the documentation for the TRN newsreader. Since more recent
versions of TRN support the news overview (NOV) format, it
is recommended that this extension become historic and no
longer be used in current servers or future implementations.
2.12.1 Responses
288 Binary data to follow
412 No newsgroup current selected
502 No permission
503 program error, function not performed
Re: NNTP and YENC
Author: Claus Färber
Date: Thu, 09 Jan 2003 14:25
Date: Thu, 09 Jan 2003 14:25
24 lines
2010 bytes
2010 bytes
Frank Slootweg <franks@neth.hp.com> schrieb/wrote: > You're joking, right!? So you mean that tools which are meant to > provide interoperability are not meant to provide interoperability? You are completly ignoring what these tools are for: They provide some *functionality* found on POSIX systems but they are not part of some- thing that's meant to provide interoperability. >> 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". > Of course they do. That's ridiculous. POSIX does not say anything about non-POSIX systems. If you know that is does, just name the part of the standard so that anyone can have a look at it. Claus -- ------------------------ http://www.faerber.muc.de/ ------------------------ OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Frank Slootweg
Date: Thu, 09 Jan 2003 16:17
Date: Thu, 09 Jan 2003 16:17
42 lines
3115 bytes
3115 bytes
Claus F�rber <claus-usenet-20030109@faerber.muc.de> wrote: > Frank Slootweg <franks@neth.hp.com> schrieb/wrote: >> You're joking, right!? So you mean that tools which are meant to >> provide interoperability are not meant to provide interoperability? > > You are completly ignoring what these tools are for: They provide some > *functionality* found on POSIX systems but they are not part of some- > thing that's meant to provide interoperability. Uptil now I mostly ignored your remarks about "POSIX systems" and "non-POSIX systems", because, as far as I am concerned, there are (effectively) no such animals, at least no "POSIX systems". There *are* systems which are mostly POSIX *conformant*. I.e. most Unices are such systems, but no-one would call that a "POSIX system". But in any case, we are not talking about POSIX conformant *systems*, we are talking about POSIX conformant *tools* (grep/sed in this case), which run on a system, which (the *system*) may or may not be POSIX conformant. I.e. for UNIX the system is probably POSIX conformant. For DOS/Windows the system is not POSIX conformant. But that does *not matter*, because the *tools* *are* POSIX conformant. Example: Cygwin's grep/sed are POSIX conformant and if I use those tools on (MS-)Windows, then I have POSIX conformant *tools* on a "non-POSIX system". These (Cygwin) tools on Windows are intended to provide interoperability with similar POSIX conformant tools on other platforms, for example on UNIX. *That* is the purpose of the POSIX standard. If you do not agree with that, then I'm afraid we have to agree to disagree. >>> 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". > >> Of course they do. > > That's ridiculous. POSIX does not say anything about non-POSIX systems. > If you know that is does, just name the part of the standard so that > anyone can have a look at it. See above.
Re: NNTP and YENC
Author: Russ Allbery
Date: Thu, 09 Jan 2003 18:05
Date: Thu, 09 Jan 2003 18:05
18 lines
1893 bytes
1893 bytes
Bart Crane <svcrane@attbi.com> writes:
> Yes, the consensus seems to be that "textual" == "binary".
Actually, I would interpret textual in this context as excluding NUL, and
as carrying an expectation that there will be a CRLF every so often.
Realistically, I expect textual was just thrown in there because that was
what people used Usenet for at the time, it didn't have any particular
meaning at all, and you've now spent two orders of magnitude more time
thinking about it than the authors of RFC 977 did.
--
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
Author: Russ Allbery
Date: Thu, 09 Jan 2003 18:05
Date: Thu, 09 Jan 2003 18:05
17 lines
1799 bytes
1799 bytes
Bart Crane <svcrane@attbi.com> writes:
> Oh, one last thing. In RFC 2980, Common NNTP Extensions, this seems
> relevant. This command will return "binary data", and gives the
> response code of 288 to mean "Binary data to follow."
> This is a solution I can use. Is this a standard practice, using 288
> to notify nntp-clients that non-textual data follows?
No.
--
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
Author: Jeremy
Date: Thu, 09 Jan 2003 20:50
Date: Thu, 09 Jan 2003 20:50
32 lines
2298 bytes
2298 bytes
Bart Crane <svcrane@attbi.com> wrote: > I am surprised at how many unix people here are saying that text- > filters are not stdio.h-compatible. They sure are in my experience. NNTP text streams are not stdio-compatible. You're attempting to force an NNTP text stream to be a DOS text stream, which is silly. You need to do whatever is necessary on any given platform to turn an NNTP text stream into something your OS can deal with. > Yes, the consensus seems to be that "textual" == "binary". No. Textual means textual; to most around here it includes an assumption of line-oriented data. But what we're talking about is simply "textual" in NNTP, as opposed to "textual" in *any* operating system. >> What functionality would you be tossing out by using binary mode for >> the datastream? It seems to me that you'd simply be regaining the >> functionality you lost by switching to DOS in the first place. > > There was no loss switching to DOS. This software has been > running perfectly for years. Only by coincidence. You never encountered the bug, but it was there. By the way, we're going to be using UTF-8 for headers in the future. I bet your stuff breaks again when we have umlauts and Chinese glyphs in newsgroup names... -- Jeremy | jeremy@exit109.com
Re: NNTP and YENC
Author: Curt Welch
Date: Fri, 10 Jan 2003 01:17
Date: Fri, 10 Jan 2003 01:17
26 lines
2502 bytes
2502 bytes
Frank Slootweg <franks@neth.hp.com> wrote: > Curt Welch <curt@kcwc.com> wrote: > > Pete the Plumber <none@none.invalid> wrote: > >> Frank Slootweg <franks@neth.hp.com> wrote: > >> Actually I'm wondering why I went to all this effort, since Bart seems > >> more interested in arguing than solving his problem. > > > > None of us would have dreamed of asking "Usenet" to change if we had > > similar problems. We would have simply changed our code so it worked > > an moved on with our lives. Building a custom set of libc routines > > would not have been by first approach, but it's one of many that would > > work just fine. > > Would probably not even be neccessary: My 1988 Turbo C documentation > indicates that setting the global variable _fmode to O_BINARY is > sufficient. He needs more than that. He wants to keep the CR LF to LF translations but loose the ^Z. So he needs a "half binary" mode to solve his problem or else he needs to use full binary and change any code that's trying do do things like write a \n and expect a \r\n to end up in the data. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: NNTP and YENC
Author: Curt Welch
Date: Fri, 10 Jan 2003 06:30
Date: Fri, 10 Jan 2003 06:30
11 lines
1628 bytes
1628 bytes
Pete the Plumber <none@none.invalid> wrote: > Heck, with my luck, the software is probably an email address harvester > anyway > :-). That would explain a lot. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: NNTP and YENC
Author: Claus Färber
Date: Fri, 10 Jan 2003 16:04
Date: Fri, 10 Jan 2003 16:04
37 lines
2932 bytes
2932 bytes
Frank Slootweg <franks@neth.hp.com> schrieb/wrote:
> Uptil now I mostly ignored your remarks about "POSIX systems" and
> "non-POSIX systems", because, as far as I am concerned, there are
> (effectively) no such animals, at least no "POSIX systems". There *are*
> systems which are mostly POSIX *conformant*. I.e. most Unices are such
> systems, but no-one would call that a "POSIX system".
You are splitting hairs (probably due to a lack of other arguments). It
does not matter if you call them "POSIX systems", "POSIX-conformant
systems", or "mostly POSIX-conformant systems".
> But in any case, we are not talking about POSIX conformant *systems*,
> we are talking about POSIX conformant *tools* (grep/sed in this case),
> which run on a system, which (the *system*) may or may not be POSIX
> conformant.
You are still missing the point. POSIX only defines how tools have to
behave on POSIX systems, i.e. it only defines how tools behave on
conformant systems.
Just have a look at the POSIX standard. It clearly says:
| Abstract: This standard defines a standard operating system interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| and environment, including a command interpreter (or "shell"), and
~~~~~~~~~~~~~~~~~ ^^^^^^^^^
| common utility programs to support applications portability at the
| source code level.
So it clearly says that it defines an operating system *including*
utility programmes. It does not define utility programmes that are not
part of the defined operating system environment.
Claus
--
------------------------ http://www.faerber.muc.de/ ------------------------
OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Claus Färber
Date: Fri, 10 Jan 2003 16:27
Date: Fri, 10 Jan 2003 16:27
14 lines
1643 bytes
1643 bytes
Karl Kleinpaste <karl@charcoal.com> schrieb/wrote: > "Bart Crane" <svcrane@attbi.com> writes: >> It is not a problem, it is a mode. Text- vs. binary-mode. > Your arbitrary distinction of "text" versus "binary" "mode" is a DOS > phantasm. The ISO C standard makes a clear distinction between "text streams" and "binary streams". I would not call that a "DOS phantasm". Claus -- ------------------------ http://www.faerber.muc.de/ ------------------------ OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Claus Färber
Date: Fri, 10 Jan 2003 16:57
Date: Fri, 10 Jan 2003 16:57
49 lines
3064 bytes
3064 bytes
Jeremy <jeremy@exit109.com> schrieb/wrote: > Phil <PeepingUnder@TheCovers.org> wrote: >> 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. > But whatever gave you that idea? C code isn't inherently portable; No, Phil is right. The problem is that you can't expect it to produce the same result without converting the input data to local conventions for text and binary files: The C specification does only make some guarantees about data written to and from text and binary streams but it does not define the mapping from these streams to the data that it actually stored on disk. > you have to make it portable by working around platform-specific > quirks. In your case, this is one of them. It's not platform-specific quirks but making assumptions that the C standard does not guarantee. > If you want to process data from Usenet, you're going to have to open > it in binary mode. Yes, this is the solution because the C standard guarantees that "binary streams" are able to save any char values, whereas "text streams" can't handle all data allowed by Netnews standards. But that suddenly exposes us to ... > Which, in fact, *would* be pretty portable, since Unix systems ignore > the "b". ... the quirks found on Unix systems: On these systems, Netnews data is usually stored in what maps to C's "text mode". However, the assumption that this is possible is only true on POSIX systems but not guaranteed by the C specification. The original poster is also making the assumption that his platform can handle Netnews data as "text streams" and that ports of text utilities can handle it. This is true on POSIX systems but not on his system. There's *nothing* broken here, except that his assumptions are not valid on his non-POSIX system. Claus -- ------------------------ http://www.faerber.muc.de/ ------------------------ OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Frank Slootweg
Date: Mon, 13 Jan 2003 13:17
Date: Mon, 13 Jan 2003 13:17
58 lines
4262 bytes
4262 bytes
Claus F�rber <claus-usenet-20030110@faerber.muc.de> wrote: > Frank Slootweg <franks@neth.hp.com> schrieb/wrote: >> Uptil now I mostly ignored your remarks about "POSIX systems" and >> "non-POSIX systems", because, as far as I am concerned, there are >> (effectively) no such animals, at least no "POSIX systems". There *are* >> systems which are mostly POSIX *conformant*. I.e. most Unices are such >> systems, but no-one would call that a "POSIX system". > > You are splitting hairs (probably due to a lack of other arguments). It > does not matter if you call them "POSIX systems", "POSIX-conformant > systems", or "mostly POSIX-conformant systems". I was/am "splitting hairs" because you seemed to have some strange interpretation of the POSIX standard. After your clarification it is clear that your interpretation is not just strange, but actually wrong/incorrect. See below. >> But in any case, we are not talking about POSIX conformant *systems*, >> we are talking about POSIX conformant *tools* (grep/sed in this case), >> which run on a system, which (the *system*) may or may not be POSIX >> conformant. > > You are still missing the point. POSIX only defines how tools have to > behave on POSIX systems, i.e. it only defines how tools behave on > conformant systems. > > Just have a look at the POSIX standard. It clearly says: > | Abstract: This standard defines a standard operating system interface > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | and environment, including a command interpreter (or "shell"), and > ~~~~~~~~~~~~~~~~~ ^^^^^^^^^ > | common utility programs to support applications portability at the > | source code level. > > So it clearly says that it defines an operating system *including* > utility programmes. It does not define utility programmes that are not > part of the defined operating system environment. No, it does not define an operating system, but, *as you have quoted*, it defines an operating system *interface*! That is a big difference! I.e. it defines the APIs (Application Programming Interface), i.e. the syntax and the semantics of the APIs, but not the code. So the *interface* and the *utility programs* (i.e. sed/grep in this case), are POSIX conformant/standard/compatible/<whatever>, but the *underlying operating system* is *not* *neccessarily* POSIX conformant/ ... Specifically for this discussion, Cygwin sed/grep, i.e. the *"common utility programs"* *are* POSIX conformant/..., but the underlying (MS-)Windows *operating system* is *not* POSIX conformant/.... So here have POSIX conformant utility programs on a non-POSIX system, and the (POSIX conformant) behaviour of these utilities is defined by the POSIX standard. That was what I was saying and what you were contradicting. But back to the original issue of interoperability: You seem to have the opinion, see <news:8dZhBbs3cDD@3247.org>, that interoperability is not the purpose of the POSIX standard. If that is indeed your opinion, then what *is* in your opinion the purpose of the POSIX standard?
Re: NNTP and YENC
Author: Claus Färber
Date: Mon, 13 Jan 2003 20:08
Date: Mon, 13 Jan 2003 20:08
44 lines
3231 bytes
3231 bytes
Frank Slootweg <franks@neth.hp.com> schrieb/wrote: > No, it does not define an operating system, but, *as you have quoted*, > it defines an operating system *interface*! That is a big difference! Well, the *only* difference here is that if I say "operating system" you can intentionally misunderstand it in order to avoid to see the point of the whole discussion... even if it was clear that "operating system" was used by me as a shorthand for "os environment". > So the *interface* and the *utility programs* (i.e. sed/grep in this > case), are POSIX conformant/standard/compatible/<whatever>, but the > *underlying operating system* is *not* *neccessarily* POSIX conformant/ And this is where you are wrong: The POSIX standard only defines these utility programmes as *part* *of* *the* standardised *os* *environment*, not on themselves. So it says that systems that claim POSIX conformance (and only those) must have utilities named 'sed' and 'grep' that behave as specified. It does not say that any utility named 'sed' or 'grep' must behave in a compliant way. (Nor could it; that's simply out of scope for the POSIX specification.) If you want to have 'sed' and 'grep' on "non-POSIX" systems like Windows, there are actually two possibilities: * Implement a full POSIX environment. This enables you to run software designed for POSIX environments but you can't use utilities from that environment to handle files on the same system that don't follow POSIX conventions. * Port the tools to local conventions, i.e. change the behaviour of the utilities so that they can handle files on the same system. There's nothing wrong with either approach; they just fulfill different needs. Cygwin tries to do both by being just enough POSIX-compliant to run (most) programmes desgined for a POSIX environment and not so POSIX- compliant that the utilities would not work with local files. Claus -- ------------------------ http://www.faerber.muc.de/ ------------------------ OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Bart Crane
Date: Tue, 14 Jan 2003 00:28
Date: Tue, 14 Jan 2003 00:28
130 lines
6523 bytes
6523 bytes
Claus F�rber <claus-usenet-20030110@faerber.muc.de> wrote in message news:8d$Rtvs3cDD@3247.org... > Jeremy <jeremy@exit109.com> schrieb/wrote: > > Phil <PeepingUnder@TheCovers.org> wrote: > >> 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. > > > But whatever gave you that idea? C code isn't inherently portable; > > No, Phil is right. The problem is that you can't expect it to produce > the same result without converting the input data to local conventions > for text and binary files: > The C specification does only make some guarantees about data written to > and from text and binary streams but it does not define the mapping from > these streams to the data that it actually stored on disk. > > > you have to make it portable by working around platform-specific > > quirks. In your case, this is one of them. > > It's not platform-specific quirks but making assumptions that the C > standard does not guarantee. > > > If you want to process data from Usenet, you're going to have to open > > it in binary mode. > > Yes, this is the solution because the C standard guarantees that "binary > streams" are able to save any char values, whereas "text streams" can't > handle all data allowed by Netnews standards. > > But that suddenly exposes us to ... > > > Which, in fact, *would* be pretty portable, since Unix systems ignore > > the "b". > > ... the quirks found on Unix systems: On these systems, Netnews data is > usually stored in what maps to C's "text mode". However, the assumption > that this is possible is only true on POSIX systems but not guaranteed > by the C specification. > > The original poster is also making the assumption that his platform can > handle Netnews data as "text streams" and that ports of text utilities > can handle it. This is true on POSIX systems but not on his system. > There's *nothing* broken here, except that his assumptions are not valid > on his non-POSIX system. This is not a POSIX thing, this is a C thing. NNTP-data has been, up to now, compatible with what DOS considers a text-stream to be. Coincidence? Not at all. It was in fact compatible with what became the the ISO-C definition of a text-stream, which forbids any ANSI-defined control-codes from appearing in the stream (excepting for those few that have definition use for formatting text: VTAB, HTAB, FF, CR and LF). The following document describes text-streams, C and UNIX, from the IBM 370 perspective. I think it helps clarify the definition of a text-stream, why it is necessary. http://www.sas.com/service/library/onlinedoc/sasc/doc700/html/lr1/zhbkgrnd.h tm I think this wording (from the above link) summarizes my position well: "ISO/ANSI C I/O Concepts The definition of the C I/O library contained in the ISO/ANSI C standard is based on the traditional UNIX standard I/O definition, but differs from it in many ways. These differences exist to support efficient I/O implementations on systems other than UNIX, and to provide some functionality not offered by UNIX. In general, where definitions of I/O routines differ between ISO/ANSI C and UNIX C, programs should assume the ISO/ANSI definitions for maximum portability. The ISO/ANSI definitions are designed for use on many systems including UNIX, while the applicability of the UNIX definitions is more limited." And this wording summarizes the problem with NNTP-server output containing control-codes: "The ISO/ANSI I/O model The following list describes the I/O model for ISO/ANSI C. The points are listed in the same order as the corresponding points for the UNIX I/O model, as presented in the previous section. A file may be processed in one of two ways: as a text stream, or as a binary stream. When a file is processed as a binary stream, it appears to the program as a sequence of characters. It may not be possible to create a file containing no characters. A file accessed as a text stream appears to the program as a sequence of lines separated by occurrences of the new-line character ( '\n' ). The effects of reading or writing control characters using a text stream are not predictable. An implementation is permitted to record line separators using some technique other than physical new-line characters." As you and whoever reads this can probably surmise, my whole position is that the phrasing in RFC 977 that the "textual matter" is "to be displayed on the user's terminal." -- i.e.: terminal control codes must not appear in the data stream -- the same definitiona as the the ISO C definition of a "text-stream". Coincidence? Not hardly!!! Thanks for the conversation. It was illuminating. Hopefully, we all now realize the extent to which RFC 977 is being violated with the recent change to include terminal-control codes in the data stream (by way of YENC encoding). Processing nntp-data with text-processing utilities written in stdio- based portable C should be possible for all computer systems, not just those that use the Unix I/O model. Bart. > > Claus > -- > ------------------------ http://www.faerber.muc.de/ ------------------------ > OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Re: NNTP and YENC
Author: Jeremy
Date: Tue, 14 Jan 2003 01:58
Date: Tue, 14 Jan 2003 01:58
30 lines
2340 bytes
2340 bytes
Bart Crane <bcrane@iready.com> wrote: > NNTP-data has been, up to now, compatible with what DOS considers > a text-stream to be. Coincidence? Not at all. It was in fact compatible > with what became the the ISO-C definition of a text-stream, which > forbids any ANSI-defined control-codes from appearing in the stream > (excepting for those few that have definition use for formatting text: > VTAB, HTAB, FF, CR and LF). NNTP data has never been compatible with this, it's just that you didn't encounter the incompatibility until now. Even if it were *supposed* to be compatible, trusting the server's data to be terminal-safe, or to not contain anything harmful when you take it and pass it off to library or system calls, is simply poor program design. Especially if you're dumping it to a terminal, you really must scrub it first -- that's the client's responsibility. > As you and whoever reads this can probably surmise, my whole > position is that the phrasing in RFC 977 that the "textual matter" > is "to be displayed on the user's terminal." -- i.e.: terminal control > codes must not appear in the data stream Your interpretation is based on assumptions as to what values a terminal considers special. Neither NNTP nor the server is in a position to know this; the client is. -- Jeremy | jeremy@exit109.com
Re: NNTP and YENC
Author: Bart Crane
Date: Tue, 14 Jan 2003 02:34
Date: Tue, 14 Jan 2003 02:34
76 lines
3996 bytes
3996 bytes
Hello to everyone reading this who is interested in this, especially those who took the time to respond. First, I do not purport to be a "standards expert", not on any of the specs mentioned. My understanding of these things is from a practical perspective: how to solve a problem, especially for the long-term. I have often suggested the use of NNTP for news-like information transfer. An important facet of nntp is that it transports data via text. Using text-streams means that stdio-based software can be written that is portable across platforms. This allows building data-processing systems that include computers with different operating systems. Changing NNTP from its textual nature to binary is a profound change that limits interoperability among computers with different operating systems. Because, on Unix, it just so happens that there is no special translation between text- and binary-modes, to Unix programmers, this problem seems to be non-existent. For programmers on other operating systems, the C runtime library would have to be re-implemented. On DOS, this only involves CR LF -> LF translation, but on other operating systems, this may not be so trivial. The idea that DOS is broken, or non-conformant, is to deny that operating systems be allowed to define a difference in how a text-file is stored. There is a good reason for "r" vs. "rb", as I have learned recently. Deciding to include all ANSI-defined control-codes in the NNTP Response Data, in addition to those explicitly defined in RFC 977, is more than just upgrading the protocol to transfer 8-bit data. Allowing control-codes in the data-stream eliminates the ability to write source-code compatible stdio-based filters for any and all computers whose operating system makes a distinction between text- and binary-modes. This is not because DOS is not POSIX-compliant, or because the software in question was written 10+ years ago. NNTP is a text-based protocol, not a binary protocol. Any and all computers connected to the network, not just Unix computers, should be able to process the data as text-streams, as they always have. Now that 1Ah is now realized to cause a problem, it should be added to the list of YENC Critical Characters. An update to the Common NNTP Extensions should be made, to document the need for certain control-codes to be excluded for reasons of compatibility. When NNTP-B(inary) is deployed, text-processing utilities will, by definition, be incompatible. As long as need exists to exclude certain codes, treat specially certain others, then accomodating operating-system particulars for reasons of compatibility is not uncalled for. Thanks!! Bart.
Re: NNTP and YENC
Author: Frank Slootweg
Date: Tue, 14 Jan 2003 08:34
Date: Tue, 14 Jan 2003 08:34
64 lines
4281 bytes
4281 bytes
Claus F�rber <claus-usenet-20030113@faerber.muc.de> wrote: > Frank Slootweg <franks@neth.hp.com> schrieb/wrote: >> No, it does not define an operating system, but, *as you have quoted*, >> it defines an operating system *interface*! That is a big difference! > > Well, the *only* difference here is that if I say "operating system" you > can intentionally misunderstand it in order to avoid to see the point of > the whole discussion... even if it was clear that "operating system" was > used by me as a shorthand for "os environment". Easy does it! I do "intentionally misunderstand" anything. Perhaps you do, but I don't. >> So the *interface* and the *utility programs* (i.e. sed/grep in this >> case), are POSIX conformant/standard/compatible/<whatever>, but the >> *underlying operating system* is *not* *neccessarily* POSIX conformant/ > > And this is where you are wrong: The POSIX standard only defines these > utility programmes as *part* *of* *the* standardised *os* *environment*, > not on themselves. So it says that systems that claim POSIX conformance > (and only those) must have utilities named 'sed' and 'grep' that behave > as specified. So you keep saying, but you do not provide any proof. In contrary, you provide proof which invalidates your statements. > It does not say that any utility named 'sed' or 'grep' must behave in a > compliant way. (Nor could it; that's simply out of scope for the POSIX > specification.) No it does not, but it also does not say that a utility named 'sed' or 'grep' *cannot* behave in a (POSIX) compliant way, nor does it say that such utility can not claim POSIX conformance, and that is exactly the/my point. > If you want to have 'sed' and 'grep' on "non-POSIX" systems like > Windows, there are actually two possibilities: > > * Implement a full POSIX environment. This enables you to run software > designed for POSIX environments but you can't use utilities from that > environment to handle files on the same system that don't follow POSIX > conventions. There is nothing which prevents the "full POSIX environment" to be implemented in a way which allows to handle 'non-POSIX' files in a POSIX-conformant way. > * Port the tools to local conventions, i.e. change the behaviour of the > utilities so that they can handle files on the same system. That is indeed *possible*, but not (always) *neccessary* (except, in the case of DOS/Windows, for the CRLF<-->LF translation, but *that* has never been the issue of this discussion). > There's nothing wrong with either approach; they just fulfill different > needs. > Cygwin tries to do both by being just enough POSIX-compliant to run > (most) programmes desgined for a POSIX environment and not so POSIX- > compliant that the utilities would not work with local files. (More or less) Agreed. However it totally escapes me what your point is. I.e. how does that prove me 'wrong'? And why don't you answer my specific question (which you stripped)?
Re: NNTP and YENC
Author: Rene
Date: Tue, 14 Jan 2003 13:08
Date: Tue, 14 Jan 2003 13:08
51 lines
3315 bytes
3315 bytes
"Bart Crane" <svcrane@attbi.com> wrote:
> Deciding to include all ANSI-defined control-codes
> in the NNTP Response Data, in addition to those
> explicitly defined in RFC 977, is more than just
> upgrading the protocol to transfer 8-bit data.
Just a little comment: Your problem character 1Ah is 26decimal, and has
nothing what so ever to do with allowing the 8th bit to be set, because
that bit covers the range 128-255. Never the less, using 8 bit data is
directly violating or ignoring RFC 977. Its being done because RFC 977 is
not representing todays status - as many already told you so.
Also, you didn't answer my message where I showed you that RFC 822 -
Standard Internet Message Format explicitly allows in a message *any* char
within the range 1-127. No matter that this RFC is also badly outdated, it
was always allowed in RFC 822.
If you want to be prepared for the future (well actually its probably
almost 100% today) read RFC 2822. Its still 7bit even for the body but the
definition of what is text is very clear: RFC 2822 / Section 3.2.1
primitive Tokens:
text = %d1-9 / ; Characters excluding CR and LF
%d11 /
%d12 /
%d14-127 /
obs-text
Meaning anything exluding 00h, 0Ah and 0Dh (up to 127dec). Again, this
explicitly *includes* 1Ah. This defines *text* not binary data.
> NNTP is a text-based protocol, not a binary protocol.
Right. Read definition of text in RFC 2822 or RFC822.
RFC 822 says in Section 3.3 :
CHAR = <any ASCII character> ; ( 0-177, 0.-127.)
[..]
text = <any CHAR, including bare ; => atoms, specials,
CR & bare LF, but NOT ; comments and
including CRLF> ; quoted-strings are
; NOT recognized.
So you see, both RFC 2822 AND 822 explicitly define the char 1Ah as text.
If you or your OS or your tools can't cope with them, they are in error.
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Re: NNTP and YENC
Author: Bart Crane
Date: Tue, 14 Jan 2003 23:30
Date: Tue, 14 Jan 2003 23:30
127 lines
6528 bytes
6528 bytes
Rene <invalid@email.addr> wrote in message news:20030114080852.917$xx@newsreader.com... > "Bart Crane" <svcrane@attbi.com> wrote: > > Deciding to include all ANSI-defined control-codes > > in the NNTP Response Data, in addition to those > > explicitly defined in RFC 977, is more than just > > upgrading the protocol to transfer 8-bit data. > > Just a little comment: Your problem character 1Ah is 26decimal, and has > nothing what so ever to do with allowing the 8th bit to be set, because > that bit covers the range 128-255. Never the less, using 8 bit data is > directly violating or ignoring RFC 977. Its being done because RFC 977 is > not representing todays status - as many already told you so. > > Also, you didn't answer my message where I showed you that RFC 822 - > Standard Internet Message Format explicitly allows in a message *any* char > within the range 1-127. No matter that this RFC is also badly outdated, it > was always allowed in RFC 822. Sorry for not answering your message specifically, but in another response I refer to ANSI X3.4, which excludes 00h..1Fh as control-codes. The NNTP spec specifically states that Response Data is "textual", and is "usually displayed on the user's terminal." Thus, ANSI X3.4 is relevant, as it defines a standard upon which terminal devices can be made compatible across operating systems. (Again, not a standards expert, I just read specs so as to build systems that work across operating systems and platforms.) > > If you want to be prepared for the future (well actually its probably > almost 100% today) read RFC 2822. Its still 7bit even for the body but the > definition of what is text is very clear: RFC 2822 / Section 3.2.1 > primitive Tokens: > > text = %d1-9 / ; Characters excluding CR and LF > %d11 / > %d12 / > %d14-127 / > obs-text > > Meaning anything exluding 00h, 0Ah and 0Dh (up to 127dec). Again, this > explicitly *includes* 1Ah. This defines *text* not binary data. Then this protocol is not compatible with operating systems that use ANSI-defined control-codes for text-mode streams, but which would be somewhat problematic for legacy applications that presume a 1-byte character-set!!! Note that Section 5 has this interesting wording: "5. Security Considerations Care needs to be taken when displaying messages on a terminal or terminal emulator. Powerful terminals may act on escape sequences and other combinations of ASCII control characters with a variety of consequences. They can remap the keyboard or permit other modifications to the terminal which could lead to denial of service or even damaged data. They can trigger (sometimes programmable) answerback messages which can allow a message to cause commands to be issued on the recipient's behalf. They can also effect the operation of terminal attached devices such as printers. Message viewers may wish to strip potentially dangerous terminal escape sequences from the message prior to display. " This is my position exactly. Contrasting the NNTP author's statement that the nntp response data is usually "displayed on the user's terminal" with that statement above. > > > NNTP is a text-based protocol, not a binary protocol. > > Right. > Read definition of text in RFC 2822 or RFC822. > RFC 822 says in Section 3.3 : > > CHAR = <any ASCII character> ; ( 0-177, 0.-127.) > [..] > > text = <any CHAR, including bare ; => atoms, specials, > CR & bare LF, but NOT ; comments and > including CRLF> ; quoted-strings are > ; NOT recognized. > > So you see, both RFC 2822 AND 822 explicitly define the char 1Ah as text. > If you or your OS or your tools can't cope with them, they are in error. Values between 00h..1Fh may be compatible with one aspect of the spec, but they are invalid with another (ANSI X3.4), and result in a true interoperability problem, which is what I am reporting. RFC 977, Section 1.4: "While it is possible that such a ... implementation might work well with a group of similar computers running nearly identical operating systems, such a scheme is not general enough to offer service to a wide range of client systems, especially when many diverse operating systems may be in use among a group of clients. There are few (if any) ... systems that can offer the generality of service ... , particularly when a wide range of host hardware and operating systems are considered." It is clear that the intentions of RFC 977 were to serve the needs of a network that consisted of clients with different hardware and operating systems. Interpretations that ignore the "user's terminal" aspect or that equate "textual" == "binary" are not in the spirit of what NNTP was designed to accomplish. Bart. > > -- > -------------------- http://NewsReader.Com/ -------------------- > Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Re: NNTP and YENC
Author: Jeffrey M. Vinocur
Date: Tue, 14 Jan 2003 23:49
Date: Tue, 14 Jan 2003 23:49
17 lines
1606 bytes
1606 bytes
In article <r11V9.71$2r2.60729@news.uswest.net>, Bart Crane <bcrane@iready.com> wrote: > >The NNTP spec specifically states that Response Data is "textual", >and is "usually displayed on the user's terminal." You ignored my message pointing out that (since RFC 977 is now seventeen years old) you need to be working from the drafts which will become the next standards if you want to even pretend to be on the same page as the rest of us. In which case, the character set is very clearly defined. -- Jeffrey M. Vinocur jeff@litech.org
Re: NNTP and YENC
Author: Bart Crane
Date: Tue, 14 Jan 2003 23:56
Date: Tue, 14 Jan 2003 23:56
84 lines
4377 bytes
4377 bytes
Jeremy <jeremy@exit109.com> wrote in message
news:1042509487.957651@ok-corral.gunslinger.net...
> Bart Crane <bcrane@iready.com> wrote:
>
> > NNTP-data has been, up to now, compatible with what DOS considers
> > a text-stream to be. Coincidence? Not at all. It was in fact
compatible
> > with what became the the ISO-C definition of a text-stream, which
> > forbids any ANSI-defined control-codes from appearing in the stream
> > (excepting for those few that have definition use for formatting text:
> > VTAB, HTAB, FF, CR and LF).
>
> NNTP data has never been compatible with this, it's just that you didn't
> encounter the incompatibility until now.
NNTP has always been compatible in this way. Why do you think
uuencode was made to produce only printable characters?
>
> Even if it were *supposed* to be compatible, trusting the server's data
> to be terminal-safe, or to not contain anything harmful when you take it
> and pass it off to library or system calls, is simply poor program design.
> Especially if you're dumping it to a terminal, you really must scrub it
> first -- that's the client's responsibility.
There is no design that circumvents this problem.
The problem is that a filter designed to process the data specifically
to ensure that "no bad stuff" gets through stops on End Of File when
1Ah is encountered.
A binary filter would require the intelligence of the decoder so that it
could escape the 1Ah properly, according to the context of the data
in which the 1Ah occurs.
newsget | decoder -escape | sed -f fixnewsg | decoder -decode
Although this is a workaround, whenever a new protocol is introduced
that utilizes control-codes, that decoding format must be supported by
the decoder, else a 1Ah can get through and stop the pipeline.
>
> > As you and whoever reads this can probably surmise, my whole
> > position is that the phrasing in RFC 977 that the "textual matter"
> > is "to be displayed on the user's terminal." -- i.e.: terminal control
> > codes must not appear in the data stream
>
> Your interpretation is based on assumptions as to what values a terminal
> considers special. Neither NNTP nor the server is in a position to know
> this; the client is.
Following the ANSI spec will get you compatibility with most
devices, if not all.
Following the ANSI spec will also allow compatibility with
text-mode processing on most non-Unix-based computers.
It does not seem reasonable to introduce a change in standard
practices that restricts the ability to process the data using stdio-
based utilities to Unix-based computers only, especially given
the NNTP authors' statements that the protocol was designed
to serve clients on a wide variety of hardware and software.
Thanks for the conversation, but I must say that you and just
about everyone else here seems absolutely determined to
ensure that only Unix-based systems are allowed to process
NNTP data using text-processing utilities.
It all seems like a no-brainer to me, text- vs. binary-streams
and all, but if you want to say that 1Ah is a perfectly valid text-
character on DOS because it is on Unix, you can say that!!!
Bart.
>
> --
> Jeremy | jeremy@exit109.com
Re: NNTP and YENC
Author: Russ Allbery
Date: Wed, 15 Jan 2003 00:10
Date: Wed, 15 Jan 2003 00:10
22 lines
2068 bytes
2068 bytes
Bart Crane <bcrane@iready.com> writes:
> Thanks for the conversation, but I must say that you and just about
> everyone else here seems absolutely determined to ensure that only
> Unix-based systems are allowed to process NNTP data using
> text-processing utilities.
In all the time that you've been spending posting to this group on this
topic, you could have followed the multiple posts of advice made around
the time that you first brought up this issue and installed one of the
many sets of text-processing utilities for DOS that have no problems with
Ctrl-Z.
At this point, I fear that my response to your messages is basically "no
sympathy for self-inflicted wounds."
--
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
Author: Bart Crane
Date: Wed, 15 Jan 2003 00:25
Date: Wed, 15 Jan 2003 00:25
60 lines
3046 bytes
3046 bytes
Jeffrey M. Vinocur <jeff@litech.org> wrote in message
news:b027li$abk$2@puck.litech.org...
> In article <r11V9.71$2r2.60729@news.uswest.net>,
> Bart Crane <bcrane@iready.com> wrote:
> >
> >The NNTP spec specifically states that Response Data is "textual",
> >and is "usually displayed on the user's terminal."
>
> You ignored my message pointing out that (since RFC 977 is now
> seventeen years old) you need to be working from the drafts which
> will become the next standards
Hello,
I have now found the message that you are referring to,
and I see that 4.3.1 states:
"Posters SHOULD avoid using control characters and escape sequences
except for tab (US-ASCII 9), formfeed (US-ASCII 12) and, possibly,
backspace (US-ASCII 8). ...
NOTE: Passing other control characters or escape sequences
unaltered to a display or printing device is likely to have
unpredictable results, except in the case of a device adapted to
the special needs of some particular character set.
...."
So, if compatibility with stdio-based processing on
non-Unix based operating systems is important, it would
seem that the data should continue to exclude ANSI-
defined control codes.
> if you want to even pretend to be
> on the same page as the rest of us. In which case, the character
> set is very clearly defined.
The character set for RFC 977 is ANSI X3.4 (again, not a spec-
expert, just going by what has always worked).
If I have missed something of particular relevance, I
apologize. I am not as interested in new protocols as I
am with preserving compatibility with the existing
protocol. I imagine new protocols to use multi-byte
characters, and my text-processing utilities will
definitely be incompatible with those.
Bart.
>
>
> --
> Jeffrey M. Vinocur
> jeff@litech.org
Re: NNTP and YENC
Author: Rene
Date: Wed, 15 Jan 2003 00:33
Date: Wed, 15 Jan 2003 00:33
117 lines
6683 bytes
6683 bytes
"Bart Crane" <bcrane@iready.com> wrote: > Sorry for not answering your message specifically, but in another > response I refer to ANSI X3.4, which excludes 00h..1Fh as > control-codes. Yes, I've read through that. I do not deny that ANSI does declare them as control chars. > The NNTP spec specifically states that Response Data is "textual", > and is "usually displayed on the user's terminal." Thus, ANSI X3.4 > is relevant, as it defines a standard upon which terminal devices can > be made compatible across operating systems. No that's an jump to a conclusion on your part. I don't see why "textual" automatically means this must be ANSI X3.4. In the very same RFC which says textual, they also defined text - in clear contradiction to ANSI X3.4. What does that mean? Either they overlooked that - a mistake or they understand something other in textual than you do. In any case, RFC 977 defines what they mean with text. They have provided EBNF-formulas (extended backus naur') which exactly define what is valid for text, headers, etc. > (Again, not a standards expert, I just read specs so as to build > systems that work across operating systems and platforms.) Right, me neither, but that spec defines what text regarding nntp is. You trust all your argumentation in those two words "textual matter" which is never explained anywhere - and therefor ambigous and problematic. > > Meaning anything exluding 00h, 0Ah and 0Dh (up to 127dec). Again, this > > explicitly *includes* 1Ah. This defines *text* not binary data. > > Then this protocol is not compatible with operating systems that > use ANSI-defined control-codes for text-mode streams, but > which would be somewhat problematic for legacy applications > that presume a 1-byte character-set!!! Right. This is a problem for systems that can't cope with it. You apparently have one such. Now who was first, the spec or your system/tools ? > Note that Section 5 has this interesting wording: > > "5. Security Considerations > > Care needs to be taken when displaying messages on a terminal or > terminal emulator. Powerful terminals may act on escape sequences > and other combinations of ASCII control characters with a variety of > consequences. They can remap the keyboard or permit other > modifications to the terminal which could lead to denial of service > or even damaged data. They can trigger (sometimes programmable) > answerback messages which can allow a message to cause commands to be > issued on the recipient's behalf. They can also effect the operation > of terminal attached devices such as printers. Message viewers may > wish to strip potentially dangerous terminal escape sequences from > the message prior to display. " > > This is my position exactly. Contrasting the NNTP author's statement > that the nntp response data is usually "displayed on the user's terminal" > with that statement above. Right, and I dont disagree with it either. "Care needs to be taken when..." This care needs to be taken by *your system* or *your tools* not by the standard. The standard has no power to control what any system anywhere actually does - therefor to remain fully functional, a programmer of any tool on such a plattform has to take care that it still works - that's how I read this paragraph. As has been already pointed out to you earlier in this thread, you could include a wrapper which somehow escapes out the 1Ah code and re-injects them later, after the critical, non-coping program in your filter chain is through with it. That's what I read as "Message viewers may wish to strip potentially dangerous terminal escape sequences from the message prior to display." from above quote. NNTP is clearly no message viewer, its a transport system (that's even in the name). Your filter chain qualifies as message viewer though. > > So you see, both RFC 2822 AND 822 explicitly define the char 1Ah as > > text. If you or your OS or your tools can't cope with them, they are in > > error. > > Values between 00h..1Fh may be compatible with one aspect > of the spec, but they are invalid with another (ANSI X3.4), and > result in a true interoperability problem, which is what I am > reporting. Now I wanted to look up something on that ANSI standard and googling for it, I happen to find this one : "http://www.itl.nist.gov/fipspubs/33fipwd.htm" This document states that the FIPS 1-2 Standard publication has been withdrawn. Now I'm not quite sure what this means, but it could mean that ANSI X3.4 has been obsoleted and is of no concern any longer. It says : "These thirty-three FIPS are being withdrawn because they are obsolete, or have not been updated to adopt current voluntary industry standards. " So if I understand that right, this means all your argumentation was based on too old a fundament. > Interpretations that ignore the "user's terminal" aspect or that > equate "textual" == "binary" are not in the spirit of what NNTP > was designed to accomplish. But NNTP defines textual. The interpretation of a special char happens in your program, not in NNTP. Your terminal (console) can without any problem show 1Ah, your filter program in your pipe-chain can't. Why? Because it makes an interpretation where it should not. Replace it and all will be fine. -- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Re: NNTP and YENC
Author: Bart Crane
Date: Wed, 15 Jan 2003 01:14
Date: Wed, 15 Jan 2003 01:14
70 lines
4101 bytes
4101 bytes
Russ Allbery <rra@stanford.edu> wrote in message news:ylvg0r9ssr.fsf@windlord.stanford.edu... > Bart Crane <bcrane@iready.com> writes: > > > Thanks for the conversation, but I must say that you and just about > > everyone else here seems absolutely determined to ensure that only > > Unix-based systems are allowed to process NNTP data using > > text-processing utilities. > > In all the time that you've been spending posting to this group on this > topic, you could have followed the multiple posts of advice made around > the time that you first brought up this issue and installed one of the > many sets of text-processing utilities for DOS that have no problems with > Ctrl-Z. My grep has a special option to write matching lines to one file, and non-matching lines to another file, as well as other options, and they use a special regexp package I wrote many years ago, that is especially compatible with how DOS expands wildcards. Scripts are built using these programs. A simple drop-in replacement of a new sed-workalike is not necessarily a simple, no-coding-required, option. I can not install a binary-to-text filter at the front of the pipeline without including the decoder logic, so that the proper context is known so as to escape 1Ah properly, so the rest of the pipeline works. But, then the decoder has to be kept up-to-date for every new protocol, else the same problem results. Alternatively, YENC could include 1Ah as a Critical Character, then everything is restored to normal. I could also run my existing software such that each article is redirected to a separate file. Then, if an article contained the End Of File character, only that file would be affected. The process-startup costs would be in the background, so that would not affect processing much. I worry about the nntp-server, though... that is a lot of socket connect/disconnects. > > At this point, I fear that my response to your messages is basically "no > sympathy for self-inflicted wounds." Compatibility with other operating-system's definition of "textual matter" may not be important to you, but it was to the authors of RFC 977, which is why they included the phrase that the data is "usually to be displayed on the user's terminal." You seem to claim that the nntp authors had no foresight at all with respect to portably processing data across computers with different operating systems, even though they reference in RFC 977 Section 1 that this is a major reason for introducing NNTP, as opposed to using a distributed filesystem. If these wounds are self-inflicted, they took almost 15 years to start hurting!! > > -- > 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
Author: Russ Allbery
Date: Wed, 15 Jan 2003 01:23
Date: Wed, 15 Jan 2003 01:23
46 lines
3578 bytes
3578 bytes
Bart Crane <bcrane@iready.com> writes:
> My grep has a special option to write matching lines to one file, and
> non-matching lines to another file, as well as other options, and they
> use a special regexp package I wrote many years ago, that is especially
> compatible with how DOS expands wildcards. Scripts are built using
> these programs.
Ah, I understand now. You're using old software you wrote yourself,
rather than using various standard tools (which is what I'd thought from
your previous messages).
> You seem to claim that the nntp authors had no foresight at all with
> respect to portably processing data across computers with different
> operating systems, even though they reference in RFC 977 Section 1 that
> this is a major reason for introducing NNTP, as opposed to using a
> distributed filesystem.
As far as I can remember, you are the only person using DOS who has ever
had a problem with this of sufficient magnitude that they brought it up on
this newsgroup. I've only been reading the group for a few years, and
certainly my memory isn't perfect, but I think the available evidence
seems to point to the idea that you're doing something fairly unique and
that the general portability of the protocol is not particularly
compromised.
In any event, I really don't personally care whether yEnc escapes Ctrl-Z
or not, as I don't use that encoding mechanism personally and it seems to
make very little difference to the server whether it does or not.
However, I'm sure that it's not the only problem that you'll encounter,
and I expect that your problems will increase as time goes on and Usenet
moves closer and closer to being binary-clean. I *do* care about
binary-clean Usenet servers and will attempt to support NUL in articles in
INN as soon as we clean up the code sufficiently as to make that possible
because I believe that's simply the right thing to do.
Anyone running INN is of course welcome and indeed encouraged to enforce
whatever posting restrictions they personally believe in using one of the
many embedded filtering options available.
--
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
Author: Bart Crane
Date: Wed, 15 Jan 2003 02:20
Date: Wed, 15 Jan 2003 02:20
290 lines
12446 bytes
12446 bytes
Rene <invalid@email.addr> wrote in message news:20030114193303.623$hA@newsreader.com... > "Bart Crane" <bcrane@iready.com> wrote: > > Sorry for not answering your message specifically, but in another > > response I refer to ANSI X3.4, which excludes 00h..1Fh as > > control-codes. > > Yes, I've read through that. I do not deny that ANSI does declare them as > control chars. > > > The NNTP spec specifically states that Response Data is "textual", > > and is "usually displayed on the user's terminal." Thus, ANSI X3.4 > > is relevant, as it defines a standard upon which terminal devices can > > be made compatible across operating systems. > > No that's an jump to a conclusion on your part. I don't see why "textual" > automatically means this must be ANSI X3.4. RFC 977 references RFC 822 which references ANSI X3.4. The conclusion is valid if and only if ANSI-compatibility is important to the clients being served by the nntp-server. (If none of the clients were ANSI-compatible, then the relevant spec would be something else appropriate to those clients.) Being ANSI-compatible has some marvelous benefits, one of which is the ability to write portable text-processing utilities in C that work on any operating system with an appropriate runtime library. This is, of course, exactly my complaint. That an ANSI- compatible operating system with an ANSI-compatible C- compiler is producing different results than the exact same source code would produce on a Unix computer. > In the very same RFC which says > textual, they also defined text - in clear contradiction to ANSI X3.4. What > does that mean? All values defined in each that are not in violation of the other make up the set of values that are allowed. > > Either they overlooked that - a mistake or they understand something other > in textual than you do. Also, in 1982 and before, there was not a lot of awareness with respect to "r" vs. "rb" modes, because C was just breaking out of the unix-only domain. This is not a DOS-specific thing. The International Standards Organization has blessed the concept and made "text-mode" a formal part of C. > > In any case, RFC 977 defines what they mean with text. They have provided > EBNF-formulas (extended backus naur') which exactly define what is valid > for text, headers, etc. I do not find any such in RFC 977, just references to RFCs 822, 850, 793 and 821. An important distinction to make is that while 822 and 821 define the format of "messages", 977 defines a format for the "transport" of those messages. RFC 977 defines how these messages are to be transported: using only the low 7-bits, and excluding control-codes except as defined. The 7-bit restriction is being lifted, and while in the process of doing that, the control-code restriction was also lifted, which is the source of the incompatibility with non-Unix computers. > > > (Again, not a standards expert, I just read specs so as to build > > systems that work across operating systems and platforms.) > > Right, me neither, but that spec defines what text regarding nntp is. You > trust all your argumentation in those two words "textual matter" which is > never explained anywhere - and therefor ambigous and problematic. Yes, it is vague, and my interpretation is what I have stated. In my mind, the phrase "ANSI-compatibility" sums it all up. In my mind, it was the only way you could guarantee that data produced on one computer could be processed on another. The fopen "r" mode was added to C specifically for this reason. > > > > Meaning anything exluding 00h, 0Ah and 0Dh (up to 127dec). Again, this > > > explicitly *includes* 1Ah. This defines *text* not binary data. > > > > Then this protocol is not compatible with operating systems that > > use ANSI-defined control-codes for text-mode streams, but > > which would be somewhat problematic for legacy applications > > that presume a 1-byte character-set!!! > > Right. This is a problem for systems that can't cope with it. You > apparently have one such. Now who was first, the spec or your system/tools > ? The ANSI spec was first, my tools were second, new multi-byte character set protocols third. > > > Note that Section 5 has this interesting wording: > > > > "5. Security Considerations > > > > Care needs to be taken when displaying messages on a terminal or > > terminal emulator. Powerful terminals may act on escape sequences > > and other combinations of ASCII control characters with a variety of > > consequences. They can remap the keyboard or permit other > > modifications to the terminal which could lead to denial of service > > or even damaged data. They can trigger (sometimes programmable) > > answerback messages which can allow a message to cause commands to be > > issued on the recipient's behalf. They can also effect the operation > > of terminal attached devices such as printers. Message viewers may > > wish to strip potentially dangerous terminal escape sequences from > > the message prior to display. " > > > > This is my position exactly. Contrasting the NNTP author's statement > > that the nntp response data is usually "displayed on the user's terminal" > > with that statement above. > > Right, and I dont disagree with it either. "Care needs to be taken when..." > This care needs to be taken by *your system* or *your tools* not by the > standard. In this case, there is nothing I can do about 1Ah. When the C runtime library encounters it, it means End Of File, no matter how much data remains to process. If I were to install a binary-to-text filter, it would need all the intelligence of the decoder to know exactly what to convert the 1Ah to, depending on if the 1Ah appears in the middle of a YENC-encoded data block, or some other newly introduced protocol. Any nntp-server operator could choose to on enforce the spec, and allow clients to post "terminal bombs". Or, an nntp-server operator could choose to enforce the spec, and disallow clients from posting articles that contain "terminal bombs". > The standard has no power to control what any system anywhere > actually does - therefor to remain fully functional, a programmer of any > tool on such a plattform has to take care that it still works - that's how > I read this paragraph. As above, I can not escape 1Ah without knowing the context of the data in which it appears, and any new encoding format can be used, which will affect the entire pipeline, not just the article using the new encoding format. > > As has been already pointed out to you earlier in this thread, you could > include a wrapper which somehow escapes out the 1Ah code and re-injects > them later, after the critical, non-coping program in your filter chain is > through with it. That's what I read as "Message viewers may wish to strip > potentially dangerous terminal escape sequences from the message prior to > display." from above quote. Oh, sorry, I described this above. I could write a stupid filter that just assumes any 1Ah is the result of being YENC-encoded, and just apply the YENC- escape. But, what if it is not YENC-encoded? Then I would apply the wrong escape, and the data would be corrupted. Alternatively, what if I am reading from a device that actually uses CTRL-Z to mean End Of File? In which case, my filter would attempt to continue reading, and hang. This is not about DOS being broken. This is all about the need for "text-" vs. "binary-" streams. There is a reason for fopen() "r" vs. "rb". And, some of these protocols were documenting the existing practice, which, in some cases, were never run on anything but Unix machines. Thus, references that say a text-character is any-character is a hold-over from those days, because on Unix, "r" == "rb". On computers where "r" != "rb", you can be sure that not any-character is a text-character. > > NNTP is clearly no message viewer, its a transport system (that's even in > the name). Your filter chain qualifies as message viewer though. True. The nntp-spec does not require nntp-server operators to ensure that the data it is transporting does not violate any device- specific restrictions. On the other hand, it does not deny that, either. I had asked the author of YENC to please include 1Ah as a Critical Character, I had asked a vendor of newsposting software to voluntarily do this. When the "cooperative client" approach failed, I asked about this "server enforcement" approach. The fact is that people are sending the equivalent of DOS text-bombs, and it is disrupting processing of systems based on published standards. > > > > So you see, both RFC 2822 AND 822 explicitly define the char 1Ah as > > > text. If you or your OS or your tools can't cope with them, they are in > > > error. > > > > Values between 00h..1Fh may be compatible with one aspect > > of the spec, but they are invalid with another (ANSI X3.4), and > > result in a true interoperability problem, which is what I am > > reporting. > > Now I wanted to look up something on that ANSI standard and googling for > it, I happen to find this one : > "http://www.itl.nist.gov/fipspubs/33fipwd.htm" This document states that > the FIPS 1-2 Standard publication has been withdrawn. > > Now I'm not quite sure what this means, but it could mean that ANSI X3.4 > has been obsoleted and is of no concern any longer. It says : "These > thirty-three FIPS are being withdrawn because they are obsolete, or have > not been updated to adopt current voluntary industry standards. " > > So if I understand that right, this means all your argumentation was based > on too old a fundament. I fully expect my system to be incompatible with protocols developed in the new international, multi-byte, character-set paradigm. > > > Interpretations that ignore the "user's terminal" aspect or that > > equate "textual" == "binary" are not in the spirit of what NNTP > > was designed to accomplish. > > But NNTP defines textual. The interpretation of a special char happens in > your program, not in NNTP. > Your terminal (console) can without any problem > show 1Ah, your filter program in your pipe-chain can't. Why? Because it > makes an interpretation where it should not. Replace it and all will be > fine. RFC 977 Section 1 defines why NNTP was proposed, precisely because (an alternative) was not suitable for use with clients using different operating systems. The interpretation that 1Ah is a textual character is not in keeping with the intent of NNTP, because it results in aborted processing on one of those different operating systems. Thanks for your input. Bart. > > -- > -------------------- http://NewsReader.Com/ -------------------- > Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Re: NNTP and YENC
Author: Jeremy
Date: Wed, 15 Jan 2003 04:45
Date: Wed, 15 Jan 2003 04:45
33 lines
2277 bytes
2277 bytes
Bart Crane <bcrane@iready.com> wrote: >> NNTP data has never been compatible with this, it's just that you >> didn't encounter the incompatibility until now. > > NNTP has always been compatible in this way. Why do you think > uuencode was made to produce only printable characters? No, NNTP has *never* been compatible in this way. People were free to include control-Z in articles a decade ago just as they are now. > There is no design that circumvents this problem. > > The problem is that a filter designed to process the data specifically > to ensure that "no bad stuff" gets through stops on End Of File when > 1Ah is encountered. So tell it not to. It's a silly thing in the first place; it's historical and it just doesn't matter anymore. Open your streams in binary mode. > It all seems like a no-brainer to me, text- vs. binary-streams > and all, but if you want to say that 1Ah is a perfectly valid text- > character on DOS because it is on Unix, you can say that!!! It's a perfectly valid character for an NNTP datastream. It's up to you to make whatever you're using to process it can handle it. Making NNTP datastreams compatible with DOS text streams simply is not going to be a design goal. That NNTP datastreams are mostly compatible with Unix text utilities is a happy coincidence. -- Jeremy | jeremy@exit109.com
Re: NNTP and YENC
Author: George Ruof
Date: Wed, 15 Jan 2003 04:59
Date: Wed, 15 Jan 2003 04:59
115 lines
4853 bytes
4853 bytes
"Bart Crane" <bcrane@iready.com> wrote:
>My grep has a special option to write matching lines to one
>file, and non-matching lines to another file, as well as other
>options, and they use a special regexp package I wrote
>many years ago, that is especially compatible with how DOS
>expands wildcards. Scripts are built using these programs.
>A simple drop-in replacement of a new sed-workalike is not
>necessarily a simple, no-coding-required, option.
>
>I can not install a binary-to-text filter at the front of the
>pipeline without including the decoder logic, so that the
>proper context is known so as to escape 1Ah properly,
>so the rest of the pipeline works. But, then the decoder
>has to be kept up-to-date for every new protocol, else the
>same problem results.
>
>Alternatively, YENC could include 1Ah as a Critical
>Character, then everything is restored to normal.
>
>I could also run my existing software such that each article
>is redirected to a separate file. Then, if an article contained
>the End Of File character, only that file would be affected.
>The process-startup costs would be in the background, so
>that would not affect processing much. I worry about the
>nntp-server, though... that is a lot of socket connect/disconnects.
Did you even try to solve this problem on your own? I assume you can
still compile your tools since you said you wrote them initially.
Here's an example of how to put stdin into binary mode and still detect
EOF when the end of the physical file is reached. Works on Windows XP
and although I didn't test it on Unix I don't see any reason it wouldn't
work there too.
>//spew.cpp
>#include <stdio.h>
>#include <string.h>
>#include <fcntl.h>
>#include <io.h>
>
>const char* line1 = "This is a test of reading binary data from stdin.\n";
>const char* line2 = "This line contains an embedded CTRL-Z (0x1a) character here >";
>const char* line3 = "<\nIf you're reading this line it read past the EOF character.\n";
>const char eofchar = 0x1a;
>
>int main(int argc, char* argv[])
>{
> if(argc == 1)
> {
> printf("usage: 'spew f' to create test.txt file containing an embedded ctrl-z.\n");
> printf(" 'spew t < test.txt' to read test.txt in text mode.\n");
> printf(" 'spew b < test.txt' to read test.txt in binary mode.\n");
> return 0;
> }
>
> if(argc > 1 && argv[1][0] == 'f')
> {
> FILE* f = fopen("test.txt", "wb" );
> if(f)
> {
> fprintf(f, "%s%s%c%s", line1, line2, eofchar, line3 );
> fclose(f);
> }
> return 0;
> }
>
> if(argc > 1 && argv[1][0] == 'b')
> {
> int result = _setmode(_fileno( stdin ), _O_BINARY);
> if(result == -1)
> {
> perror("Cannot set mode");
> }
> else
> {
> printf("'stdin' successfully changed to binary mode\n");
> }
> }
> else if(argc > 1 && argv[1][0] == 't')
> {
> int result = _setmode(_fileno( stdin ), _O_TEXT);
> if(result == -1)
> {
> perror("Cannot set mode");
> }
> else
> {
> printf("'stdin' successfully changed to text mode\n");
> }
> }
> char buffer[1024];
> while(!feof(stdin))
> {
> memset(buffer, 0, sizeof buffer );
> fgets(buffer, sizeof buffer, stdin);
> if( buffer )
> {
> fputs(buffer, stdout);
> }
> }
> return 0;
>}
Have fun.
--
George Ruof
gruof@pacificnet.net
Re: NNTP and YENC
Author: Claus Färber
Date: Fri, 17 Jan 2003 01:44
Date: Fri, 17 Jan 2003 01:44
12 lines
1520 bytes
1520 bytes
Jeffrey M. Vinocur <jeff@litech.org> schrieb/wrote: > If you want a reference for article content, you may as well use the > latest USEFOR draft. It's not a standard yet, but it's going to be... It's very unlikely that the USEFOR draft will ever become a standard. Especially the part that mandates UTF-8 will probably not pass the IESG. Claus -- ------------------------ http://www.faerber.muc.de/ ------------------------ OpenPGP: DSS 1024/639680F0 E7A8 AADB 6C8A 2450 67EA AF68 48A5 0E63 6396 80F0
Page 3 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