Bug 115353

Summary: security/clamav - security/clamav-milter does not start up when clamd listens TCP socket
Product: Ports & Packages Reporter: Alexander Shikoff <minotaur>
Component: Individual Port(s)Assignee: Renato Botelho <garga>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alexander Shikoff 2007-08-09 15:50:00 UTC
If clamd configured to use only TCP socket then clamav-milter rc.d script does not start clamav-milter. -S test in rc.d-script fails because there is no clamd UNIX-socket.

Fix: Apply attached patch to clamav-milter rc.d-script, set clamav_clamd_socket variable to empty string in rc.conf to disable checks of local clamd UNIX-socket.


Patch attached with submission follows:
How-To-Repeat: 1. Disable LocalSocket and enable "TCPSocket 3310" and "TCPAddr 127.0.0.1" in clamd.conf.

2. Add following lines to rc.conf:
clamav_freshclam_enable="YES"
clamav_clamd_enable=YES

clamav_milter_enable="YES"
clamav_milter_socktimeout=2
clamav_milter_socket="/var/run/clamav/milter.sock"
clamav_milter_flags="   --dont-scan-on-error \
                        --force-scan \
                        --blacklist-time=60 \
                        --quiet \
                        --max-children=16 \
                        --timeout=30 \
                        --external \
                        --server=localhost"

3. Start clamd with "/usr/local/etc/rc.d/clamav-clamd start" command.

4. Try to start clamav-milter. You should get the following error:
# /usr/local/etc/rc.d/clamav-milter start
Waiting for clamd socket.. 
There is no clamd socket (/var/run/clamav/clamd)!
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-08-10 06:54:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

Over to maintainer
Comment 2 Renato Botelho freebsd_committer freebsd_triage 2007-08-13 19:48:54 UTC
Hello,

Could you apply following patch on your clamav port, reinstall it and test
it for me? If it works fine i can commit.

FYI, with this change, you need to set clamav_clamd_socket="" on your
/etc/rc.conf

Thanks

----------------------------------------------------------------------
Index: files/clamav-milter.in
===================================================================
RCS file: /home/pcvs/ports/security/clamav-devel/files/clamav-milter.in,v
retrieving revision 1.3
diff -u -r1.3 clamav-milter.in
--- files/clamav-milter.in	29 May 2007 17:33:52 -0000	1.3
+++ files/clamav-milter.in	13 Aug 2007 18:48:18 -0000
@@ -36,7 +36,7 @@
 	fi
 	rc_flags="--pidfile ${pidfile} ${flags:-$clamav_milter_flags} $clamav_milter_socket"
 	
-	if checkyesno clamav_clamd_enable; then
+	if checkyesno clamav_clamd_enable && [ "x$clamav_clamd_socket" != "x" ]; then
 		echo -n "Waiting for clamd socket.. "
 		i=${clamav_milter_socktimeout}
 		while [ $i -ne 0 ]
----------------------------------------------------------------------
-- 
Renato Botelho <garga @ FreeBSD.org>
               <freebsd @ galle.com.br>
GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc

Therefore it is necessary to learn how not to be good, and to use
this knowledge and not use it, according to the necessity of the cause.
		-- Machiavelli
Comment 3 Renato Botelho freebsd_committer freebsd_triage 2007-08-13 19:49:30 UTC
State Changed
From-To: open->feedback

Wait submitter test and answer
Comment 4 Alexander Shikoff 2007-08-14 08:10:06 UTC
On Mon, Aug 13, 2007 at 06:49:31PM +0000, garga@FreeBSD.org wrote:
> Synopsis: security/clamav - security/clamav-milter does not start up when clamd listens TCP socket
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: garga
> State-Changed-When: Mon Aug 13 18:49:30 UTC 2007
> State-Changed-Why: 
> Wait submitter test and answer
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=115353

Hello,

Your patch applies cleanly and works fine. Thanks!

-- 
Kind Regards,	Alexander Shikoff
minotaur@crete.org.ua
Comment 5 dfilter service freebsd_committer freebsd_triage 2007-08-14 12:14:12 UTC
garga       2007-08-14 11:14:06 UTC

  FreeBSD ports repository

  Modified files:
    security/clamav/files clamav-milter.in 
    security/clamav-devel/files clamav-milter.in 
  Log:
  Fix clamav-milter startup script to don't wait clamd socket when it's using tcp
  socket
  
  PR:             ports/115353 (Based on)
  Submitted by:   Alexander Shikoff <minotaur@crete.org.ua>
  
  Revision  Changes    Path
  1.4       +2 -2      ports/security/clamav-devel/files/clamav-milter.in
  1.5       +2 -2      ports/security/clamav/files/clamav-milter.in
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Renato Botelho freebsd_committer freebsd_triage 2007-08-14 12:14:39 UTC
State Changed
From-To: feedback->closed

Fixed. Thanks!