summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2007-08-31 18:13:25 +0000
committerKees Cook <kees@outflux.net>2007-08-31 18:13:25 +0000
commitfd60784ec413a506af8e2721d3cf265582c58d01 (patch)
treef585093c5a8d9e35612a22a61d5b3fe778b446c4 /scripts
parent39588f474d96b694056e8bedf2b93b8b3d4c8e27 (diff)
new scripts to help with ubuntu kernel releases
git-svn-id: svn+ssh://svn.debian.org/svn/kernel-sec@937 e094ebfe-e918-0410-adfb-c712417f3574
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ubuntu-release7
-rwxr-xr-xscripts/ubuntu-usn-desc25
2 files changed, 32 insertions, 0 deletions
diff --git a/scripts/ubuntu-release b/scripts/ubuntu-release
new file mode 100644
index 00000000..cf436685
--- /dev/null
+++ b/scripts/ubuntu-release
@@ -0,0 +1,7 @@
+#!/bin/bash
+echo 'This is just a place holder for future scripts. View source for examples.'
+exit 1
+
+# Examples:
+#../scripts/ubuntu-usn-desc $(egrep '^2.6.20-feisty-security: pending' CVE* | cut -d: -f1)
+#perl -pi -e 's/^2.6.20-feisty-security: pending \(2\.6\.20-16\.30\)/2.6.20-feisty-security: released (2.6.20-16.31)/' CVE*
diff --git a/scripts/ubuntu-usn-desc b/scripts/ubuntu-usn-desc
new file mode 100755
index 00000000..9894a9e8
--- /dev/null
+++ b/scripts/ubuntu-usn-desc
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# Dumps the Ubuntu-Descriptions in a form suitable for a USN announcement
+import sys, deb822
+
+def wrap(text, width):
+ """
+ A word-wrap function that preserves existing line breaks
+ and most spaces in the text. Expects that existing line
+ breaks are posix newlines (\n).
+ """
+ return reduce(lambda line, word, width=width: '%s%s%s' %
+ (line,
+ ' \n'[(len(line)-line.rfind('\n')-1
+ + len(word.split('\n',1)[0]
+ ) >= width)],
+ word),
+ text.split(' ')
+ )
+
+for cve in sys.argv[1:]:
+ desc = deb822.deb822(file(cve))['Ubuntu-Description'].strip()
+ if len(sys.argv[1:])!=1:
+ desc += " (%s)"%cve
+ print
+ print wrap(desc,75)

© 2014-2024 Faster IT GmbH | imprint | privacy policy