From owner-cvs-src-old@FreeBSD.ORG Sat Dec 19 18:42:56 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D764C106566B for ; Sat, 19 Dec 2009 18:42:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C4FBE8FC08 for ; Sat, 19 Dec 2009 18:42:56 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJIguCJ031562 for ; Sat, 19 Dec 2009 18:42:56 GMT (envelope-from ed@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nBJIguZp031561 for cvs-src-old@freebsd.org; Sat, 19 Dec 2009 18:42:56 GMT (envelope-from ed@repoman.freebsd.org) Message-Id: <200912191842.nBJIguZp031561@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ed@repoman.freebsd.org using -f From: Ed Schouten Date: Sat, 19 Dec 2009 18:42:12 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/fs/devfs devfs_vnops.c src/sys/kern kern_exit.c kern_proc.c src/sys/sys proc.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 18:42:56 -0000 ed 2009-12-19 18:42:12 UTC FreeBSD src repository Modified files: sys/fs/devfs devfs_vnops.c sys/kern kern_exit.c kern_proc.c sys/sys proc.h Log: SVN rev 200732 on 2009-12-19 18:42:12Z by ed Let access overriding to TTYs depend on the cdev_priv, not the vnode. Basically this commit changes two things, which improves access to TTYs in exceptional conditions. Basically the problem was that when you ran jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if you want to attach to screens quickly, use ssh(1), etc. The fixes: - Cache the cdev_priv of the controlling TTY in struct session. Change devfs_access() to compare against the cdev_priv instead of the vnode. This allows you to bypass UNIX permissions, even across different mounts of devfs. - Extend devfs_prison_check() to unconditionally expose the device node of the controlling TTY, even if normal prison nesting rules normally don't allow this. This actually allows you to interact with this device node. To be honest, I'm not really happy with this solution. We now have to store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp). In an ideal world, we should just get rid of the latter two and only use s_ttyp, but this makes certian pieces of code very impractical (e.g. devfs, kern_exit.c). Reported by: Many people Revision Changes Path 1.182 +18 -7 src/sys/fs/devfs/devfs_vnops.c 1.333 +1 -0 src/sys/kern/kern_exit.c 1.290 +1 -0 src/sys/kern/kern_proc.c 1.541 +1 -0 src/sys/sys/proc.h