/dev/tty permissions changed by login
I am using Equinox SST serial port boards on a Red Hat Enterprise 3 server. I have installed the equinox drivers, and set up the ttys in /etc/inittab with entries that look like this:
1a2:2345:respawn:/sbin/agetty 19200 ttyQ1a1 wy60
Everything works fine when you login on the serial port, and my software application also works fine. The problem is with the /dev/tty permissions for "slave" printing. My software allows for "slave" printers to be attached to the ttys so you can use the terminal, and also print through the port to an attached printer.
Before I login on any port, the permissions for the /dev/tty look like this:
crw-rw-rw- 1 root root 253, 0 Dec 9 15:33 ttyQ1a1
After I login on the port, the login program (or some other one?) changes the owner, group, and permissions on the /dev/tty file. For example, if I am user "dog" then the /dev/tty file I login on looks like this after I login:
crw--w---- 1 dog tty 253, 0 Dec 21 08:33 ttyQ1a1
Notice that the owner becomes "dog", group gets changed to "tty" and the permissions are restricted. This is a problem since any other user wishing to print to the attached printer on this tty gets a permission denied error. Well, I solved that by adding the group "tty" to all my users so that while someone is logged in it works.
The real problem though is when I log off. The /dev/tty file gets changed again to :
crw------- 1 root root 253, 0 Dec 21 08:33 ttyQ1a1
Now I am really stuck since only root can use the port. Id there any way to get login, or whatever is changing these permissions to leave things alone? Or at least put things back the way they were:
crw-rw-rw- 1 root root 253, 0 Dec 9 15:33 ttyQ1a1
Thanks for your help to a newbie!
|