diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-05 21:32:25 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-05 21:32:25 +0000 |
commit | 9d79e2a08d27cc1928c368cb307bc17761291cd7 (patch) | |
tree | 73d79391511aac294cacd0d16f3fb7f4c8de9103 /perl-install | |
parent | 5ee6b96619c9e67ba525e9bd0c6f098da88d9f9e (diff) | |
download | drakx-9d79e2a08d27cc1928c368cb307bc17761291cd7.tar drakx-9d79e2a08d27cc1928c368cb307bc17761291cd7.tar.gz drakx-9d79e2a08d27cc1928c368cb307bc17761291cd7.tar.bz2 drakx-9d79e2a08d27cc1928c368cb307bc17761291cd7.tar.xz drakx-9d79e2a08d27cc1928c368cb307bc17761291cd7.zip |
Updated level.pm to work with new msec (0.60.x+)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/security/level.pm | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/perl-install/security/level.pm b/perl-install/security/level.pm index 826617ad3..c0f76e049 100644 --- a/perl-install/security/level.pm +++ b/perl-install/security/level.pm @@ -7,12 +7,9 @@ use run_program; sub level_list() { ( - 0 => N("Welcome To Crackers"), - 1 => N("Poor"), - 2 => N("Standard"), - 3 => N("High"), - 4 => N("Higher"), - 5 => N("Paranoid"), + 0 => N("Disable msec"), + 1 => N("Standard"), + 2 => N("Secure"), ); } @@ -23,38 +20,35 @@ sub get_string() { to_string(get() || 2) } sub get_common_list() { map { to_string($_) } (1, 2, 3, 4, 5) } sub get() { - cat_("$::prefix/etc/profile") =~ /export SECURE_LEVEL=(\d+)/ && $1 || #- 8.0 msec - cat_("$::prefix/etc/profile.d/msec.sh") =~ /export SECURE_LEVEL=(\d+)/ && $1 || #- 8.1 msec - ${{ getVarsFromSh("$::prefix/etc/sysconfig/msec") }}{SECURE_LEVEL} || #- 8.2 msec - $ENV{SECURE_LEVEL} || 3; + ${{ getVarsFromSh("$::prefix/etc/security/msec/security.conf") }}{BASE_LEVEL} || #- 2009.1 msec + 1; } sub set { my ($security) = @_; - run_program::rooted($::prefix, 'msec', '-o', 'run_commands=0', '-o', 'log=stderr', $security || 3); + my @levelnames = ( 'none', 'standard', 'secure' ); + run_program::rooted($::prefix, 'msec', '-q', '-f', @levelnames[$security]); + run_program::rooted($::prefix, 'msecperms', '-q', '-e', '-f', @levelnames[$security]); } sub level_choose { my ($in, $security, $email) = @_; my %help = ( - 0 => N("This level is to be used with care. It makes your system more easy to use, -but very sensitive. It must not be used for a machine connected to others -or to the Internet. There is no password access."), - 1 => N("Passwords are now enabled, but use as a networked computer is still not recommended."), - 2 => N("This is the standard security recommended for a computer that will be used to connect to the Internet as a client."), - 3 => N("There are already some restrictions, and more automatic checks are run every night."), - 4 => N("With this security level, the use of this system as a server becomes possible. + 0 => N("This level is to be used with care, as it disables all additional security +provided by msec. Use it only when you want to take care of all aspects of system security +on your own."), + 1 => N("This is the standard security recommended for a computer that will be used to connect to the Internet as a client."), + 2 => N("With this security level, the use of this system as a server becomes possible. The security is now high enough to use the system as a server which can accept connections from many clients. Note: if your machine is only a client on the Internet, you should choose a lower level."), - 5 => N("This is similar to the previous level, but the system is entirely closed and security features are at their maximum."), ); - my @l = 2 .. 5; + my @l = 1 .. 2; $in->ask_from_({ title => $::isInstall ? N("Security") : N("DrakSec Basic Options"), - interactive_help_id => 'misc-params#draxid-miscellaneous', - }, [ + interactive_help_id => 'misc-params#draxid-miscellaneous', + }, [ { label => N("Please choose the desired security level"), title => 1 }, { val => $security, list => \@l, format => sub { |