bug fix: subdomain creation on cent/alma

This commit is contained in:
Usman Nasir
2022-06-10 12:29:33 +05:00
parent e14ce3e0f9
commit 516a68fe39
2 changed files with 23 additions and 0 deletions

View File

@@ -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()

View File

@@ -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