summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorjimw@rama.(none) <>2006-07-24 16:45:26 -0700
committerjimw@rama.(none) <>2006-07-24 16:45:26 -0700
commit36a26abd8f912c18efba651ad4d6f6f99747af15 (patch)
treed24e85a81ecddbc8e760854b7e45effc8f4c3385 /sql/sql_acl.cc
parentb7a55b9b5c645fbedc81d7e751c25fed4a44d8db (diff)
downloadmariadb-git-36a26abd8f912c18efba651ad4d6f6f99747af15.tar.gz
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.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ae5ea210a47..3735f4403de 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -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.