package security::level; use strict; use common; 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"), ); } sub to_string { +{ level_list() }->{$_[0]} } sub from_string { +{ reverse level_list() }->{$_[0]} || 2 } 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; } sub set { my ($security) = @_; run_program::rooted($::prefix, 'msec', '-o', 'run_commands=0', '-o', 'log=stderr', $security || 3); } sub level_choose { my ($in, $security, $libsafe, $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. 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; $in->ask_from_({ title => $::isInstall ? N("Security") : N("DrakSec Basic Options"), messages => N("Please choose the desired security level") . "\n\n" . join('', map { to_string($_) . ": " . formatAlaTeX($help{$_}) . "\n\n" } @l), interactive_help_id => 'miscellaneous', }, [ { label => N("Security level"), val => $security, list => \@l, format => \&to_string }, if_($in->do_pkgs->is_installed('libsafe') && arch() =~ /^i.86/, { label => N("Use libsafe for servers"), val => $libsafe, type => 'bool', text => N("A library which defends against buffer overflow and format string attacks.") }), { label => N("Security Administrator (login or email)"), val => $email, }, ], ); } 1; Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
...
* better explanation of the wp fieldThierry Vignaud2003-05-201-1/+1
* fix #3960: divide by zero execptionThierry Vignaud2003-05-201-1/+1
* fix #3959 : add aic79xx scsi host controller driverThierry Vignaud2003-05-201-1/+1
* perl_checker compliantDamien Chaumette2003-05-201-8/+7
* first bits of 9.2-0.1mdkThierry Vignaud2003-05-201-2/+6
* fix #3952: do not pass extra argument (gc alteredThierry Vignaud2003-05-201-1/+1
* - fix #3616 (draksec discarding changes)Thierry Vignaud2003-05-201-2/+2
* perl_checker fixThierry Vignaud2003-05-201-2/+2
* add a bug referenceThierry Vignaud2003-05-191-1/+1
* some drakconnect cleanupsThierry Vignaud2003-05-191-5/+2
* in standalone drakboot, raise a wait message window so that the user can figureThierry Vignaud2003-05-191-0/+2
* dialog window is already modalThierry Vignaud2003-05-191-1/+0
* - (read_location, rip_location): simplify loop condition since once we getThierry Vignaud2003-05-191-5/+3
* - (get_cups_autoconf, set_cups_autoconf, get_usermode, set_usermode): simplifyThierry Vignaud2003-05-191-72/+13
* (gimp::pop_spaces): consolidate skipping of lines that are space endedThierry Vignaud2003-05-191-8/+9
* perl_checker fixesThierry Vignaud2003-05-198-308/+297
* localize drive capabilites (aka burning, dvd managment, ...)Thierry Vignaud2003-05-191-0/+5
* fix #3560 (drakboot not updating bootloader label): the only confusingThierry Vignaud2003-05-192-3/+15
* further fix #2826 (lilo failling to handle entry with spaces): replaceThierry Vignaud2003-05-191-0/+1
* when configuring to install grub bootloader, we first install lilo, then grub.Thierry Vignaud2003-05-191-1/+1
* let further consolidate make_label_lilo_compatible()Thierry Vignaud2003-05-191-2/+2
* fix network::netconnect::save_conf() calleeThierry Vignaud2003-05-191-1/+1
* updated Spanish translationsFabián Mandelbaum2003-05-191-221/+176
* simplifyThierry Vignaud2003-05-191-5/+2
* do not drop return values from regexp but use them to ensure we do notThierry Vignaud2003-05-191-1/+1
* move expert stuff under the "advanced" button like in all other drakx/drakxto...Thierry Vignaud2003-05-191-7/+6
* %langs: first column is supposed to be localized in englishThierry Vignaud2003-05-191-3/+3
* last 9.1-38mdk bitsThierry Vignaud2003-05-191-1/+7
* update perl-gtk0 users list (drakcronat being ported to gtk+2)Thierry Vignaud2003-05-191-1/+4
* first bits of 9.1-38mdkThierry Vignaud2003-05-161-2/+5
* updated pot filePablo Saratxaga2003-05-16