mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:08:10 +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:
parent
7a51e846b2
commit
88c9e4f3b0
6 changed files with 10 additions and 7 deletions
|
@ -8,7 +8,7 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|||
|
||||
if [ "$(id -u)" != 0 ]; then
|
||||
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue