summaryrefslogtreecommitdiff
path: root/contrib/oeaudit/oe_audit.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/oeaudit/oe_audit.py')
-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+")