[BUG] SHOW GRANTS treats hostname as case sensitive

[BUG] SHOW GRANTS treats hostname as case sensitive

am 24.09.2002 03:30:25 von Paul DuBois

Hostnames are not supposed to be case sensitive in grant table entries.
However, SHOW GRANTS treats hostnames as case sensitive.

How to repeat:

Do something like this:

mysql> show grants for paul@localhost;
+----------------------------------------------------------- ------------------------------------------------------------ +
| Grants for paul@localhost
|
+----------------------------------------------------------- ------------------------------------------------------------ +
| GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO
'paul'@'localhost' IDENTIFIED BY PASSWORD '309e6910634ab429' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `dubois`.* TO 'paul'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `schedulator`.* TO 'paul'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `sampdb`.* TO 'paul'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `cookbook`.* TO 'paul'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `test`.* TO 'paul'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
INDEX, ALTER ON `webdb`.* TO 'paul'@'localhost' |
+----------------------------------------------------------- ------------------------------------------------------------ +
7 rows in set (0.00 sec)

mysql> show grants for paul@LOCALHOST;
ERROR 1141: There is no such grant defined for user 'paul' on host 'LOCALHOST'
mysql>


How to fix:

Change a strcmp() in mysql_show_grants() to strcasecmp()?

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12577@lists.mysql.com
To unsubscribe, e-mail

[BUG] SHOW GRANTS treats hostname as case sensitive

am 26.09.2002 08:45:23 von Michael Widenius

Hi!

>>>>> "Paul" == Paul DuBois writes:

Paul> Hostnames are not supposed to be case sensitive in grant table entries.
Paul> However, SHOW GRANTS treats hostnames as case sensitive.

Paul> How to repeat:

Paul> Do something like this:

mysql> show grants for paul@localhost;
Paul> +----------------------------------------------------------- ------------------------------------------------------------ +
Paul> | Grants for paul@localhost
Paul> |
Paul> +----------------------------------------------------------- ------------------------------------------------------------ +
Paul> | GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO
Paul> 'paul'@'localhost' IDENTIFIED BY PASSWORD '309e6910634ab429' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `dubois`.* TO 'paul'@'localhost' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `schedulator`.* TO 'paul'@'localhost' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `sampdb`.* TO 'paul'@'localhost' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `cookbook`.* TO 'paul'@'localhost' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `test`.* TO 'paul'@'localhost' |
Paul> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES,
Paul> INDEX, ALTER ON `webdb`.* TO 'paul'@'localhost' |
Paul> +----------------------------------------------------------- ------------------------------------------------------------ +
Paul> 7 rows in set (0.00 sec)

mysql> show grants for paul@LOCALHOST;
Paul> ERROR 1141: There is no such grant defined for user 'paul' on host 'LOCALHOST'

Now fixed in 4.0.4; Thanks for the bug report.

Regards,
Monty

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12605@lists.mysql.com
To unsubscribe, e-mail