[oe-commits] Holger Hans Peter Freyther : oeaudit: Add -f option to fetch an auditfile from FreeBSD

git version control git at git.openembedded.org
Tue Mar 23 09:49:52 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: e7c2b83b0692c00b22baf81dbbed5468f3f51d2e
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e7c2b83b0692c00b22baf81dbbed5468f3f51d2e

Author: Holger Hans Peter Freyther <zecke at selfish.org>
Date:   Tue Mar 23 10:21:35 2010 +0100

oeaudit: Add -f option to fetch an auditfile from FreeBSD

---

 contrib/oeaudit/oe_audit.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py
index 018547a..13e53be 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+")





More information about the Openembedded-commits mailing list