Re: ptsname() support (new ptys)

C. Scott Ananian (cananian@lcs.mit.edu)
Thu, 15 Jan 1998 04:06:08 -0500 (EST)


On Thu, 15 Jan 1998, H. Peter Anvin wrote:

> I don't see any major difference here, although I agree that the root
> of the name should be configurable, presumably via sysctl. The reason
> to put it in the kernel is that it is (a) fairly trivial and (b) a
> permissions issue.

So the first open of a pty slave would set its uid/gid to that of the
opening process (mode rw user), and a close would reset it? [a crash could
leave the pty unusable to all but one user, but we'll let that pass]. We
don't have to worry about pty master permissions, because the kernel only
allows one open on them anyway.

If this is what you want, there's no need to resort to disk accesses. Why
not add a UID field in the pty slave information structure, and disallow
opens on an already-open device unless the UIDs match. Why touch the
disk?

I'll add this support if people really want it -- Peter is right, it's
trivial -- but it's entirely separate from the /dev/ptmx code.

--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian