aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2005-01-08 15:43:23 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2005-01-08 15:43:23 +0000
commitc510dbc5c37db11397d3d89968749119a63cf48b (patch)
tree0c4174b2c07bbb940fc135dd89bfceb889976930 /security
parentc206b902171e4b5808ef111c0411d302bda8b191 (diff)
downloadports-c510dbc5c37db11397d3d89968749119a63cf48b.tar.gz
ports-c510dbc5c37db11397d3d89968749119a63cf48b.zip
Notes
Diffstat (limited to 'security')
-rw-r--r--security/vuxml/Makefile3
-rw-r--r--security/vuxml/files/newentry.sh65
2 files changed, 68 insertions, 0 deletions
diff --git a/security/vuxml/Makefile b/security/vuxml/Makefile
index 8ac1215c3339..63a1b78ea742 100644
--- a/security/vuxml/Makefile
+++ b/security/vuxml/Makefile
@@ -80,4 +80,7 @@ validate:
tidy:
@${SH} ${FILESDIR}/tidy.sh "${FILESDIR}/tidy.xsl" "${VUXML_FILE}"
+newentry:
+ @${SH} ${FILESDIR}/newentry.sh "${VUXML_FILE}"
+
.include <bsd.port.mk>
diff --git a/security/vuxml/files/newentry.sh b/security/vuxml/files/newentry.sh
new file mode 100644
index 000000000000..449482dffe24
--- /dev/null
+++ b/security/vuxml/files/newentry.sh
@@ -0,0 +1,65 @@
+#! /bin/sh
+vuxml_file="$1"
+if [ -z "${vuxml_file}" ]; then
+ exec >&2
+ echo "Usage: newentry.sh /path/to/vuxml/document"
+ exit 1
+fi
+
+tmp="`mktemp -t vuxml`"
+[ "$?" -eq 0 ] || exit 1
+doclean="yes"
+cleanup() {
+ if [ "${doclean}" = "yes" ]; then
+ rm -f "${tmp}"
+ fi
+}
+trap cleanup EXIT 1 2 13 15
+
+set errexit
+vid="`uuidgen | tr '[:upper:]' '[:lower:]'`"
+discovery="`date -u '+%Y-%m'`-FIXME"
+entry="`date -u '+%Y-%m-%d'`"
+
+awk '/^<\?/,/^<vuxml/ { print }' "${vuxml_file}" >> "${tmp}"
+cat << EOF >> "${tmp}"
+ <vuln vid="${vid}">
+ <topic> -- </topic>
+ <affects>
+ <package>
+ <name></name>
+ <range><lt></lt></range>
+ </package>
+ </affects>
+ <description>
+ <body xmlns="http://www.w3.org/1999/xhtml">
+ <p>SO-AND-SO reports:</p>
+ <blockquote cite="INSERT URL HERE">
+ <p>.</p>
+ </blockquote>
+ </body>
+ </description>
+ <references>
+ </references>
+ <dates>
+ <discovery>${discovery}</discovery>
+ <entry>${entry}</entry>
+ </dates>
+ </vuln>
+
+EOF
+awk '/^[[:space:]]+<vuln /,/^NONE$/ { print }' "${vuxml_file}" >> "${tmp}"
+
+set noerrexit
+
+if cp "${tmp}" "${vuxml_file}"; then
+ exec >&2
+ echo "Template entry added. Please edit \`${vuxml_file}'."
+ exit 0
+else
+ doclean="no"
+ exec >&2
+ echo "Could not overwrite \`${vuxml_file}'."
+ echo "Results are left in \`${tmp}'."
+ exit 1
+fi