Correct, except that you don't really want the gid set (normally you
want gid tty). My proposal is to use the already existing
setgid-directory mechanism to remedy that problem:
drwxr-sr-x root tty /dev/pts
And have the kernel create the new entries with mode (0620 & ~umask).
> 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?
Because it's legal for chown() and chmod() to happen after the fact --
especially chmod().
> 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.
Actually, my idea was for the kernel to mknod() the devices in
/dev/pts/* as well. Yes, it is separate in some ways, but the SysV
naming scheme makes this a helluva lot more reasonable. It would also
solve the crash problem quite simply, since it would be perfectly
reasonable to do an unlink() before doing these things.
I would normally propose having a daemon do these things, but since it
is so simple, we might as well do it right in the kernel.
-hpa