mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 23:36:11 +01:00
security fix: CP-26: Manage Website – File Manager – Upload
This commit is contained in:
@@ -664,6 +664,16 @@ class preFlightsChecks:
|
|||||||
command = 'mount -o remount,rw,hidepid=2 /proc'
|
command = 'mount -o remount,rw,hidepid=2 /proc'
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
## symlink protection
|
||||||
|
|
||||||
|
writeToFile = open('/usr/lib/sysctl.d/50-default.conf', 'a')
|
||||||
|
writeToFile.writelines('fs.protected_hardlinks = 1\n')
|
||||||
|
writeToFile.writelines('fs.protected_symlinks = 1\n')
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
command = 'sysctl --system'
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
def install_unzip(self):
|
def install_unzip(self):
|
||||||
|
|||||||
@@ -2097,6 +2097,16 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
|||||||
command = 'chmod 750 /usr/local/lsws/logs'
|
command = 'chmod 750 /usr/local/lsws/logs'
|
||||||
Upgrade.executioner(command, 0)
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
|
## symlink protection
|
||||||
|
|
||||||
|
writeToFile = open('/usr/lib/sysctl.d/50-default.conf', 'a')
|
||||||
|
writeToFile.writelines('fs.protected_hardlinks = 1\n')
|
||||||
|
writeToFile.writelines('fs.protected_symlinks = 1\n')
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
command = 'sysctl --system'
|
||||||
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
Upgrade.stdOut("Permissions updated.")
|
Upgrade.stdOut("Permissions updated.")
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
|||||||
Reference in New Issue
Block a user