summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-09-21 19:52:14 +0100
committerLeah Rowe <leah@libreboot.org>2025-09-21 19:52:14 +0100
commit6b796e2b4c0598d8dabfa0ee503418c1ad01e06b (patch)
tree880c1a35fd366ae31105d49fa0e51d0df4f1da40
parent2c02b17810da58ef482608be844493ad25b96c0f (diff)
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>
-rw-r--r--include/init.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/init.sh b/include/init.sh
index 6e638be5..d3543986 100644
--- a/include/init.sh
+++ b/include/init.sh
@@ -23,11 +23,11 @@ xbmk_init()
xbmklock="$xbmkpwd/lock"
basetmp="$xbmkpwd/xbmkwd"
+ [ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0
+
export PWD="$xbmkpwd"
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)" != "0" ] || \
err "this command as root is not permitted" xbmk_init "$@"