Bug #82118 | MYSQL_AUDIT_GENERAL_LOG event does not report database to audit plugins in 5.7 | ||
---|---|---|---|
Submitted: | 5 Jul 2016 17:26 | Modified: | 6 Jul 2016 14:24 |
Reporter: | Sergei Glushchenko | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Security: Audit | Severity: | S3 (Non-critical) |
Version: | 5.7.13 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[5 Jul 2016 17:26]
Sergei Glushchenko
[5 Jul 2016 17:59]
MySQL Verification Team
I am unable to spot a problem. The called function gets `command` as its parameters. And it deals with it twice, both times properly, IMHO: 1) #ifndef EMBEDDED_LIBRARY /* Send a general log message to the audit API. */ mysql_audit_general_log(thd, command_name[(uint) command].str, command_name[(uint) command].length); #endif 2) for (Log_event_handler **current_handler= general_log_handler_list; *current_handler; ) { error|= (*current_handler++)->log_general(thd, current_utime, user_host_buff, user_host_len, thd->thread_id(), command_name[(uint) command].str, command_name[(uint) command].length, query, query_length, thd->variables.character_set_client); }
[5 Jul 2016 18:45]
Sergei Glushchenko
Yes. Command is handled properly. It is "Init DB". What I am looking for is `query`. Here is the mysql_audit_general_log from 5.6: static inline void mysql_audit_general_log(THD *thd, const char *cmd, uint cmdlen, const char *query_str, size_t query_len) and from 5.7: inline static int mysql_audit_general_log(THD *thd, const char *cmd, size_t cmdlen)
[5 Jul 2016 18:50]
Sergei Glushchenko
Eventually, notify function of the audit plugin will receive command="Init DB" and query="database_name" in 5.6, but in 5.7 command="Init DB" and query="".
[6 Jul 2016 14:24]
MySQL Verification Team
Hi! Your last response cleared out a matter. Verified as reported. Thank you very much !!!