summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-10-16 11:44:33 +0000
committerdamien <damien@mandriva.com>2001-10-16 11:44:33 +0000
commit0f6b8287759aa1390ee879a2b6e62f283f14c602 (patch)
tree9684178ebbbb852428f51add25f9f5c1f1f6fa7d /perl-install
parenta8bfa8dd7fa6c550cac65acc8ed9194b3d091785 (diff)
downloaddrakx-0f6b8287759aa1390ee879a2b6e62f283f14c602.tar
drakx-0f6b8287759aa1390ee879a2b6e62f283f14c602.tar.gz
drakx-0f6b8287759aa1390ee879a2b6e62f283f14c602.tar.bz2
drakx-0f6b8287759aa1390ee879a2b6e62f283f14c602.tar.xz
drakx-0f6b8287759aa1390ee879a2b6e62f283f14c602.zip
correct bad level display
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/draksec16
1 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec
index 7228e232e..4b557050f 100755
--- a/perl-install/standalone/draksec
+++ b/perl-install/standalone/draksec
@@ -47,7 +47,6 @@ delete @help{0,1,5} unless $::expert;
begin:
$::isEmbedded and kill USR2, $::CCPID;
-$secure_level = ${{ getVarsFromSh("/etc/profile") }}{SECURE_LEVEL} || $ENV{SECURE_LEVEL} || 2;
#$in->ask_from('',
# _("Choose security level") . "\n\n" . join('', map { "$l{$_}: $help{$_}\n\n" } keys %l),
@@ -55,14 +54,23 @@ $secure_level = ${{ getVarsFromSh("/etc/profile") }}{SECURE_LEVEL} || $ENV{SECUR
# { label => _($st->{$f}{text}), val => \$def_choice, list => [ 'replay', 'manual' ] }
# )
-my ($level, $libsafe);
+my $libsafe);
+my $secure_level;
+if (-e "$prefix/etc/profile.d/msec.sh") {
+ local $_ = cat_("$prefix/etc/profile.d/msec.sh");
+ /export SECURE_LEVEL=(\d+)/ and $secure_level = $1;
+}
+$secure_level ||= $ENV{SECURE_LEVEL};
+$secure_level ||= 2;
+$secure_level = $l{$secure_level};
+
my %h = getVarsFromSh("$prefix/etc/sysconfig/system");
$libsafe = $h{LIBSAFE} =~ /yes/i;
if ($in->ask_from('', _("Choose security level") . "\n\n" .
join('', map { "$l{$_}: $help{$_}\n\n" } keys %l),
[
- { label => _("Security level"), val => \$level, list => [ (values %l) ] },
+ { label => _("Security level"), val => \$secure_level, list => [ (values %l) ] },
if_(pkgs_interactive::is_installed('libsafe') && arch() =~ /^i.86/,
{ label => _("Use libsafe for servers"), val => \$libsafe, type => 'bool', text =>
_("A library which defends against buffer overflow and format string attacks.") }
@@ -73,7 +81,7 @@ if ($in->ask_from('', _("Choose security level") . "\n\n" .
$in->suspend;
$ENV{LILO_PASSWORD} = ''; # make it non interactive
- system "/usr/sbin/msec", $m{$level};
+ system "/usr/sbin/msec", $m{$secure_level};
my %t = getVarsFromSh("$prefix/etc/sysconfig/system");
$t{LIBSAFE} = bool2yesno($libsafe);