mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-04 20:03:10 +03:00
Force pymssql to version >= 1.0.2
This commit is contained in:
parent
b19de015c5
commit
cad8f61d55
|
@ -651,6 +651,13 @@ def parseTargetDirect():
|
||||||
if dbmsName == "Microsoft SQL Server":
|
if dbmsName == "Microsoft SQL Server":
|
||||||
import _mssql
|
import _mssql
|
||||||
import pymssql
|
import pymssql
|
||||||
|
|
||||||
|
if not hasattr(pymssql, "__version__") or pymssql.__version__ < "1.0.2":
|
||||||
|
errMsg = "pymssql library on your system must be "
|
||||||
|
errMsg += "version 1.0.2 to work, get it from "
|
||||||
|
errMsg += "http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/"
|
||||||
|
raise sqlmapMissingDependence, errMsg
|
||||||
|
|
||||||
elif dbmsName == "MySQL":
|
elif dbmsName == "MySQL":
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
elif dbmsName == "PostgreSQL":
|
elif dbmsName == "PostgreSQL":
|
||||||
|
|
|
@ -43,6 +43,9 @@ class Connector(GenericConnector):
|
||||||
License: LGPL
|
License: LGPL
|
||||||
|
|
||||||
Possible connectors: http://wiki.python.org/moin/SQL%20Server
|
Possible connectors: http://wiki.python.org/moin/SQL%20Server
|
||||||
|
|
||||||
|
Important note: pymssql library on your system MUST be version 1.0.2
|
||||||
|
to work, get it from http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -79,6 +82,10 @@ class Connector(GenericConnector):
|
||||||
def select(self, query):
|
def select(self, query):
|
||||||
self.execute(query)
|
self.execute(query)
|
||||||
value = self.fetchall()
|
value = self.fetchall()
|
||||||
self.connector.commit()
|
|
||||||
|
try:
|
||||||
|
self.connector.commit()
|
||||||
|
except pymssql.OperationalError:
|
||||||
|
pass
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user