From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 5 11:10:25 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC69E16A4E7 for ; Wed, 5 Jul 2006 11:10:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E620443D55 for ; Wed, 5 Jul 2006 11:10:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k65BAON9078657 for ; Wed, 5 Jul 2006 11:10:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k65BAOQu078656; Wed, 5 Jul 2006 11:10:24 GMT (envelope-from gnats) Date: Wed, 5 Jul 2006 11:10:24 GMT Message-Id: <200607051110.k65BAOQu078656@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Robert Watson Cc: Subject: Re: kern/99758: chown/chmod pty slave side in kernel X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Robert Watson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jul 2006 11:10:25 -0000 The following reply was made to PR kern/99758; it has been noted by GNATS. From: Robert Watson To: Atsuo Ohki Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@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