cvs commit: src/sys/fs/devfs devfs_vnops.c

Ed Schouten ed at
Sat May 31 14:06:45 UTC 2008

ed          2008-05-31 14:06:44 UTC

  FreeBSD src repository

  Modified files:
    sys/fs/devfs         devfs_vnops.c 
  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

More information about the cvs-src mailing list