From 5889ffb5e002dab1e71b8ff4d0cef5f5bb90d5ba Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Sat, 27 Dec 2014 20:32:17 +0500 Subject: Added ability to change ClamAV mode from GUI --- config/havp/havp.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/havp/havp.xml b/config/havp/havp.xml index 3e12f5bb..433e9c33 100644 --- a/config/havp/havp.xml +++ b/config/havp/havp.xml @@ -67,6 +67,22 @@ Check this for enable proxy. checkbox + + ClamAV mode + use_clamd + + Select ClamAV running mode:<br> + <b>Daemon</b> - HAVP will use ClamAV as socket scanner daemon. Default option.<br> + <b>Library</b> - HAVP will use ClamAV as loaded library scanner. Note: this mode needs much more memory.<br> + Attention: In order to switch mode properly, you need to save settings twice. Since don`t know why, simply save twice. + + select + true + + + + + Proxy mode proxymode -- cgit v1.2.3 From c621a1088eb70c39fd8dbcc7fbefc48d3c03fa53 Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Sat, 27 Dec 2014 20:44:17 +0500 Subject: Added ability to change ClamAV mode from GUI Attention. Don`t know why, but to properly change mode settings needs to be saved twice. Looks like reading settings executing before "save" command. Maybe someone could investigate that. At this version added notice in gui. --- config/havp/havp.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 08937a2f..6c26a0d4 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -48,7 +48,8 @@ if(!function_exists("filter_configure")) define('HV_DEBUG', 'false'); # use Clamd daemon (another - use libclam) -define('HV_USE_CLAMD', 'true'); +$use_clamd_mode = $config['installedpackages']['havp']['config'][0]['use_clamd']; +define('HV_USE_CLAMD', $use_clamd_mode); define('HV_CLAMD_TCPSOCKET', 'true'); # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From bfab6f2300dccf54e696bb2e98c2794c58c4a046 Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Sat, 27 Dec 2014 21:41:34 +0500 Subject: Added ability to change ClamAV mode from GUI Solves situation when "save" needs to be pressed twice. --- config/havp/havp.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/havp/havp.xml b/config/havp/havp.xml index 433e9c33..f66fd003 100644 --- a/config/havp/havp.xml +++ b/config/havp/havp.xml @@ -74,7 +74,6 @@ Select ClamAV running mode:<br> <b>Daemon</b> - HAVP will use ClamAV as socket scanner daemon. Default option.<br> <b>Library</b> - HAVP will use ClamAV as loaded library scanner. Note: this mode needs much more memory.<br> - Attention: In order to switch mode properly, you need to save settings twice. Since don`t know why, simply save twice. select true -- cgit v1.2.3 From 676e6e803ffd82670c5d25e8803bca8ce5da590a Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Sat, 27 Dec 2014 21:45:14 +0500 Subject: Added ability to change ClamAV mode from GUI Solves situation when "save" needs to be pressed twice. --- config/havp/havp.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 6c26a0d4..8118f695 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -48,8 +48,7 @@ if(!function_exists("filter_configure")) define('HV_DEBUG', 'false'); # use Clamd daemon (another - use libclam) -$use_clamd_mode = $config['installedpackages']['havp']['config'][0]['use_clamd']; -define('HV_USE_CLAMD', $use_clamd_mode); +# define('HV_USE_CLAMD', 'true'); define('HV_CLAMD_TCPSOCKET', 'true'); # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -152,6 +151,7 @@ define('HV_SCANTEMPFILE', 'hv_scan_tempfile'); # XML fields # ------------------------------------------------------------------------------ define('F_ENABLE', 'enable'); +define('F_USECLAMD', 'useclamd'); define('F_PROXYMODE', 'proxymode'); define('F_PROXYINTERFACE', 'proxyinterface'); define('F_PROXYBINDIFACE', 'proxybindiface'); # internal var @@ -516,6 +516,8 @@ function havp_convert_pfxml_xml() # === GUI Fields === $havp_config[F_ENABLE] = ( $pfconf[F_ENABLE] === 'on' ? 'true' : 'false' ); + # ClamAV mode + $havp_config[F_USECLAMD] = $pfconf[F_USECLAMD]; # proxy $havp_config[F_PROXYMODE] = ( !empty($pfconf[F_PROXYMODE]) ? $pfconf[F_PROXYMODE] : 'standard' ); # ToDo: add check squid transparent @@ -711,9 +713,9 @@ function havp_config_havp() $conf[] = "MAXDOWNLOADSIZE {$havp_config[F_MAXDOWNLOADSIZE]}"; # $conf[] = "\n# ClamAV Library Scanner (libclamav) "; - $conf[] = "ENABLECLAMLIB " . (HV_USE_CLAMD !== 'true' ? "true" : "false"); + $conf[] = "ENABLECLAMLIB " . ($havp_config[F_USECLAMD] !== 'true' ? "true" : "false"); # use clamd, if configured - if (HV_USE_CLAMD === 'true') { + if ($havp_config[F_USECLAMD] === 'true') { $conf[] = "\n# Clamd scanner (Clam daemon)"; $conf[] = "ENABLECLAMD true"; # clamd socket @@ -1343,7 +1345,7 @@ function havp_startup_script() $s[] = "\t# start"; $s[] = "\tif [ -z \"`{$havpchk}`\" ];then"; - if (HV_USE_CLAMD === 'true') { + if ($havp_config[F_USECLAMD] === 'true') { $clampid_dir = HVDEF_CLAM_RUNDIR; $s[] = "\t\t# start clamd before (to be sure)"; $s[] = "\t\t" . HVDEF_CLAM_STARTUP_SCRIPT . " start"; @@ -1564,7 +1566,7 @@ function start_antivirus_scanner($filename) $param[] = "--max-dir-recursion=255"; # Maximum directory recursion level $param = implode(" ", $param); - if (HV_USE_CLAMD === 'true') + if ($havp_config[F_USECLAMD] === 'true') $param = "clamdscan $param $filename"; # use clamd daemon (more quickly) else $param = "clamscan $param $filename"; -- cgit v1.2.3 From dbf76323627819b71ddba9f929ff5f67ad43c05a Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Sat, 27 Dec 2014 21:46:12 +0500 Subject: Added ability to change ClamAV mode from GUI --- config/havp/havp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/havp/havp.xml b/config/havp/havp.xml index f66fd003..51356862 100644 --- a/config/havp/havp.xml +++ b/config/havp/havp.xml @@ -69,7 +69,7 @@ ClamAV mode - use_clamd + useclamd Select ClamAV running mode:<br> <b>Daemon</b> - HAVP will use ClamAV as socket scanner daemon. Default option.<br> -- cgit v1.2.3 From 836b3eacfb6eeba969453ea075b7888865da8b1c Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Tue, 30 Dec 2014 00:24:10 +0500 Subject: Bump HAVP package version due to last changes --- pkg_config.8.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 673bfc2f..2d83bb41 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1394,7 +1394,7 @@ havp-0.91_1-i386.pbi /usr/ports/www/havp CLAMAVUSER=havp;CLAMAVGROUP=havp - 0.91_1 pkg v1.03 + 0.91_1 pkg v1.04 BETA 1.2.2 https://packages.pfsense.org/packages/config/havp/havp.xml -- cgit v1.2.3 From ff6e832a42687468b8d21201ccec53beb80fd318 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Tue, 30 Dec 2014 00:25:15 +0500 Subject: Bump HAVP package version due to last changes --- pkg_config.8.xml.amd64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 7349e565..3489d4e5 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1381,7 +1381,7 @@ havp-0.91_1-amd64.pbi /usr/ports/www/havp CLAMAVUSER=havp;CLAMAVGROUP=havp - 0.91_1 pkg v1.03 + 0.91_1 pkg v1.04 BETA 1.2.2 https://packages.pfsense.org/packages/config/havp/havp.xml -- cgit v1.2.3 From 96e9c8b943230eb5c7668ebac627fbb328fe42f9 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Tue, 30 Dec 2014 00:26:23 +0500 Subject: Bump HAVP package version due to last changes --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index b1b98931..c74b4bc2 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1059,7 +1059,7 @@ security/clamav CLAMAVUSER=havp;CLAMAVGROUP=havp - 0.91_3 pkg v1.03 + 0.91_3 pkg v1.04 BETA 2.2 https://packages.pfsense.org/packages/config/havp/havp.xml -- cgit v1.2.3