diff options
Diffstat (limited to 'perl-install/security')
| -rw-r--r-- | perl-install/security/help.pm | 2 | ||||
| -rw-r--r-- | perl-install/security/level.pm | 30 | ||||
| -rw-r--r-- | perl-install/security/various.pm | 2 | 
3 files changed, 24 insertions, 10 deletions
| diff --git a/perl-install/security/help.pm b/perl-install/security/help.pm index 267dcd866..ec934e067 100644 --- a/perl-install/security/help.pm +++ b/perl-install/security/help.pm @@ -91,7 +91,7 @@ and crontab(1))."),  'enable_password' => N("Use password to authenticate users."), -'enable_promisc_check' => N("Activate ethernet cards promiscuity check."), +'enable_promisc_check' => N("Activate Ethernet cards promiscuity check."),  'enable_security_check' => N("Activate daily security check."), diff --git a/perl-install/security/level.pm b/perl-install/security/level.pm index c0f76e049..bb3d9ddf2 100644 --- a/perl-install/security/level.pm +++ b/perl-install/security/level.pm @@ -3,7 +3,7 @@ package security::level;  use strict;  use common;  use run_program; - +# perl_checker: require interactive  sub level_list() {      ( @@ -16,23 +16,37 @@ sub level_list() {  sub to_string { +{ level_list() }->{$_[0]} }  sub from_string { +{ reverse level_list() }->{$_[0]} || 2 } +sub rawlevel_list() { +    ( +     0 => 'none', +     1 => 'standard', +     2 => 'secure', +    ); +} + +sub to_lowlevel_string { +{ rawlevel_list() }->{$_[0]} } +sub from_lowlevel_string { +{ reverse rawlevel_list() }->{$_[0]} || 2 } +  sub get_string() { to_string(get() || 2) }  sub get_common_list() { map { to_string($_) } (1, 2, 3, 4, 5) }  sub get() { -    ${{ getVarsFromSh("$::prefix/etc/security/msec/security.conf") }}{BASE_LEVEL}  || #- 2009.1 msec -    1; +    my $level = ${{ getVarsFromSh("$::prefix/etc/security/msec/security.conf") }}{BASE_LEVEL} || #- 2009.1 msec +    "standard"; +    from_lowlevel_string($level);  }  sub set {      my ($security) = @_; -    my @levelnames = ( 'none', 'standard', 'secure' ); -    run_program::rooted($::prefix, 'msec', '-q', '-f', @levelnames[$security]); -    run_program::rooted($::prefix, 'msecperms', '-q', '-e', '-f', @levelnames[$security]); +    my @levelnames = ('none', 'standard', 'secure'); +    # use Standard level if specified level is out of range +    $security = 1 if $security > $#levelnames; +    run_program::rooted($::prefix, 'msec', '-q', '-f', $levelnames[$security]); +    run_program::rooted($::prefix, 'msecperms', '-q', '-e', $levelnames[$security]);  }  sub level_choose { -    my ($in, $security, $email) = @_; +    my ($in, $security, $email) = @_; # perl_checker: $in = interactive->new      my %help = (        0 => N("This level is to be used with care, as it disables all additional security @@ -47,7 +61,7 @@ connections from many clients. Note: if your machine is only a client on the Int      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 => 'securityLevel',             }, [                { label => N("Please choose the desired security level"), title => 1 },                { val => $security, list => \@l,  diff --git a/perl-install/security/various.pm b/perl-install/security/various.pm index 140eed5c4..2e4abd397 100644 --- a/perl-install/security/various.pm +++ b/perl-install/security/various.pm @@ -1,4 +1,4 @@ -package security::various; # $Id$ +package security::various;  use diagnostics;  use strict; | 
