/[smeserver]/rpms/e-smith-proxy/sme9/e-smith-proxy-5.4.0-convert_acl_to_cidr.patch
ViewVC logotype

Contents of /rpms/e-smith-proxy/sme9/e-smith-proxy-5.4.0-convert_acl_to_cidr.patch

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


Revision 1.1 - (show annotations) (download)
Mon Feb 18 21:39:26 2013 UTC (11 years, 8 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-proxy-5_4_0-3_el6_sme, e-smith-proxy-5_4_0-5_el6_sme, e-smith-proxy-5_4_0-2_el6_sme, e-smith-proxy-5_4_0-4_el6_sme, HEAD
* Mon Feb 18 2013 Daniel Berteaud <daniel@firewall-services.com> 5.4.0-2.sme
- Adjust squid config syntax [SME: 7250]

1 diff -Nur e-smith-proxy-5.4.0/root/etc/e-smith/templates/etc/squid/squid.conf/20ACL10localhost e-smith-proxy-5.4.0-cidr/root/etc/e-smith/templates/etc/squid/squid.conf/20ACL10localhost
2 --- e-smith-proxy-5.4.0/root/etc/e-smith/templates/etc/squid/squid.conf/20ACL10localhost 2005-07-19 01:06:32.000000000 +0200
3 +++ e-smith-proxy-5.4.0-cidr/root/etc/e-smith/templates/etc/squid/squid.conf/20ACL10localhost 2013-02-18 22:36:12.513504277 +0100
4 @@ -1,9 +1,21 @@
5 {
6 use esmith::NetworksDB;
7 + use Net::IPv4Addr;
8
9 my $ndb = esmith::NetworksDB->open_ro();
10
11 - $localAccess = $ndb->local_access_spec();
12 + my $localAccess = '';
13 + foreach ($ndb->local_access_spec()){
14 + # If there's a / in the network string
15 + # then convert to CIDR notation
16 + if (m!/!) {
17 + my ($ip,$bits) = Net::IPv4Addr::ipv4_parse($_);
18 + $localAccess .= "$ip/$bits ";
19 + }
20 + else {
21 + $localAccess .= "$_ ";
22 + }
23 + }
24
25 $OUT .= "acl localsrc src $localAccess\n";
26 $OUT .= "acl localdst dst $localAccess";

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