diff options
author | Florent Villard <warly@mandriva.com> | 2003-09-17 17:41:09 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2003-09-17 17:41:09 +0000 |
commit | 986a271663c7f37797bec011b2ee9379e82ac4fe (patch) | |
tree | add300da8273c0c5dc56f0e13ac72066a80399d1 /dhcp_wizard | |
parent | b5974747d1a6f7669052ddd42d4a45e4eb7072c1 (diff) | |
download | drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.gz drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.bz2 drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.tar.xz drakwizard-986a271663c7f37797bec011b2ee9379e82ac4fe.zip |
better check of ip addresses in dhcp
check that server has been run in client dns
check that the program is run as root in drakwizard
remove bad quotes in po
Diffstat (limited to 'dhcp_wizard')
-rwxr-xr-x | dhcp_wizard/Dhcp.pm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/dhcp_wizard/Dhcp.pm b/dhcp_wizard/Dhcp.pm index 6aa67a38..7bf306c6 100755 --- a/dhcp_wizard/Dhcp.pm +++ b/dhcp_wizard/Dhcp.pm @@ -74,23 +74,23 @@ $o->{pages} = { next => 'summary' }, dhcp_warning => { - name => N('Warning'), - data => [ { label => N('You are in dhcp, server may not work with your configuration.') } ], + name => N('Warning') . "\n\n" . N('You are in dhcp, server may not work with your configuration.'), + ignore => 1, next => 'ip_range' }, ip_range_error => { - name => N('Error'), - data => [ { label => N('The IP range specified is not correct.') } ], + name => N('Error') . "\n\n" . N('The IP range specified is not correct.'), + ignore => 1, next => 'ip_range' }, ip_range_warning => { - name => N('Warning'), - data => [ { label => N('The IP range specified is not in server address range.') } ], + name => N('Warning') . "\n\n" . N('The IP range specified is not in server address range.'), + ignore => 1, next => 'summary' }, server_in_range => { - name => N('Error'), - data => [ { label => N('The IP of the server must not be in range.') } ], + name => N('Error') . "\n\n" . N('The IP of the server must not be in range.'), + ignore => 1, next => 'ip_range' }, summary => { @@ -104,8 +104,7 @@ $o->{pages} = { next => 'end' }, end => { - name => N('Congratulations'), - data => [ { label => N('The wizard successfully configured the DHCP services of your server.') } ], + name => N('Congratulations') . "\n\n" . N('The wizard successfully configured the DHCP services of your server.'), end => 1, next => 0 }, @@ -128,8 +127,11 @@ sub compute_range2 { } sub check { + my $check_ip = sub { return 0 if ($_[0] < 0 || $_[0] > 255); 1 }; my $r1_trunc = "$1.$2.$3" if $o->{var}{ip1} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + foreach ($1, $2, $3, $4) { $check_ip->($_) or return 'ip_range_error' } my $r2_trunc = "$1.$2.$3" if $o->{var}{ip2} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; + foreach ($1, $2, $3, $4) { $check_ip->($_) or return 'ip_range_error' } my $d1 = "$4" if $o->{var}{ip1} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $d2 = "$4" if $o->{var}{ip2} =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; my $s_trunc = "$1.$2.$3" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; |