[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 1/3] dib: unset all temporary dirs envvars in fake-sudo



The real sudo does it as well, and leaving them when preserving the
environment (-E) maybe breaks the applications, as e.g. chroot will have
a TMPDIR path pointing outside of it.
---
 dib/dib.ml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dib/dib.ml b/dib/dib.ml
index df83ba1..d15cd19 100644
--- a/dib/dib.ml
+++ b/dib/dib.ml
@@ -301,6 +301,11 @@ if [ -z \"$preserve_env\" ]; then
     esac
   done
 fi
+# TMPDIR needs to be unset, regardless of -E
+unset TMPDIR
+# ... and do that also to the other \"TMPDIR\"-like variables
+unset TMP
+unset TMP_DIR
 
 cmd=$1
 shift
-- 
2.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]