Minor fixes

This commit is contained in:
Bernardo Damele 2010-05-30 14:53:13 +00:00
parent b380d34d3c
commit b798222dd7
6 changed files with 8 additions and 8 deletions

View File

@ -380,9 +380,9 @@ def dataToOutFile(data):
rFile = filePathToString(conf.rFile) rFile = filePathToString(conf.rFile)
rFilePath = "%s%s%s" % (conf.filePath, os.sep, rFile) rFilePath = "%s%s%s" % (conf.filePath, os.sep, rFile)
rFileFP = codecs.open(rFilePath, "wb", conf.dataEncoding) rFileFP = codecs.open(rFilePath, "wb")
rFileFP.write(utf8decode(data)) rFileFP.write(data)
rFileFP.flush() rFileFP.flush()
rFileFP.close() rFileFP.close()
@ -421,7 +421,7 @@ def fileToStr(fileName):
@rtype: C{str} @rtype: C{str}
""" """
filePointer = codecs.open(fileName, "rb", conf.dataEncoding) filePointer = codecs.open(fileName, "rb")
fileText = filePointer.read() fileText = filePointer.read()
return fileText.replace(" ", "").replace("\t", "").replace("\r", "").replace("\n", " ") return fileText.replace(" ", "").replace("\t", "").replace("\r", "").replace("\n", " ")

View File

@ -92,7 +92,7 @@ optDict = {
"getCurrentDb": ("boolean", "Databases"), "getCurrentDb": ("boolean", "Databases"),
"isDba": "boolean", "isDba": "boolean",
"getUsers": ("boolean", "Users"), "getUsers": ("boolean", "Users"),
"getPasswordHashes": ("boolean", "Hashes"), "getPasswordHashes": ("boolean", "Passwords"),
"getPrivileges": ("boolean", "Privileges"), "getPrivileges": ("boolean", "Privileges"),
"getRoles": ("boolean", "Roles"), "getRoles": ("boolean", "Roles"),
"getDbs": ("boolean", "Databases"), "getDbs": ("boolean", "Databases"),

View File

@ -127,7 +127,7 @@ def __setOutputResume():
__url_cache = set() __url_cache = set()
__expression_cache = {} __expression_cache = {}
for line in readSessionFP.readlines(): #xreadlines doesn't return unicode strings when codec.open used for line in readSessionFP.readlines(): # xreadlines doesn't return unicode strings when codec.open() is used
if line.count("][") == 4: if line.count("][") == 4:
line = line.split("][") line = line.split("][")
@ -142,7 +142,7 @@ def __setOutputResume():
if url[0] == "[": if url[0] == "[":
url = url[1:] url = url[1:]
value = value.rstrip('\r\n') #strips both chars independently value = value.rstrip('\r\n') # Strips both chars independently
if url not in ( conf.url, conf.hostname ): if url not in ( conf.url, conf.hostname ):
continue continue

View File

@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License along
with sqlmap; if not, write to the Free Software Foundation, Inc., 51 with sqlmap; if not, write to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
""" """
import codecs import codecs
from ConfigParser import NoSectionError from ConfigParser import NoSectionError

View File

@ -414,7 +414,6 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
break break
elif commonCharset: elif commonCharset:
# TODO: this part does not seem to work yet
val = getChar(index, commonCharset, False) val = getChar(index, commonCharset, False)
# If we had no luck with singleValue and common charset, # If we had no luck with singleValue and common charset,

View File

@ -775,7 +775,7 @@ class Enumeration:
plusOne = True plusOne = True
else: else:
plusOne = False plusOne = False
indexRange = getRange(count) indexRange = getRange(count, plusOne=plusOne)
for index in indexRange: for index in indexRange:
if kb.dbms in ("SQLite", "Firebird"): if kb.dbms in ("SQLite", "Firebird"):