1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#25671

"CREATE/DROP/ALTER SERVER should require privileges"
  Add check for SUPER privilege when executing CREATE/DROP/ALTER SERVER.
  Previously, any user even with only USAGE priv can execute those commands.
This commit is contained in:
acurtis/antony@xiphis.org/ltamd64.xiphis.org
2007-03-13 11:58:24 -07:00
parent 11d37efa5e
commit e4d93c6bcd
3 changed files with 224 additions and 0 deletions

View File

@ -4273,6 +4273,10 @@ create_sp_error:
int error;
LEX *lex= thd->lex;
DBUG_PRINT("info", ("case SQLCOM_CREATE_SERVER"));
if (check_global_access(thd, SUPER_ACL))
break;
if ((error= create_server(thd, &lex->server_options)))
{
DBUG_PRINT("info", ("problem creating server <%s>",
@ -4288,6 +4292,10 @@ create_sp_error:
int error;
LEX *lex= thd->lex;
DBUG_PRINT("info", ("case SQLCOM_ALTER_SERVER"));
if (check_global_access(thd, SUPER_ACL))
break;
if ((error= alter_server(thd, &lex->server_options)))
{
DBUG_PRINT("info", ("problem altering server <%s>",
@ -4303,6 +4311,10 @@ create_sp_error:
int err_code;
LEX *lex= thd->lex;
DBUG_PRINT("info", ("case SQLCOM_DROP_SERVER"));
if (check_global_access(thd, SUPER_ACL))
break;
if ((err_code= drop_server(thd, &lex->server_options)))
{
if (! lex->drop_if_exists && err_code == ER_FOREIGN_SERVER_EXISTS)