← Back to team overview

maria-developers team mailing list archive

Re: 8e21b91fd31: MDEV-26875: Wrong user in SET DEFAULT ROLE error

 

Hi, Anel!

On Jan 11, Anel Husakovic wrote:
> revision-id: 8e21b91fd31 (mariadb-10.5.12-71-g8e21b91fd31)
> parent(s): e5a9dcfda20
> author: Anel Husakovic
> committer: Anel Husakovic
> timestamp: 2021-10-25 14:43:38 +0200
> message:
> 
> MDEV-26875: Wrong user in SET DEFAULT ROLE error
> 
> diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
> index 65f053aa09b..0a59f5fce37 100644
> --- a/sql/sql_acl.cc
> +++ b/sql/sql_acl.cc
> @@ -3273,7 +3273,7 @@ static int check_user_can_set_role(THD *thd, const char *user,
>        {
>          /* Role is not granted but current user can see the role */
>          my_printf_error(ER_INVALID_ROLE, "User %`s@%`s has not been granted role %`s",
> -                        MYF(0), thd->security_ctx->priv_user,
> +                        MYF(0), user,
>                          thd->security_ctx->priv_host, rolename);

That's strange. you'll use `user` and `thd->security_ctx->priv_host` ?
They generally correspond to two different accounts.

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx