sanebox: fix pasta argv passing

This commit is contained in:
2024-08-16 02:14:29 +00:00
parent 62ebdf5de4
commit f3df321713

View File

@@ -776,7 +776,11 @@ bwrapGetCli() {
"${cliArgs[@]}" "${cliArgs[@]}"
) )
if [ -n "$bwrapUsePasta" ]; then if [ -n "$bwrapUsePasta" ]; then
# not critical, but it's less confusing if we have pasta execute bwrap *as* "bwrap"
local _realArgv="$argv0"
argv0=bwrap
pastaonlyGetCli pastaonlyGetCli
argv0="$_realArgv"
fi fi
} }
@@ -994,7 +998,8 @@ pastaonlyIngestCapability() {
pastaonlyGetCli() { pastaonlyGetCli() {
cliArgs=( cliArgs=(
"/bin/sh" "-c" "/bin/sh" "-c"
"$pastaNetSetup exec"' "$argv0" "$@"' "$pastaNetSetup exec"' "$@"'
"$argv0" # first argument after `-c "..."` is interpreted by bash as the argv
"${cliArgs[@]}" "${cliArgs[@]}"
) )
locate _pasta "pasta" "$PASTA_FALLBACK" locate _pasta "pasta" "$PASTA_FALLBACK"