lkml.org 
[lkml]   [1998]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: pty pairs in POSIX with devpts
Date
H. Peter Anvin writes ("Re: pty pairs in POSIX with devpts"):
> author: pjb1008@cam.ac.uk (Peter Benie)
> > To make the device safe, you still have to use vhangup(), but now you
> > have to locate the corresponding /dev/tty?? entry and chown it, even
> > though you are using SysV-style pty allocation.
> >
> > IMO, it would be sensible for slave devices in /dev/pts to have a
> > different major number so that the two allocation schemes were better
> > separated from each other.
>
> This is a very good point. Obviously you can't allocate it twice, but
> there is nastiness about having the two allocated from the same pool.
> One possibility is to remove the restriction that you need to have
> used /dev/ptmx in order for the device node to exist in /dev/pts, and
> make all the /dev/tty?? entries symlinks to /dev/pts. Does anyone
> know if that solution would work properly? I have a nasty feeling it
> wouldn't.

I quite like this solution - it means that programs using the BSD ptys
unsafely (xterm, script, emacs, etc.) start being safe without any
source changes.

The only odd effect that I can think of is that libc5 chown() probably
calls the kernel's lchown(), which means that chown() will change the
owner of the symlink, not the device. The error isn't serious provided
that the device in /dev/pts/ has the correct owner (real rather than
effective uid). Only priviledged programs will be able make this
mistake anyway so in practice you have very few programs to check.

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.031 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site