1
0
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:
Tatiana A. Nurnberg
2010-11-11 07:34:14 +00:00
parent d47e8991cb
commit b56f1d8283
4 changed files with 56 additions and 7 deletions

View File

@ -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))))