diff options
author | Frederic Lepied <flepied@mandriva.com> | 2002-02-14 00:52:24 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2002-02-14 00:52:24 +0000 |
commit | f5f8da18b3aeca5175bbf09f66938190c1ee67fc (patch) | |
tree | ea534bf886f2e049a616c23bb49ed682b584a403 /msec.csh | |
parent | 102709ca341438a5f5a21532b4fd2b6a2f820f97 (diff) | |
download | msec-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.csh')
-rwxr-xr-x | msec.csh | 41 |
1 files changed, 34 insertions, 7 deletions
@@ -1,7 +1,31 @@ +#--------------------------------------------------------------- +# Project : Mandrake Linux +# Module : msec +# File : msec.csh +# 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 eval `sed -n 's/^\([^#]*\)=\([^#]*\)/set \1=\2;/p' < /etc/sysconfig/msec` endif +if ( { id -u } >= 500 ) then + if ( ${?UMASK_USER} ) then + umask ${UMASK_USER} + else + umask 022 + endif +else + if ( ${?UMASK_ROOT} ) then + umask ${UMASK_ROOT} + else + umask 002 + endif +endif + if ! { (echo "${PATH}" | grep -q /usr/X11R6/bin) } then setenv PATH "${PATH}:/usr/X11R6/bin" endif @@ -10,18 +34,21 @@ if ! { (echo "${PATH}" | grep -q /usr/games) } then setenv PATH "${PATH}:/usr/games" endif +if ( ${?SECURE_LEVEL} && ${SECURE_LEVEL} <= 1 ) then + if ! { (echo "${PATH}" | fgrep -q :.) } then + setenv PATH "${PATH}:." + endif +endif + # translate sh variables from /etc/sysconfig/msec to their equivalent in csh if ( ${?TMOUT} ) then - if ( "$TMOUT" != "" ) then - set autologout=`expr $TMOUT / 60` - endif - + set autologout=`expr $TMOUT / 60` endif if ( ${?HISTFILESIZE} ) then - if ( "$HISTFILESIZE" != "" ) then - set history=$HISTFILESIZE - endif + set history=$HISTFILESIZE endif setenv SECURE_LEVEL ${SECURE_LEVEL} + +# msec.csh ends here |