mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
88c9e4f3b0
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).
18 lines
569 B
Bash
Executable file
18 lines
569 B
Bash
Executable file
#!/bin/sh
|
|
# shellcheck disable=SC2034
|
|
# SC2034: "Variable appears unused. Verify it or export it."
|
|
# Those are intentional here, as the file is meant to be included elsewhere.
|
|
|
|
# NOTE: If using another privilege escalation binary make sure it is configured or has the appropiate flag
|
|
# to keep the current environment variables in the launched process (in sudo's case this is achieved
|
|
# through the -E flag described in sudo(8).
|
|
SUDO="sudo -E"
|
|
|
|
if [ "$(uname -s)" = "SerenityOS" ]; then
|
|
SUDO="pls -E"
|
|
fi
|
|
|
|
die() {
|
|
echo "die: $*"
|
|
exit 1
|
|
}
|