MXS-2559: Log source of loaded users
MySQLAuth now logs the server where the users were loaded from. As only the initial loading of users causes a log message, it is still possible for the source server to change without any indication of it.
This commit is contained in:
@ -136,7 +136,7 @@ const char* mariadb_users_query
|
||||
// We only care about users that have a default role assigned
|
||||
"WHERE t.default_role = u.user %s;";
|
||||
|
||||
static int get_users(SERV_LISTENER* listener, bool skip_local);
|
||||
static int get_users(SERV_LISTENER* listener, bool skip_local, SERVER** srv);
|
||||
static MYSQL* gw_mysql_init(void);
|
||||
static int gw_mysql_set_timeouts(MYSQL* handle);
|
||||
static char* mysql_format_user_entry(void* data);
|
||||
@ -192,9 +192,9 @@ static char* get_users_query(const char* server_version, int version, bool inclu
|
||||
return rval;
|
||||
}
|
||||
|
||||
int replace_mysql_users(SERV_LISTENER* listener, bool skip_local)
|
||||
int replace_mysql_users(SERV_LISTENER* listener, bool skip_local, SERVER** srv)
|
||||
{
|
||||
int i = get_users(listener, skip_local);
|
||||
int i = get_users(listener, skip_local, srv);
|
||||
return i;
|
||||
}
|
||||
|
||||
@ -1092,7 +1092,7 @@ int get_users_from_server(MYSQL* con, SERVER_REF* server_ref, SERVICE* service,
|
||||
* @param users The users table into which to load the users
|
||||
* @return -1 on any error or the number of users inserted
|
||||
*/
|
||||
static int get_users(SERV_LISTENER* listener, bool skip_local)
|
||||
static int get_users(SERV_LISTENER* listener, bool skip_local, SERVER** srv)
|
||||
{
|
||||
const char* service_user = NULL;
|
||||
const char* service_passwd = NULL;
|
||||
@ -1148,6 +1148,7 @@ static int get_users(SERV_LISTENER* listener, bool skip_local)
|
||||
|
||||
if (users > total_users)
|
||||
{
|
||||
*srv = server->server;
|
||||
total_users = users;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user