From: Marco van Wieringen Date: Mon, 26 Sep 2011 20:21:34 +0000 (+0200) Subject: Fix lurking bug in match when db_driver is not set (everything but DBI). X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=108bc6b13e8a6eda41d6517fd47f01eb4f3ccdae;p=bacula%2Fbacula Fix lurking bug in match when db_driver is not set (everything but DBI). --- diff --git a/bacula/src/cats/cats.c b/bacula/src/cats/cats.c index ec8cf8bf84..eed774c71c 100644 --- a/bacula/src/cats/cats.c +++ b/bacula/src/cats/cats.c @@ -43,14 +43,19 @@ bool B_DB::db_match_database(const char *db_driver, const char *db_name, const char *db_address, int db_port) { - if (bstrcmp(m_db_driver, db_driver) && - bstrcmp(m_db_name, db_name) && - bstrcmp(m_db_address, db_address) && - m_db_port == db_port) { - return true; + bool match; + + if (db_driver) { + match = strcasecmp(m_db_driver, db_driver) == 0 && + bstrcmp(m_db_name, db_name) && + bstrcmp(m_db_address, db_address) && + m_db_port == db_port; + } else { + match = bstrcmp(m_db_name, db_name) && + bstrcmp(m_db_address, db_address) && + m_db_port == db_port; } - - return false; + return match; } B_DB *B_DB::db_clone_database_connection(JCR *jcr, bool mult_db_connections)