@@ -903,37 +903,6 @@ def getTables(self, bruteForce=None):
903903
904904 return kb .data .cachedTables
905905
906- def getSchema (self ):
907- infoMsg = "enumerating database management system schema"
908- logger .info (infoMsg )
909-
910- pushValue (conf .db )
911- pushValue (conf .tbl )
912-
913- conf .db = None
914- conf .tbl = None
915-
916- self .getTables ()
917-
918- infoMsg = "fetched tables: "
919- infoMsg += ", " .join (["%s" % ", " .join ("%s%s%s" % (db , ".." if \
920- Backend .isDbms (DBMS .MSSQL ) or Backend .isDbms (DBMS .SYBASE ) \
921- else "." , t ) for t in tbl ) for db , tbl in \
922- kb .data .cachedTables .items ()])
923- logger .info (infoMsg )
924-
925- for db , tables in kb .data .cachedTables .items ():
926- for tbl in tables :
927- conf .db = db
928- conf .tbl = tbl
929-
930- self .getColumns ()
931-
932- conf .tbl = popValue ()
933- conf .db = popValue ()
934-
935- return kb .data .cachedColumns
936-
937906 def getColumns (self , onlyColNames = False ):
938907 bruteForce = False
939908
@@ -1174,6 +1143,37 @@ def getColumns(self, onlyColNames=False):
11741143
11751144 return kb .data .cachedColumns
11761145
1146+ def getSchema (self ):
1147+ infoMsg = "enumerating database management system schema"
1148+ logger .info (infoMsg )
1149+
1150+ pushValue (conf .db )
1151+ pushValue (conf .tbl )
1152+
1153+ conf .db = None
1154+ conf .tbl = None
1155+
1156+ self .getTables ()
1157+
1158+ infoMsg = "fetched tables: "
1159+ infoMsg += ", " .join (["%s" % ", " .join ("%s%s%s" % (db , ".." if \
1160+ Backend .isDbms (DBMS .MSSQL ) or Backend .isDbms (DBMS .SYBASE ) \
1161+ else "." , t ) for t in tbl ) for db , tbl in \
1162+ kb .data .cachedTables .items ()])
1163+ logger .info (infoMsg )
1164+
1165+ for db , tables in kb .data .cachedTables .items ():
1166+ for tbl in tables :
1167+ conf .db = db
1168+ conf .tbl = tbl
1169+
1170+ self .getColumns ()
1171+
1172+ conf .tbl = popValue ()
1173+ conf .db = popValue ()
1174+
1175+ return kb .data .cachedColumns
1176+
11771177 def __pivotDumpTable (self , table , colList , count = None , blind = True ):
11781178 lengths = {}
11791179 entries = {}
0 commit comments