fixes for sqlite

This commit is contained in:
Miroslav Stampar 2010-03-30 13:36:23 +00:00
parent 8702cce760
commit f0729565a9
2 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ class Connector(GenericConnector):
try: try:
self.connector = sqlite3.connect(database=self.db, timeout=conf.timeout) self.connector = sqlite3.connect(database=self.db, timeout=conf.timeout)
except sqlite3.OperationalError, msg: except sqlite3.OperationalError, msg:
raise sqlmapConnectionException, msg[1] raise sqlmapConnectionException, msg[0]
self.setCursor() self.setCursor()
self.connected() self.connected()
@ -62,7 +62,7 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except sqlite3.OperationalError, msg: except sqlite3.OperationalError, msg:
logger.log(8, msg[1]) logger.log(8, msg[0])
return None return None
def execute(self, query): def execute(self, query):
@ -71,9 +71,9 @@ class Connector(GenericConnector):
try: try:
self.cursor.execute(query) self.cursor.execute(query)
except sqlite3.OperationalError, msg: except sqlite3.OperationalError, msg:
logger.log(8, msg[1]) logger.log(8, msg[0])
except sqlite3.Error, msg: except sqlite3.Error, msg:
raise sqlmapConnectionException, msg[1] raise sqlmapConnectionException, msg[0]
self.connector.commit() self.connector.commit()

View File

@ -117,7 +117,7 @@ class Fingerprint(GenericFingerprint):
if not conf.extensiveFp: if not conf.extensiveFp:
return True return True
version = inject.getValue("SUBSTR((SQLITE_VERSION()), 1, 1)", unpack=False, charsetType=2) version = inject.getValue("SELECT SUBSTR((SQLITE_VERSION()), 1, 1)", unpack=False, charsetType=2)
kb.dbmsVersion = [ version ] kb.dbmsVersion = [ version ]
return True return True