mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.4' into 10.5
This commit is contained in:
@ -3252,7 +3252,6 @@ end:
|
||||
my_error(ER_INVALID_ROLE, MYF(0), rolename);
|
||||
break;
|
||||
case 1:
|
||||
StringBuffer<1024> c_usr;
|
||||
LEX_CSTRING role_lex;
|
||||
/* First, check if current user can see mysql database. */
|
||||
bool read_access= !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 1);
|
||||
@ -3273,11 +3272,9 @@ end:
|
||||
NULL) == -1))
|
||||
{
|
||||
/* Role is not granted but current user can see the role */
|
||||
c_usr.append(user, strlen(user));
|
||||
c_usr.append('@');
|
||||
c_usr.append(host, strlen(host));
|
||||
my_printf_error(ER_INVALID_ROLE, "User %`s has not been granted role %`s",
|
||||
MYF(0), c_usr.c_ptr(), rolename);
|
||||
my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
|
||||
MYF(0), thd->security_ctx->priv_user,
|
||||
thd->security_ctx->priv_host, rolename);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -9416,14 +9413,13 @@ static bool show_default_role(THD *thd, ACL_USER *acl_entry,
|
||||
String def_str(buff, buffsize, system_charset_info);
|
||||
def_str.length(0);
|
||||
def_str.append(STRING_WITH_LEN("SET DEFAULT ROLE "));
|
||||
def_str.append(&def_rolename);
|
||||
def_str.append(" FOR '");
|
||||
def_str.append(&acl_entry->user);
|
||||
append_identifier(thd, &def_str, def_rolename.str, def_rolename.length);
|
||||
def_str.append(" FOR ");
|
||||
append_identifier(thd, &def_str, acl_entry->user.str, acl_entry->user.length);
|
||||
DBUG_ASSERT(!(acl_entry->flags & IS_ROLE));
|
||||
def_str.append(STRING_WITH_LEN("'@'"));
|
||||
def_str.append(acl_entry->host.hostname, acl_entry->hostname_length,
|
||||
system_charset_info);
|
||||
def_str.append('\'');
|
||||
def_str.append('@');
|
||||
append_identifier(thd, &def_str, acl_entry->host.hostname,
|
||||
acl_entry->hostname_length);
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(def_str.ptr(),def_str.length(),def_str.charset());
|
||||
if (protocol->write())
|
||||
|
Reference in New Issue
Block a user