DragonFly commits List (threaded) for 2009-09
DragonFly BSD
DragonFly commits List (threaded) for 2009-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: pty - Introduce unix98 ptys


From: Alex Hornung <alexh@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Sep 2009 08:06:55 -0700 (PDT)

commit c578a286621a95cbcd28c62f7583d70c9bc908b5
Author: Alex Hornung <ahornung@gmail.com>
Date:   Tue Sep 1 14:00:15 2009 +0100

    pty - Introduce unix98 ptys
    
    * Add the clone base device, /dev/ptmx.
    
    * Add TIOCISPTMASTER ioctl, which returns successfully if the
      device is a unix98 pty master.
    
    * Add sysctl kern.pty_debug, default to 0, to control pty debug
      info printing.
    
    * Remove old unix98 pty code, which was inactive and inherited
      from an initial implementation during devfs development.
    
    * Add userland functions:
      - posix_openpt (is equivalent to opening /dev/ptmx)
      - ptsname (as described in standard but thread-safe)
      - unlockpt (no op)
      - grantpt (no op)
    
    * Implement proper permissions for unix98 pty slaves.
      Set them to real uid - group "tty" - 0620 for
      the slave device, as specified in standard (for grantpt).
      Master's permissions don't matter as the device cannot be opened
      again.
      Set the permissions of the unix98 ptys to be overridable by
      setattr() as the old ptys are.
    
    * Use the define UNIX98_PTYS to activate/deactivate the unix98
      pty code in tty_pty.c. By default it is enabled.
    
    NOTE: due to the permission handling on cloning of the slave
          pty, grantpt is not needed and would only pose a security
          risk.

Summary of changes:
 include/stdlib.h                       |    8 +-
 lib/libc/gen/Makefile.inc              |    2 +-
 lib/libc/gen/{fdevname.c => ptsname.c} |   87 +++++++++------
 sys/kern/tty_pty.c                     |  186 ++++++++++++++++++++++++--------
 sys/sys/ttycom.h                       |    1 +
 5 files changed, 202 insertions(+), 82 deletions(-)
 copy lib/libc/gen/{fdevname.c => ptsname.c} (67%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c578a286621a95cbcd28c62f7583d70c9bc908b5


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]