From 9e7b9466c983016f1f80f1f604d4b6cd67a78fe5 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:52:44 +0600 Subject: [PATCH] better chattr detection for disk enforcement limit better chattr detection supported by both ubuntu, rocky linux, alma linux and centos --- filemanager/filemanager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index 385f1ce44..bc5a8b3b0 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -386,9 +386,9 @@ class FileManager: command = 'touch %s/public_html/hello.txt' % (self.homePath) result = ProcessUtilities.outputExecutioner(command) + result_lower = result.lower() - - if result.find('cannot touch') > -1: + if 'cannot touch' in result_lower or 'no such file or directory' in result_lower: RemoveOK = 0 command = 'chattr -R -i %s' % (self.homePath) @@ -454,8 +454,9 @@ class FileManager: command = 'touch %s/public_html/hello.txt' % (self.homePath) result = ProcessUtilities.outputExecutioner(command) + result_lower = result.lower() - if result.find('cannot touch') > -1: + if 'cannot touch' in result_lower or 'no such file or directory' in result_lower: RemoveOK = 0 command = 'chattr -R -i %s' % (self.homePath)