Skip to content

Commit 9c3c2aa

Browse files
committed
update some permissions structure;
"
1 parent 07d0304 commit 9c3c2aa

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plogical/vhost.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ def createDirectories(path, virtualHostUser, pathHTML, pathLogs, confPath, compl
9595
try:
9696
os.makedirs(pathHTML)
9797

98-
command = "chown " + virtualHostUser + ":" + virtualHostUser + " " + pathHTML
98+
command = "chown " + virtualHostUser + ":nobody " + pathHTML
99+
cmd = shlex.split(command)
100+
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
101+
102+
command = "chmod 750 %s" % (pathHTML)
99103
cmd = shlex.split(command)
100104
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
101105

@@ -771,9 +775,14 @@ def createDirectoryForDomain(masterDomain, domain, phpVersion, path, administrat
771775

772776
try:
773777
os.makedirs(path)
774-
command = "chown " + virtualHostUser + ":" + virtualHostUser + " " + path
778+
command = "chown " + virtualHostUser + ":nobody " + path
775779
cmd = shlex.split(command)
776780
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
781+
782+
command = "chmod 755 %s" % (path)
783+
cmd = shlex.split(command)
784+
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
785+
777786
except OSError as msg:
778787
logging.CyberCPLogFileWriter.writeToFile(
779788
str(msg) + "329 [Not able to create directories for virtual host [createDirectoryForDomain]]")

0 commit comments

Comments
 (0)