@@ -426,10 +426,10 @@ def _createTargetDirs():
426426 if not os .path .isdir (paths .SQLMAP_OUTPUT_PATH ):
427427 try :
428428 os .makedirs (paths .SQLMAP_OUTPUT_PATH , 0755 )
429- except OSError , msg :
429+ except OSError , ex :
430430 tempDir = tempfile .mkdtemp (prefix = 'output' )
431431 warnMsg = "unable to create default root output directory "
432- warnMsg += "'%s' (%s). " % (paths .SQLMAP_OUTPUT_PATH , msg )
432+ warnMsg += "'%s' (%s). " % (paths .SQLMAP_OUTPUT_PATH , ex )
433433 warnMsg += "using temporary directory '%s' instead" % tempDir
434434 logger .warn (warnMsg )
435435
@@ -440,10 +440,10 @@ def _createTargetDirs():
440440 if not os .path .isdir (conf .outputPath ):
441441 try :
442442 os .makedirs (conf .outputPath , 0755 )
443- except OSError , msg :
443+ except OSError , ex :
444444 tempDir = tempfile .mkdtemp (prefix = 'output' )
445445 warnMsg = "unable to create output directory "
446- warnMsg += "'%s' (%s). " % (conf .outputPath , msg )
446+ warnMsg += "'%s' (%s). " % (conf .outputPath , ex )
447447 warnMsg += "using temporary directory '%s' instead" % tempDir
448448 logger .warn (warnMsg )
449449
@@ -453,12 +453,12 @@ def _createTargetDirs():
453453 with open (os .path .join (conf .outputPath , "target.txt" ), "w+" ) as f :
454454 _ = kb .originalUrls .get (conf .url ) or conf .url or conf .hostname
455455 f .write (_ .encode (UNICODE_ENCODING ))
456- except IOError , msg :
457- if "denied" in str (msg ):
456+ except IOError , ex :
457+ if "denied" in str (ex ):
458458 errMsg = "you don't have enough permissions "
459459 else :
460460 errMsg = "something went wrong while trying "
461- errMsg += "to write to the output directory '%s' (%s)" % (paths .SQLMAP_OUTPUT_PATH , msg )
461+ errMsg += "to write to the output directory '%s' (%s)" % (paths .SQLMAP_OUTPUT_PATH , ex )
462462
463463 raise SqlmapMissingPrivileges , errMsg
464464
0 commit comments