From d0ff0ab8ea9f4f3bf4eacb5ddf3124e719d2d3ac Mon Sep 17 00:00:00 2001 From: bpce-it-dis-soc-sof Date: Wed, 8 Jul 2026 14:19:48 +0200 Subject: [PATCH 1/3] fix(command): authoritative sudo required --- secator/runners/command.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/secator/runners/command.py b/secator/runners/command.py index 329e1a695..e29b437c7 100644 --- a/secator/runners/command.py +++ b/secator/runners/command.py @@ -502,9 +502,8 @@ def yielder(self): self.print_command() # Check for sudo requirements and prepare the password if needed - sudo_required = re.search(r'\bsudo\b', self.cmd) sudo_password = None - if CONFIG.security.prompt_sudo_password and sudo_required: + if CONFIG.security.prompt_sudo_password and self.sudo_required: self.debug('prompting for sudo password', sub='start') sudo_password, error = self._prompt_sudo(self.cmd) if error: From 80099f4ae33c5649163f61b3d27b5e97ce2528e0 Mon Sep 17 00:00:00 2001 From: bpce-it-dis-soc-sof Date: Wed, 8 Jul 2026 14:22:49 +0200 Subject: [PATCH 2/3] fix: lint --- secator/runners/command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secator/runners/command.py b/secator/runners/command.py index e29b437c7..b41cb060b 100644 --- a/secator/runners/command.py +++ b/secator/runners/command.py @@ -543,7 +543,7 @@ def yielder(self): stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, - preexec_fn=os.setsid if not (sudo_required or self.disable_preexec) else None, + preexec_fn=os.setsid if not (self.sudo_required or self.disable_preexec) else None, shell=self.shell, errors='replace', env=env, From b04e485b8f591e5248505ce64006ec5e125935f1 Mon Sep 17 00:00:00 2001 From: bpce-it-dis-soc-sof Date: Wed, 8 Jul 2026 14:25:33 +0200 Subject: [PATCH 3/3] fix: requires_sudo instead of sudo_required --- secator/runners/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/secator/runners/command.py b/secator/runners/command.py index b41cb060b..bbd035ae4 100644 --- a/secator/runners/command.py +++ b/secator/runners/command.py @@ -503,7 +503,7 @@ def yielder(self): # Check for sudo requirements and prepare the password if needed sudo_password = None - if CONFIG.security.prompt_sudo_password and self.sudo_required: + if CONFIG.security.prompt_sudo_password and self.requires_sudo: self.debug('prompting for sudo password', sub='start') sudo_password, error = self._prompt_sudo(self.cmd) if error: @@ -543,7 +543,7 @@ def yielder(self): stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, - preexec_fn=os.setsid if not (self.sudo_required or self.disable_preexec) else None, + preexec_fn=os.setsid if not (self.requires_sudo or self.disable_preexec) else None, shell=self.shell, errors='replace', env=env,