summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-01-10 02:19:01 -0800
committerigor@rurik.mysql.com <>2006-01-10 02:19:01 -0800
commit19f3821ccb4a5c7a95d858067058756567cb349c (patch)
tree013342d9039705d4ffa97700de22676872c5ec93
parented7a11895f583b4c6253ea04c93b95815ae1b777 (diff)
parentd37c04d12543cbeba0fe327926eb3ddaeb3ea065 (diff)
downloadmariadb-git-19f3821ccb4a5c7a95d858067058756567cb349c.tar.gz
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into rurik.mysql.com:/home/igor/mysql-5.1
-rw-r--r--mysql-test/r/grant.result9
-rw-r--r--mysql-test/t/grant.test12
-rw-r--r--sql/sql_acl.cc5
3 files changed, 24 insertions, 2 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 448847bc919..eea29161de8 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -615,3 +615,12 @@ show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
set names latin1;
+create user mysqltest_7@;
+set password for mysqltest_7@ = password('systpass');
+show grants for mysqltest_7@;
+Grants for mysqltest_7@
+GRANT USAGE ON *.* TO 'mysqltest_7'@'' IDENTIFIED BY PASSWORD '*2FB071A056F9BB745219D9C876814231DAF46517'
+drop user mysqltest_7@;
+flush privileges;
+show grants for mysqltest_7@;
+ERROR 42000: There is no such grant defined for user 'mysqltest_7' on host ''
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index e806df5e91c..9a8b7a19c59 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -499,4 +499,16 @@ revoke all privileges on ÂÄ.* from root@localhost;
show grants for root@localhost;
set names latin1;
+#
+# Bug #15598 Server crashes in specific case during setting new password
+# - Caused by a user with host ''
+#
+create user mysqltest_7@;
+set password for mysqltest_7@ = password('systpass');
+show grants for mysqltest_7@;
+drop user mysqltest_7@;
+flush privileges; # BUG#16297(flush should be removed when that bug is fixed)
+--error 1141
+show grants for mysqltest_7@;
+
# End of 4.1 tests
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index b15320567c2..71bcfad5e29 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1541,7 +1541,8 @@ find_acl_user(const char *host, const char *user, my_bool exact)
acl_user->user && !strcmp(user,acl_user->user))
{
if (exact ? !my_strcasecmp(&my_charset_latin1, host,
- acl_user->host.hostname) :
+ acl_user->host.hostname ?
+ acl_user->host.hostname : "") :
compare_hostname(&acl_user->host,host,host))
{
DBUG_RETURN(acl_user);
@@ -4649,7 +4650,7 @@ ACL_USER *check_acl_user(LEX_USER *user_name,
if (!(user=acl_user->user))
user= "";
if (!(host=acl_user->host.hostname))
- host= "%";
+ host= "";
if (!strcmp(user_name->user.str,user) &&
!my_strcasecmp(system_charset_info, user_name->host.str, host))
break;