mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 09:32:27 +02:00
lib.sh: do root check before python check
we don't need python before the root check principle of least privilege Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+3
-3
@@ -93,6 +93,9 @@ if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
pyver="2"
|
pyver="2"
|
||||||
python="python3"
|
python="python3"
|
||||||
command -v python3 1>/dev/null || python="python"
|
command -v python3 1>/dev/null || python="python"
|
||||||
@@ -109,9 +112,6 @@ if [ "${pyver%%.*}" != "3" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
# XBMK_CACHE is a directory, for caching downloads and git repositories
|
# XBMK_CACHE is a directory, for caching downloads and git repositories
|
||||||
[ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
|
[ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache"
|
||||||
[ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
|
[ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache"
|
||||||
|
|||||||
Reference in New Issue
Block a user