Bug #48286 | prompt \h doesn't offer @@global.hostname | ||
---|---|---|---|
Submitted: | 25 Oct 2009 7:58 | Modified: | 19 Feb 2010 13:44 |
Reporter: | Kevin Benton | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S4 (Feature request) |
Version: | All | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[25 Oct 2009 7:58]
Kevin Benton
[17 Dec 2009 13:18]
Susanne Ebrecht
\h already is used for "help". Listing global host names is a security risk. The user needs to have privileges for it. Users, who aren't allowed to select from schema mysql should not be able to see the host names. For getting the hostname you just need to execute either SHOW GRANTS; or SELECT user(); Additionally, users from other RDBMS are already familiar with \H for HTML query output. So if we ever will implement \H then it is more user familiar to use this also for HTML query output.
[5 Jan 2010 16:29]
Kevin Benton
Suzanne, Please see example below... Maybe I'm a little dense, but I don't see how to keep users from being able to see @@hostname so I don't see a reason why letting them set it specifically in the PROMPT command creates more of a security risk than what is already exposed. mysql me@localhost:mysql> grant usage on test.* to 'foo'@'%'; Query OK, 0 rows affected (0.01 sec) mysql me@localhost:mysql> zsh: suspended mysql % mysql -u foo test -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 45 Server version: 5.1.30-enterprise-gpl-advanced-log MySQL Enterprise Server - Advanced Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql foo@localhost:test> select @@hostname; +-----------------------------+ | @@hostname | +-----------------------------+ | nightcrawler.ecom.sears.com | +-----------------------------+ 1 row in set (0.00 sec) mysql foo@localhost:test> show grants; +---------------------------------+ | Grants for foo@% | +---------------------------------+ | GRANT USAGE ON *.* TO 'foo'@'%' | +---------------------------------+ 1 row in set (0.00 sec) mysql foo@localhost:test> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec) mysql foo@localhost:test>
[5 Jan 2010 16:31]
Kevin Benton
See previous comment.
[19 Feb 2010 13:44]
Susanne Ebrecht
Ahh sorry, I misunderstood you. Many thanks for writing a feature request.