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';