just in case commit to prevent join string iteration over 'None' values

This commit is contained in:
Miroslav Stampar 2011-07-30 13:01:37 +00:00
parent 68ae8ea5b2
commit a6ade08c28
4 changed files with 16 additions and 4 deletions

View File

@ -64,7 +64,7 @@ class Enumeration(GenericEnumeration):
else:
dbs = self.getDbs()
for db in dbs:
for db in filter(None, dbs):
dbs[dbs.index(db)] = safeSQLIdentificatorNaming(db)
infoMsg = "fetching tables for database"

View File

@ -77,6 +77,8 @@ class Enumeration(GenericEnumeration):
for db in dbs:
dbs[dbs.index(db)] = safeSQLIdentificatorNaming(db)
dbs = filter(None, dbs)
infoMsg = "fetching tables for database"
infoMsg += "%s: %s" % ("s" if len(dbs) > 1 else "", ", ".join(db for db in sorted(dbs)))
logger.info(infoMsg)

View File

@ -120,6 +120,8 @@ class Enumeration(GenericEnumeration):
for db in dbs:
dbs[dbs.index(db)] = safeSQLIdentificatorNaming(db)
dbs = filter(None, dbs)
infoMsg = "fetching tables for database"
infoMsg += "%s: %s" % ("s" if len(dbs) > 1 else "", ", ".join(db for db in sorted(dbs)))
logger.info(infoMsg)

View File

@ -252,6 +252,8 @@ class Enumeration:
else:
users = []
users = filter(None, users)
if isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION) or isTechniqueAvailable(PAYLOAD.TECHNIQUE.ERROR) or conf.direct:
if Backend.isDbms(DBMS.MSSQL) and Backend.isVersionWithin(("2005", "2008")):
query = rootQuery.inband.query2
@ -447,6 +449,8 @@ class Enumeration:
else:
users = []
users = filter(None, users)
# Set containing the list of DBMS administrators
areAdmins = set()
@ -830,6 +834,8 @@ class Enumeration:
for db in dbs:
dbs[dbs.index(db)] = safeSQLIdentificatorNaming(db)
dbs = filter(None, dbs)
if bruteForce:
resumeAvailable = False
@ -998,6 +1004,8 @@ class Enumeration:
for col in colList:
colList[colList.index(col)] = safeSQLIdentificatorNaming(col)
colList = filter(None, colList)
if conf.tbl:
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2):
conf.tbl = conf.tbl.upper()
@ -1388,7 +1396,7 @@ class Enumeration:
lengths[column] = 0
entries[column] = BigArray()
colList = sorted(colList, key=lambda x: len(x) if x else MAX_INT)
colList = filter(None, sorted(colList, key=lambda x: len(x) if x else MAX_INT))
for column in colList:
infoMsg = "fetching number of distinct "
@ -1550,7 +1558,7 @@ class Enumeration:
continue
colList = kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)][safeSQLIdentificatorNaming(tbl, True)].keys()
colList = filter(None, kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)][safeSQLIdentificatorNaming(tbl, True)].keys())
colString = ", ".join(column for column in sorted(colList))
rootQuery = queries[Backend.getIdentifiedDbms()].dump_table
@ -1856,7 +1864,7 @@ class Enumeration:
continue
conf.tbl = table
conf.col = ",".join(column for column in sorted(columns))
conf.col = ",".join(column for column in filter(None, sorted(columns)))
kb.data.cachedColumns = {}
kb.data.dumpedTable = {}