From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 5 11:08:56 2006 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C45816A4E2; Wed, 5 Jul 2006 11:08:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B31543D53; Wed, 5 Jul 2006 11:08:55 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 16E6946C21; Wed, 5 Jul 2006 07:08:55 -0400 (EDT) Date: Wed, 5 Jul 2006 12:08:54 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Atsuo Ohki In-Reply-To: <200607040242.k642g6BG099462@www.freebsd.org> Message-ID: <20060705120748.F18236@fledge.watson.org> References: <200607040242.k642g6BG099462@www.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org 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 List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jul 2006 11:08:56 -0000 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