Skip to content

Commit 9f54ab8

Browse files
Nicolas Schierkees
authored andcommitted
fortify: Cleanup temp file also on non-successful exit
Ensure cleanup of test_fortify.sh's temporary file also on script interruption, or some common signals. Reported-by: WangYuli <wangyuli@aosc.io> Closes: https://lore.kernel.org/linux-kbuild/20251112114725.287349-1-wangyuli@aosc.io/ Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: WangYuli <wangyuli@aosc.io> Signed-off-by: Nicolas Schier <nsc@kernel.org> Link: https://patch.msgid.link/20260114-fortify-improve-handling-of-tempfile-v2-2-63b86c4dbd0e@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
1 parent ccfe7d6 commit 9f54ab8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/test_fortify/test_fortify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ shift
2929
__cleanup() {
3030
rm -f "$TMP"
3131
}
32-
trap __cleanup EXIT
32+
trap __cleanup EXIT HUP INT QUIT TERM
3333

3434
# Function names in warnings are wrapped in backticks under UTF-8 locales.
3535
# Run the commands with LANG=C so that grep output will not change.

0 commit comments

Comments
 (0)