diff options
author | jimw@mysql.com <> | 2005-08-22 15:48:50 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-08-22 15:48:50 -0700 |
commit | f70beef6c7cb0f57211776854fba8d030f8389c8 (patch) | |
tree | 4ec1e5b9749edb7242d6bf464e54da5b13496dbd /sql/set_var.cc | |
parent | 3831bb56dfd728e5d8c6b6af170db0b9e8447a6e (diff) | |
download | mariadb-git-f70beef6c7cb0f57211776854fba8d030f8389c8.tar.gz |
Use the hostname with which the user authenticated when determining which
user to update with 'SET PASSWORD = ...'. (Bug #12302)
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index f7700d18607..1b66b68b349 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2944,7 +2944,18 @@ int set_var_password::check(THD *thd) { #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!user->host.str) - user->host.str= (char*) thd->host_or_ip; + { + if (thd->priv_host != 0) + { + user->host.str= (char *) thd->priv_host; + user->host.length= strlen(thd->priv_host); + } + else + { + user->host.str= (char *)"%"; + user->host.length= 1; + } + } /* 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; |