mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-09 22:00:14 +01:00
bug fix: subdomain creation on cent/alma
This commit is contained in:
@@ -2031,6 +2031,25 @@ milter_default_action = accept
|
||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [enableDisableEmail]")
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def fixSudoers():
|
||||
try:
|
||||
distroPath = '/etc/lsb-release'
|
||||
|
||||
if not os.path.exists(distroPath):
|
||||
fileName = '/etc/sudoers'
|
||||
data = open(fileName, 'r').readlines()
|
||||
|
||||
writeDataToFile = open(fileName, 'w')
|
||||
for line in data:
|
||||
if line.find("root") > -1 and line.find("ALL=(ALL)") > -1 and line[0] != '#':
|
||||
writeDataToFile.writelines('root ALL=(ALL:ALL) ALL\n')
|
||||
else:
|
||||
writeDataToFile.write(line)
|
||||
writeDataToFile.close()
|
||||
except IOError as err:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def setUpFirstAccount():
|
||||
try:
|
||||
@@ -2279,6 +2298,7 @@ def main():
|
||||
checks.setupPHPAndComposer()
|
||||
checks.fix_selinux_issue()
|
||||
checks.install_psmisc()
|
||||
checks.fixSudoers()
|
||||
|
||||
if args.postfix is None:
|
||||
checks.install_postfix_dovecot()
|
||||
|
||||
@@ -248,6 +248,9 @@ class Upgrade:
|
||||
else:
|
||||
writeToFile.writelines(items)
|
||||
|
||||
if items.find("root") > -1 and items.find("ALL=(ALL)") > -1 and items[0] != '#':
|
||||
writeToFile.writelines('root ALL=(ALL:ALL) ALL\n')
|
||||
|
||||
writeToFile.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user