From fd82b81b33d80c3e0f77f46ea119dca63176f91c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 29 Jul 2021 13:06:20 +0500 Subject: [PATCH] security fix: CP-01: Installation --- install/install.py | 7 +++++-- plogical/upgrade.py | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install/install.py b/install/install.py index f4be7829a..a26b2dbc4 100755 --- a/install/install.py +++ b/install/install.py @@ -652,6 +652,9 @@ class preFlightsChecks: rainloopinipath = '/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini' + command = 'chmod 600 /usr/local/CyberCP/public/rainloop.php' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + ### def install_unzip(self): @@ -2289,8 +2292,6 @@ def main(): if args.redis != None: checks.installRedis() - checks.fixCyberPanelPermissions() - if args.postfix != None: checks.enableDisableEmail(args.postfix.lower()) else: @@ -2350,6 +2351,8 @@ echo $oConfig->Save() ? 'Done' : 'Error'; except: pass + checks.fixCyberPanelPermissions() + logging.InstallLog.writeToFile("CyberPanel installation successfully completed!,80") diff --git a/plogical/upgrade.py b/plogical/upgrade.py index b18a5afdd..c5ea437cc 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2070,6 +2070,9 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php' Upgrade.executioner(command, 0) + command = 'chmod 600 /usr/local/CyberCP/public/rainloop.php' + Upgrade.executioner(command, 0) + Upgrade.stdOut("Permissions updated.") except BaseException as msg: