refactoring

This commit is contained in:
Miroslav Stampar 2012-01-13 21:55:39 +00:00
parent ec9cc19951
commit 8e4b8d345f
4 changed files with 8 additions and 8 deletions

View File

@ -77,8 +77,8 @@ class Enumeration(GenericEnumeration):
rootQuery = queries[Backend.getIdentifiedDbms()].tables
for db in dbs:
if not isinstance(db, basestring):
db = db[0]
if isinstance(db, (tuple, list)):
db = db[0] if db else ""
randStr = randomStr()
query = rootQuery.inband.query % (("'%s'" % db) if db != "USER" else 'USER')

View File

@ -88,8 +88,8 @@ class Enumeration(GenericEnumeration):
if any(isTechniqueAvailable(_) for _ in (PAYLOAD.TECHNIQUE.UNION, PAYLOAD.TECHNIQUE.ERROR)) or conf.direct:
for db in dbs:
if not isinstance(db, basestring):
db = db[0]
if isinstance(db, (tuple, list)):
db = db[0] if db else ""
if conf.excludeSysDbs and db in self.excludeDbsList:
infoMsg = "skipping system database '%s'" % db

View File

@ -138,8 +138,8 @@ class Enumeration(GenericEnumeration):
rootQuery = queries[Backend.getIdentifiedDbms()].tables
for db in dbs:
if not isinstance(db, basestring):
db = db[0]
if isinstance(db, (tuple, list)):
db = db[0] if db else ""
for blind in blinds:
randStr = randomStr()

View File

@ -897,8 +897,8 @@ class Enumeration:
value = map(lambda x: (dbs[0], x), value)
for db, table in filterPairValues(value):
if not isinstance(db, basestring):
db = db[0]
if isinstance(db, (tuple, list)):
db = db[0] if db else ""
db = safeSQLIdentificatorNaming(db)
table = safeSQLIdentificatorNaming(table, True)