public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: linux-man@vger.kernel.org, Jakub Wilk <jwilk@jwilk.net>,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>
Subject: Re: [PATCH v4] grantpt.3: no-op on modern glibc and other UNIXes
Date: Sun, 16 Jul 2023 03:09:03 +0200	[thread overview]
Message-ID: <062f90e1-25e1-295f-9c58-31c8da7b8f24@kernel.org> (raw)
In-Reply-To: <prx5h5lm7gnytjwm3jgmm2d5vrg3xgdnxssocx2gplcubexvf7@fkdavhrtedoo>


[-- Attachment #1.1: Type: text/plain, Size: 4298 bytes --]

Hi!

On 2023-07-15 20:49, наб wrote:
> FreeBSD, OpenBSD, and Linux (/dev/ptmx) do all intialisation in open(2),
> and grantpt(3) is a no-op (that checks whether the fd is a pty, except on
> musl).
> 
> The illumos gate and NetBSD do a ioctl (and, indeed, illumos-gate commit
>  facf4a8d7b59fde89a8662b4f4c73a758e6c402c ("PSARC/2003/246 Filesystem
>   Driven Device Naming"), which kills pt_chmod, notes that it's been
>  "6464196 bfu should remove pt_chmod, obsoleted by /dev filesystem").
> 
> glibc 2.33 completely kills BSD PTY support on Linux
> (Debian hasn't configured with them on any architecture since 2007:
>    https://bugs.debian.org/338404
>  and even earlier on some arches; they're really just trivia under
>  Linux ‒ this may be better served stuffed into HISTORY as an explainer
>  for the SIGCHLD thing, since regardless of the "version", the behaviour
>  is well-defined and consistent).
> 
> Cc: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
>> The illumos gate and NetBSD do a ioctl (and, indeed, illumos-gate commit
> paren level 1
>   v
>>  facf4a8d7b59fde89a8662b4f4c73a758e6c402c ("PSARC/2003/246 Filesystem
> paren level 2
>    v
>>   Driven Device Naming"), which kills pt_chmod, notes that it's been
> this is an in-line 2-column quote of the commit message
> (which I've misindented to 3)
>    vvv
>>     6464196 bfu should remove pt_chmod, obsoleted by /dev filesystem).
> 
> So it works by "it doesn't", it's psycho indent, probably related to
>   Date: Mon Jun 19 02:01:46 2023 +0200
> I turned the blockquote into a ""-quote, which should make more sense.

Makes sense.  Or should I say it doesn't...  :-)

Thanks!  Just a minor comment below.

> 
> Numberised open() and grantpt().
> 
>  man3/grantpt.3 | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/man3/grantpt.3 b/man3/grantpt.3
> index a19172a3e..e3d4e4aaa 100644
> --- a/man3/grantpt.3
> +++ b/man3/grantpt.3
> @@ -84,17 +84,15 @@ .SH ATTRIBUTES
>  .ad
>  .sp 1
>  .SH VERSIONS
> -Many systems implement this function via a set-user-ID helper binary
> +Historical systems implemented this function via a set-user-ID helper binary
>  called "pt_chown".
> -On Linux systems with a devpts filesystem (present since Linux 2.2),
> -the kernel normally sets the correct ownership and permissions
> -for the pseudoterminal slave when the master is opened
> -.RB ( posix_openpt (3)),
> -so that nothing must be done by
> -.BR grantpt ().
> -Thus, no such helper binary is required
> -(and indeed it is configured to be absent during the
> -glibc build that is typical on many systems).
> +glibc on Linux before glibc 2.33 could do so as well,
> +in order to support configurations with only BSD pseudoterminals;
> +this support has been removed.
> +On modern systems this is either a no-op\[em]with
> +permissions configured on pty allocation,
> +as is the case on Linux\[em]or an
> +.BR ioctl (2).

This still didn't address the following comment of mine to v2:

On 2023-07-08 17:54, Alejandro Colomar wrote:
>> +in order to support configurations with only BSD pseudoterminals;
>> +this support has been removed.
>> +On modern systems this is either a no-op\[em]with
> \[em] clearly breaks/interrupts a clause or phrase.
> Semantic newlines should apply here --I guess that you probably put the
> two words together to not add an extra space, but I do like that space
> (and I know this may be controversial)--.
> 
> Cheers,
> Alex
> 
>> +permissions configured on pty allocation,
>> +as is the case on Linux\[em]or an
>> +.BR ioctl (2).
>>   .SH STANDARDS

I wonder if you confirm your intention to have it this way, or if you
just missed that comment.  Please document your intention.  I don't feel
strong about it.  It's just that using '--' next to the "parenthesised"
part and with a space at the other side makes it more straightforward to
parse, even if some Powers might be against it.  It also fits better with
semantic newlines.

Branden, any opinion on this?

Cheers,
Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-07-16  1:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  0:14 [PATCH] grantpt.3: no-op on modern glibc and other UNIXes наб
2023-06-19  6:54 ` Jakub Wilk
2023-06-19 22:11 ` [PATCH v2] " наб
2023-07-08 15:54   ` Alejandro Colomar
2023-07-08 19:59     ` [PATCH v3] " наб
2023-07-15 13:32       ` Alejandro Colomar
2023-07-15 18:49         ` [PATCH v4] " наб
2023-07-16  1:09           ` Alejandro Colomar [this message]
2023-07-16 11:55             ` [PATCH v5] " наб
2023-07-16 13:46               ` Alejandro Colomar
2023-07-16 14:52                 ` наб
2023-07-16 15:11                   ` Alejandro Colomar
2023-07-17 23:13               ` Alejandro Colomar
2023-07-17 23:31                 ` [PATCH v6] grantpt.3: no-op on modern glibc and other UNIXes, HISTORYise наб
2023-07-18 11:42                   ` Alejandro Colomar
2023-07-18 15:07                     ` наб
2023-07-18 21:28                       ` Alejandro Colomar

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=062f90e1-25e1-295f-9c58-31c8da7b8f24@kernel.org \
    --to=alx@kernel.org \
    --cc=g.branden.robinson@gmail.com \
    --cc=jwilk@jwilk.net \
    --cc=linux-man@vger.kernel.org \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox