1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

WL2131: Access control for SHOW ... PROCEDURE|FUNCTION ...

This commit is contained in:
gluh@gluh.mysql.r18.ru
2005-03-05 14:35:32 +03:00
parent 9ca989aff2
commit df2b38913f
8 changed files with 206 additions and 31 deletions

View File

@ -4745,6 +4745,38 @@ check_procedure_access(THD *thd, ulong want_access,char *db, char *name,
return FALSE;
}
/*
Check if the routine has any of the routine privileges
SYNOPSIS
check_some_routine_access()
thd Thread handler
db Database name
name Routine name
RETURN
0 ok
1 error
*/
bool check_some_routine_access(THD *thd, char *db, char *name)
{
ulong save_priv;
if (thd->master_access & SHOW_PROC_ACLS)
return FALSE;
if (!check_access(thd, SHOW_PROC_ACLS, db, &save_priv, 0, 1) ||
(save_priv & SHOW_PROC_ACLS))
return FALSE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (grant_option)
return check_routine_level_acl(thd, db, name);
#endif
return FALSE;
}
/*
Check if the given table has any of the asked privileges