summaryrefslogtreecommitdiffstats
path: root/perl-install/security/level.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/security/level.pm')
-rw-r--r--perl-install/security/level.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/security/level.pm b/perl-install/security/level.pm
index 15dcdc2fe..51fe4b853 100644
--- a/perl-install/security/level.pm
+++ b/perl-install/security/level.pm
@@ -16,12 +16,24 @@ 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
+ my $level = ${{ getVarsFromSh("$::prefix/etc/security/msec/security.conf") }}{BASE_LEVEL} || #- 2009.1 msec
1;
+ from_lowlevel_string($level);
}
sub set {