Set mode for any files which contain an install created password

This commit is contained in:
rperper
2018-11-07 15:14:54 -05:00
parent 5fb2b31cbd
commit c56caf3a2a
2 changed files with 86 additions and 67 deletions

View File

@@ -12,6 +12,7 @@ import random
import socket
from os.path import *
from stat import *
import stat
# There can not be peace without first a great suffering.
@@ -901,6 +902,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
logging.InstallLog.writeToFile("settings.py updated!")
@@ -1325,6 +1328,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
### update password:
@@ -1341,6 +1346,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
### update password:
@@ -1357,6 +1364,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
### update password:
@@ -1373,6 +1382,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
### update password:
@@ -1389,6 +1400,8 @@ class preFlightsChecks:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.")

View File

@@ -9,6 +9,7 @@ import randomPassword
import errno
import MySQLdb as mariadb
import install
import stat
#distros
centos=0
@@ -869,6 +870,7 @@ class InstallCyberPanel:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
logging.InstallLog.writeToFile("PureFTPD configured!")
@@ -1028,6 +1030,8 @@ class InstallCyberPanel:
else:
writeDataToFile.writelines(items)
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
writeDataToFile.close()
logging.InstallLog.writeToFile("PowerDNS configured!")
@@ -1247,6 +1251,8 @@ def Main(cwd, mysql, distro):
password = open(file_name, "w")
password.writelines(InstallCyberPanel.mysql_Root_password)
os.fchmod(password, stat.S_IRUSR | stat.S_IWUSR)
password.close()
if distro == centos: