Bug #14203 | SQL_LOG_OFF should not need priv_super | ||
---|---|---|---|
Submitted: | 21 Oct 2005 9:16 | Modified: | 15 Oct 2010 9:03 |
Reporter: | Christian Hammers (Silver Quality Contributor) (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S4 (Feature request) |
Version: | 4.1 and 5.0 | OS: | Linux (Debian GNU/Linux) |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[21 Oct 2005 9:16]
Christian Hammers
[28 Nov 2009 15:01]
Valeriy Kravchuk
Thank you for the feature request. Other, less powerful privilege for this will be certainly useful.
[15 Oct 2010 8:51]
Andrew Davey
Is this feature likely to be introduced? I've recently been working on an app where one requirement was to remove SUPER from the main db user. The app executes hundreds of queries, a handful of which must not be logged. The thinking was to use a stored procedure defined by a SUPER user to set sql_log_off=1, and call this from the non-SUPER user. This works as far as toggling the flag, but of course MySQL does not check this when executing a query from the less privileged user - which I found out the hard way. An additional privilege level to alter the logging state would be the perfect solution to this situation.
[15 Oct 2010 9:03]
Christian Hammers
@Andrew: you could make your stored procedure callable by non-root users by definiting it with "CREATE DEFINER='root' PROCEDURE ... SQL SECURITY DEFINER ..."
[15 Oct 2010 12:53]
Andrew Davey
@Christian: Thanks for the response. Your suggestion was my initial approach, as mentioned in my previous post - I apologise if this was unclear. When a user without priv_super calls the stored procedure, the value of sql_log_off is indeed changed. However, when the same user then executes a query, the sql_log_off flag is ignored and the query appears in the std log. A glance at the source revealed that MySQL will only inspect the value of sql_log_off if the current user has priv_super, making it impossible for a user without priv_super to disable logging and then execute a query without it appearing in the std log.