]> mop.ddnsfree.com - git repositories - brisk.git/commit
print the privileged commands with sudo where sudo is installed
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Wed, 7 Oct 2026 10:04:45 +0000 (10:04 +0000)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Wed, 7 Oct 2026 10:04:45 +0000 (10:04 +0000)
commit94d72c9b9ae270c0107cf9f4cf462466700a90bd
treeb9b5a8069541e2fd13029c060c57fa617b4bef47
parentf447d7a70af46bf94494ced65834c9ed4efb3ad3
print the privileged commands with sudo where sudo is installed

The commands the "system" action prints, and the ones in the head of the
files it generates, were all "su -c '...'". On debian 13 sudo is installed
and the root account is left without a password, so those are commands
nobody can run.

as_root() now prints "sudo <cmd>" where sudo is on the path and
"su -c '<cmd>'" where it is not, which is still the way on the older
machines this has to keep working on. The one privileged command the action
runs by itself, the copy of the sysv script into /etc/init.d, goes through
sudo on the same condition.

The heads of the generated files also said "run INSTALL.sh again instead",
which stopped being true when they moved to the action: they say
"INSTALL.sh system" now.

Checked in the container: the action prints sudo for the nginx, nftables
and systemd commands, the heads of the three generated files carry the same
form, and as_root with sudo off the path falls back to su -c.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
INSTALL.sh
WARNING.txt