mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-31 15:40:46 +00:00
Fixes #1794
This commit is contained in:
parent
e83d8f6143
commit
31d7021d4c
3 changed files with 12 additions and 6 deletions
|
|
@ -1023,14 +1023,17 @@ def getHeader(headers, key):
|
|||
break
|
||||
return retVal
|
||||
|
||||
def checkFile(filename):
|
||||
def checkFile(filename, raiseOnError=True):
|
||||
"""
|
||||
Checks for file existence and readability
|
||||
"""
|
||||
|
||||
valid = True
|
||||
|
||||
if filename is None or not os.path.isfile(filename):
|
||||
try:
|
||||
if filename is None or not os.path.isfile(filename):
|
||||
valid = False
|
||||
except UnicodeError:
|
||||
valid = False
|
||||
|
||||
if valid:
|
||||
|
|
@ -1040,9 +1043,11 @@ def checkFile(filename):
|
|||
except:
|
||||
valid = False
|
||||
|
||||
if not valid:
|
||||
if not valid and raiseOnError:
|
||||
raise SqlmapSystemException("unable to read file '%s'" % filename)
|
||||
|
||||
return valid
|
||||
|
||||
def banner():
|
||||
"""
|
||||
This function prints sqlmap banner with its version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue