Bug #28788 acl (grant) cache treads username not casesensitive on windows
Submitted: 30 May 2007 19:56 Modified: 10 Jun 2007 18:23
Reporter: Martin Friebe (Gold Quality Contributor) (OCA) Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.bk OS:Windows
Assigned to: Evgeny Potemkin CPU Architecture:Any
Tags: cache, grant, qc, windows

[30 May 2007 19:56] Martin Friebe
acl_cache use system_charset_info (often ucs8), on windows or platforms with lower_case_file_system.

  acl_cache= new hash_filo(ACL_CACHE_SIZE, 0, 0,
                           (hash_get_key) acl_entry_get_key,
                           (hash_free_key) free,
                           lower_case_file_system ?
                           system_charset_info : &my_charset_bin);

This means that 2 users with only a different case in there username can co-exist, but the priviliges of the 1st user used will be loaded and used for the 2nd user too.

In the below example, "user1" logs in first, both useers will have access to d1 (on windows the expected error for USER1 does not happen, but USER1 can not access d2).

if USER1 logs in first both users get access to d2

How to repeat:
reate database d1;
create database d2;
create table d1.t1 (a int);
create table d2.t1 (a int);
grant select on `d1`.* to user1@localhost;
grant select on `d2`.* to USER1@localhost;

connect (connu1,localhost,user1,,d1)

--error 1044
connect (connu2,localhost,USER1,,d1)

Suggested fix:
patch follows
[30 May 2007 19:56] Martin Friebe

Attachment: acl_cache.patch (text/x-patch), 2.12 KiB.

[30 May 2007 20:31] MySQL Verification Team
Thank you for the bug report.
[10 Jun 2007 18:23] Evgeny Potemkin
Tested on 5.0.44-bk, VS8.0, WinXP SP2.
Test db was created and access granted to it to the "user".
Access was denied to the "USER".
[10 Jun 2007 18:24] Evgeny Potemkin
Correction: tested on 5.0.44-debug.
[21 Sep 2007 10:33] Chad MILLER
Can't repeat, shouldn't be private.