Skip to contentSkip to conversation

Fix removal of TMP by moving cleanup trap into main just after mktemp

PATCH New Vitaly Chikunov 2 participants 2 messages Sep 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix removal of TMP by moving cleanup trap into main just after mktemp

If user have TMP set and run 'runltp -h' their whole TMP dir is removed.

---
 runltp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
runltp +2 -1
index 11654ebff..d53ef2941 100755
@@ -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
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 Fix removal of TMP by moving cleanup trap into main just after mktemp

Hi!
Pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]