aboutsummaryrefslogtreecommitdiffstats
path: root/mageia/etc/profile.d/10tmpdir.csh
diff options
context:
space:
mode:
Diffstat (limited to 'mageia/etc/profile.d/10tmpdir.csh')
-rw-r--r--mageia/etc/profile.d/10tmpdir.csh25
1 files changed, 25 insertions, 0 deletions
diff --git a/mageia/etc/profile.d/10tmpdir.csh b/mageia/etc/profile.d/10tmpdir.csh
new file mode 100644
index 00000000..c0deecab
--- /dev/null
+++ b/mageia/etc/profile.d/10tmpdir.csh
@@ -0,0 +1,25 @@
+# $Id$
+# Set TMPDIR and TMP
+
+if (-f /etc/security/shell) then
+ eval `cat /etc/security/shell | grep -v ^# | sed -re 's/^([^=]+=)/set \1/'`
+endif
+
+if ($?SECURE_TMP) then
+ if ($SECURE_TMP == "yes") then
+ if ( -d ${HOME}/tmp && -w ${HOME}/tmp ) then
+ setenv TMPDIR ${HOME}/tmp
+ setenv TMP ${HOME}/tmp
+ exit
+ endif
+
+ if ( { mkdir -p ${HOME}/tmp >&! /dev/null } ) then
+ setenv TMPDIR ${HOME}/tmp
+ setenv TMP ${HOME}/tmp
+ exit
+ endif
+ endif
+endif
+
+setenv TMPDIR /tmp
+setenv TMP /tmp