mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-12 16:26:12 +01:00
Set mode for any files which contain an install created password
This commit is contained in:
@@ -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.")
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user