MXS-2496: Check for ALL PRIVILEGES grant
If a user has ALL PRIVILEGES as a global privilege, it overshadows the SHOW DATABASES grant.
This commit is contained in:
parent
365efb9d3a
commit
8317fec745
@ -823,8 +823,10 @@ static bool check_server_permissions(SERVICE* service,
|
||||
|
||||
for (MYSQL_ROW row = mysql_fetch_row(res); row; row = mysql_fetch_row(res))
|
||||
{
|
||||
if (strcasestr(row[0], "SHOW DATABASES"))
|
||||
if (strcasestr(row[0], "SHOW DATABASES") || strcasestr(row[0], "ALL PRIVILEGES ON *.*"))
|
||||
{
|
||||
// GRANT ALL PRIVILEGES ON *.* will overwrite SHOW DATABASES so it needs to be checked
|
||||
// separately
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user