Only check user permissions on startup
When users were loaded, the permissions for the service user were checked. The conditional that makes sure the check is executed only at startup was checking the listener's users instead of the SQLite handle which caused all reloads of users to check the permissions.
This commit is contained in:
@ -607,12 +607,6 @@ static int mysql_auth_load_users(SERV_LISTENER *port)
|
||||
int rc = MXS_AUTH_LOADUSERS_OK;
|
||||
SERVICE *service = port->listener->service;
|
||||
MYSQL_AUTH *instance = (MYSQL_AUTH*)port->auth_instance;
|
||||
|
||||
if (port->users == NULL && !check_service_permissions(port->service))
|
||||
{
|
||||
return MXS_AUTH_LOADUSERS_FATAL;
|
||||
}
|
||||
|
||||
bool skip_local = false;
|
||||
|
||||
if (instance->handle == NULL)
|
||||
@ -620,7 +614,8 @@ static int mysql_auth_load_users(SERV_LISTENER *port)
|
||||
skip_local = true;
|
||||
char path[PATH_MAX];
|
||||
get_database_path(port, path, sizeof(path));
|
||||
if (!open_instance_database(path, &instance->handle))
|
||||
if (!check_service_permissions(port->service) ||
|
||||
!open_instance_database(path, &instance->handle))
|
||||
{
|
||||
return MXS_AUTH_LOADUSERS_FATAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user