diff options
Diffstat (limited to 'mageia/etc/profile.d/10tmpdir.sh')
-rw-r--r-- | mageia/etc/profile.d/10tmpdir.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mageia/etc/profile.d/10tmpdir.sh b/mageia/etc/profile.d/10tmpdir.sh new file mode 100644 index 00000000..87d984e8 --- /dev/null +++ b/mageia/etc/profile.d/10tmpdir.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# $Id$ +# Set TMPDIR to ~/tmp and create it if directory not exist. + +if [ -z "$SECSHELL" -a -r /etc/security/shell ]; then + . /etc/security/shell + export SECSHELL=1 +fi + +if [[ "$SECURE_TMP" = "yes" ]];then + if [ -d ${HOME}/tmp -a -w ${HOME}/tmp ];then + export TMPDIR=${HOME}/tmp + export TMP=${HOME}/tmp + elif mkdir -p ${HOME}/tmp >/dev/null 2>&1;then + chmod 700 ${HOME}/tmp + export TMPDIR=${HOME}/tmp + export TMP=${HOME}/tmp + else + export TMPDIR=/tmp + export TMP=/tmp + fi +else + export TMPDIR=/tmp + export TMP=/tmp +fi |