From 4df281d2cd8e35831915a44accda9c394e24541b Mon Sep 17 00:00:00 2001 From: Alex Williams-Ferreira Date: Thu, 9 Apr 2026 09:40:57 -0700 Subject: [PATCH] Fix SuperBenchmark initialize.sh: broken sudoers syntax The visudo invocation was invalid: - Single quotes around \ prevented variable expansion (literal '\' written) - EDITOR='tee -a' visudo doesn't work reliably across distros Fix: use 'tee /etc/sudoers.d/\' which is the standard approach for adding per-user sudoers rules. Also set proper 440 permissions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../VirtualClient.Actions/SuperBenchmark/initialize.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/initialize.sh b/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/initialize.sh index 4e2d9262b1..9572cbbbd4 100644 --- a/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/initialize.sh +++ b/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/initialize.sh @@ -1,5 +1,6 @@ # Ansible will use sudo which needs explicit password input. This command removes that step. -echo '$1 ALL=(ALL) NOPASSWD:ALL' | (sudo EDITOR='tee -a' visudo) +echo "$1 ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$1 +sudo chmod 440 /etc/sudoers.d/$1 # Remove any existing system-installed Ansible to avoid version conflicts sudo apt remove -y ansible || true