File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import os
1414import tempfile
1515
16+ from lib .core .exception import SqlmapSystemException
1617from lib .core .settings import BIGARRAY_CHUNK_LENGTH
1718
1819class Cache (object ):
@@ -63,12 +64,17 @@ def index(self, value):
6364 return ValueError , "%s is not in list" % value
6465
6566 def _dump (self , value ):
66- handle , filename = tempfile .mkstemp (prefix = "sqlmapba-" )
67- self .filenames .add (filename )
68- os .close (handle )
69- with open (filename , "w+b" ) as fp :
70- pickle .dump (value , fp , pickle .HIGHEST_PROTOCOL )
71- return filename
67+ try :
68+ handle , filename = tempfile .mkstemp (prefix = "sqlmapba-" )
69+ self .filenames .add (filename )
70+ os .close (handle )
71+ with open (filename , "w+b" ) as fp :
72+ pickle .dump (value , fp , pickle .HIGHEST_PROTOCOL )
73+ return filename
74+ except IOError , ex :
75+ errMsg = "exception occurred while storing data "
76+ errMsg += "to a temporary file ('%s')" % ex
77+ raise SqlmapSystemException , errMsg
7278
7379 def _checkcache (self , index ):
7480 if (self .cache and self .cache .index != index and self .cache .dirty ):
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ class SqlmapShellQuitException(SqlmapBaseException):
5353class SqlmapSyntaxException (SqlmapBaseException ):
5454 pass
5555
56+ class SqlmapSystemException (SqlmapBaseException ):
57+ pass
58+
5659class SqlmapThreadException (SqlmapBaseException ):
5760 pass
5861
You can’t perform that action at this time.
0 commit comments