Subject: Re: CVS commit: pkgsrc/security/audit-packages
To: enami tsugutomo <enami@but-b.or.jp>
From: Alistair Crooks <agc@wasabisystems.com>
List: pkgsrc-changes
Date: 10/18/2003 09:43:18
On Sat, Oct 18, 2003 at 05:46:55AM +0900, enami tsugutomo wrote:
> > Simplify quoting syntax in the awk command, so that gawk-3.1.3 (as found in
> > NetBSD-current) doesn't have a problem with a malformed escape sequence.
> 
> Why awk is neccesary?  I guess just using shell constructs like below
> is enough.
> 
> enami.
> 
> while read pat type url
> do
> 	case $pat in
> 	\#*|'') continue;;
> 	esac
> 
> 	if /usr/sbin/pkg_info -qe $pat; then
> 		echo Package `/usr/sbin/pkg_info -e $pat` has a \
> 		    $type vulnerability, see $url
> 	fi
> done < ${PKGVULNDIR}/pkg-vulnerabilities

Thanks, Enami, you are quite right.

My tests show your shell construct takes about half the system and
user execution time than the awk version.

I'll modify audit-packages to use your suggestion.

Take care,
Alistair