summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index bcad0e627f4..f9d95b2cde5 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1240,6 +1240,10 @@ bool acl_check_host(const char *host, const char *ip)
thd THD
host hostname for the user
user user name
+ new_password new password
+
+ NOTE:
+ new_password cannot be NULL
RETURN VALUE
0 OK
@@ -1247,7 +1251,7 @@ bool acl_check_host(const char *host, const char *ip)
*/
bool check_change_password(THD *thd, const char *host, const char *user,
- char *new_password)
+ char *new_password, uint new_password_len)
{
if (!initialized)
{
@@ -1296,12 +1300,13 @@ bool check_change_password(THD *thd, const char *host, const char *user,
bool change_password(THD *thd, const char *host, const char *user,
char *new_password)
{
+ uint new_password_len= strlen(new_password);
DBUG_ENTER("change_password");
DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'",
host,user,new_password));
DBUG_ASSERT(host != 0); // Ensured by parent
- if (check_change_password(thd, host, user, new_password))
+ if (check_change_password(thd, host, user, new_password, new_password_len))
DBUG_RETURN(1);
VOID(pthread_mutex_lock(&acl_cache->lock));
@@ -1313,7 +1318,6 @@ bool change_password(THD *thd, const char *host, const char *user,
DBUG_RETURN(1);
}
/* update loaded acl entry: */
- uint new_password_len= new_password ? strlen(new_password) : 0;
set_user_salt(acl_user, new_password, new_password_len);
if (update_user_table(thd,
@@ -3241,7 +3245,7 @@ end:
SYNOPSIS
grant_reload()
- thd Thread handler
+ thd Thread handler (can be NULL)
NOTES
Locked tables are checked by acl_init and doesn't have to be checked here