mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Minor patch (proper exit code-ing)
This commit is contained in:
parent
0b93311ef2
commit
01edcbf71d
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.4.5.15"
|
VERSION = "1.4.5.16"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -238,6 +238,8 @@ def main():
|
||||||
errMsg = getSafeExString(ex)
|
errMsg = getSafeExString(ex)
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
||||||
|
os._exitcode = 1
|
||||||
|
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
@ -249,8 +251,8 @@ def main():
|
||||||
errMsg = "exit"
|
errMsg = "exit"
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
|
||||||
except SystemExit:
|
except SystemExit as ex:
|
||||||
pass
|
os._exitcode = ex.code or 0
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print()
|
print()
|
||||||
|
@ -258,6 +260,8 @@ def main():
|
||||||
excMsg = traceback.format_exc()
|
excMsg = traceback.format_exc()
|
||||||
valid = checkIntegrity()
|
valid = checkIntegrity()
|
||||||
|
|
||||||
|
os._exitcode = 255
|
||||||
|
|
||||||
if any(_ in excMsg for _ in ("MemoryError", "Cannot allocate memory")):
|
if any(_ in excMsg for _ in ("MemoryError", "Cannot allocate memory")):
|
||||||
errMsg = "memory exhaustion detected"
|
errMsg = "memory exhaustion detected"
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user