File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1023,14 +1023,17 @@ def getHeader(headers, key):
10231023 break
10241024 return retVal
10251025
1026- def checkFile (filename ):
1026+ def checkFile (filename , raiseOnError = True ):
10271027 """
10281028 Checks for file existence and readability
10291029 """
10301030
10311031 valid = True
10321032
1033- if filename is None or not os .path .isfile (filename ):
1033+ try :
1034+ if filename is None or not os .path .isfile (filename ):
1035+ valid = False
1036+ except UnicodeError :
10341037 valid = False
10351038
10361039 if valid :
@@ -1040,9 +1043,11 @@ def checkFile(filename):
10401043 except :
10411044 valid = False
10421045
1043- if not valid :
1046+ if not valid and raiseOnError :
10441047 raise SqlmapSystemException ("unable to read file '%s'" % filename )
10451048
1049+ return valid
1050+
10461051def banner ():
10471052 """
10481053 This function prints sqlmap banner with its version
Original file line number Diff line number Diff line change 1313import threading
1414
1515from lib .core .common import Backend
16+ from lib .core .common import checkFile
1617from lib .core .common import dataToDumpFile
1718from lib .core .common import dataToStdout
1819from lib .core .common import getSafeExString
@@ -434,7 +435,7 @@ def dbTableValues(self, tableValues):
434435 dumpDbPath = tempDir
435436
436437 dumpFileName = os .path .join (dumpDbPath , "%s.%s" % (unsafeSQLIdentificatorNaming (table ), conf .dumpFormat .lower ()))
437- if not os . path . isfile (dumpFileName ):
438+ if not checkFile (dumpFileName , False ):
438439 try :
439440 openFile (dumpFileName , "w+b" ).close ()
440441 except SqlmapSystemException :
@@ -449,7 +450,7 @@ def dbTableValues(self, tableValues):
449450 else :
450451 dumpFileName = os .path .join (dumpDbPath , "%s.%s" % (_ , conf .dumpFormat .lower ()))
451452
452- appendToFile = os . path . isfile ( dumpFileName ) and any ((conf .limitStart , conf .limitStop ))
453+ appendToFile = any ((conf .limitStart , conf .limitStop )) and checkFile ( dumpFileName , False )
453454 dumpFP = openFile (dumpFileName , "wb" if not appendToFile else "ab" , buffering = DUMP_FILE_BUFFER_SIZE )
454455
455456 count = int (tableValues ["__infos__" ]["count" ])
Original file line number Diff line number Diff line change 2020from lib .core .revision import getRevisionNumber
2121
2222# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23- VERSION = "1.0.3.10 "
23+ VERSION = "1.0.3.11 "
2424REVISION = getRevisionNumber ()
2525STABLE = VERSION .count ('.' ) <= 2
2626VERSION_STRING = "sqlmap/%s#%s" % (VERSION , "stable" if STABLE else "dev" )
You can’t perform that action at this time.
0 commit comments