Doing some more style updating (capitalization of exception classes; using _ is enough for private members - __ is used in Python specific methods)

This commit is contained in:
Miroslav Stampar
2012-12-06 14:14:19 +01:00
parent 003d21e962
commit 974407396e
102 changed files with 1115 additions and 1091 deletions

View File

@@ -14,7 +14,7 @@ import logging
from lib.core.data import conf
from lib.core.data import logger
from lib.core.exception import sqlmapConnectionException
from lib.core.exception import SqlmapConnectionException
from lib.core.settings import UNICODE_ENCODING
from plugins.generic.connector import Connector as GenericConnector
@@ -42,7 +42,7 @@ class Connector(GenericConnector):
self.connector = kinterbasdb.connect(host=self.hostname.encode(UNICODE_ENCODING), database=self.db.encode(UNICODE_ENCODING), \
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") #http://www.daniweb.com/forums/thread248499.html
except kinterbasdb.OperationalError, msg:
raise sqlmapConnectionException, msg[1]
raise SqlmapConnectionException, msg[1]
self.setCursor()
self.connected()
@@ -59,7 +59,7 @@ class Connector(GenericConnector):
except kinterbasdb.OperationalError, msg:
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
except kinterbasdb.Error, msg:
raise sqlmapConnectionException, msg[1]
raise SqlmapConnectionException, msg[1]
self.connector.commit()

View File

@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.exception import sqlmapUnsupportedFeatureException
from lib.core.exception import SqlmapUnsupportedFeatureException
from plugins.generic.filesystem import Filesystem as GenericFilesystem
class Filesystem(GenericFilesystem):
@@ -14,8 +14,8 @@ class Filesystem(GenericFilesystem):
def readFile(self, rFile):
errMsg = "on Firebird it is not possible to read files"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg
def writeFile(self, wFile, dFile, fileType=None):
errMsg = "on Firebird it is not possible to write files"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg

View File

@@ -47,7 +47,7 @@ class Fingerprint(GenericFingerprint):
value += actVer
return value
actVer = Format.getDbms() + " (%s)" % (self.__dialectCheck())
actVer = Format.getDbms() + " (%s)" % (self._dialectCheck())
blank = " " * 15
value += "active fingerprint: %s" % actVer
@@ -67,7 +67,7 @@ class Fingerprint(GenericFingerprint):
return value
def __sysTablesCheck(self):
def _sysTablesCheck(self):
retVal = None
table = (
("1.0", ["EXISTS(SELECT CURRENT_USER FROM RDB$DATABASE)"]),
@@ -93,7 +93,7 @@ class Fingerprint(GenericFingerprint):
return retVal
def __dialectCheck(self):
def _dialectCheck(self):
retVal = None
if Backend.getIdentifiedDbms():
@@ -141,7 +141,7 @@ class Fingerprint(GenericFingerprint):
infoMsg = "actively fingerprinting %s" % DBMS.FIREBIRD
logger.info(infoMsg)
version = self.__sysTablesCheck()
version = self._sysTablesCheck()
if version is not None:
Backend.setVersion(version)

View File

@@ -6,7 +6,7 @@ See the file 'doc/COPYING' for copying permission
"""
from lib.core.common import isDBMSVersionAtLeast
from lib.core.exception import sqlmapSyntaxException
from lib.core.exception import SqlmapSyntaxException
from plugins.generic.syntax import Syntax as GenericSyntax
class Syntax(GenericSyntax):
@@ -26,7 +26,7 @@ class Syntax(GenericSyntax):
index = expression[firstIndex:].find("'")
if index == -1:
raise sqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
raise SqlmapSyntaxException, "Unenclosed ' in '%s'" % expression
lastIndex = firstIndex + index
old = "'%s'" % expression[firstIndex:lastIndex]
@@ -58,7 +58,7 @@ class Syntax(GenericSyntax):
index = expression[firstIndex:].find(")")
if index == -1:
raise sqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
raise SqlmapSyntaxException, "Unenclosed ) in '%s'" % expression
lastIndex = firstIndex + index + 1
old = expression[firstIndex:lastIndex]

View File

@@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.exception import sqlmapUnsupportedFeatureException
from lib.core.exception import SqlmapUnsupportedFeatureException
from plugins.generic.takeover import Takeover as GenericTakeover
class Takeover(GenericTakeover):
@@ -14,18 +14,18 @@ class Takeover(GenericTakeover):
def osCmd(self):
errMsg = "on Firebird it is not possible to execute commands"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg
def osShell(self):
errMsg = "on Firebird it is not possible to execute commands"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg
def osPwn(self):
errMsg = "on Firebird it is not possible to establish an "
errMsg += "out-of-band connection"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg
def osSmb(self):
errMsg = "on Firebird it is not possible to establish an "
errMsg += "out-of-band connection"
raise sqlmapUnsupportedFeatureException, errMsg
raise SqlmapUnsupportedFeatureException, errMsg