Don't reload users for dummy sessions
The service for a dummy session will be NULL. If authentication fails for a dummy session, then no service level actions should be taken. Only the binlogrouter can trigger authentication failure with a dummy session as it creates connections before the service itself has started.
This commit is contained in:

committed by
Johan Wikman

parent
357eb67a84
commit
66be882ae0
@ -1606,6 +1606,7 @@ service_update(SERVICE *service, char *router, char *user, char *auth)
|
|||||||
*/
|
*/
|
||||||
int service_refresh_users(SERVICE *service)
|
int service_refresh_users(SERVICE *service)
|
||||||
{
|
{
|
||||||
|
ss_dassert(service);
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
if (spinlock_acquire_nowait(&service->spin))
|
if (spinlock_acquire_nowait(&service->spin))
|
||||||
|
@ -358,8 +358,11 @@ static void handle_error_response(DCB *dcb, GWBUF *buffer)
|
|||||||
errcode == ER_DBACCESS_DENIED_ERROR ||
|
errcode == ER_DBACCESS_DENIED_ERROR ||
|
||||||
errcode == ER_ACCESS_DENIED_NO_PASSWORD_ERROR)
|
errcode == ER_ACCESS_DENIED_NO_PASSWORD_ERROR)
|
||||||
{
|
{
|
||||||
// Authentication failed, reload users
|
if (dcb->session->state != SESSION_STATE_DUMMY)
|
||||||
service_refresh_users(dcb->service);
|
{
|
||||||
|
// Authentication failed, reload users
|
||||||
|
service_refresh_users(dcb->service);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user