aboutsummaryrefslogtreecommitdiffstats
path: root/msec.sh
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-02-14 00:52:24 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-02-14 00:52:24 +0000
commitf5f8da18b3aeca5175bbf09f66938190c1ee67fc (patch)
treeea534bf886f2e049a616c23bb49ed682b584a403 /msec.sh
parent102709ca341438a5f5a21532b4fd2b6a2f820f97 (diff)
downloadmsec-f5f8da18b3aeca5175bbf09f66938190c1ee67fc.tar
msec-f5f8da18b3aeca5175bbf09f66938190c1ee67fc.tar.gz
msec-f5f8da18b3aeca5175bbf09f66938190c1ee67fc.tar.bz2
msec-f5f8da18b3aeca5175bbf09f66938190c1ee67fc.tar.xz
msec-f5f8da18b3aeca5175bbf09f66938190c1ee67fc.zip
handle umask and . in path
Diffstat (limited to 'msec.sh')
-rwxr-xr-xmsec.sh36
1 files changed, 33 insertions, 3 deletions
diff --git a/msec.sh b/msec.sh
index d01e68b..dd3a429 100755
--- a/msec.sh
+++ b/msec.sh
@@ -1,15 +1,45 @@
+#---------------------------------------------------------------
+# Project : Mandrake Linux
+# Module : msec
+# File : msec.sh
+# Version : $Id$
+# Author : Yoann Vandoorselaere
+# Created On : Wed Feb 13 18:35:58 2002
+# Purpose : settings according to security level
+#---------------------------------------------------------------
+
if [ -r /etc/sysconfig/msec ]; then
. /etc/sysconfig/msec
fi
+if [ `id -u` -ge 500 ]; then
+ if [ -n "$UMASK_USER" ]; then
+ umask $UMASK_USER
+ else
+ umask 022
+ fi
+else
+ if [ -n "$UMASK_ROOT" ]; then
+ umask $UMASK_ROOT
+ else
+ umask 002
+ fi
+fi
+
if ! echo ${PATH} |grep -q /usr/X11R6/bin ; then
- export PATH=$PATH:/usr/X11R6/bin
+ export PATH=$PATH:/usr/X11R6/bin
fi
if ! echo ${PATH} |grep -q /usr/games ; then
- export PATH=$PATH:/usr/games
+ export PATH=$PATH:/usr/games
fi
-export SECURE_LEVEL=${SECURE_LEVEL}
+if [ "$SECURE_LEVEL" -le 1 ] && ! echo ${PATH} | fgrep -q :.; then
+ export PATH=$PATH:.
+fi
+
+export SECURE_LEVEL
[ -n "$TMOUT" ] && typeset -r TMOUT
+
+# msec.sh ends here