Bug #51401 | GRANT treats nonexistent functions/privileges differently | ||
---|---|---|---|
Submitted: | 22 Feb 2010 19:35 | Modified: | 22 Apr 2011 13:28 |
Reporter: | Paul DuBois | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Security: Privileges | Severity: | S3 (Non-critical) |
Version: | 5.0+ | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[22 Feb 2010 19:35]
Paul DuBois
[23 Feb 2010 13:45]
MySQL Verification Team
Thank you for the bug report.
[25 Feb 2010 17:51]
Omer Barnir
triage: setting tag to CHECKED (w4 give the grant as a function and then create as a procedure), I3 embarrassment
[25 Feb 2010 18:13]
Paul DuBois
I'm not sure what the correct behavior should be here. The manual says this about granting privileges to nonexistent objects. http://dev.mysql.com/doc/refman/5.1/en/grant.html: "MySQL enables you to grant privileges on databases or tables that do not exist. For tables, the privileges to be granted must include the CREATE privilege. This behavior is by design, and is intended to enable the database administrator to prepare user accounts and privileges for databases or tables that are to be created at a later time." So that says nothing about stored routines. If the principle for tables should apply to routines, I suppose GRANT should be rejected unless the privileges contain CREATE. But CREATE cannot be granted to individual routines. Maybe the grant should fail unless the privileges include CREATE ROUTINE.
[22 Apr 2011 13:28]
Paul DuBois
Noted in 5.6.3 changelog. Attempts to grant the EXECUTE or ALTER ROUTINE privilege for a nonexistent stored procedure returned success instead of an error. CHANGESET - http://lists.mysql.com/commits/135954