MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getCurrentDb

Method getCurrentDb

plugins/generic/databases.py:74–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

72 kb.data.cachedStatements = []
73
74 def getCurrentDb(self):
75 infoMsg = "fetching current database"
76 logger.info(infoMsg)
77
78 query = queries[Backend.getIdentifiedDbms()].current_db.query
79
80 if not kb.data.currentDb:
81 kb.data.currentDb = unArrayizeValue(inject.getValue(query, safeCharEncode=False))
82
83 if not kb.data.currentDb and Backend.isDbms(DBMS.VERTICA):
84 kb.data.currentDb = VERTICA_DEFAULT_SCHEMA
85
86 if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2, DBMS.PGSQL, DBMS.MONETDB, DBMS.DERBY, DBMS.VERTICA, DBMS.PRESTO, DBMS.MIMERSQL, DBMS.CRATEDB, DBMS.CACHE, DBMS.FRONTBASE):
87 warnMsg = "on %s you'll need to use " % Backend.getIdentifiedDbms()
88 warnMsg += "schema names for enumeration as the counterpart to database "
89 warnMsg += "names on other DBMSes"
90 singleTimeWarnMessage(warnMsg)
91 elif Backend.getIdentifiedDbms() in (DBMS.ALTIBASE, DBMS.CUBRID):
92 warnMsg = "on %s you'll need to use " % Backend.getIdentifiedDbms()
93 warnMsg += "user names for enumeration as the counterpart to database "
94 warnMsg += "names on other DBMSes"
95 singleTimeWarnMessage(warnMsg)
96
97 return kb.data.currentDb
98
99 def getDbs(self):
100 if len(kb.data.cachedDbs) > 0:

Callers 8

getDbsMethod · 0.95
getTablesMethod · 0.95
getColumnsMethod · 0.95
getCountMethod · 0.95
actionFunction · 0.45
dumpTableMethod · 0.45
searchTableMethod · 0.45
searchColumnMethod · 0.45

Calls 5

unArrayizeValueFunction · 0.90
singleTimeWarnMessageFunction · 0.90
infoMethod · 0.80
getIdentifiedDbmsMethod · 0.80
isDbmsMethod · 0.80

Tested by

no test coverage detected