Only use valid server credentials

The server credentials are only used if both the monuser and monpw
parameters are defined. This is a sort of a bugfix as a monitor connection
could use a username from server but a password from the monitor.
This commit is contained in:
Markus Makela
2016-11-10 13:00:03 +02:00
parent c08a637564
commit bbd3e13a54
2 changed files with 9 additions and 8 deletions

View File

@ -688,15 +688,9 @@ monitorDatabase(MONITOR *mon, MONITOR_SERVERS *database)
MYSQL_MONITOR* handle = mon->handle;
MYSQL_ROW row;
MYSQL_RES *result;
char *uname = mon->user;
unsigned long int server_version = 0;
char *server_string;
if (!database->server->monuser[0])
{
return;
}
/* Don't probe servers in maintenance mode */
if (SERVER_IN_MAINT(database->server))
{