diff --git a/lib/controller/handler.py b/lib/controller/handler.py index 31e2859d1..02caa563b 100644 --- a/lib/controller/handler.py +++ b/lib/controller/handler.py @@ -89,7 +89,7 @@ def setHandler(): except SqlmapConnectionException, msg: logger.critical(msg) - if sqlalchemy.connection: + if sqlalchemy.connector: conf.dbmsConnector = sqlalchemy else: conf.dbmsConnector.connect() diff --git a/lib/utils/sqlalchemy.py b/lib/utils/sqlalchemy.py index 9626e7c96..4c48eba77 100644 --- a/lib/utils/sqlalchemy.py +++ b/lib/utils/sqlalchemy.py @@ -43,7 +43,7 @@ class SQLAlchemy(GenericConnector): conf.direct = conf.direct.replace(conf.dbms, self.dialect) engine = _sqlalchemy.create_engine(conf.direct, connect_args={'check_same_thread':False} if self.dialect == "sqlite" else {}) - self.connection = engine.connect() + self.connector = engine.connect() except SqlmapFilePathException: raise except Exception, msg: @@ -63,7 +63,7 @@ class SQLAlchemy(GenericConnector): def execute(self, query): try: - self.cursor = self.connection.execute(query) + self.cursor = self.connector.execute(query) except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError), msg: logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1]) except _sqlalchemy.exc.InternalError, msg: diff --git a/plugins/generic/connector.py b/plugins/generic/connector.py index 185aeff6b..17e3c7756 100644 --- a/plugins/generic/connector.py +++ b/plugins/generic/connector.py @@ -18,7 +18,6 @@ class Connector: """ def __init__(self): - self.connection = None self.connector = None self.cursor = None