mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 00:36:10 +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 = open(metaPath, 'w')
|
||||||
metaFile.write(xmlpretty.decode())
|
metaFile.write(xmlpretty.decode())
|
||||||
metaFile.close()
|
metaFile.close()
|
||||||
os.chmod(metaPath, 0o777)
|
os.chmod(metaPath, 0o600)
|
||||||
|
|
||||||
## meta generated
|
## meta generated
|
||||||
|
|
||||||
@@ -2023,6 +2023,9 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
|
|||||||
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, status)
|
command = 'chown %s:%s %s' % (website.externalApp, website.externalApp, status)
|
||||||
ProcessUtilities.executioner(command)
|
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 = "sudo nice -n 10 /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/backupUtilities.py"
|
||||||
execPath = execPath + " startBackup --tempStoragePath " + tempStoragePath + " --backupName " \
|
execPath = execPath + " startBackup --tempStoragePath " + tempStoragePath + " --backupName " \
|
||||||
+ backupName + " --backupPath " + backupPath + ' --backupDomain ' + backupDomain + ' --metaPath %s' % (
|
+ backupName + " --backupPath " + backupPath + ' --backupDomain ' + backupDomain + ' --metaPath %s' % (
|
||||||
@@ -2039,6 +2042,9 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
|
|||||||
|
|
||||||
## Backing up databases
|
## Backing up databases
|
||||||
|
|
||||||
|
command = 'chown cyberpanel:cyberpanel %s' % (result[2])
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
backupMetaData = ElementTree.parse(result[2])
|
backupMetaData = ElementTree.parse(result[2])
|
||||||
|
|
||||||
databases = backupMetaData.findall('Databases/database')
|
databases = backupMetaData.findall('Databases/database')
|
||||||
|
|||||||
Reference in New Issue
Block a user