Fix permission race condition in fixPermissions function
Fixes #1583 - Ubuntu 24 permission issues causing 404 errors Changes: - Move main public_html permission setting to END of fixPermissions function - Ensures public_html maintains user:nogroup ownership (not user:user) - Prevents child domain processing from interfering with main directory permissions - Changed all async popenExecutioner calls to sync executioner calls - Reordered operations: permissions first, then ownership This fixes the issue where clicking "Fix Permissions" in file manager would incorrectly change public_html group from nogroup to the user's group, causing 404 errors on Ubuntu 24.
This commit is contained in:
parent
acc6cad623
commit
46e40d6822
|
|
@ -1068,13 +1068,7 @@ class FileManager:
|
||||||
command = 'chown -R -P %s:%s /home/%s/public_html/.[^.]*' % (externalApp, externalApp, domainName)
|
command = 'chown -R -P %s:%s /home/%s/public_html/.[^.]*' % (externalApp, externalApp, domainName)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
# Set public_html directory itself to user:nogroup with 750 permissions
|
# Process child domains first
|
||||||
command = 'chown %s:%s /home/%s/public_html' % (externalApp, groupName, domainName)
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = 'chmod 750 /home/%s/public_html' % (domainName)
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
for childs in website.childdomains_set.all():
|
for childs in website.childdomains_set.all():
|
||||||
command = 'ls -la %s' % childs.path
|
command = 'ls -la %s' % childs.path
|
||||||
result = ProcessUtilities.outputExecutioner(command)
|
result = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
@ -1105,3 +1099,10 @@ class FileManager:
|
||||||
|
|
||||||
command = 'chown %s:%s %s' % (externalApp, groupName, childs.path)
|
command = 'chown %s:%s %s' % (externalApp, groupName, childs.path)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
# Set public_html directory itself to user:nogroup with 750 permissions (done at the end)
|
||||||
|
command = 'chown %s:%s /home/%s/public_html' % (externalApp, groupName, domainName)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
command = 'chmod 750 /home/%s/public_html' % (domainName)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue