mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Cosmetics
This commit is contained in:
parent
71d0b1bcd7
commit
b152b1a04d
|
@ -15,6 +15,13 @@ class Replication:
|
||||||
replication purposes.
|
replication purposes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# sqlite data types
|
||||||
|
NULL = DataType('NULL')
|
||||||
|
INTEGER = DataType('INTEGER')
|
||||||
|
REAL = DataType('REAL')
|
||||||
|
TEXT = DataType('TEXT')
|
||||||
|
BLOB = DataType('BLOB')
|
||||||
|
|
||||||
def __init__(self, dbpath):
|
def __init__(self, dbpath):
|
||||||
self.dbpath = dbpath
|
self.dbpath = dbpath
|
||||||
self.connection = sqlite3.connect(dbpath)
|
self.connection = sqlite3.connect(dbpath)
|
||||||
|
@ -67,13 +74,6 @@ class Replication:
|
||||||
stmt += 'WHERE %s' % condition
|
stmt += 'WHERE %s' % condition
|
||||||
return self.parent.cursor.execute(stmt)
|
return self.parent.cursor.execute(stmt)
|
||||||
|
|
||||||
# sqlite data types
|
|
||||||
NULL = DataType('NULL')
|
|
||||||
INTEGER = DataType('INTEGER')
|
|
||||||
REAL = DataType('REAL')
|
|
||||||
TEXT = DataType('TEXT')
|
|
||||||
BLOB = DataType('BLOB')
|
|
||||||
|
|
||||||
def createTable(self, tblname, columns=None, typeless=False):
|
def createTable(self, tblname, columns=None, typeless=False):
|
||||||
"""
|
"""
|
||||||
This function creates Table instance with current connection settings.
|
This function creates Table instance with current connection settings.
|
||||||
|
|
|
@ -212,12 +212,15 @@ class Connect:
|
||||||
page = decodePage(page, responseHeaders.get("Content-Encoding"), responseHeaders.get("Content-Type"))
|
page = decodePage(page, responseHeaders.get("Content-Encoding"), responseHeaders.get("Content-Type"))
|
||||||
|
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
|
code = e.code
|
||||||
|
status = e.msg
|
||||||
|
|
||||||
if e.code == 401:
|
if e.code == 401:
|
||||||
errMsg = "not authorized, try to provide right HTTP "
|
errMsg = "not authorized, try to provide right HTTP "
|
||||||
errMsg += "authentication type and valid credentials (%d)" % e.code
|
errMsg += "authentication type and valid credentials (%d)" % code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
elif e.code == 404 and raise404:
|
elif e.code == 404 and raise404:
|
||||||
errMsg = "page not found (%d)" % e.code
|
errMsg = "page not found (%d)" % code
|
||||||
raise sqlmapConnectionException, errMsg
|
raise sqlmapConnectionException, errMsg
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
@ -225,13 +228,10 @@ class Connect:
|
||||||
responseHeaders = e.info()
|
responseHeaders = e.info()
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
warnMsg = "connection timed out while trying "
|
warnMsg = "connection timed out while trying "
|
||||||
warnMsg += "to get error page information (%d)" % e.code
|
warnMsg += "to get error page information (%d)" % code
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
code = e.code
|
|
||||||
status = e.msg
|
|
||||||
|
|
||||||
debugMsg = "got HTTP error code: %d (%s)" % (code, status)
|
debugMsg = "got HTTP error code: %d (%s)" % (code, status)
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user