In server_update check if new user or pwd are NULL and decline to update used values if they are.
This commit is contained in:
parent
ce8ce5b8fd
commit
9305cf0f9f
@ -302,19 +302,27 @@ server_update(SERVER *server, char *protocol, char *user, char *passwd)
|
||||
{
|
||||
if (!strcmp(server->protocol, protocol))
|
||||
{
|
||||
skygw_log_write(NULL, LOGFILE_MESSAGE, "Update server protocol for server %s to protocol %s",
|
||||
server->name, protocol);
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_MESSAGE,
|
||||
"Update server protocol for server %s to protocol %s",
|
||||
server->name,
|
||||
protocol);
|
||||
free(server->protocol);
|
||||
server->protocol = strdup(protocol);
|
||||
}
|
||||
|
||||
if (strcmp(server->monuser, user) == 0 || strcmp(server->monpw, passwd) == 0)
|
||||
{
|
||||
skygw_log_write(NULL, LOGFILE_MESSAGE, "Update server monitor credentials for server %s",
|
||||
if (user != NULL && passwd != NULL) {
|
||||
if (strcmp(server->monuser, user) == 0 ||
|
||||
strcmp(server->monpw, passwd) == 0)
|
||||
{
|
||||
skygw_log_write(NULL,
|
||||
LOGFILE_MESSAGE,
|
||||
"Update server monitor credentials for server %s",
|
||||
server->name);
|
||||
free(server->monuser);
|
||||
free(server->monpw);
|
||||
serverAddMonUser(server, user, passwd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user