/[smeserver]/rpms/e-smith-base/sme8/e-smith-base-4.18.0-gateway_validation.patch
ViewVC logotype

Annotation of /rpms/e-smith-base/sme8/e-smith-base-4.18.0-gateway_validation.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue Jun 12 18:30:34 2007 UTC (17 years, 4 months ago) by slords
Branch: MAIN
CVS Tags: e-smith-base-4_18_0-58_el5_sme, e-smith-base-4_18_0-89_el5_sme, e-smith-base-4_18_0-82_el5_sme, e-smith-base-4_18_0-67_el5_sme, e-smith-base-4_18_0-88_el5_sme, e-smith-base-4_18_0-87_el5_sme, e-smith-base-4_18_0-77_el5_sme, e-smith-base-4_18_0-69_el5_sme, e-smith-base-4_18_0-81_el5_sme, e-smith-base-4_18_0-100_el5_sme, e-smith-base-4_18_0-72_el5_sme, e-smith-base-4_18_0-62_el5_sme, e-smith-base-4_18_0-61_el5_sme, e-smith-base-4_18_0-78_el5_sme, e-smith-base-4_18_0-60_el5_sme, e-smith-base-4_18_0-94_el5_sme, e-smith-base-4_18_0-66_el5_sme, e-smith-base-4_18_0-83_el5_sme, e-smith-base-4_18_0-59_el5_sme, e-smith-base-4_18_0-63_el5_sme, e-smith-base-4_18_0-92_el5_sme, e-smith-base-4_18_0-64_el5_sme, e-smith-base-4_18_0-101_el5_sme, e-smith-base-4_18_0-98_el5_sme, e-smith-base-4_18_0-102_el5_sme, e-smith-base-4_18_0-90_el5_sme, e-smith-base-4_18_0-104_el5_sme, e-smith-base-4_18_0-71_el5_sme, e-smith-base-4_18_0-103_el5_sme, e-smith-base-4_18_0-99_el5_sme, e-smith-base-4_18_0-73_el5_sme, e-smith-base-4_18_0-79_el5_sme, e-smith-base-4_18_0-75_el5_sme, e-smith-base-4_18_0-76_el5_sme
Import on branch sme8 of package e-smith-base-4.18.0-58.el5.sme.src.rpm

1 slords 1.1 diff -Nur -x '*.orig' -x '*.rej' e-smith-base-4.18.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm mezzanine_patched_e-smith-base-4.18.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm
2     --- e-smith-base-4.18.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm 2007-04-27 15:09:31.000000000 -0400
3     +++ mezzanine_patched_e-smith-base-4.18.0/root/usr/lib/perl5/site_perl/esmith/console/configure.pm 2007-04-27 15:08:19.000000000 -0400
4     @@ -6,7 +6,7 @@
5     use esmith::util::network qw(:all);
6     use esmith::db;
7     use esmith::ethernet;
8     -use Net::IPv4Addr qw(ipv4_network);
9     +use Net::IPv4Addr qw(:all);
10    
11     our @adapters;
12     our $console;
13     @@ -1096,26 +1096,33 @@
14    
15     goto STATIC_NETMASK unless ($rc == 0);
16    
17     - if ($choice)
18     + $choice ||= '';
19     + my $error = undef;
20     + if (!isValidIP($choice))
21     {
22     - if (isValidIP($choice) )
23     - {
24     - $db->set_value('GatewayIP', cleanIP($choice));
25     - goto OTHER_PARAMETERS;
26     - }
27     + $error = "not a valid IP address";
28     }
29     - else
30     + elsif (cleanIP($choice) eq $db->get_value('ExternalIP'))
31     {
32     - $choice = '';
33     + $error = "address matches external interface address";
34     }
35     + elsif (!ipv4_in_network($db->get_value('ExternalIP'),
36     + $db->get_value('ExternalNetmask'), "$choice/32"))
37     + {
38     + $error = "address is not local";
39     + }
40     + if ($error)
41     + {
42     + ($rc, $choice) = $console->tryagain_page
43     + (
44     + title => gettext("Invalid") . " - " . gettext($error),
45     + choice => $choice,
46     + );
47    
48     - ($rc, $choice) = $console->tryagain_page
49     - (
50     - title => gettext("Invalid gateway IP address"),
51     - choice => $choice,
52     - );
53     -
54     - goto STATIC_GATEWAY;
55     + goto STATIC_GATEWAY;
56     + }
57     + $db->set_value('GatewayIP', cleanIP($choice));
58     + goto OTHER_PARAMETERS;
59     }
60    
61     #------------------------------------------------------------
62     @@ -1702,27 +1709,41 @@
63    
64     goto SYSTEM_MODE unless ($rc == 0);
65    
66     - if ($choice eq "")
67     + $choice ||= '';
68     + if (!$choice)
69     {
70     $db->delete('GatewayIP');
71     $db->set_value('AccessType', 'off');
72     goto OTHER_PARAMETERS;
73     }
74    
75     - if ( isValidIP($choice) )
76     + my $error = undef;
77     + if (!isValidIP($choice))
78     {
79     - $db->set_value('GatewayIP', cleanIP($choice));
80     - $db->set_value('AccessType', 'dedicated');
81     - goto OTHER_PARAMETERS;
82     + $error = "not a valid IP address";
83     }
84     + elsif (cleanIP($choice) eq $db->get_value('LocalIP'))
85     + {
86     + $error = "address matches local interface address";
87     + }
88     + elsif (!ipv4_in_network($db->get_value('LocalIP'),
89     + $db->get_value('LocalNetmask'), "$choice/32"))
90     + {
91     + $error = "address is not local";
92     + }
93     + if ($error)
94     + {
95     + ($rc, $choice) = $console->tryagain_page
96     + (
97     + title => gettext("Invalid") . " - " . gettext($error),
98     + choice => $choice,
99     + );
100    
101     - ($rc, $choice) = $console->tryagain_page
102     - (
103     - title => gettext("Invalid gateway IP address"),
104     - choice => $choice,
105     - );
106     -
107     - goto SERVER_ONLY;
108     + goto SERVER_ONLY;
109     + }
110     + $db->set_value('GatewayIP', cleanIP($choice));
111     + $db->set_value('AccessType', 'dedicated');
112     + goto OTHER_PARAMETERS;
113     }
114    
115     #------------------------------------------------------------

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed