fixed authorize of x2go for python2/3 compat

This commit is contained in:
Adolfo Gómez García 2019-07-10 11:30:04 +02:00
parent 8a61986dad
commit 4b9b386f14
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
*_enterprise.*
.settings/
.ipynb_checkpoints
.mypy_cache
# Debian buildings
*.debhelper*

View File

@ -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