From c8c7883e99abf44f26bfb89f44583047aa963380 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Tue, 9 Sep 2008 10:51:22 +0000 Subject: [PATCH] - don't set TMPDIR to ~/tmp if it doesn't exist Changed files: etc/profile.d/tmp-dir.csh -> 1.6 etc/profile.d/tmp-dir.sh -> 1.7 --- etc/profile.d/tmp-dir.csh | 9 +++++++-- etc/profile.d/tmp-dir.sh | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/etc/profile.d/tmp-dir.csh b/etc/profile.d/tmp-dir.csh index 98af61b..85eb2c8 100644 --- a/etc/profile.d/tmp-dir.csh +++ b/etc/profile.d/tmp-dir.csh @@ -1,5 +1,10 @@ -if ( `/bin/id -u` >= 500 && ! -d ~/tmp ) then +# create ~/tmp for normal users +if ( `/bin/id -u` >= 1000 && ! -d ~/tmp ) then mkdir -p ~/tmp >& /dev/null chmod -f og-rwx ~/tmp >& /dev/null endif -setenv TMPDIR ~/tmp + +# if any user has ~/tmp then use it +if ( -d ~/tmp ) then + setenv TMPDIR ~/tmp +endif diff --git a/etc/profile.d/tmp-dir.sh b/etc/profile.d/tmp-dir.sh index 97993c0..a97b135 100644 --- a/etc/profile.d/tmp-dir.sh +++ b/etc/profile.d/tmp-dir.sh @@ -1,6 +1,11 @@ -if [ $(/bin/id -u) -ge 500 -a ! -d ~/tmp ]; then +# create ~/tmp for normal users +if [ $(/bin/id -u) -ge 1000 -a ! -d ~/tmp ]; then mkdir -p ~/tmp > /dev/null 2>&1 chmod -f og-rwx ~/tmp 2>/dev/null fi -TMPDIR=~/tmp -export TMPDIR + +# if any user has ~/tmp then use it +if [ -d ~/tmp ]; then + TMPDIR=~/tmp + export TMPDIR +fi -- 2.44.0