From f6fd2192c5709b5b1b64b581cdbb1e5a6fba1b40 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sun, 26 Oct 2025 17:05:58 +0500 Subject: [PATCH] Add shell=True for cat redirection command - Shell redirection requires shell=True parameter in executioner - Without shell=True, the > is treated as literal argument - Fixes: File contents not being replaced --- aiScanner/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiScanner/api.py b/aiScanner/api.py index ed5d48da0..ccb965efb 100644 --- a/aiScanner/api.py +++ b/aiScanner/api.py @@ -1300,7 +1300,7 @@ def scanner_replace_file(request): # Replace file using cat redirection (more reliable than cp for overwriting) # This ensures the file contents are actually replaced replace_cmd = f'cat "{user_temp_path}" > "{full_path}"' - replace_result = ProcessUtilities.executioner(replace_cmd, user=user) + replace_result = ProcessUtilities.executioner(replace_cmd, user=user, shell=True) # Clean up temp file ProcessUtilities.executioner(f'rm -f "{user_temp_path}"', user=user)