diff options
author | Leah Rowe <leah@libreboot.org> | 2025-09-01 08:14:49 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-09-01 08:14:49 +0100 |
commit | ed84d33e59b8b2cf1789eb591c592d921907dbdd (patch) | |
tree | 8e67bf7d04a0ef0dbdacd3028e4ae9acf5fa72a7 /include | |
parent | 40f064ae336f125762584be8a6ddd52d7ff1cd01 (diff) |
lib.sh and rom.sh: stricter mktemp usage
error out under fault condition
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/lib.sh | 3 | ||||
-rw-r--r-- | include/rom.sh | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/lib.sh b/include/lib.sh index f64a6a35..948d7f3f 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -114,7 +114,8 @@ unpad_one_byte() fx_() { - fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd" + fd="`mktemp || err "can't create tmpfile"`" || err + x_ rm -f "$fd" && x_ touch "$fd" xx="$1" && shift 1 "$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || err "FATAL: !sort fx_" dx_ "$xx" "$fd" || : diff --git a/include/rom.sh b/include/rom.sh index 34dea35c..53bb4487 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -257,7 +257,7 @@ cprom() newrom="${newrom%.rom}_${tmpnew%.gkb}.rom" irom="$tmprom" - [ $# -lt 1 ] || irom="`mktemp`" || err "!mk irom, $(echo "$@")" + [ $# -lt 1 ] || irom="`mktemp || err "!mk irom, $(echo "$@")"`" || err [ $# -gt 0 ] && x_ cp "$tmprom" "$irom" && cpcmd="mv" [ $# -gt 0 ] && [ "${1%.gkb}" != "$1" ] && \ |