mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
minor improvement
This commit is contained in:
parent
22ce464efc
commit
a555d1ad68
|
@ -1355,7 +1355,7 @@ def initCommonOutputs():
|
|||
|
||||
cfile.close()
|
||||
|
||||
def getFileItems(filename, commentPrefix='#', unicode_=True):
|
||||
def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, unique=False):
|
||||
retVal = []
|
||||
|
||||
checkFile(filename)
|
||||
|
@ -1376,6 +1376,10 @@ def getFileItems(filename, commentPrefix='#', unicode_=True):
|
|||
except UnicodeDecodeError:
|
||||
continue
|
||||
if line:
|
||||
if lowercase:
|
||||
line = line.lower()
|
||||
if unique and line in retVal:
|
||||
continue
|
||||
retVal.append(line)
|
||||
|
||||
return retVal
|
||||
|
|
|
@ -21,13 +21,14 @@ from lib.core.common import safeStringFormat
|
|||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.exception import sqlmapMissingMandatoryOptionException
|
||||
from lib.core.exception import sqlmapThreadException
|
||||
from lib.core.settings import METADB_SUFFIX
|
||||
from lib.request import inject
|
||||
|
||||
def tableExists(tableFile):
|
||||
tables = getFileItems(tableFile)
|
||||
tables = getFileItems(tableFile, lowercase=kb.dbms in (DBMS.ACCESS), unique=True)
|
||||
tableSet = set(tables)
|
||||
retVal = []
|
||||
infoMsg = "checking table existence using items from '%s'" % tableFile
|
||||
|
@ -133,7 +134,7 @@ def columnExists(columnFile):
|
|||
errMsg = "missing table parameter"
|
||||
raise sqlmapMissingMandatoryOptionException, errMsg
|
||||
|
||||
columns = getFileItems(columnFile)
|
||||
columns = getFileItems(columnFile, unique=True)
|
||||
if conf.db and not conf.db.endswith(METADB_SUFFIX):
|
||||
table = "%s.%s" % (conf.db, conf.tbl)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user