Dansguardian icap scanning URL and contentscannertimeout



  • I noted a problem with the Dansguardian/General tab not doing two things correctly…
    1.) wasn't saving the "contentscannertimeout" value in dansguardian.conf (or the config.xml)
    2.) wasn't saving the ICap URL value in the icapscan.conf file

    I've attached patch diffs for fixing both issues (they were relate). Will look at getting this into GitHub if I have time...

    Patch for /usr/local/pkg/dansguardian_config.xml

    --- dansguardian_config.xml	2013-10-16 09:53:31.847579920 -0400
    +++ dansguardian_config.xml.new	2013-10-16 09:51:56.255576295 -0400
    @@ -274,7 +274,7 @@
    
     		 <field><fielddescr>ICAP URL</fielddescr>
    -			<fieldname>contentscannertimeout</fieldname>
    +			<fieldname>icapurl</fieldname>
     			<type>input</type>
     			<size>40</size>
     			<description>icap://icapserver:1344/avscan format
    
    [/code]
    
    patch for /usr/local/pkg/dansguardian.inc
    [code]--- dansguardian.inc    2013-09-18 20:22:24.110941141 -0400
    +++ dansguardian.inc.new        2013-10-16 10:24:02.003649323 -0400
    @@ -185,6 +185,7 @@
            $icapscan=(preg_match('/icapscan/',$dansguardian_config['content_scanners'])?"on":"off");
            $contentscannertimeout=($dansguardian_config['contentscannertimeout']?$dansguardian_config['contentscannertimeout']:"60");
            $contentscanexceptions=($dansguardian_config['contentscanexceptions']?"on":"off");
    +       $icapurl=($dansguardian_config['icapurl']?$dansguardian_config['icapurl']:"icap://icapserver:1344/avscan");
            $recheckreplacedurls=(preg_match('/recheckreplacedurls/',$dansguardian_config['misc_options'])?"on":"off");
            $forwardedfor=(preg_match('/forwardedfor/',$dansguardian_config['misc_options'])?"on":"off");
            $recheckreplacedurls=(preg_match('/icapscan/',$dansguardian_config['misc_options'])?"on":"off");
    @@ -974,6 +975,7 @@
            $filterip=($filterip==""?"filterip = ":$filterip);
            $filterports=($filterports==""?"filterports = $filterport":$filterports);
            include("/usr/local/pkg/dansguardian.conf.template");
    +       include("/usr/local/pkg/icapscan.conf.template");
    
            #check cron_tab
            $new_cron=array();
    @@ -1111,6 +1113,7 @@
    
            #create config files
            file_put_contents($dansguardian_dir."/dansguardian.conf", $dg, LOCK_EX);
    +       file_put_contents($dansguardian_dir."/contentscanners/icapscan.conf", $icapconf, LOCK_EX);
    
            #check virus_scanner options
            $libexec_dir= DANSGUARDIAN_DIR."/libexec/dansguardian/";
    [/code]
    
    New file to be created /usr/local/pkg/icapscan.conf.template
    [code]	$icapconf=<<<eof<br>plugname = 'icapscan'
    
    # ICAP URL
    # Use hostname rather than IP address
    # Always specify the port
    #
    icapurl = '{$icapurl}'
    
    exceptionvirusmimetypelist = '/usr/pbi/dansguardian-amd64/etc/dansguardian/lists/contentscanners/exceptionvirusmimetypelist'
    exceptionvirusextensionlist = '/usr/pbi/dansguardian-amd64/etc/dansguardian/lists/contentscanners/exceptionvirusextensionlist'
    exceptionvirussitelist = '/usr/pbi/dansguardian-amd64/etc/dansguardian/lists/contentscanners/exceptionvirussitelist'
    exceptionvirusurllist = '/usr/pbi/dansguardian-amd64/etc/dansguardian/lists/contentscanners/exceptionvirusurllist'
    EOF;
    ?>
    [/code]</eof<br></description></field>
    


  • OK. Submitted a pull request.



  • @rjcrowder:

    OK. Submitted a pull request.

    merged. :) Thanks!


Log in to reply