init.sh: make TMPDIR *after* calling xbmkpkg

otherwise, running ./mk dependencies as root will
create xbmkwd/ (temporary directories) as root,
which will then prevent non-root instances of lbmk
from being able to make temporary files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-09-21 19:52:14 +01:00
parent 2c02b17810
commit 6b796e2b4c
+2 -2
View File
@@ -23,11 +23,11 @@ xbmk_init()
xbmklock="$xbmkpwd/lock" xbmklock="$xbmkpwd/lock"
basetmp="$xbmkpwd/xbmkwd" basetmp="$xbmkpwd/xbmkwd"
[ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0
export PWD="$xbmkpwd" export PWD="$xbmkpwd"
x_ mkdir -p "$basetmp" x_ mkdir -p "$basetmp"
[ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0
id -u 1>/dev/null 2>/dev/null || err "suid check failed" xbmk_init "$@" id -u 1>/dev/null 2>/dev/null || err "suid check failed" xbmk_init "$@"
[ "$(id -u)" != "0" ] || \ [ "$(id -u)" != "0" ] || \
err "this command as root is not permitted" xbmk_init "$@" err "this command as root is not permitted" xbmk_init "$@"