fix(rooted): run dockerCommandRun via bash -c so pipes/redirects work

The rooted branch executed the command string as bare $command, which
word-splits without shell interpretation: pipes, redirects, && and quoted
Go templates were passed as literal argv to a single process. Nearly every
caller relies on shell syntax (docker ps | xargs -r ..., cd && docker
compose, --format='{{...}}', > /dev/null), so rooted mode silently
mishandled them — most visibly dockerStartAllApps after its pipe rewrite,
which failed with 'unknown shorthand flag: r'. Run via bash -c like the
rootless path so both modes share identical shell semantics. No caller uses
the sudo type arg.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-24 13:05:24 +01:00
parent 42a96b909b
commit 99460cb05e

View File

@ -9,9 +9,9 @@ dockerCommandRun()
dockerCommandRunInstallUser "$command" dockerCommandRunInstallUser "$command"
elif [[ $CFG_DOCKER_INSTALL_TYPE == "rooted" ]]; then elif [[ $CFG_DOCKER_INSTALL_TYPE == "rooted" ]]; then
if [[ $type == "sudo" ]]; then if [[ $type == "sudo" ]]; then
sudo $command sudo bash -c "$command"
else else
$command bash -c "$command"
fi fi
fi fi
} }