Răsfoiți Sursa

Define which environment variables to preserve with the chroot-wrapper

Emmanuel Bouthenot 9 ani în urmă
părinte
comite
a6c67e8b53
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      tools/web/chroot-wrapper

+ 2 - 1
tools/web/chroot-wrapper

@@ -1,5 +1,6 @@
 #!/bin/sh
 
-export HOME="${HOME}"
+# preserve only some variables (like LANG) for some crappy tools.
+unset $(printenv | grep -v '^\$' | egrep -v '^(HOME|LOGNAME|PATH|SHELL|TERM|USER|LANG)=' | sed -r 's/^([^=]+)=.*$/\1/' | xargs)
 
 schroot -c "$(schroot -l | head -1)" -- "$(basename "${0}")" "${@}"