pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/46538: audit-packages results appear in arbitrary order



The following reply was made to PR pkg/46538; it has been noted by GNATS.

From: Steven Drake <sbd%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/46538: audit-packages results appear in arbitrary order
Date: Mon, 4 Jun 2012 19:16:25 +1200 (NZST)

 On Mon, 4 Jun 2012, dholland%eecs.harvard.edu@localhost wrote:
 
 > audit-packages prints results in arbitrary order, probably the result
 > of iterating a hash table or something.
 > 
 > It should either be sorted explicitly (probably by package name and
 > then url) or retain the ordering of the input file, which is pretty
 > much chronological.
 
 Try the below script, I find it very handy.
 
 -- 
 Steven
 
 #!/bin/sh
 PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
 
 PKGDB_DIR=/var/db/pkg
 LAST_VULNS=${PKGDB_DIR}/.last_vulns
 
 (
 echo "To: root"
 echo "Subject: pkgsrc security report for `uname -n`"
 echo
 
 TMP1=`mktemp`
 TMP2=`mktemp`
 
 trap 'rm -f $TMP1 $TMP2' EXIT
 
 echo "Checking package's installed files..."
 echo "-------------------------------------"
 pkg_admin -q check 2>&1
 echo ""
 
 pkg_admin fetch-pkg-vulnerabilities
 
 : >$TMP1
 pkg_admin audit | sort >$TMP1
 if [ -s $TMP1 ] ;then 
        echo "Checking package vulnerabilities..."
        echo "-----------------------------------"
        if [ -s $LAST_VULNS ] ;then
                comm -23 $TMP1 $LAST_VULNS >$TMP2
                if [ -s $TMP2 ] ;then
                        echo "New vulnerabilities:"
                        cat $TMP2
                        echo ""
                fi
        fi
        echo "All vulnerabilities:"
        cat $TMP1
        cat $TMP1 >$LAST_VULNS
 fi
 )| sendmail -t
 


Home | Main Index | Thread Index | Old Index