mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 07:46:35 +01:00
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:
@@ -1068,13 +1068,7 @@ class FileManager:
|
||||
command = 'chown -R -P %s:%s /home/%s/public_html/.[^.]*' % (externalApp, externalApp, domainName)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
# Set public_html directory itself to user:nogroup with 750 permissions
|
||||
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)
|
||||
|
||||
# Process child domains first
|
||||
for childs in website.childdomains_set.all():
|
||||
command = 'ls -la %s' % childs.path
|
||||
result = ProcessUtilities.outputExecutioner(command)
|
||||
@@ -1105,3 +1099,10 @@ class FileManager:
|
||||
|
||||
command = 'chown %s:%s %s' % (externalApp, groupName, childs.path)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user