summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-23 10:21:35 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-23 10:28:20 +0100
commite7c2b83b0692c00b22baf81dbbed5468f3f51d2e (patch)
tree67c09bc6b1630e0e6e711dbe427c4e7f54befaac /contrib
parentdd651f27f6c62a043e06025c9825f38264245229 (diff)
oeaudit: Add -f option to fetch an auditfile from FreeBSD
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/oeaudit/oe_audit.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py
index 018547a04e..13e53beb52 100755
--- a/contrib/oeaudit/oe_audit.py
+++ b/contrib/oeaudit/oe_audit.py
@@ -82,6 +82,8 @@ def handle_options(args):
action = "store", dest = "oe_available", default = None)
parser.add_option("-b", "--buggy", help = "Write out unmaped packets",
action = "store", dest = "buggy", default = "not_in_oe.bugs")
+ parser.add_option("-f", "--fetch", help = "Fetch a new auditfile",
+ action = "store_true", dest = "fetch", default = False)
options, args = parser.parse_args(args)
return options
@@ -89,6 +91,16 @@ def handle_options(args):
# read the input data
import sys
opts = handle_options(sys.argv)
+
+if opts.fetch:
+ import os
+ print "Fetching new auditfile with wget and unpacking to the local directory"
+ os.system("(rm auditfile.tbz || true) && wget -c http://ports.freebsd.org/auditfile.tbz; tar xjf auditfile.tbz auditfile && rm auditfile.tbz")
+
+if not opts.oe_available or not opts.freebsd_auditfile:
+ print "You need to specific -a and -p."
+ sys.exit(0)
+
oe_packages = oe.read_available(opts.oe_available)
freebsd_vuln = freebsd.read_auditfile(opts.freebsd_auditfile)
buggy = open(opts.buggy, "w+")