mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-17 03:50:42 +03:00
quick fix
This commit is contained in:
parent
ac6ce478a0
commit
ad3c425a18
|
@ -33,7 +33,7 @@ import socket
|
||||||
import urllib2
|
import urllib2
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import RawConfigParser
|
||||||
|
|
||||||
from lib.core.common import getConsoleWidth
|
from lib.core.common import getConsoleWidth
|
||||||
from lib.core.common import getFileType
|
from lib.core.common import getFileType
|
||||||
|
@ -76,6 +76,26 @@ authHandler = urllib2.BaseHandler()
|
||||||
proxyHandler = urllib2.BaseHandler()
|
proxyHandler = urllib2.BaseHandler()
|
||||||
redirectHandler = SmartRedirectHandler()
|
redirectHandler = SmartRedirectHandler()
|
||||||
|
|
||||||
|
|
||||||
|
class UnicodeRawConfigParser(RawConfigParser):
|
||||||
|
def write(self, fp):
|
||||||
|
"""Write an .ini-format representation of the configuration state."""
|
||||||
|
if self._defaults:
|
||||||
|
fp.write("[%s]\n" % DEFAULTSECT)
|
||||||
|
for (key, value) in self._defaults.items():
|
||||||
|
fp.write("%s = %s\n" % (key, unicode(value).replace('\n', '\n\t')))
|
||||||
|
fp.write("\n")
|
||||||
|
for section in self._sections:
|
||||||
|
fp.write("[%s]\n" % section)
|
||||||
|
for (key, value) in self._sections[section].items():
|
||||||
|
if key != "__name__":
|
||||||
|
if value is None:
|
||||||
|
fp.write("%s\n" % (key))
|
||||||
|
else:
|
||||||
|
fp.write("%s = %s\n" %
|
||||||
|
(key, unicode(value).replace('\n', '\n\t')))
|
||||||
|
fp.write("\n")
|
||||||
|
|
||||||
def __urllib2Opener():
|
def __urllib2Opener():
|
||||||
"""
|
"""
|
||||||
This function creates the urllib2 OpenerDirector.
|
This function creates the urllib2 OpenerDirector.
|
||||||
|
@ -981,7 +1001,7 @@ def __saveCmdline():
|
||||||
debugMsg = "saving command line options on a sqlmap configuration INI file"
|
debugMsg = "saving command line options on a sqlmap configuration INI file"
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
config = ConfigParser()
|
config = UnicodeRawConfigParser()
|
||||||
userOpts = {}
|
userOpts = {}
|
||||||
|
|
||||||
for family in optDict.keys():
|
for family in optDict.keys():
|
||||||
|
@ -1016,8 +1036,10 @@ def __saveCmdline():
|
||||||
|
|
||||||
config.set(family, option, value)
|
config.set(family, option, value)
|
||||||
|
|
||||||
confFP = open(paths.SQLMAP_CONFIG, "wb")
|
print 11111
|
||||||
|
confFP = codecs.open(paths.SQLMAP_CONFIG, "wb", "UTF8")
|
||||||
config.write(confFP)
|
config.write(confFP)
|
||||||
|
print 22222
|
||||||
|
|
||||||
infoMsg = "saved command line options on '%s' configuration file" % paths.SQLMAP_CONFIG
|
infoMsg = "saved command line options on '%s' configuration file" % paths.SQLMAP_CONFIG
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user