Minor patch for too fast Ctrl-C(-ers)

This commit is contained in:
Miroslav Stampar 2015-12-28 11:39:46 +01:00
parent 24d95ab6b3
commit 849babaf8d

View File

@ -111,7 +111,10 @@ def main():
except SqlmapUserQuitException: except SqlmapUserQuitException:
errMsg = "user quit" errMsg = "user quit"
try:
logger.error(errMsg) logger.error(errMsg)
except KeyboardInterrupt:
pass
except (SqlmapSilentQuitException, bdb.BdbQuit): except (SqlmapSilentQuitException, bdb.BdbQuit):
pass pass
@ -121,18 +124,30 @@ def main():
except SqlmapBaseException as ex: except SqlmapBaseException as ex:
errMsg = getSafeExString(ex) errMsg = getSafeExString(ex)
try:
logger.critical(errMsg) logger.critical(errMsg)
except KeyboardInterrupt:
pass
raise SystemExit raise SystemExit
except KeyboardInterrupt: except KeyboardInterrupt:
print print
errMsg = "user aborted" errMsg = "user aborted"
try:
logger.error(errMsg) logger.error(errMsg)
except KeyboardInterrupt:
pass
except EOFError: except EOFError:
print print
errMsg = "exit" errMsg = "exit"
try:
logger.error(errMsg) logger.error(errMsg)
except KeyboardInterrupt:
pass
except SystemExit: except SystemExit:
pass pass
@ -142,6 +157,7 @@ def main():
errMsg = unhandledExceptionMessage() errMsg = unhandledExceptionMessage()
excMsg = traceback.format_exc() excMsg = traceback.format_exc()
try:
if any(_ in excMsg for _ in ("No space left", "Disk quota exceeded")): if any(_ in excMsg for _ in ("No space left", "Disk quota exceeded")):
errMsg = "no space left on output device" errMsg = "no space left on output device"
logger.error(errMsg) logger.error(errMsg)
@ -168,6 +184,8 @@ def main():
kb.stickyLevel = logging.CRITICAL kb.stickyLevel = logging.CRITICAL
dataToStdout(excMsg) dataToStdout(excMsg)
createGithubIssue(errMsg, excMsg) createGithubIssue(errMsg, excMsg)
except KeyboardInterrupt:
pass
finally: finally:
if conf.get("showTime"): if conf.get("showTime"):