mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 08:46:09 +01:00
security fix: CP-13: Admin Back Up Create Back Up
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user