From 878056f37b8069a70ce2b8a2909be0aea8b1c0a3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 5 Jun 2024 11:26:08 +0100 Subject: [PATCH] move id check to lib.sh too doesn't really matter, it's just an extra layer to ensure reliability, but "id" is pretty standard Signed-off-by: Leah Rowe --- build | 1 - include/lib.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index f63f3a8..420276c 100755 --- a/build +++ b/build @@ -22,7 +22,6 @@ linkname="${linkpath##*/}" main() { - x_ id -u 1>/dev/null 2>/dev/null [ $# -lt 1 ] && badcmd spath="script/$1" diff --git a/include/lib.sh b/include/lib.sh index 23dfe81..6a4be7e 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -61,6 +61,7 @@ install_packages() } [ $# -gt 0 ] && [ "$1" = "dependencies" ] && install_packages $@ && return 0 +id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)" [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" # if "y": a coreboot target won't be built if target.cfg says release="n"