mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #49752: 2469.126.2 unintentionally breaks authentication against
MySQL 5.1 server Server used to clip overly long user-names. This was presumably lost when code was made UTF8-clean. Now we emulate the behaviour for backward compatibility, but UTF8-ly correct.
This commit is contained in:
@ -899,6 +899,19 @@ static int check_connection(THD *thd)
|
||||
user_len-= 2;
|
||||
}
|
||||
|
||||
/*
|
||||
Clip username to allowed length in characters (not bytes). This is
|
||||
mostly for backward compatibility.
|
||||
*/
|
||||
{
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
int err;
|
||||
|
||||
user_len= (uint) cs->cset->well_formed_len(cs, user, user + user_len,
|
||||
USERNAME_CHAR_LENGTH, &err);
|
||||
user[user_len]= '\0';
|
||||
}
|
||||
|
||||
if (thd->main_security_ctx.user)
|
||||
x_free(thd->main_security_ctx.user);
|
||||
if (!(thd->main_security_ctx.user= my_strdup(user, MYF(MY_WME))))
|
||||
|
Reference in New Issue
Block a user