removed all trailing spaces from blank lines

This commit is contained in:
Miroslav Stampar
2010-11-03 10:08:27 +00:00
parent 977df7276d
commit 6adee3792a
29 changed files with 121 additions and 122 deletions

View File

@@ -21,7 +21,7 @@ class MagicException(Exception): pass
class Magic:
"""
Magic is a wrapper around the libmagic C library.
"""
def __init__(self, mime=False, magic_file=None):
@@ -30,12 +30,12 @@ class Magic:
mime - if True, mimetypes are returned instead of textual descriptions
magic_file - use a mime database other than the system default
"""
flags = MAGIC_NONE
if mime:
flags |= MAGIC_MIME
self.cookie = magic_open(flags)
magic_load(self.cookie, magic_file)
@@ -54,7 +54,7 @@ class Magic:
if not os.path.exists(filename):
raise IOError("File does not exist: " + filename)
return magic_file(self.cookie, filename)
def __del__(self):

View File

@@ -47,11 +47,11 @@ class MultipartPostHandler(urllib2.BaseHandler):
def http_request(self, request):
data = request.get_data()
if data is not None and type(data) != str:
v_files = []
v_vars = []
try:
for(key, value) in data.items():
if type(value) == file or hasattr(value, 'file'):

View File

@@ -311,5 +311,5 @@ def start():
if conf.loggedToOut:
logger.info("Fetched data logged to text files under '%s'" % conf.outputPath)
return True

View File

@@ -313,7 +313,7 @@ class Agent:
fieldsToCastStr = fieldsSelect.groups()[0]
elif fieldsNoSelect:
fieldsToCastStr = fieldsNoSelect
if re.search("\A\w+\(.*\)", fieldsToCastStr, re.I): #function
fieldsToCastList = [fieldsToCastStr]
else:
@@ -531,7 +531,7 @@ class Agent:
if kb.dbms in ( DBMS.MYSQL, DBMS.POSTGRESQL, DBMS.SQLITE ):
limitStr = queries[kb.dbms].limit.query % (num, 1)
limitedQuery += " %s" % limitStr
elif kb.dbms == DBMS.FIREBIRD:
limitStr = queries[kb.dbms].limit.query % (num+1, num+1)
limitedQuery += " %s" % limitStr

View File

@@ -1256,7 +1256,7 @@ def readCachedFileContent(filename, mode='rb'):
xfile.close()
kb.locks.cacheLock.release()
return kb.cache.content[filename]
def readXmlFile(xmlFile):

View File

@@ -39,7 +39,7 @@ def hexdecode(string):
string = string[2:]
return string.decode("hex")
def hexencode(string):
return string.encode("hex")

View File

@@ -611,7 +611,7 @@ def __setHTTPProxy():
errMsg = "Proxy authentication credentials "
errMsg += "value must be in format username:password"
raise sqlmapSyntaxException, errMsg
# Reference: http://stackoverflow.com/questions/34079/how-to-specify-an-authenticated-proxy-for-a-python-http-connection
__proxyString = "%s@" % conf.pCred

View File

@@ -89,4 +89,3 @@ class Replication:
def __del__(self):
self.cursor.close()
self.connection.close()

View File

@@ -180,13 +180,13 @@ def __setOutputResume():
continue
url, _, _, expression, value = line
if not value:
continue
if url[0] == "[":
url = url[1:]
value = value.rstrip('\r\n') # Strips both chars independently
if url not in ( conf.url, conf.hostname ):
@@ -197,9 +197,9 @@ def __setOutputResume():
kb.resumedQueries[url][expression] = value
__url_cache.add(url)
__expression_cache[url] = set(expression)
resumeConfKb(expression, url, value)
if expression not in __expression_cache[url]:
kb.resumedQueries[url][expression] = value
__expression_cache[url].add(value)

View File

@@ -116,7 +116,7 @@ def decodePage(page, contentEncoding, contentType):
data = gzip.GzipFile('', 'rb', 9, StringIO.StringIO(page))
page = data.read()
#http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode
if contentType and (contentType.find('charset=') != -1):
charset = checkCharEncoding(contentType.split('charset=')[-1])

View File

@@ -69,7 +69,7 @@ class Abstraction(Web, UDF, xp_cmdshell):
message = "do you want to retrieve the command standard "
message += "output? [Y/n/a] "
getOutput = readInput(message, default="Y")
if getOutput in ("a", "A"):
self.alwaysRetrieveCmdOutput = True

View File

@@ -80,7 +80,7 @@ class Registry:
logger.debug("reading registry key '%s' value '%s'" % (regKey, regValue))
data = self.evalCmd(self.__batPathRemote)
if data and not parse:
pattern = ' '
index = data.find(pattern)

View File

@@ -60,7 +60,7 @@ class UPX:
logger.debug("executing local command: %s" % self.__upxCmd)
process = execute(self.__upxCmd, shell=True, stdout=PIPE, stderr=STDOUT)
dataToStdout("\r[%s] [INFO] compression in progress " % time.strftime("%X"))
pollProcess(process)
upxStdout, upxStderr = process.communicate()

View File

@@ -236,7 +236,7 @@ class Web:
self.webBackdoorUrl = "%s/%s" % (self.webBaseUrl, backdoorName)
self.webDirectory = directory
infoMsg = "the backdoor has probably been successfully "
infoMsg += "uploaded on '%s', go with your browser " % self.webDirectory
infoMsg += "to '%s' and enjoy it!" % self.webBackdoorUrl

View File

@@ -22,7 +22,7 @@ class _Getch:
self.impl = _GetchUnix()
def __call__(self): return self.impl()
class _GetchUnix:
def __init__(self):