security fix: CP-13: Admin Back Up Create Back Up

This commit is contained in:
Usman Nasir
2021-08-07 14:28:10 +05:00
parent 3aa9deb112
commit 7f9f60682e

View File

@@ -291,7 +291,7 @@ class backupUtilities:
metaFile = open(metaPath, 'w')
metaFile.write(xmlpretty.decode())
metaFile.close()
os.chmod(metaPath, 0o777)
os.chmod(metaPath, 0o600)
## meta generated
@@ -2023,6 +2023,9 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, status)
ProcessUtilities.executioner(command)
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, result[2])
ProcessUtilities.executioner(command)
execPath = "sudo nice -n 10 /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
execPath = execPath + " startBackup --tempStoragePath " + tempStoragePath + " --backupName " \
+ backupName + " --backupPath " + backupPath + ' --backupDomain ' + backupDomain + ' --metaPath %s' % (
@@ -2039,6 +2042,9 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
## Backing up databases
command = 'chown cyberpanel:cyberpanel %s' % (result[2])
ProcessUtilities.executioner(command)
backupMetaData = ElementTree.parse(result[2])
databases = backupMetaData.findall('Databases/database')