HomeFreeBSD

linux(4): Check fd passed to unlockpt()

Description

linux(4): Check fd passed to unlockpt()

In our implementation, grantpt() and unlockpt() don't actually have
any use, because PTY's are created on the fly and already have proper
permissions upon creation.
Atleast check that a proper fd passed to unlockpt(). For grantpt()
Glibc calls TIOCGPTN ioctl which would fail if fd is not a master.

Differential Revision: https://reviews.freebsd.org/D40100
MFC after: 1 week

(cherry picked from commit 0f62290e7f749b7a453d413dd72c406129a9aba5)

Details

Provenance
dchaginAuthored on May 18 2023, 7:55 AM
Differential Revision
D40100: linux(4): Check fd passed to unlockpt()
Parents
rG8975a63ad5c2: ktrace: Simplify ae6ac587, drop the sa var declaration
Branches
Unknown
Tags
Unknown