1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-29167 new db-level SHOW CREATE ROUTINE privilege

This commit is contained in:
Oleksandr Byelkin
2023-09-04 13:04:06 +02:00
parent b1d1dc90b8
commit 53cdfbd1da
43 changed files with 2308 additions and 110 deletions

View File

@@ -6956,14 +6956,16 @@ bool check_some_routine_access(THD *thd, const char *db, const char *name,
that are implemented for the INFORMATION_SCHEMA and PERFORMANCE_SCHEMA,
which are located in check_access().
Since the I_S and P_S do not contain routines, this bypass is ok,
as it only opens SHOW_PROC_ACLS.
as it only opens SHOW_PROC_WITHOUT_DEFINITION_ACLS.
*/
if (thd->security_ctx->master_access & SHOW_PROC_ACLS)
if (thd->security_ctx->master_access & SHOW_PROC_WITHOUT_DEFINITION_ACLS)
return FALSE;
if (!check_access(thd, SHOW_PROC_ACLS, db, &save_priv, NULL, 0, 1) ||
(save_priv & SHOW_PROC_ACLS))
if (!check_access(thd, SHOW_PROC_WITHOUT_DEFINITION_ACLS,
db, &save_priv, NULL, 0, 1) ||
(save_priv & SHOW_PROC_WITHOUT_DEFINITION_ACLS))
return FALSE;
return check_routine_level_acl(thd, db, name, sph);
return check_routine_level_acl(thd, SHOW_PROC_WITHOUT_DEFINITION_ACLS,
db, name, sph);
}