util: Change the /tmp/printer pty to be group readable

For some reason, Linux creates the pseudo tty with group writable
permissions, but not group readable.  Use chmod to allow the device to
also be group readable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-05-16 13:25:21 -04:00
parent 3505a0727d
commit c331406774
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@ def create_pty(ptyname):
os.unlink(ptyname)
except os.error:
pass
os.symlink(os.ttyname(sfd), ptyname)
filename = os.ttyname(sfd)
os.chmod(filename, 0660)
os.symlink(filename, ptyname)
set_nonblock(mfd)
old = termios.tcgetattr(mfd)
old[3] = old[3] & ~termios.ECHO