MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:July 24 2006 11:45pm
Subject:bk commit into 5.0 tree (jimw:1.2207) BUG#10668
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-07-24 16:45:26-07:00, jimw@rama.(none) +3 -0
  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@stripped, 2006-07-24 16:45:23-07:00, jimw@rama.(none) +3 -0
    Add new results

  mysql-test/t/grant.test@stripped, 2006-07-24 16:45:23-07:00, jimw@rama.(none) +6 -0
    Add new regression test

  sql/sql_acl.cc@stripped, 2006-07-24 16:45:23-07:00, jimw@rama.(none) +10 -1
    Enforce the user and host name limits in mysql_create_user().

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-9545

--- 1.199/sql/sql_acl.cc	2006-07-24 16:45:29 -07:00
+++ 1.200/sql/sql_acl.cc	2006-07-24 16:45:29 -07:00
@@ -5220,7 +5220,16 @@ bool mysql_create_user(THD *thd, List <L
     {
       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.

--- 1.52/mysql-test/r/grant.result	2006-07-24 16:45:29 -07:00
+++ 1.53/mysql-test/r/grant.result	2006-07-24 16:45:29 -07:00
@@ -867,3 +867,6 @@ insert into mysql.user select * from t2;
 flush privileges;
 drop table t2;
 drop table t1;
+create user mysqltest1_thisisreallytoolong;
+ERROR HY000: Operation CREATE USER failed for 'mysqltest1_thisisreallytoolong'@'%'
+End of 5.0 tests

--- 1.41/mysql-test/t/grant.test	2006-07-24 16:45:29 -07:00
+++ 1.42/mysql-test/t/grant.test	2006-07-24 16:45:29 -07:00
@@ -680,4 +680,10 @@ drop table t2;
 
 drop table t1;
 
+#
+# Bug #10668: CREATE USER does not enforce username length limit
+#
+--error ER_CANNOT_USER
+create user mysqltest1_thisisreallytoolong;
 
+--echo End of 5.0 tests
Thread
bk commit into 5.0 tree (jimw:1.2207) BUG#10668Jim Winstead25 Jul