mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 00:36:10 +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
|
import socket
|
||||||
from os.path import *
|
from os.path import *
|
||||||
from stat import *
|
from stat import *
|
||||||
|
import stat
|
||||||
|
|
||||||
# There can not be peace without first a great suffering.
|
# There can not be peace without first a great suffering.
|
||||||
|
|
||||||
@@ -901,6 +902,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("settings.py updated!")
|
logging.InstallLog.writeToFile("settings.py updated!")
|
||||||
@@ -1325,6 +1328,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
### update password:
|
### update password:
|
||||||
@@ -1341,6 +1346,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
### update password:
|
### update password:
|
||||||
@@ -1357,6 +1364,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
### update password:
|
### update password:
|
||||||
@@ -1373,6 +1382,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
### update password:
|
### update password:
|
||||||
@@ -1389,6 +1400,8 @@ class preFlightsChecks:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.")
|
logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.")
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import randomPassword
|
|||||||
import errno
|
import errno
|
||||||
import MySQLdb as mariadb
|
import MySQLdb as mariadb
|
||||||
import install
|
import install
|
||||||
|
import stat
|
||||||
|
|
||||||
#distros
|
#distros
|
||||||
centos=0
|
centos=0
|
||||||
@@ -869,6 +870,7 @@ class InstallCyberPanel:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("PureFTPD configured!")
|
logging.InstallLog.writeToFile("PureFTPD configured!")
|
||||||
@@ -1028,6 +1030,8 @@ class InstallCyberPanel:
|
|||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
|
os.fchmod(writeDataToFile, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("PowerDNS configured!")
|
logging.InstallLog.writeToFile("PowerDNS configured!")
|
||||||
@@ -1247,6 +1251,8 @@ def Main(cwd, mysql, distro):
|
|||||||
password = open(file_name, "w")
|
password = open(file_name, "w")
|
||||||
password.writelines(InstallCyberPanel.mysql_Root_password)
|
password.writelines(InstallCyberPanel.mysql_Root_password)
|
||||||
|
|
||||||
|
os.fchmod(password, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
password.close()
|
password.close()
|
||||||
|
|
||||||
if distro == centos:
|
if distro == centos:
|
||||||
|
|||||||
Reference in New Issue
Block a user