From owner-cvs-all@FreeBSD.ORG Sat May 31 14:06:45 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ADB41065743; Sat, 31 May 2008 14:06:45 +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 007AA8FC16; Sat, 31 May 2008 14:06:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4VE6ioV013007; Sat, 31 May 2008 14:06:44 GMT (envelope-from ed@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4VE6iJJ013006; Sat, 31 May 2008 14:06:44 GMT (envelope-from ed@repoman.freebsd.org) Message-Id: <200805311406.m4VE6iJJ013006@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ed@repoman.freebsd.org using -f From: Ed Schouten Date: Sat, 31 May 2008 14:06:37 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/fs/devfs devfs_vnops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2008 14:06:45 -0000 ed 2008-05-31 14:06:44 UTC FreeBSD src repository Modified files: sys/fs/devfs devfs_vnops.c Log: SVN rev 179457 on 2008-05-31 14:06:37Z by ed Merge back devfs changes from the mpsafetty branch. In the mpsafetty branch, PTY's are allocated through the posix_openpt() system call. The controller side of a PTY now uses its own file descriptor type (just like sockets, vnodes, pipes, etc). To remain compatible with existing FreeBSD and Linux C libraries, we can still create PTY's by opening /dev/ptmx or /dev/ptyXX. These nodes implement d_fdopen(). Devfs has been slightly changed here, to allow finit() to be called from d_fdopen(). The routine grantpt() has also been moved into the kernel. This routine is a little odd, because it needs to bypass standard UNIX permissions. It needs to change the owner/group/mode of the slave device node, which may often not be possible. The old implementation solved this by spawning a setuid utility. When VOP_SETATTR() is called with NOCRED, devfs_setattr() dereferences ap->a_cred, causing a kernel panic. Change the de_{uid,gid,mode} code to allow changes when a->a_cred is set to NOCRED. Approved by: philip (mentor) Revision Changes Path 1.160 +6 -6 src/sys/fs/devfs/devfs_vnops.c