From 4bc6f3f6c90c7e117dbcc752d803307935f523df Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 8 Mar 2012 15:32:05 +0000 Subject: [PATCH] Minor bug fix so that --search -T tablename -D db1,db2 now correctly forges the query concatenating db1 and db2 with a OR, not an AND anymore --- plugins/generic/enumeration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 3c673d461..3dd44fb19 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -2012,7 +2012,7 @@ class Enumeration: if conf.db and conf.db != CURRENT_DB: _ = conf.db.split(",") - whereDbsQuery = "".join(" AND '%s' = %s" % (unsafeSQLIdentificatorNaming(db), dbCond) for db in _) + whereDbsQuery = " AND (" + " OR ".join("%s = '%s'" % (dbCond, unsafeSQLIdentificatorNaming(db)) for db in _) + ")" infoMsg += " for database%s '%s'" % ("s" if len(_) > 1 else "", ", ".join(db for db in _)) elif conf.excludeSysDbs: whereDbsQuery = "".join(" AND '%s' != %s" % (unsafeSQLIdentificatorNaming(db), dbCond) for db in self.excludeDbsList)