]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/__init__.py
Fix kernel buffer overflow by avoiding passing --debug to subprocesses.
[wizard.git] / wizard / command / __init__.py
index 8d5e14c3c434b922db807dffc7214c4ceb4aab0c..e3558f6dfb3fdbe82dd015ddaa5c1f529f2fdfd0 100644 (file)
@@ -57,11 +57,14 @@ def make_base_args(options, **grab):
     """Takes parsed options, and breaks them back into a command
     line string that we can pass into a subcommand"""
     args = []
-    grab["debug"]   = "--debug"
-    grab["verbose"] = "--verbose"
-    grab["quiet"]   = "--quiet"
-    #grab["log_db"] = "--log-db"
+    # Note: you can override these by passing in debug = None
+    # in your kwargs.
+    grab.setdefault("debug", "--debug")
+    grab.setdefault("verbose", "--verbose")
+    grab.setdefault("quiet", "--quiet")
+    #grab.setdefault("log_db", "--log-db")
     for k,flag in grab.items():
+        if not flag: continue
         value = getattr(options, k)
         if not value: continue
         args.append(flag)