diff options
author | eik <eik@FreeBSD.org> | 2004-06-14 16:04:41 +0800 |
---|---|---|
committer | eik <eik@FreeBSD.org> | 2004-06-14 16:04:41 +0800 |
commit | 1f760cb8e5a57cca3c976374b3d81c67b216f9a5 (patch) | |
tree | 38734c03fd3e79c0ef01a8934bdcd2ae59870a56 /security/portaudit-db | |
parent | 7409dfe3e041c057227445c9385ae28c6becf5d7 (diff) | |
download | freebsd-ports-gnome-1f760cb8e5a57cca3c976374b3d81c67b216f9a5.tar.gz freebsd-ports-gnome-1f760cb8e5a57cca3c976374b3d81c67b216f9a5.tar.zst freebsd-ports-gnome-1f760cb8e5a57cca3c976374b3d81c67b216f9a5.zip |
update to 0.1.1, supporting some of the VuXML 1.1 features
Diffstat (limited to 'security/portaudit-db')
-rw-r--r-- | security/portaudit-db/Makefile | 3 | ||||
-rw-r--r-- | security/portaudit-db/database/portaudit.xml | 4 | ||||
-rw-r--r-- | security/portaudit-db/files/packaudit.sh | 14 | ||||
-rw-r--r-- | security/portaudit-db/files/portaudit2vuxml.awk | 87 | ||||
-rw-r--r-- | security/portaudit-db/files/vuxml2html.xslt | 138 | ||||
-rw-r--r-- | security/portaudit-db/pkg-plist | 1 |
6 files changed, 194 insertions, 53 deletions
diff --git a/security/portaudit-db/Makefile b/security/portaudit-db/Makefile index 2a48688047d5..bae0f1ecd46d 100644 --- a/security/portaudit-db/Makefile +++ b/security/portaudit-db/Makefile @@ -6,7 +6,7 @@ # PORTNAME= portaudit-db -PORTVERSION= 0.1 +PORTVERSION= 0.1.1 CATEGORIES= security DISTFILES= @@ -35,6 +35,7 @@ do-install: @${INSTALL_SCRIPT} ${WRKDIR}/packaudit.sh ${PREFIX}/bin/packaudit @${INSTALL_DATA} ${WRKDIR}/packaudit.conf ${PREFIX}/etc/packaudit.conf.sample @${MKDIR} ${DATADIR} + @${INSTALL_SCRIPT} ${FILESDIR}/portaudit2vuxml.awk ${DATADIR} @${INSTALL_DATA} ${FILESDIR}/vuxml2html.xslt ${FILESDIR}/vuxml2portaudit.xslt ${DATADIR} @${MKDIR} ${DATABASEDIR} diff --git a/security/portaudit-db/database/portaudit.xml b/security/portaudit-db/database/portaudit.xml index ae616f4cbf7e..c0d547850c97 100644 --- a/security/portaudit-db/database/portaudit.xml +++ b/security/portaudit-db/database/portaudit.xml @@ -66,4 +66,8 @@ This file is in the public domain. </dates> </vuln> + <vuln vid="1ed556e6-734f-11d8-868e-000347dd607f"> + <cancelled superseded="1a448eb7-6988-11d8-873f-0020ed76ef5a"/> + </vuln> + </vuxml> diff --git a/security/portaudit-db/files/packaudit.sh b/security/portaudit-db/files/packaudit.sh index ff8ebd767625..778f781ca670 100644 --- a/security/portaudit-db/files/packaudit.sh +++ b/security/portaudit-db/files/packaudit.sh @@ -55,24 +55,30 @@ PUBLIC_HTML="${PUBLIC_HTML:-$HOME/public_html/portaudit}" HTMLSHEET="%%DATADIR%%/vuxml2html.xslt" BASEURL="http://people.freebsd.org/~eik/portaudit/" -[ -r "%%PREFIX%%/etc/packaudit.conf" ] && . "%%PREFIX%%/etc/packaudit.conf" +PORTAUDIT2VUXML="%%DATADIR%%/portaudit2vuxml.awk" + +TMPNAME=`$BASENAME "$0"` VULVER=`$SED -En -e '/^.*\\$FreeBSD\: [^$ ]+,v ([0-9]+(\.[0-9]+)+) [^$]+\\$.*$/{s//\1/p;q;}' "$VUXMLDIR/vuln.xml"` VULURL="http://cvsweb.freebsd.org/ports/security/vuxml/vuln.xml?rev=$VULVER" +[ -r "%%PREFIX%%/etc/packaudit.conf" ] && . "%%PREFIX%%/etc/packaudit.conf" + if [ -d "$PUBLIC_HTML" ]; then - VULNMD5=`$CAT "$VUXMLDIR/vuln.xml" "$PORTAUDITDBDIR/database/portaudit.xml" | $MD5` + VULNMD5=`$CAT "$VUXMLDIR/vuln.xml" "$PORTAUDITDBDIR/database/portaudit.xml" "$PORTAUDITDBDIR/database/portaudit.txt" | $MD5` if [ -f "$PUBLIC_HTML/portaudit.md5" ]; then VULNMD5_OLD=`$CAT "$PUBLIC_HTML/portaudit.md5"` fi if [ "$VULNMD5" != "$VULNMD5_OLD" ]; then echo -n "$VULNMD5" > "$PUBLIC_HTML/portaudit.md5" - $XSLTPROC $XSLTPROC_EXTRA_ARGS --stringparam vulurl "$VULURL" --stringparam extradoc "$PORTAUDITDBDIR/database/portaudit.xml" \ + TMPXML=`$MKTEMP -t "$TMPNAME.$$"` || exit 1 + $PORTAUDIT2VUXML "$PORTAUDITDBDIR/database/portaudit.txt" "$PORTAUDITDBDIR/database/portaudit.xml" > "$TMPXML" + $XSLTPROC $XSLTPROC_EXTRA_ARGS --stringparam vulurl "$VULURL" --stringparam extradoc "$TMPXML" \ -o "$PUBLIC_HTML/" "$HTMLSHEET" "$VUXMLDIR/vuln.xml" + $RM "$TMPXML" fi fi -TMPNAME=`$BASENAME "$0"` TMPDIR=`$MKTEMP -d -t "$TMPNAME.$$"` || exit 1 TESTPORT="vulnerability-test-port>=2000<`$DATE -u +%Y.%m.%d`" diff --git a/security/portaudit-db/files/portaudit2vuxml.awk b/security/portaudit-db/files/portaudit2vuxml.awk new file mode 100644 index 000000000000..182d72431391 --- /dev/null +++ b/security/portaudit-db/files/portaudit2vuxml.awk @@ -0,0 +1,87 @@ +#!/usr/bin/awk -f + + BEGIN { + XMLFILE=ARGV[2] + delete ARGV[2] + while (getline < XMLFILE) { + if (/<\/vuxml>/) + break + print + } + XML=$0 + FS="|" + } + + /^(#|$)/ { next } + + { + if (PKG[$4]) + PKG[$4]=PKG[$4] FS $1 + else + PKG[$4]=$1 + gsub(/</, "<") + gsub(/>/, ">") + gsub(/&/, "&") + URL[$4]=$2 + TOPIC[$4]=$3 + } + + END { + OPN["<"]="lt" + OPN["<="]="le" + OPN["="]="eq" + OPN[">="]="ge" + OPN[">"]="gt" + + for (UUID in PKG) { + print " <vuln vid=\"" UUID "\">" + print " <topic>" TOPIC[UUID] "</topic>" + + print " <affects>" + split(PKG[UUID], APKG) + for (TPKG in APKG) { + VERS=APKG[TPKG] + print " <package>" + if (match(VERS, /(<|>)=?|=/) > 0) { + print " <name>" substr(VERS, 1, RSTART-1) "</name>" + printf " <range>" + do { + OP=substr(VERS, RSTART, RLENGTH) + LEN=length(VERS) + VERS=substr(VERS, RSTART+RLENGTH, LEN+1-RSTART-RLENGTH) + XXX=match(VERS, /(<|>)=?|=/) + if (XXX > 0) + printf "<%s>%s</%s>", OPN[OP], substr(VERS, 1, RSTART-1), OPN[OP] + else + printf "<%s>%s</%s>", OPN[OP], VERS, OPN[OP] + } while (XXX > 0) + printf "</range>\n" + } + else { + print " <name>" VERS "</name>" + } + print " </package>" + } + print " </affects>" + + print " <description>" + print " <body xmlns=\"http://www.w3.org/1999/xhtml\">" + print " <p>Please <a href=\"mailto:security-officer@FreeBSD.org?subject=vid%20" UUID "\">contact" + print " the FreeBSD Security Officer</a> for more information.</p>" + print " </body>" + print " </description>" + print " <references>" + print " <url>" URL[UUID] "</url>" + print " </references>" + print " <dates>" + print " <discovery>2000-00-00</discovery>" + print " <entry>2000-00-00</entry>" + print " </dates>" + print " </vuln>" + print "" + } + print XML + while (getline < XMLFILE) { + print + } + } diff --git a/security/portaudit-db/files/vuxml2html.xslt b/security/portaudit-db/files/vuxml2html.xslt index 75a5e4cfc48b..4bc42d663757 100644 --- a/security/portaudit-db/files/vuxml2html.xslt +++ b/security/portaudit-db/files/vuxml2html.xslt @@ -70,7 +70,9 @@ Usage: <p> <a href="index-pkg.html">[Sorted by package name]</a> </p> - <xsl:call-template name="foo"/> + <xsl:call-template name="foo"> + <xsl:with-param name="vid">index</xsl:with-param> + </xsl:call-template> </body> </html> </xsl:document> @@ -105,7 +107,9 @@ Usage: <p> <a href="index.html">[Sorted by last modification]</a> </p> - <xsl:call-template name="foo"/> + <xsl:call-template name="foo"> + <xsl:with-param name="vid">index</xsl:with-param> + </xsl:call-template> </body> </html> </xsl:document> @@ -114,48 +118,75 @@ Usage: <xsl:document href="{translate(@vid, 'ABCDEF', 'abcdef')}.html" method="xml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>portaudit: <xsl:value-of select="vuxml:topic"/></title> + <xsl:choose> + <xsl:when test="vuxml:cancelled"> + <title>portaudit: Cancelled entry</title> + </xsl:when> + <xsl:otherwise> + <title>portaudit: <xsl:value-of select="vuxml:topic"/></title> + </xsl:otherwise> + </xsl:choose> <xsl:call-template name="css"/> </head> <body> <div> <xsl:call-template name="bar"/> </div> - <h1> - <xsl:value-of select="vuxml:topic"/> - </h1> - <h2>Description:</h2> - <xsl:copy-of select="vuxml:description/xhtml:body/*"/> - <h2>References:</h2> - <ul> - <xsl:apply-templates select="vuxml:references"/> - </ul> - <h2>Affects:</h2> - <ul> - <xsl:for-each select="vuxml:affects/vuxml:package"> - <xsl:for-each select="vuxml:name"> - <xsl:variable name="name" select="."/> - <xsl:for-each select="../vuxml:range"> - <li> - <xsl:value-of select="$name"/> - <xsl:apply-templates/> - </li> + <xsl:choose> + <xsl:when test="vuxml:cancelled"> + <h1> + Cancelled entry + </h1> + <xsl:if test="vuxml:cancelled/@superseded"> + <h2>References:</h2> + <ul> + <li>Superseded by <a href="./{vuxml:cancelled/@superseded}.html">entry + <xsl:value-of select="vuxml:cancelled/@superseded"/></a></li> + </ul> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <h1> + <xsl:value-of select="vuxml:topic"/> + </h1> + <h2>Description:</h2> + <xsl:copy-of select="vuxml:description/xhtml:body/*"/> + <h2>References:</h2> + <ul> + <xsl:apply-templates select="vuxml:references"/> + </ul> + <h2>Affects:</h2> + <ul> + <xsl:for-each select="vuxml:affects/vuxml:package"> + <xsl:for-each select="vuxml:name"> + <xsl:variable name="name" select="."/> + <xsl:for-each select="../vuxml:range"> + <li> + <xsl:value-of select="$name"/> + <xsl:apply-templates/> + </li> + </xsl:for-each> + </xsl:for-each> </xsl:for-each> - </xsl:for-each> - </xsl:for-each> - <xsl:for-each select="vuxml:affects/vuxml:system"> - <xsl:for-each select="vuxml:name"> - <xsl:variable name="name" select="."/> - <xsl:for-each select="../vuxml:range"> - <li> - <xsl:value-of select="$name"/> - <xsl:apply-templates/> - </li> + <xsl:for-each select="vuxml:affects/vuxml:system"> + <xsl:for-each select="vuxml:name"> + <xsl:variable name="name" select="."/> + <xsl:for-each select="../vuxml:range"> + <li> + <xsl:value-of select="$name"/> + <xsl:apply-templates/> + </li> + </xsl:for-each> + </xsl:for-each> </xsl:for-each> - </xsl:for-each> - </xsl:for-each> - </ul> - <xsl:call-template name="foo"/> + </ul> + <title>portaudit: <xsl:value-of select="vuxml:topic"/></title> + </xsl:otherwise> + </xsl:choose> + + <xsl:call-template name="foo"> + <xsl:with-param name="vid" select="@vid"/> + </xsl:call-template> </body> </html> </xsl:document> @@ -163,16 +194,6 @@ Usage: <!-- end of vuxml file processing --> </xsl:template> <!-- vulnerability references --> - <xsl:template match="vuxml:url"> - <li> - <a href="{.}"> - <xsl:value-of select="."/> - </a> - </li> - </xsl:template> - <xsl:template match="vuxml:cvename"> - <li>CVE name <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name={text()}"><xsl:value-of select="text()"/></a></li> - </xsl:template> <xsl:template match="vuxml:bid"> <li>BugTraq ID <a href="http://www.securityfocus.com/bid/{.}"><xsl:value-of select="."/></a></li> </xsl:template> @@ -182,9 +203,29 @@ Usage: <xsl:template match="vuxml:certvu"> <li>CERT vulnerability note <a href="http://www.kb.cert.org/vuls/id/{.}"><xsl:value-of select="."/></a></li> </xsl:template> + <xsl:template match="vuxml:cvename"> + <li>CVE name <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name={.}"><xsl:value-of select="."/></a></li> + </xsl:template> <xsl:template match="vuxml:freebsdsa"> <li>FreeBSD security advisory <a href="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-{.}.asc">FreeBSD-<xsl:value-of select="."/></a></li> </xsl:template> + <xsl:template match="vuxml:freebsdpr"> + <li>FreeBSD PR <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr={.}"><xsl:value-of select="."/></a></li> + </xsl:template> + <xsl:template match="vuxml:mlist"> + <li>List post: <a href="{.}"><<xsl:value-of select="."/>></a> + <xsl:if test="@msgid"><a href="http://www.google.com/search?q={@msgid}">(search)</a></xsl:if> + </li> + </xsl:template> + <xsl:template match="vuxml:url"> + <li>URL: <a href="{.}"><<xsl:value-of select="."/>></a></li> + </xsl:template> + <xsl:template match="vuxml:uscertsa"> + <li>US-CERT security alert <a href="http://www.us-cert.gov/cas/alerts/{.}.html"><xsl:value-of select="."/></a></li> + </xsl:template> + <xsl:template match="vuxml:uscertta"> + <li>US-CERT technical security alert <a href="http://www.us-cert.gov/cas/techalerts/{.}.html"><xsl:value-of select="."/></a></li> + </xsl:template> <!-- comparison operators --> <xsl:template match="vuxml:lt"> <xsl:text> <</xsl:text> @@ -268,13 +309,14 @@ Usage: </map> </xsl:template> <xsl:template name="foo"> + <xsl:param name="vid"/> <hr/> - <p><strong>Disclaimer:</strong> The data contained on this page is derived for the VuXML document, + <p><strong>Disclaimer:</strong> The data contained on this page is derived from the VuXML document, please refer to the <a href="{$vulurl}">the original document</a> for copyright information. The author of portaudit makes no claim of authorship or ownership of any of the information contained herein.</p> <p> If you have found a vulnerability in a FreeBSD port not listed in the - database, please <a href="mailto:security-officer@FreeBSD.org">contact the + database, please <a href="mailto:security-officer@FreeBSD.org?subject=vid%20{$vid}">contact the FreeBSD Security Officer</a>. Refer to <a href="http://www.freebsd.org/security/#sec">"FreeBSD Security Information"</a> for more information. diff --git a/security/portaudit-db/pkg-plist b/security/portaudit-db/pkg-plist index a5c18909f2d6..46e9b0674f4c 100644 --- a/security/portaudit-db/pkg-plist +++ b/security/portaudit-db/pkg-plist @@ -1,5 +1,6 @@ bin/packaudit etc/packaudit.conf.sample +%%DATADIR%%/portaudit2vuxml.awk %%DATADIR%%/vuxml2html.xslt %%DATADIR%%/vuxml2portaudit.xslt @dirrm %%DATADIR%% |