MXS-2246 Remove duplicate info in SERVICE and Service
Both of them contained fields for the service and router names. Now the names are in SERVICE and they must be accessed via member function.
This commit is contained in:
@ -736,7 +736,7 @@ static bool check_table_permissions(MYSQL* mysql,
|
||||
MXS_LOG_MESSAGE(log_priority,
|
||||
"[%s] User '%s' is missing SELECT privileges "
|
||||
"on %s table.%sMySQL error message: %s",
|
||||
service->name,
|
||||
service->name(),
|
||||
user,
|
||||
table,
|
||||
message ? message : " ",
|
||||
@ -746,7 +746,7 @@ static bool check_table_permissions(MYSQL* mysql,
|
||||
{
|
||||
MXS_ERROR("[%s] Failed to query from %s table."
|
||||
" MySQL error message: %s",
|
||||
service->name,
|
||||
service->name(),
|
||||
table,
|
||||
mysql_error(mysql));
|
||||
}
|
||||
@ -759,7 +759,7 @@ static bool check_table_permissions(MYSQL* mysql,
|
||||
{
|
||||
MXS_ERROR("[%s] Result retrieval failed when checking for permissions to "
|
||||
"the %s table: %s",
|
||||
service->name,
|
||||
service->name(),
|
||||
table,
|
||||
mysql_error(mysql));
|
||||
}
|
||||
@ -818,7 +818,7 @@ static bool check_default_table_permissions(MYSQL* mysql,
|
||||
{
|
||||
MXS_WARNING("[%s] User '%s' is missing the SHOW DATABASES privilege. "
|
||||
"This means that MaxScale cannot see all databases and authentication can fail.",
|
||||
service->name,
|
||||
service->name(),
|
||||
user);
|
||||
}
|
||||
|
||||
@ -895,7 +895,7 @@ static bool check_server_permissions(SERVICE* service,
|
||||
|
||||
MXS_ERROR("[%s] Failed to connect to server '%s' ([%s]:%d) when"
|
||||
" checking authentication user credentials and permissions: %d %s",
|
||||
service->name,
|
||||
service->name(),
|
||||
server->name(),
|
||||
server->address,
|
||||
server->port,
|
||||
@ -1027,7 +1027,7 @@ static bool roles_are_available(MYSQL* conn, SERVICE* service, SERVER* server)
|
||||
MXS_WARNING("The user for service '%s' might be missing the SELECT grant on "
|
||||
"`mysql.roles_mapping` or `mysql.user`. Use of default roles is disabled "
|
||||
"until the missing privileges are added. Error was: %s",
|
||||
service->name,
|
||||
service->name(),
|
||||
mysql_error(conn));
|
||||
}
|
||||
}
|
||||
@ -1238,7 +1238,7 @@ static int get_users(Listener* listener, bool skip_local)
|
||||
"[%s:%i] for service [%s]. MySQL error %i, %s",
|
||||
server->server->address,
|
||||
server->server->port,
|
||||
service->name,
|
||||
service->name(),
|
||||
mysql_errno(con),
|
||||
mysql_error(con));
|
||||
mysql_close(con);
|
||||
@ -1274,7 +1274,7 @@ static int get_users(Listener* listener, bool skip_local)
|
||||
{
|
||||
MXS_ERROR("Unable to get user data from backend database for service [%s]."
|
||||
" Failed to connect to any of the backend databases.",
|
||||
service->name);
|
||||
service->name());
|
||||
}
|
||||
|
||||
return total_users;
|
||||
|
@ -334,7 +334,7 @@ static int mysql_auth_authenticate(DCB* dcb)
|
||||
|
||||
MXS_LOG_EVENT(maxscale::event::AUTHENTICATION_FAILURE,
|
||||
"%s: login attempt for user '%s'@[%s]:%d, authentication failed. %s",
|
||||
dcb->service->name,
|
||||
dcb->service->name(),
|
||||
client_data->user,
|
||||
dcb->remote,
|
||||
dcb_get_port(dcb),
|
||||
@ -346,7 +346,7 @@ static int mysql_auth_authenticate(DCB* dcb)
|
||||
MXS_NOTICE("If you have a wildcard grant that covers this address, "
|
||||
"try adding 'localhost_match_wildcard_host=true' for "
|
||||
"service '%s'. ",
|
||||
dcb->service->name);
|
||||
dcb->service->name());
|
||||
}
|
||||
}
|
||||
|
||||
@ -566,7 +566,7 @@ static bool add_service_user(Listener* port)
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_ERROR("[%s] Failed to decrypt service user password.", port->service()->name);
|
||||
MXS_ERROR("[%s] Failed to decrypt service user password.", port->service()->name());
|
||||
}
|
||||
|
||||
return rval;
|
||||
@ -621,7 +621,7 @@ static int mysql_auth_load_users(Listener* port)
|
||||
if (loaded < 0)
|
||||
{
|
||||
MXS_ERROR("[%s] Unable to load users for listener %s listening at [%s]:%d.",
|
||||
service->name,
|
||||
service->name(),
|
||||
port->name(),
|
||||
*port->address() ? port->address() : "::",
|
||||
port->port());
|
||||
@ -633,7 +633,7 @@ static int mysql_auth_load_users(Listener* port)
|
||||
* if loading of the users fails */
|
||||
if (!add_service_user(port))
|
||||
{
|
||||
MXS_ERROR("[%s] Failed to inject service user.", port->service()->name);
|
||||
MXS_ERROR("[%s] Failed to inject service user.", port->service()->name());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -649,18 +649,18 @@ static int mysql_auth_load_users(Listener* port)
|
||||
MXS_NOTICE("[%s] No users were loaded but 'inject_service_user' is enabled. "
|
||||
"Enabling service credentials for authentication until "
|
||||
"database users have been successfully loaded.",
|
||||
service->name);
|
||||
service->name());
|
||||
}
|
||||
}
|
||||
else if (loaded == 0 && !first_load)
|
||||
{
|
||||
MXS_WARNING("[%s]: failed to load any user information. Authentication"
|
||||
" will probably fail as a result.",
|
||||
service->name);
|
||||
service->name());
|
||||
}
|
||||
else if (loaded > 0 && first_load)
|
||||
{
|
||||
MXS_NOTICE("[%s] Loaded %d MySQL users for listener %s.", service->name, loaded, port->name());
|
||||
MXS_NOTICE("[%s] Loaded %d MySQL users for listener %s.", service->name(), loaded, port->name());
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user