List:Commits« Previous MessageNext Message »
From:gluh Date:February 27 2006 3:30pm
Subject:bk commit into 4.1 tree (gluh:1.2475) BUG#14385
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of gluh. When gluh 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
  1.2475 06/02/27 19:30:46 gluh@stripped +3 -0
  Fix for bug#14385 GRANT and mapping to correct user account problems
    Check if the host of table hash record exactly matches host from GRANT command

  sql/sql_acl.cc
    1.174 06/02/27 19:29:59 gluh@stripped +4 -1
    Fix for bug#14385 GRANT and mapping to correct user account problems
      Check if the host of table hash record exactly matches host from GRANT command

  mysql-test/t/grant.test
    1.34 06/02/27 19:29:59 gluh@stripped +16 -0
    Fix for bug#14385 GRANT and mapping to correct user account problems
      test case

  mysql-test/r/grant.result
    1.41 06/02/27 19:29:59 gluh@stripped +18 -0
    Fix for bug#14385 GRANT and mapping to correct user account problems
      test case

# 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:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Merge/4.1

--- 1.173/sql/sql_acl.cc	Mon Jan  9 13:57:23 2006
+++ 1.174/sql/sql_acl.cc	Mon Feb 27 19:29:59 2006
@@ -2001,7 +2001,10 @@ static GRANT_TABLE *table_hash_search(co
   {
     if (exact)
     {
-      if (compare_hostname(&grant_table->host, host, ip))
+      if ((host &&
+	   !my_strcasecmp(system_charset_info, host,
+                          grant_table->host.hostname)) ||
+	  (ip && !strcmp(ip, grant_table->host.hostname)))
 	return grant_table;
     }
     else

--- 1.40/mysql-test/r/grant.result	Mon Jan  9 13:31:01 2006
+++ 1.41/mysql-test/r/grant.result	Mon Feb 27 19:29:59 2006
@@ -473,3 +473,21 @@ GRANT USAGE ON *.* TO 'mysqltest_7'@'' I
 drop user mysqltest_7@;
 show grants for mysqltest_7@;
 ERROR 42000: There is no such grant defined for user 'mysqltest_7' on host ''
+create database mysqltest;
+use mysqltest;
+create table t1(f1 int);
+GRANT DELETE ON mysqltest.t1 TO mysqltest1@'%';
+GRANT SELECT ON mysqltest.t1 TO mysqltest1@'192.%';
+show grants for mysqltest1@'192.%';
+Grants for mysqltest1@192.%
+GRANT USAGE ON *.* TO 'mysqltest1'@'192.%'
+GRANT SELECT ON `mysqltest`.`t1` TO 'mysqltest1'@'192.%'
+show grants for mysqltest1@'%';
+Grants for mysqltest1@%
+GRANT USAGE ON *.* TO 'mysqltest1'@'%'
+GRANT DELETE ON `mysqltest`.`t1` TO 'mysqltest1'@'%'
+delete from mysql.user where user='mysqltest1';
+delete from mysql.db where user='mysqltest1';
+delete from mysql.tables_priv where user='mysqltest1';
+flush privileges;
+drop database mysqltest;

--- 1.33/mysql-test/t/grant.test	Mon Jan  9 13:31:01 2006
+++ 1.34/mysql-test/t/grant.test	Mon Feb 27 19:29:59 2006
@@ -433,4 +433,20 @@ drop user mysqltest_7@;
 --error 1141
 show grants for mysqltest_7@;
 
+#
+# Bug#14385: GRANT and mapping to correct user account problems
+#
+create database mysqltest;
+use mysqltest;
+create table t1(f1 int);
+GRANT DELETE ON mysqltest.t1 TO mysqltest1@'%';
+GRANT SELECT ON mysqltest.t1 TO mysqltest1@'192.%';
+show grants for mysqltest1@'192.%';
+show grants for mysqltest1@'%';
+delete from mysql.user where user='mysqltest1';
+delete from mysql.db where user='mysqltest1';
+delete from mysql.tables_priv where user='mysqltest1';
+flush privileges;
+drop database mysqltest;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (gluh:1.2475) BUG#14385gluh27 Feb