* [LTP] [PATCH] Fix removal of TMP by moving cleanup trap into main just after mktemp
@ 2020-09-07 7:51 Vitaly Chikunov
2020-09-07 8:13 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Chikunov @ 2020-09-07 7:51 UTC (permalink / raw)
To: ltp
If user have TMP set and run 'runltp -h' their whole TMP dir is removed.
Fixes: https://github.com/linux-test-project/ltp/issues/722
Suggested-by: Cyril Hrubis <metan@ucw.cz>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
---
runltp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/runltp b/runltp
index 11654ebff..d53ef2941 100755
--- a/runltp
+++ b/runltp
@@ -552,6 +552,8 @@ main()
# write to it as user nobody
export TMPDIR=$TMP
+ trap "cleanup" 0
+
chmod 777 $TMP || \
{
echo "unable to chmod 777 $TMP ... aborting"
@@ -952,7 +954,6 @@ cleanup()
LTP_SCRIPT="$(basename $0)"
if [ "$LTP_SCRIPT" = "runltp" ]; then
- trap "cleanup" 0
setup
main "$@"
fi
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-07 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-07 7:51 [LTP] [PATCH] Fix removal of TMP by moving cleanup trap into main just after mktemp Vitaly Chikunov
2020-09-07 8:13 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox