From owner-svn-src-stable-7@FreeBSD.ORG Sat Jan 10 19:00:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 326DC10656FD; Sat, 10 Jan 2009 19:00:18 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718A98FC08; Sat, 10 Jan 2009 19:00:17 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0AJ0H6B006282; Sat, 10 Jan 2009 19:00:17 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0AJ0Hv1006281; Sat, 10 Jan 2009 19:00:17 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200901101900.n0AJ0Hv1006281@svn.freebsd.org> From: Antoine Brodin Date: Sat, 10 Jan 2009 19:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187031 - in stable/7/etc: . periodic/security X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2009 19:00:20 -0000 Author: antoine Date: Sat Jan 10 19:00:17 2009 New Revision: 187031 URL: http://svn.freebsd.org/changeset/base/187031 Log: MFC r181531 to stable/7: Improve periodic/security/550.ipfwlimit a bit: - don't run it if net.inet.ip.fw.verbose = 0 as it is pointless - handle rules without logging limit correctly [1] (those rules show up without logamount in "ipfw -a list") PR: conf/126060 [1] MFC after: 1 month Modified: stable/7/etc/ (props changed) stable/7/etc/periodic/security/550.ipfwlimit Modified: stable/7/etc/periodic/security/550.ipfwlimit ============================================================================== --- stable/7/etc/periodic/security/550.ipfwlimit Sat Jan 10 18:19:22 2009 (r187030) +++ stable/7/etc/periodic/security/550.ipfwlimit Sat Jan 10 19:00:17 2009 (r187031) @@ -42,19 +42,16 @@ rc=0 case "$daily_status_security_ipfwlimit_enable" in [Yy][Ee][Ss]) - IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null` - if [ $? -ne 0 ]; then + IPFW_VERBOSE=`sysctl -n net.inet.ip.fw.verbose 2> /dev/null` + if [ $? -ne 0 ] || [ "$IPFW_VERBOSE" -eq 0 ]; then exit 0 fi TMP=`mktemp -t security` ipfw -a list | grep " log " | \ grep '^[[:digit:]]\+[[:space:]]\+[[:digit:]]\+' | \ - awk -v limit="$IPFW_LOG_LIMIT" \ + awk \ '{if ($6 == "logamount") { if ($2 > $7) - {print $0} - } else { - if ($2 > limit) {print $0}} }' > ${TMP}