From c40c452a7fdb5098cd33a34513902724544ffe74 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 28 Dec 2021 19:17:25 +0500 Subject: [PATCH] permissions fix --- install/install.py | 5 +++++ plogical/upgrade.py | 5 +++++ plogical/virtualHostUtilities.py | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/install/install.py b/install/install.py index a02b5546d..a8c19b639 100755 --- a/install/install.py +++ b/install/install.py @@ -677,6 +677,11 @@ class preFlightsChecks: command = 'chmod 700 %s' % ('/home/cyberpanel') preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + destPrivKey = "/usr/local/lscp/conf/key.pem" + + command = 'chmod 600 %s' % (destPrivKey) + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + ### def install_unzip(self): diff --git a/plogical/upgrade.py b/plogical/upgrade.py index afa822e83..2afe39a29 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2122,6 +2122,11 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'chmod 700 %s' % ('/home/cyberpanel') Upgrade.executioner(command, 0) + destPrivKey = "/usr/local/lscp/conf/key.pem" + + command = 'chmod 600 %s' % (destPrivKey) + Upgrade.executioner(command, 0) + Upgrade.stdOut("Permissions updated.") except BaseException as msg: diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index 64f59f80d..6a0cea348 100644 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -460,6 +460,10 @@ class virtualHostUtilities: return 0, retValues[1] + command = 'chmod 600 %s' % (destPrivKey) + ProcessUtilities.normalExecutioner(command) + + ## removing old certs for lscpd if os.path.exists(destPrivKey): os.remove(destPrivKey)