lbmk: don't handle TMPDIR directly

lbmk creates TMPDIR as /tmp/xbmk_*, but it's theoretically
possible that something could re-export it by mistake.

this change retains the same initialisation, but further
use is now via a new variable "xbmktmp", that stores the
value of TMPDIR upon lbmk's initialisation of it.

this reduces the chance of such a bug in the future, as
described above, so it is a preemptive/preventative fix.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-04-17 23:43:22 +01:00
parent 9d3b52cd1d
commit e07a2adb13
4 changed files with 22 additions and 19 deletions
+3 -3
View File
@@ -48,11 +48,11 @@ vendor_download()
readkconfig()
{
x_ rm -f "$TMPDIR/cbcfg"
x_ rm -f "$xbmktmp/cbcfg"
cbcfg="`check_defconfig "$boarddir"`" || for cbc in $cv; do
grep "$cbc" "$cbcfg" 1>>"$TMPDIR/cbcfg" 2>/dev/null || :
grep "$cbc" "$cbcfg" 1>>"$xbmktmp/cbcfg" 2>/dev/null || :
done
eval "`setcfg "$TMPDIR/cbcfg" 1`"
eval "`setcfg "$xbmktmp/cbcfg" 1`"
for c in $cvchk; do
eval "[ \"\${$c}\" = \"/dev/null\" ] && continue"