diff --git a/lib/core/settings.py b/lib/core/settings.py index cc646743c..67291cec4 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.5.126" +VERSION = "1.0.5.127" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/sqlmap.py b/sqlmap.py index 109d63f28..e1eb31c52 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -256,11 +256,14 @@ def main(): dataToStdout("\n[*] shutting down at %s\n\n" % time.strftime("%X"), forceOutput=True) if kb.get("tempDir"): - for prefix in (MKSTEMP_PREFIX.IPC, MKSTEMP_PREFIX.TESTING, MKSTEMP_PREFIX.COOKIE_JAR, MKSTEMP_PREFIX.BIG_ARRAY): - for filepath in glob.glob(os.path.join(kb.tempDir, "%s*" % prefix)): - os.remove(filepath) - if not glob.glob(os.path.join(kb.tempDir, '*')): - shutil.rmtree(kb.tempDir, ignore_errors=True) + for prefix in (MKSTEMP_PREFIX.IPC, MKSTEMP_PREFIX.TESTING, MKSTEMP_PREFIX.COOKIE_JAR, MKSTEMP_PREFIX.BIG_ARRAY): + for filepath in glob.glob(os.path.join(kb.tempDir, "%s*" % prefix)): + try: + os.remove(filepath) + except OSError: + pass + if not filter(None, (filepath for filepath in glob.glob(os.path.join(kb.tempDir, '*')) if not any(filepath.endswith(_) for _ in ('.lock', '.exe', '_')))): + shutil.rmtree(kb.tempDir, ignore_errors=True) if conf.get("hashDB"): try: