ioctl_tty.2: Tweaks to Aleksa Sarai's patch

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-15 21:24:06 +02:00
parent 0ec74af9db
commit 91e34595bc
1 changed files with 15 additions and 8 deletions

View File

@ -382,19 +382,26 @@ in the location pointed to by
(since Linux 3.8).
.TP
.BI "TIOCGPTPEER int " flags
Opens and returns a new file handle to the pseudoterminal slave
device with the given
.\" commit 54ebbfb1603415d9953c150535850d30609ef077
(since Linux 4.13)
Given a file descriptor in
.I fd
that refers to a pseudoterminal master,
open (with the given
.BR open (2)-style
.IR flags ,
regardless of whether the path is accessible through the calling process's
mount namespaces.
.IR flags )
and return a new file descriptor that refers to the peer
pseudoterminal slave device.
This operation can be performed
regardless of whether the pathname of the slave device
is accessible through the calling process's mount namespaces.
Security-conscious programs interacting with namespaces may wish to use this
over
operation rather than
.BR open (2)
with the path provided by
with the pathname returned by
.BR ptsname (3),
and similar library methods that have insecure APIs (since Linux 4.13).
and similar library functions that have insecure APIs.
.PP
The BSD ioctls
.BR TIOCSTOP ,