mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Meta: default SUDO_UID and SUDO_GID to 0 in build-image-*.sh scripts
In the GNU coreutils version of chown, ":" is a valid argument (the command will result in a no-op), but POSIX chown does not consider that valid. If the user who ran build-image-*.sh was root, SUDO_UID and SUDO_GID would not be set and, if the version of chown installed on the system did not allow passing just a ":" as argument, the script would fail. Let's default the value of SUDO_UID and SUDO_GID to 0 just in case.
This commit is contained in:
parent
22aa4cbf92
commit
8e24a17d0d
Notes:
sideshowbarker
2024-07-19 05:29:57 +09:00
Author: https://github.com/emanuele6 Commit: https://github.com/SerenityOS/serenity/commit/8e24a17d0d7 Pull-request: https://github.com/SerenityOS/serenity/pull/2595
2 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,8 @@ die() {
|
|||
|
||||
if [ "$(id -u)" != 0 ]; then
|
||||
exec sudo -E -- "$0" "$@" || die "this script needs to run as root"
|
||||
else
|
||||
: "${SUDO_UID:=0}" "${SUDO_GID:=0}"
|
||||
fi
|
||||
|
||||
grub=$(command -v grub-install 2>/dev/null) || true
|
||||
|
|
|
@ -9,6 +9,8 @@ die() {
|
|||
|
||||
if [ "$(id -u)" != 0 ]; then
|
||||
exec sudo -E -- "$0" "$@" || die "this script needs to run as root"
|
||||
else
|
||||
: "${SUDO_UID:=0}" "${SUDO_GID:=0}"
|
||||
fi
|
||||
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
|
|
Loading…
Reference in a new issue