kern/99758: chown/chmod pty slave side in kernel
rwatson at FreeBSD.org
Wed Jul 5 11:08:56 UTC 2006
On Tue, 4 Jul 2006, Atsuo Ohki wrote:
> I know that the ownership and permission of the pty slave side can be
> controlled by `grantpt()' (with a set-uided helper program
> /usr/libexec/pt_chown), but all programs which manipulate control/slave pair
> of pty do not use `grantpt()'. More over, `grantpt()' leave the onwership of
> pty slave as those of user who used the slave last time.
> I though it is better to control the ownership and permission of the pty slave
> as follow:
> 1) when the control side is opened, set the ownership of the corresponding
> slave to those who opend the control side, and the permission as 0620.
> 2) when the control side is closed, restore the ownership/permission of the
> corresponding slave to root/wheel, 0666.
> Included patch modifies kern/tty_pty.c, fs/devfs/devfs_devs.c,
The tty_pts implementation in 7-CURRENT does the same, except more so, by
forcing revocation of the pty on last close. Unfortunately, this triggers
bugs in devfs. Your help in getting the 7.x pts implementation up and running
would be much appreciated. Take a look at src/sys/kern/tty_pts.c.
Robert N M Watson
University of Cambridge
More information about the freebsd-bugs