mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-05 08:13:46 +03:00
some fixes
This commit is contained in:
parent
9e29120603
commit
939fa5d2c4
|
@ -48,17 +48,30 @@ class Connector(GenericConnector):
|
||||||
def connect(self):
|
def connect(self):
|
||||||
self.initConnection()
|
self.initConnection()
|
||||||
|
|
||||||
|
lastMsg = None
|
||||||
|
for connString in ('Driver={Microsoft Access Driver (*.mdb)};Dbq=%s;Uid=Admin;Pwd=;' % self.db, 'DSN=%s' % self.db):
|
||||||
try:
|
try:
|
||||||
self.connector = pyodbc.connect('DSN=%s' % self.db)
|
self.connector = pyodbc.connect(connString)
|
||||||
except (pyodbc.Error, pyodbc.OperationalError), msg:
|
break
|
||||||
|
except pyodbc.Error, msg:
|
||||||
|
lastMsg = msg
|
||||||
|
except pyodbc.OperationalError, msg:
|
||||||
raise sqlmapConnectionException, msg[1]
|
raise sqlmapConnectionException, msg[1]
|
||||||
|
if not self.connector:
|
||||||
|
raise sqlmapConnectionException, lastMsg[1]
|
||||||
|
|
||||||
self.setCursor()
|
self.setCursor()
|
||||||
self.connected()
|
self.connected()
|
||||||
|
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
output = self.cursor.fetchall()
|
||||||
|
for i in xrange(len(output)):
|
||||||
|
for j in xrange(len(output[i])):
|
||||||
|
if type(output[i][j]) == str and output[i][j].find('\0') != -1:
|
||||||
|
output[i][j] = output[i][j][:output[i][j].find('\0')].rstrip()
|
||||||
|
return output
|
||||||
|
|
||||||
except pyodbc.ProgrammingError, msg:
|
except pyodbc.ProgrammingError, msg:
|
||||||
logger.log(8, msg[1])
|
logger.log(8, msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user