Bug fix for metasploit (EINTR should be ignored)

This commit is contained in:
Miroslav Stampar 2019-05-03 15:59:10 +02:00
parent 585ebca401
commit cb5dc41277
2 changed files with 9 additions and 2 deletions

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty import six from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.5.14" VERSION = "1.3.5.15"
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)

View File

@ -7,6 +7,7 @@ See the file 'LICENSE' for copying permission
from __future__ import print_function from __future__ import print_function
import errno
import os import os
import re import re
import select import select
@ -595,7 +596,13 @@ class Metasploit:
else: else:
proc.kill() proc.kill()
except (EOFError, IOError, select.error): except select.error as ex:
# Reference: https://github.com/andymccurdy/redis-py/pull/743/commits/2b59b25bb08ea09e98aede1b1f23a270fc085a9f
if ex[0] == errno.EINTR:
continue
else:
return proc.returncode
except (EOFError, IOError):
return proc.returncode return proc.returncode
except KeyboardInterrupt: except KeyboardInterrupt:
pass pass