Set tty ownership on pty open (temporary until devfs is integrated)
Fix a very long standing issue when opening new pty's as non-root. The
related tty could not be chowned/chmoded in that case, giving any user
in the system access to the pty.
This would not effect programs like sshd which set up the pty as root, but
it did effect programs like xterm which do not run suid-root.
This is strictly a temporary fix until devfs can be integrated into the
system. Basically we allow the uid stored in the cdev_t structure to
override the uid returned by VOP_GETATTR for VCHR devices, and the chmod
helper function checks the uid stored in the cdev_t structure for
compatibility.
Reported-by: Hasso Tepper <hasso@estpak.ee>, Numerous others