From aaff90f5a502844e6dae33e964fb70674d6e9c44 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 25 May 2024 16:34:48 +0100 Subject: [PATCH] build: do root check before git check otherwise, git could be initialised as root. running as root is not allowed. Signed-off-by: Leah Rowe --- build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build b/build index 9fe53fc..205bc89 100755 --- a/build +++ b/build @@ -28,13 +28,13 @@ main() [ "$1" = "dependencies" ] && x_ install_packages $@ && return 0 + [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" + for g in "which git" "git config --global user.name" \ "git config --global user.email" "git_init"; do eval "$g 1>/dev/null 2>/dev/null || git_err \"$g\"" done - [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" - case "${1}" in version) printf "%s\n" "$relname" ;; release) shift 1; mkrelease $@ ;;