From nobody@FreeBSD.org  Thu Nov 10 08:17:25 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E961C16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2005 08:17:25 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B335F43D55
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2005 08:17:25 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id jAA8HPHp016986
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2005 08:17:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id jAA8HOlE016983;
	Thu, 10 Nov 2005 08:17:24 GMT
	(envelope-from nobody)
Message-Id: <200511100817.jAA8HOlE016983@www.freebsd.org>
Date: Thu, 10 Nov 2005 08:17:24 GMT
From: Taketo Kabe <kabe@sra-tohoku.co.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] Baseline ipmon(8) uses LOG_LOCAL0 syslog, not LOG_SECURITY as mentioned in manpage
X-Send-Pr-Version: www-2.3

>Number:         88780
>Category:       bin
>Synopsis:       [patch] Baseline ipmon(8) uses LOG_LOCAL0 syslog, not LOG_SECURITY as mentioned in manpage
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 10 08:20:18 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Dec 29 18:07:34 UTC 2008
>Originator:     Taketo Kabe
>Release:        6.0-RELEASE
>Organization:
>Environment:
FreeBSD ns-fw.example.org 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Tue Nov  8 05:14:05 JST 2005     root@ns-fw.example.org:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Current ipmon(8) is documented to use LOG_SECURITY syslog facility
when invoked as `ipmon -s', but
FreeBSD 6.0 baseline (and probably earlier versions) source code
still is using LOG_LOCAL0.

ipf(8) installed from ports should not have this problem; only
the baseline source has this problem.

>How-To-Repeat:
- Compile the full source, including userland (make buildworld)
- cd /usr/src/sbin/ipf/ipmon
- make clean
- make
  The diags will say
cc -O2 -fno-strict-aliasing -pipe  -DLOGFAC=LOG_LOCAL0
                                     ^^^^^^^^^^^^^^^^^

Also setting "pass log all" in /etc/ipf.conf and enabling the ipfilter
will log packets in /var/log/messages (LOG_LOCAL0),
not /var/log/security (LOG_SECURITY).

>Fix:

--- /usr/src/sbin/ipf/ipmon/Makefile.dist	Thu Apr 28 16:26:34 2005
+++ /usr/src/sbin/ipf/ipmon/Makefile	Thu Nov 10 08:14:29 2005
@@ -1,10 +1,10 @@
-#	$FreeBSD: src/sbin/ipf/ipmon/Makefile,v 1.2 2005/04/28 16:26:34 darrenr Exp $
+#	$FreeBSD: src/sbin/ipf/ipmon/Makefile,v 1.2 2005/04/28 16:26:34 darrenr Exp $ 
 
 PROG=		ipmon
 SRCS=		ipmon.c ipmon_y.c ipmon_l.c
 MAN=		ipmon.8
 
-CFLAGS+=	-DLOGFAC=LOG_LOCAL0 -I.
+CFLAGS+=	-DLOGFAC=LOG_SECURITY -I.
 
 DPSRCS+=	ipmon_l.h ipmon_y.h
 
>Release-Note:
>Audit-Trail:
>Unformatted:
