mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 13:14:13 +03:00
Minor fix
This commit is contained in:
parent
75edb84a71
commit
0795760255
|
@ -730,8 +730,13 @@ def dataToTrafficFile(data):
|
||||||
if not conf.trafficFile:
|
if not conf.trafficFile:
|
||||||
return
|
return
|
||||||
|
|
||||||
conf.trafficFP.write(data)
|
try:
|
||||||
conf.trafficFP.flush()
|
conf.trafficFP.write(data)
|
||||||
|
conf.trafficFP.flush()
|
||||||
|
except IOError, ex:
|
||||||
|
errMsg = "something went wrong while trying "
|
||||||
|
errMsg += "to write to the traffic file '%s' ('%s')" % (conf.trafficFile, ex)
|
||||||
|
raise SqlmapGenericException, errMsg
|
||||||
|
|
||||||
def dataToDumpFile(dumpFile, data):
|
def dataToDumpFile(dumpFile, data):
|
||||||
dumpFile.write(data)
|
dumpFile.write(data)
|
||||||
|
|
|
@ -426,10 +426,10 @@ def _createTargetDirs():
|
||||||
if not os.path.isdir(paths.SQLMAP_OUTPUT_PATH):
|
if not os.path.isdir(paths.SQLMAP_OUTPUT_PATH):
|
||||||
try:
|
try:
|
||||||
os.makedirs(paths.SQLMAP_OUTPUT_PATH, 0755)
|
os.makedirs(paths.SQLMAP_OUTPUT_PATH, 0755)
|
||||||
except OSError, msg:
|
except OSError, ex:
|
||||||
tempDir = tempfile.mkdtemp(prefix='output')
|
tempDir = tempfile.mkdtemp(prefix='output')
|
||||||
warnMsg = "unable to create default root output directory "
|
warnMsg = "unable to create default root output directory "
|
||||||
warnMsg += "'%s' (%s). " % (paths.SQLMAP_OUTPUT_PATH, msg)
|
warnMsg += "'%s' (%s). " % (paths.SQLMAP_OUTPUT_PATH, ex)
|
||||||
warnMsg += "using temporary directory '%s' instead" % tempDir
|
warnMsg += "using temporary directory '%s' instead" % tempDir
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
@ -440,10 +440,10 @@ def _createTargetDirs():
|
||||||
if not os.path.isdir(conf.outputPath):
|
if not os.path.isdir(conf.outputPath):
|
||||||
try:
|
try:
|
||||||
os.makedirs(conf.outputPath, 0755)
|
os.makedirs(conf.outputPath, 0755)
|
||||||
except OSError, msg:
|
except OSError, ex:
|
||||||
tempDir = tempfile.mkdtemp(prefix='output')
|
tempDir = tempfile.mkdtemp(prefix='output')
|
||||||
warnMsg = "unable to create output directory "
|
warnMsg = "unable to create output directory "
|
||||||
warnMsg += "'%s' (%s). " % (conf.outputPath, msg)
|
warnMsg += "'%s' (%s). " % (conf.outputPath, ex)
|
||||||
warnMsg += "using temporary directory '%s' instead" % tempDir
|
warnMsg += "using temporary directory '%s' instead" % tempDir
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
@ -453,12 +453,12 @@ def _createTargetDirs():
|
||||||
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
|
with open(os.path.join(conf.outputPath, "target.txt"), "w+") as f:
|
||||||
_ = kb.originalUrls.get(conf.url) or conf.url or conf.hostname
|
_ = kb.originalUrls.get(conf.url) or conf.url or conf.hostname
|
||||||
f.write(_.encode(UNICODE_ENCODING))
|
f.write(_.encode(UNICODE_ENCODING))
|
||||||
except IOError, msg:
|
except IOError, ex:
|
||||||
if "denied" in str(msg):
|
if "denied" in str(ex):
|
||||||
errMsg = "you don't have enough permissions "
|
errMsg = "you don't have enough permissions "
|
||||||
else:
|
else:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to write to the output directory '%s' (%s)" % (paths.SQLMAP_OUTPUT_PATH, msg)
|
errMsg += "to write to the output directory '%s' (%s)" % (paths.SQLMAP_OUTPUT_PATH, ex)
|
||||||
|
|
||||||
raise SqlmapMissingPrivileges, errMsg
|
raise SqlmapMissingPrivileges, errMsg
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user