aboutsummaryrefslogtreecommitdiffstats
path: root/share/msec
blob: 423766c2e67d4acd09a07eb51c8c1bd585008af5 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandrake Linux
# Module          : share
# File            : msec
# Version         : $Id$
# Author          : Frederic Lepied
# Created On      : Thu Dec 13 11:36:50 2001
#---------------------------------------------------------------

MSEC=/usr/share/msec/msec.py

for a in "$@"; do
    last="$a"
done

if [ -n "$last" ]; then
    case $last in
	[0-5]) ;;
	*) [ -x /usr/share/msec/$last.py ] && MSEC=/usr/share/msec/$last.py;;
    esac
else
    # no args so try to guess if a custom msec is needed
    . /etc/sysconfig/msec
    
    case "$SECURE_LEVEL" in
	[0-5]) ;;
	*) MSEC=/usr/share/msec/$SECURE_LEVEL.py;;
    esac
fi

if [ ! -x $MSEC ]; then
    echo "/usr/share/msec/$last.py not found or not executable. Aborting" 1>&2
    exit 1
fi

if $MSEC "$@"; then
    . /etc/sysconfig/msec

    [ -z "$PERM_LEVEL" ] && PERM_LEVEL=$SECURE_LEVEL

    LOCAL=
    [ -f /etc/security/msec/perm.local ] && LOCAL=/etc/security/msec/perm.local
    
    /usr/share/msec/Perms.py /etc/security/msec/perm.$PERM_LEVEL $LOCAL
fi

# msec.sh ends here