1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

Meta: Don't depend on sudo for privileged operations

We previously depended on sudo's specific -E flag to keep all the
environment variables when performing a privilege escalation. We now
incorporate the -E flag into the $SUDO variable, allowing for other
privilege escalation binaries (such as doas) to be used (as long as
they preserve the current environment variables).
This commit is contained in:
Baitinq 2022-11-23 21:01:11 +01:00 committed by Linus Groh
parent 7a51e846b2
commit 88c9e4f3b0
6 changed files with 10 additions and 7 deletions

View file

@ -25,7 +25,7 @@ if [ "$(id -u)" != 0 ]; then
USE_FUSE2FS=1
else
set +e
${SUDO} -E -- sh -c "\"$0\" $* || exit 42"
${SUDO} -- sh -c "\"$0\" $* || exit 42"
case $? in
1)
die "this script needs to run as root"