kern/99758: chown/chmod pty slave side in kernel

Robert Watson rwatson at FreeBSD.org
Wed Jul 5 11:10:25 UTC 2006


The following reply was made to PR kern/99758; it has been noted by GNATS.

From: Robert Watson <rwatson at FreeBSD.org>
To: Atsuo Ohki <ohki at gssm.otsuka.tsukuba.ac.jp>
Cc: freebsd-gnats-submit at FreeBSD.org, freebsd-bugs at FreeBSD.org
Subject: Re: kern/99758: chown/chmod pty slave side in kernel
Date: Wed, 5 Jul 2006 12:08:54 +0100 (BST)

 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, 
 > fs/devfs/devfs_vfsops.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
 Computer Laboratory
 University of Cambridge


More information about the freebsd-bugs mailing list