patch: refactor permission code

This commit is contained in:
Edwin Joassart 2025-07-16 11:54:41 +02:00
parent a792c854ba
commit 0f480eaa42
No known key found for this signature in database
GPG Key ID: 6337EBE5AC716051

View File

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