From 93dee30895646def3f7041b05b7de25e295adc37 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 2 May 2011 13:34:55 +0000 Subject: [PATCH] better fix for the previous commit --- lib/core/option.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 1e5360a2c..f9d5f7e03 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1228,6 +1228,12 @@ def __cleanupOptions(): if conf.dbms: conf.dbms = conf.dbms.capitalize() + if conf.optimize and any([conf.data, conf.textOnly]): + conf.nullConnection = False + + debugMsg = "turning off --null-connection switch used indirectly by switch -o" + logger.debug(debugMsg) + # to distinguish explicit usage of --time-sec if conf.timeSec is None: if conf.tor: @@ -1561,11 +1567,11 @@ def __basicOptionValidation(): raise sqlmapSyntaxException, errMsg if conf.textOnly and conf.nullConnection: - errMsg = "switch --text-only is incompatible with switch --null-connection%s" % (" used indirectly by switch -o" if conf.optimize else "") + errMsg = "switch --text-only is incompatible with switch --null-connection" raise sqlmapSyntaxException, errMsg if conf.data and conf.nullConnection: - errMsg = "switch --data is incompatible with switch --null-connection%s" % (" used indirectly by switch -o" if conf.optimize else "") + errMsg = "switch --data is incompatible with switch --null-connection" raise sqlmapSyntaxException, errMsg if conf.predictOutput and conf.threads > 1: