aboutsummaryrefslogtreecommitdiffstats
path: root/mageia/etc/profile.d/10tmpdir.sh
blob: 87d984e869cb49f07538f58a2fb4334cb309edff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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