From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 28 15:00:08 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E77106564A for ; Wed, 28 Jul 2010 15:00:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 859A18FC2F for ; Wed, 28 Jul 2010 15:00:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6SF08oV004970 for ; Wed, 28 Jul 2010 15:00:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6SF08jn004969; Wed, 28 Jul 2010 15:00:08 GMT (envelope-from gnats) Resent-Date: Wed, 28 Jul 2010 15:00:08 GMT Resent-Message-Id: <201007281500.o6SF08jn004969@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, pluknet Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D622E1065673 for ; Wed, 28 Jul 2010 14:51:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C5B218FC23 for ; Wed, 28 Jul 2010 14:51:45 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o6SEpjkT055399 for ; Wed, 28 Jul 2010 14:51:45 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o6SEpjIr055398; Wed, 28 Jul 2010 14:51:45 GMT (envelope-from nobody) Message-Id: <201007281451.o6SEpjIr055398@www.freebsd.org> Date: Wed, 28 Jul 2010 14:51:45 GMT From: pluknet To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/149036: [rc.d] [patch] Mixed/misuse of AND-OR list operators in rc.d/ipmon X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2010 15:00:08 -0000 >Number: 149036 >Category: conf >Synopsis: [rc.d] [patch] Mixed/misuse of AND-OR list operators in rc.d/ipmon >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 28 15:00:08 UTC 2010 >Closed-Date: >Last-Modified: >Originator: pluknet >Release: 6.4-RELEASE-p9 >Organization: >Environment: >Description: src/etc/rc.d/ipmon#rev1.5 added the next check: o In ipmon and ipnat show a warning if neither ipfilter nor ipnat is enabled [..], and exit 1) this check mixes /bin/test and /bin/sh syntax of AND-OR list operators. 2) it checks for AND, while it should check for OR (also see comment for cvs rev1.5 above). >How-To-Repeat: Place to /etc/rc.conf: ipnat_enable="YES" ipmon_enable="YES" Try to launch ipmon: # /etc/rc.d/ipmon start /etc/rc.d/ipmon: ERROR: ipmon requires either ipfilter or ipnat enabled >Fix: 1) Correct the combined check as done in attached patch. 2) profit # /etc/rc.d/ipmon start Starting ipmon. Patch attached with submission follows: Index: etc/rc.d/ipmon =================================================================== --- etc/rc.d/ipmon (revision 207204) +++ etc/rc.d/ipmon (working copy) @@ -20,7 +20,7 @@ # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable -o ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! sysctl net.inet.ipf.fr_pass >/dev/null 2>&1; then >Release-Note: >Audit-Trail: >Unformatted: