From c331406774715c13a556cd7f402165b516468429 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 16 May 2018 13:25:21 -0400 Subject: [PATCH] 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 --- klippy/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klippy/util.py b/klippy/util.py index 03c2083d..86f42246 100644 --- a/klippy/util.py +++ b/klippy/util.py @@ -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