]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
shell: Use ~/tmp as tempdir if available.
authorSimon Ruderich <simon@ruderich.org>
Sun, 17 Jan 2010 14:42:08 +0000 (15:42 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sun, 17 Jan 2010 14:42:08 +0000 (15:42 +0100)
shell/env

index a119eaf17727332aaa9e2db5fd2bb11eb3fdd2be..38ee013b9581f0217109b4c1c205fac39bae8c8e 100644 (file)
--- a/shell/env
+++ b/shell/env
@@ -27,6 +27,14 @@ export EDITOR
 PAGER=less
 export PAGER
 
+# Use ~/tmp as directory for temporary files if available to reduce security
+# problems on multi-user systems.
+if [ -d ~/tmp ]; then
+    TMP=~/tmp
+    TMPDIR=$TMP
+    export TMP TMPDIR
+fi
+
 # Set colors for GNU ls (and zsh completions). This colors files normal (fi),
 # directories blue bold (di), symbolic links cyan (ln), named pipes normal
 # (pi), sockets normal (so), block devices normal (bd), character devices