All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Howard Chu <hyc@symas.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Jiri Slaby <jslaby@suse.cz>,
	Linux Kernel Mailing List <Linux-Kernel@vger.kernel.org>,
	linux-serial@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>
Subject: Re: [PATCH] n_tty: Remove LINEMODE support
Date: Tue, 20 Jan 2015 13:02:40 -0500	[thread overview]
Message-ID: <54BE9840.8080808@hurleysoftware.com> (raw)
In-Reply-To: <54BD5E54.3050909@symas.com>

On 01/19/2015 02:43 PM, Howard Chu wrote:
> Peter Hurley wrote:
>> On 01/19/2015 11:36 AM, Howard Chu wrote:
>>> Peter Hurley wrote:
>>>> On 01/19/2015 07:46 AM, Howard Chu wrote:
>>>>> Peter Hurley wrote:

[...]

>>>> Which brings up another point: only a pty master should be able to set EXTPROC
>>>> mode. Right now, any tty can be set to EXTPROC and the pty slave can even
>>>> accidentally unset it. This argues for a new pty ioctl() to set EXTPROC in
>>>> termios. pty_set_termios() can silently merge the bit.
>>>
>>> Historically EXTPROC could also be set on regular ttys, for lines that were hooked up to special terminal interfaces. E.g. X.29 PADs that did their own input processing. I'm not sure how relevant this is now, but this is the reason EXTPROC is not a pty-specific ioctl.
>>
>> How does the remote end find out when non-canon mode is selected?
>> And who does the EXTPROC setting, because if it's the program that opened the
>> tty, then it can just select raw mode instead.
> 
> There's a few significant differences in semantics between raw mode and EXTPROC mode.

Sorry, I have this unfortunate habit of referring to non-canonical modes
as 'raw' (which stems from the way the terminal driver handles input).

> The point of EXTPROC is to maintain the tty driver state as if cooked mode were still in effect. One obvious difference is that VMIN/VTIME are overlaid on VEOL/VEOF in raw mode

Not in Linux; these are different c_cc[] slots.

> , so the two are not directly interchangeable.
> 
> The fact that EXTPROC can be manually unset is by design. Quoting from the original again:
> 
>> stty.diff:
>>     This file contains the changes needed for the stty(1) program
>>     to report on the current status of the TS_EXTPROC bit.  It also
>>     allows the user to turn on/off the TS_EXTPROC bit.  This is useful
>>     because it allows the user to say "stty -extproc", and the
>>     LINEMODE option will be automatically disabled, and saying "stty
>>     extproc" will re-enable the LINEMODE option.

This option is not supported by gnu coreutils.

So it's really back to the question of, does allowing EXTPROC for regular
ttys have _value_?


>>>>>> 6. EXTPROC still does some input processing on the server. For example,
>>>>>>       7-bit mode (ISTRIP), tolower mode (IUCLC) and processing while
>>>>>>       closing; if input processing is being done on the local/client side,
>>>>>>       why the extra work here?
>>>>>
>>>>> That's defensive, on the assumption that something else might break if e.g. the tty expected only 7-bit input but 8-bit characters were sent to it.
>>>>
>>>> Ok, is that because RFC 1116 doesn't specify ISTRIP and IUCLC handling so
>>>> the server can't be sure the client did it? If so, that should be documented
>>>> so that refactors don't remove that handling.
>>
>> Could you get back to me about this, as well?
> 
> The telnet protocol (RFC854) defines a Network Virtual Terminal (NVT) as using 7-bit USASCII in an 8-bit field. As such, it expects the client to be able to generate both upper and lower case itself, so there's no analogue to IUCLC, and there would be no reason to use ISTRIP.
> 
> RFC5198 updates the protocols to use UTF8. So again, it assumes full octets are being transmitted.
> 
> Perhaps we can drop these special cases from the driver.

I don't mind leaving it in, but without comments it looks like a
refactoring error.

Regards,
Peter Hurley


  reply	other threads:[~2015-01-20 18:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 21:30 [PATCH] n_tty: Remove LINEMODE support Peter Hurley
2015-01-18 22:09 ` Howard Chu
2015-01-18 22:22   ` Peter Hurley
2015-01-18 22:44     ` Howard Chu
2015-01-18 23:06       ` Peter Hurley
2015-01-19  4:55         ` Theodore Ts'o
2015-01-19 16:34           ` Peter Hurley
     [not found] ` <54BC3771.7030204@symas.com>
     [not found]   ` <54BC5EC7.1090202@hurleysoftware.com>
2015-01-19 12:46     ` Howard Chu
2015-01-19 14:57       ` Peter Hurley
2015-01-19 16:36         ` Howard Chu
2015-01-19 19:09           ` Peter Hurley
2015-01-19 19:43             ` Howard Chu
2015-01-20 18:02               ` Peter Hurley [this message]
2015-01-20 18:39                 ` Howard Chu
2015-01-20 18:51                   ` Howard Chu
2015-01-20 19:08                   ` Peter Hurley
2015-01-20 18:16               ` Peter Hurley
2015-01-19 20:31             ` Howard Chu
2015-01-20 14:53               ` Peter Hurley
2015-01-20 17:20                 ` Peter Hurley
2015-01-19 19:40           ` Peter Hurley
2015-01-19 16:37         ` Theodore Ts'o
2015-01-19 17:26           ` Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BE9840.8080808@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=Linux-Kernel@vger.kernel.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hyc@symas.com \
    --cc=jslaby@suse.cz \
    --cc=linux-serial@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.