diff --git a/cloudAPI/cloudManager.py b/cloudAPI/cloudManager.py index 0c52e591f..43a97f86c 100755 --- a/cloudAPI/cloudManager.py +++ b/cloudAPI/cloudManager.py @@ -345,18 +345,11 @@ def statusFunc(self): try: statusFile = self.data['statusFile'] - if not statusFile.startswith('/home/cyberpanel'): - data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", } - json_data = json.dumps(data_ret) - return HttpResponse(json_data) - - TemFilePath = statusFile.split('panel/')[1] - - try: - value = int(TemFilePath) - print(value) - except: - data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", } + if ACLManager.CheckStatusFilleLoc(statusFile): + pass + else: + data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "100", + 'currentStatus': 'Invalid status file.'} json_data = json.dumps(data_ret) return HttpResponse(json_data) diff --git a/plogical/acl.py b/plogical/acl.py index fed781d57..811a94288 100644 --- a/plogical/acl.py +++ b/plogical/acl.py @@ -882,6 +882,14 @@ def CheckDomainBlackList(domain): @staticmethod def CheckStatusFilleLoc(statusFile): + TemFilePath = statusFile.split('panel/')[1] + + try: + value = int(TemFilePath) + print(value) + except: + return 0 + if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[ :4] == '/tmp' or statusFile[ :18] == '/usr/local/CyberCP') \ diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index a2fbff4ce..68207df78 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -356,6 +356,10 @@ def setupDKIM(virtualHostName): keyTable = "/etc/opendkim/KeyTable" configToWrite = "default._domainkey." + actualDomain + " " + actualDomain + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n" + writeToFile = open(keyTable, 'a') + writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.") + writeToFile.close() + data = open(keyTable, 'r').read() if data.find("default._domainkey." + actualDomain) == -1: @@ -369,6 +373,10 @@ def setupDKIM(virtualHostName): signingTable = "/etc/opendkim/SigningTable" configToWrite = "*@" + actualDomain + " default._domainkey." + actualDomain + "\n" + writeToFile = open(signingTable, 'a') + writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.") + writeToFile.close() + data = open(signingTable, 'r').read() if data.find("default._domainkey." + actualDomain) == -1: @@ -382,6 +390,10 @@ def setupDKIM(virtualHostName): trustedHosts = "/etc/opendkim/TrustedHosts" configToWrite = actualDomain + "\n" + writeToFile = open(trustedHosts, 'a') + writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.") + writeToFile.close() + data = open(trustedHosts, 'r').read() if data.find(actualDomain) == -1: