diff options
author | Thierry Vignaud <tv@mageia.org> | 2011-05-19 00:31:34 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2011-05-19 00:31:34 +0000 |
commit | 0fc288a92156fe7ef712bef48a84293e0ffa04bc (patch) | |
tree | 6299a636f991fa9dd3fef3f73b51696c748e4519 /perl-install | |
parent | ad804a1c57135503fb3bf710ea0d08303c63027a (diff) | |
download | drakx-0fc288a92156fe7ef712bef48a84293e0ffa04bc.tar drakx-0fc288a92156fe7ef712bef48a84293e0ffa04bc.tar.gz drakx-0fc288a92156fe7ef712bef48a84293e0ffa04bc.tar.bz2 drakx-0fc288a92156fe7ef712bef48a84293e0ffa04bc.tar.xz drakx-0fc288a92156fe7ef712bef48a84293e0ffa04bc.zip |
(rawlevel_list,to_lowlevel_string,from_lowlevel_string) introduce them
in order to read/write new msec config file format
(get) fix reading security level with new msec (mga#332)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/security/level.pm | 14 |
3 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index aa875fba3..d6de85c28 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -9,6 +9,7 @@ which is deprecated. - scannerdrake: use skanlite instead of kooka - any.pm: fix faces icons paths (mga#1315) +- fix reading security level with new msec (mga#332) Version 13.52 - 14 May 2011 diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index bcba2f826..1754f53f0 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,4 +1,5 @@ - advertize LibreOffice instead of OpenOffice.org (mga#1323) +- fix reading security level with new msec (mga#332) Version 13.53 - 16 May 2011 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 { |