mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug #10668: CREATE USER does not enforce username length limit
This appears to have just been an oversight -- CREATE USER was not enforcing the existing username limitations. mysql-test/r/grant.result: Add new results mysql-test/t/grant.test: Add new regression test sql/sql_acl.cc: Enforce the user and host name limits in mysql_create_user().
This commit is contained in:
@@ -5220,7 +5220,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
||||
{
|
||||
result= TRUE;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (user_name->host.length > HOSTNAME_LENGTH ||
|
||||
user_name->user.length > USERNAME_LENGTH)
|
||||
{
|
||||
append_user(&wrong_users, user_name);
|
||||
result= TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
Search all in-memory structures and grant tables
|
||||
for a mention of the new user name.
|
||||
|
||||
Reference in New Issue
Block a user