diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2013-05-19 22:21:45 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2013-05-19 22:21:45 -0400 |
commit | 6349929d81e4248672d754798c1dbb485933ff91 (patch) | |
tree | 76524fbd919f7baf5970a6b765e867ea1cd151b5 /config | |
parent | 717af69c8a12e258c61c9fa410b642c80042cfc5 (diff) | |
parent | 61944b680cd6269aa1a6b57b703084ed19b62fb6 (diff) | |
download | pfsense-packages-6349929d81e4248672d754798c1dbb485933ff91.tar.gz pfsense-packages-6349929d81e4248672d754798c1dbb485933ff91.tar.bz2 pfsense-packages-6349929d81e4248672d754798c1dbb485933ff91.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'config')
-rw-r--r-- | config/squid/squid.inc | 2 | ||||
-rwxr-xr-x | config/squid3/33/squid.inc | 35 |
2 files changed, 24 insertions, 13 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc index bd0c8634..34186407 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -295,7 +295,7 @@ function squid_before_form_general($pkg) { } $field = &$pkg['fields']['field'][$i]; - for ($i = 0; $i < count($values) - 1; $i++) + for ($i = 0; $i < count($values); $i++) $field['options']['option'][] = array('name' => $names[$i], 'value' => $values[$i]); } diff --git a/config/squid3/33/squid.inc b/config/squid3/33/squid.inc index 8eb9f2fa..a29fb3c6 100755 --- a/config/squid3/33/squid.inc +++ b/config/squid3/33/squid.inc @@ -427,6 +427,10 @@ function squid_validate_general($post, $input_errors) { $input_errors[] = "You can not run squid on the same port as the webgui"; } + if (($post['ssl_proxy'] == 'on') && ( $post['dca'] == '')) { + $input_errors[] = "SSL interception cannot be enabled without a CA."; + } + foreach (array('defined_ip_proxy_off') as $hosts) { foreach (explode(";", $post[$hosts]) as $host) { $host = trim($host); @@ -783,7 +787,7 @@ function squid_check_ca_hashes(){ #check certificates $cert_count=0; if (is_dir(SQUID_LOCALBASE. '/share/certs')) - if ($handle = opendir(SQUID_LOCALBASE.'/usr/local/share/certs')) { + if ($handle = opendir(SQUID_LOCALBASE.'/share/certs')) { while (false !== ($file = readdir($handle))) if (preg_match ("/\d+.0/",$file)) $cert_count++; @@ -1345,9 +1349,9 @@ EOF; if (!file_exists(SQUID_LOCALBASE."/etc/c-icap/squidclamav.conf.sample")) if (file_exists(SQUID_LOCALBASE."/etc/c-icap/squidclamav.conf.default")){ $sample_file=file_get_contents(SQUID_LOCALBASE."/etc/c-icap/squidclamav.conf.default"); - $matches[0]="@/var/run/clamav/clamd.ctl@"; - $replaces[0]="/var/run/clamav/clamd.sock"; - file_put_contents(SQUID_LOCALBASE."/etc/c-icap/squidclamav.conf.sample",preg_replace($matches,$replaces,$sample_file),LOCK_EX); + $clamav_m[0]="@/var/run/clamav/clamd.ctl@"; + $clamav_r[0]="/var/run/clamav/clamd.sock"; + file_put_contents(SQUID_LOCALBASE."/etc/c-icap/squidclamav.conf.sample",preg_replace($clamav_m,$clamav_r,$sample_file),LOCK_EX); } #c-icap.conf if (!file_exists(SQUID_LOCALBASE."/etc/c-icap/c-icap.conf.sample")) @@ -1355,8 +1359,6 @@ EOF; $sample_file=file_get_contents(SQUID_LOCALBASE."/etc/c-icap/c-icap.conf.default"); if (! preg_match ("/squidclamav/")) $sample_file.="\nService squidclamav squidclamav.so\n"; - if (! preg_match ("/User proxy/")) - $sample_file.="\nUser proxy\n"; file_put_contents(SQUID_LOCALBASE."/etc/c-icap/c-icap.conf.sample",$sample_file,LOCK_EX); } @@ -1378,8 +1380,8 @@ EOF; $antivirus_config = $config['installedpackages']['squidantivirus']['config'][0]; } #check dirs - $dirs=array("/var/run/c-icap" => "proxy", - "/var/log/c-icap" => "proxy", + $dirs=array("/var/run/c-icap" => "clamav", + "/var/log/c-icap" => "clamav", "/var/log/clamav" => "clamav", "/var/run/clamav" => "clamav", "/var/db/clamav" => "clamav"); @@ -1404,11 +1406,20 @@ EOF; #check antivirus daemons #check icap - if (is_process_running("c-icap")) - mwexec_bg("/usr/local/etc/rc.d/c-icap reload"); - else + if (is_process_running("c-icap")){ + mwexec('/bin/echo -n "reconfigure" > /var/run/c-icap/c-icap.ctl'); + } + else{ + #check c-icap user on startup file + $c_icap_rcfile="/usr/local/etc/rc.d/c-icap"; + if (file_exists($c_icap_rcfile)){ + $sample_file=file_get_contents($c_icap_rcfile); + $cicapm[0]="@c_icap_user=.*}@"; + $cicapr[0]='c_icap_user="clamav"}'; + file_put_contents($c_icap_rcfile,preg_replace($cicapm,$cicapr,$sample_file),LOCK_EX); + } mwexec("/usr/local/etc/rc.d/c-icap start"); - + } #check clamav if (is_process_running("clamd")) mwexec_bg("/usr/local/etc/rc.d/clamav-clamd reload"); |