From 4b9b386f14d43a4154a7dbdc0738e6a550c2f459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 10 Jul 2019 11:30:04 +0200 Subject: [PATCH] fixed authorize of x2go for python2/3 compat --- .gitignore | 1 + server/src/uds/transports/X2GO/scripts/authorize.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 053d32e2..4cd2fabe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *_enterprise.* .settings/ .ipynb_checkpoints +.mypy_cache # Debian buildings *.debhelper* diff --git a/server/src/uds/transports/X2GO/scripts/authorize.py b/server/src/uds/transports/X2GO/scripts/authorize.py index c3be0e8a..678d77e8 100644 --- a/server/src/uds/transports/X2GO/scripts/authorize.py +++ b/server/src/uds/transports/X2GO/scripts/authorize.py @@ -29,7 +29,7 @@ def updateAuthorizedKeys(user, pubKey): sshFolder = '{}/.ssh'.format(home) if not os.path.exists(sshFolder): try: - os.makedirs(sshFolder, 0700) + os.makedirs(sshFolder, 0o700) os.chown(sshFolder, uid, -1) except OSError as e: if e.errno != errno.EEXIST: @@ -53,7 +53,7 @@ def updateAuthorizedKeys(user, pubKey): # Ensure access is correct os.chown(authorizedKeys, uid, -1) - os.chmod(authorizedKeys, 0600) + os.chmod(authorizedKeys, 0o600) # Done