summaryrefslogtreecommitdiffstats
path: root/dhcp_wizard
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2003-09-17 17:41:09 +0000
committerFlorent Villard <warly@mandriva.com>2003-09-17 17:41:09 +0000
commit986a271663c7f37797bec011b2ee9379e82ac4fe (patch)
treeadd300da8273c0c5dc56f0e13ac72066a80399d1 /dhcp_wizard
parentb5974747d1a6f7669052ddd42d4a45e4eb7072c1 (diff)
downloaddrakwizard-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-xdhcp_wizard/Dhcp.pm22
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})/;