1 |
slords |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-s2s-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpns2s.pm mezzanine_patched_smeserver-openvpn-s2s-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpns2s.pm |
2 |
|
|
--- smeserver-openvpn-s2s-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpns2s.pm 2010-10-17 00:07:07.000000000 +0200 |
3 |
|
|
+++ mezzanine_patched_smeserver-openvpn-s2s-0.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpns2s.pm 2010-10-17 00:06:48.000000000 +0200 |
4 |
|
|
@@ -333,13 +333,17 @@ |
5 |
|
|
sub is_valid_net_or_empty{ |
6 |
|
|
my ($fm, $nets) = @_; |
7 |
|
|
my $ret = 'OK'; |
8 |
|
|
+ my $conf = $fm->{cgi}->param('conf_name') || ''; |
9 |
|
|
|
10 |
|
|
foreach my $net (split (/[;,]/, $nets)){ |
11 |
|
|
$ret = $fm->localise('INVALID_NET') unless $net =~ m/([\d\.]+)\/([\d\.]+)/; |
12 |
|
|
my $netaddr = $1; |
13 |
|
|
my $mask = $2; |
14 |
|
|
- $ret = $fm->localise('INVALID_NET') unless |
15 |
|
|
- (CGI::FormMagick::Validator::ip_number($fm,$netaddr) eq 'OK' && |
16 |
|
|
+ $ret = $fm->localise('NET_IS_LOCAL') if |
17 |
|
|
+ ($net_db->get("$netaddr") && |
18 |
|
|
+ ($net_db->get("$netaddr")->prop('VPN') || '') ne $conf); |
19 |
|
|
+ $ret = $fm->localise('INVALID_NET') unless |
20 |
|
|
+ (CGI::FormMagick::Validator::ip_number($fm,$netaddr) eq 'OK' && |
21 |
|
|
CGI::FormMagick::Validator::ip_number($fm,$mask) eq 'OK'); |
22 |
|
|
} |
23 |
|
|
return $ret; |