diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 11:41:40 -0700 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-10-18 11:41:40 -0700 |
commit | ac6877d420a70e215c59f1c85cfe80c6a71cf349 (patch) | |
tree | eacddfe96382dcd8f07d60b5e171049381247c58 /sql/set_var.cc | |
parent | 4cc8cda346bdd63c7e3882d687ba01143856b5dd (diff) | |
download | mariadb-git-ac6877d420a70e215c59f1c85cfe80c6a71cf349.tar.gz |
SET PASSWORD bugfixes:
* work as documented, use CURRENT_USER()
* move the check for ER_PASSWORD_ANONYMOUS_USER where it can actually work
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 4eb53dd04f4..fc5c549b9de 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -832,23 +832,7 @@ int set_var_user::update(THD *thd) int set_var_password::check(THD *thd) { #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!user->host.str) - { - DBUG_ASSERT(thd->security_ctx->priv_host); - if (*thd->security_ctx->priv_host != 0) - { - user->host.str= (char *) thd->security_ctx->priv_host; - user->host.length= strlen(thd->security_ctx->priv_host); - } - else - user->host= host_not_specified; - } - if (user->user.str == current_user.str) - { - DBUG_ASSERT(thd->security_ctx->user); - user->user.str= (char *) thd->security_ctx->user; - user->user.length= strlen(thd->security_ctx->user); - } + user= get_current_user(thd, user); /* Returns 1 as the function sends error to client */ return check_change_password(thd, user->host.str, user->user.str, password, strlen(password)) ? 1 : 0; |