From robtone@ek-muc.de  Thu Mar 29 09:09:23 2007
Return-Path: <robtone@ek-muc.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 7A01A16A406
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Mar 2007 09:09:23 +0000 (UTC)
	(envelope-from robtone@ek-muc.de)
Received: from robtone.ek-muc.de (robtone.ek-muc.de [62.225.182.35])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E11713C468
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Mar 2007 09:09:23 +0000 (UTC)
	(envelope-from robtone@ek-muc.de)
Received: from localhost (localhost [127.0.0.1])
	by robtone.ek-muc.de (Postfix) with ESMTP id 842D6C3A1F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Mar 2007 11:08:58 +0200 (CEST)
Received: by robtone.ek-muc.de (Postfix, from userid 1001)
	id 3401DC39F7; Thu, 29 Mar 2007 11:08:50 +0200 (CEST)
Message-Id: <20070329090850.3401DC39F7@robtone.ek-muc.de>
Date: Thu, 29 Mar 2007 11:08:50 +0200 (CEST)
From: Robert Felber <robtone@ek-muc.de>
Reply-To: Robert Felber <robtone@ek-muc.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] /usr/ports/security/amavisd-new
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         111003
>Category:       ports
>Synopsis:       [patch] /usr/ports/security/amavisd-new
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gabor
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 29 09:10:02 GMT 2007
>Closed-Date:    Fri Mar 30 21:55:31 GMT 2007
>Last-Modified:  Fri May 18 20:20:09 GMT 2007
>Originator:     Robert Felber
>Release:        FreeBSD 6.1-RELEASE-p7 i386
>Organization:
Autohaus Erich Kuttendreier (Ford Main Dealer Munich)
>Environment:
System: 6.1-RELEASE-p7


	
>Description:

The rc script /usr/local/etc/rc.d/amavis-p0fanalyzer does not allow
to set a specific interface on which p0f(1) shall listen on.
I have added an amavis_p0fanalyzer_p0f_flags parameter which can be set
via /etc/rc.conf and defaults to '-l' (ell)


>How-To-Repeat:
	
>Fix:


--- amavis-p0fanalyzer begins here ---
#!/bin/sh
# $FreeBSD: ports/security/amavisd-new/files/amavis-p0fanalyzer.sh.in,v 1.5 2007/02/26 23:02:04 dougb Exp $

# PROVIDE: amavis_p0fanalyzer
# REQUIRE: DAEMON
# BEFORE: amavisd

amavis_p0fanalyzer_enable="${amavis_p0fanalyzer_enable-NO}"
amavis_p0fanalyzer_p0f_filter="${amavis_p0fanalyzer_p0f_filter-"tcp dst port 25"}"
amavis_p0fanalyzer_pidfile1="${amavis_p0fanalyzer_pidfile1-/var/run/p0fanalyzer1.pid}"
amavis_p0fanalyzer_pidfile2="${amavis_p0fanalyzer_pidfile2-/var/run/p0fanalyzer2.pid}"
amavis_p0fanalyzer_flags="${amavis_p0fanalyzer_flags-2345}"
amavis_p0fanalyzer_p0f_flags="${amavis_p0fanalyzer_p0f_flags--l}"

. /etc/rc.subr

name="amavis_p0fanalyzer"
rcvar=`set_rcvar`

start_cmd=p0fanalyzer_start
stop_cmd=p0fanalyzer_stop

p0fanalyzer_start() {
	echo "Starting p0f-analyzer." &&                     \
	  /usr/sbin/daemon -p ${amavis_p0fanalyzer_pidfile1} \
	  /usr/local/bin/p0f ${amavis_p0f_daemon_flags}      \
      ${amavis_p0fanalyzer_p0f_flags}                    \
	  "${amavis_p0fanalyzer_p0f_filter}" 2>&1 |       \
	  /usr/sbin/daemon -p ${amavis_p0fanalyzer_pidfile2} \
	  /usr/local/sbin/p0f-analyzer.pl ${amavis_p0fanalyzer_flags}
}

p0fanalyzer_stop() {
	/bin/kill `cat ${amavis_p0fanalyzer_pidfile2}` && rm ${amavis_p0fanalyzer_pidfile2}
	/bin/kill `cat ${amavis_p0fanalyzer_pidfile1}` && rm ${amavis_p0fanalyzer_pidfile1}
}

load_rc_config $name
run_rc_command "$1"
--- amavis-p0fanalyzer ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gabor 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Mar 29 09:10:12 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111003 
State-Changed-From-To: open->closed 
State-Changed-By: gabor 
State-Changed-When: Fri Mar 30 21:52:23 UTC 2007 
State-Changed-Why:  
Hello Robert, 

amavis_p0f_daemon_flags was added exactly for this reason a long time ago, so 
you can use that. The pkg-message file also mentions this. I don't use 
p0fanalyzer myself, so I don't exactly know what -l is for, but I removed the 
explicit -l and now amavis_p0f_daemon_flags defaults to it, so you can redefine 
this if you want to remove -l or use another interface. 
Thanks for your interest in this port. 

Regards, 
Gabor 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111003 

From: Mark Martinec <Mark.Martinec@ijs.si>
To: bug-followup@freebsd.org,
 robtone@ek-muc.de
Cc:  
Subject: Re: ports/111003: [patch] /usr/ports/security/amavisd-new
Date: Fri, 18 May 2007 21:15:23 +0200

 Hmmm. Having to reinstall amavisd-new from ports after a crash,
 I just realized that p0f-analyzer.pl isn't giving results
 any longer since the new install, it is just responding
 to queries with a 'no results' packet.
 
 It turns out the culprit is a change brought by this PR.
 
 My setting in rc.conf was: amavis_p0f_daemon_flags="-i bge0"
 which previously resulted in '-l -i bge0' options,
 but now the -l is missing, so p0f is not passing any
 information to p0f-analyzer.pl.
 
 A workaround is to specify:
   amavis_p0f_daemon_flags="-l -i bge0"
 although (since the -l is a required option) I think
 this incompatible change was unwarranted, breaking
 former setups with no notification, just resulting
 in a silent lack of results form p0f.
 
   Mark

From: Robert Felber <robtone@ek-muc.de>
To: bug-followup@freebsd.org
Cc: Mark.Martinec@ijs.si
Subject: Re: ports/111003: [patch] /usr/ports/security/amavisd-new
Date: Fri, 18 May 2007 21:53:17 +0200

 On Fri, May 18, 2007 at 09:15:00PM +0200, Mark Martinec wrote:
 > Hmmm. Having to reinstall amavisd-new from ports after a crash,
 > I just realized that p0f-analyzer.pl isn't giving results
 > any longer since the new install, it is just responding
 > to queries with a 'no results' packet.
 > 
 > It turns out the culprit is a change brought by this PR.
 > 
 > My setting in rc.conf was: amavis_p0f_daemon_flags="-i bge0"
 > which previously resulted in '-l -i bge0' options,
 > but now the -l is missing, so p0f is not passing any
 > information to p0f-analyzer.pl.
 > 
 > A workaround is to specify:
 >   amavis_p0f_daemon_flags="-l -i bge0"
 > although (since the -l is a required option) I think
 > this incompatible change was unwarranted, breaking
 > former setups with no notification, just resulting
 > in a silent lack of results form p0f.
 
 For this reason, I initially kept
 
 ${amavis_p0f_daemon_flags} untouched
 
 But introduced ${amavis_p0fanalyzer_p0f_flags} defaulting 
 to -l
 
 I.e. ${amavis_p0f_daemon_flags} for the user
 and  ${amavis_p0fanalyzer_p0f_flags} for the
 required defaults.
 
 I'm aware that even my patch wasn't required (IIRC). But
 I was somehow blind.
 
 
 -- 
     Robert Felber (PGP: 896CF30B)
     Munich, Germany
>Unformatted:
