From 0f480eaa42e069177bdbcad375b8b6642ddfac43 Mon Sep 17 00:00:00 2001 From: Edwin Joassart Date: Wed, 16 Jul 2025 11:54:41 +0200 Subject: [PATCH] patch: refactor permission code --- lib/shared/sudo/darwin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shared/sudo/darwin.ts b/lib/shared/sudo/darwin.ts index 5f05dae0..d11c3634 100644 --- a/lib/shared/sudo/darwin.ts +++ b/lib/shared/sudo/darwin.ts @@ -43,7 +43,7 @@ export async function sudo( // Build the shell command string const shellCmd = `echo ${SUCCESSFUL_AUTH_MARKER} && ${command[0]} ${command .slice(1) - .map((a) => a.replace(/"/g, '\\"')) + .map((a) => a.replace(/\\/g, '\\\\').replace(/"/g, '\\"')) .join(' ')}`; let elevated = 'pending';