From owner-freebsd-questions@FreeBSD.ORG Sat May 21 19:24:06 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 71CA216A7A2 for ; Sat, 21 May 2005 19:24:06 +0000 (GMT) Received: from spork.qfe3.net (spork.qfe3.net [212.13.207.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 082AC43D1F for ; Sat, 21 May 2005 19:24:05 +0000 (GMT) (envelope-from tom.hurst@clara.net) Received: from [81.104.55.176] (helo=voi.aagh.net) by spork.qfe3.net with esmtp (Exim 4.50) id 1DZZZp-0002kw-Oj; Sat, 21 May 2005 20:24:01 +0100 Received: from freaky by voi.aagh.net with local (Exim 4.44 (FreeBSD)) id 1DZZZp-000I8y-Dl; Sat, 21 May 2005 20:24:01 +0100 Date: Sat, 21 May 2005 20:24:01 +0100 From: Thomas Hurst To: Tony Shadwick Message-ID: <20050521192401.GA57477@voi.aagh.net> Mail-Followup-To: Tony Shadwick , Chris , freebsd-questions@freebsd.org References: <20050517144200.T26182@mail.goinet.com> <3aaaa3a05052005436414e0a3@mail.gmail.com> <20050521110951.GB27958@voi.aagh.net> <20050521111200.Q11826@mail.goinet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20050521111200.Q11826@mail.goinet.com> Organization: Not much. User-Agent: Mutt/1.5.6i Sender: Thomas Hurst X-RBL-Warning: 81.104.55.176 is in RBL blacklist at dnsbl.sorbs.net cc: Chris cc: freebsd-questions@freebsd.org Subject: Re: portaudit is being stubborn X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2005 19:24:06 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Tony Shadwick (tshadwick@goinet.com) wrote: > I'd like to see it done, but I know just enough sh scripting to be > dangerous. ;) > > If it were perl I'd be all over it. Any takers? :) Well, the relevent bit is actually written in awk :) The attached patch seems to do the trick. Note portaudit_fixed is a regular expression, so if you want to list multiple entries, seperate them with | -- Thomas 'Freaky' Hurst http://hur.st/ --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="portaudit-fixedre.diff" --- portaudit.old Mon Sep 6 20:18:55 2004 +++ portaudit Sat May 21 20:18:21 2005 @@ -136,8 +136,8 @@ BEGIN { vul=0; fixedre="'"$fixedre"'" } /^(#|\$)/ { next } $2 !~ /'"$opt_restrict"'/ { next } + { if (fixedre && $2 ~ fixedre) next } $1 ~ /^FreeBSD[<=>!]/ { - if (fixedre && $2 ~ fixedre) next if (!system("'"$pkg_version"' -T \"FreeBSD-'"$osversion"'\" \"" $1 "\"")) { print_affected("FreeBSD-'"$osversion"'", \ "To disable this check add the uuid to \`portaudit_fixed'"'"' in /usr/local/etc/portaudit.conf") --DocE+STaALJfprDB--