diff options
author | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2010-12-14 17:34:23 +0300 |
---|---|---|
committer | Sergey Vojtovich <sergey.vojtovich@oracle.com> | 2010-12-14 17:34:23 +0300 |
commit | 9a3e46c520e857c9e32eebc612fe00991dcc5fe3 (patch) | |
tree | a01ebb52ef2a45d385cf45850e61c8b584256240 /sql/sql_audit.cc | |
parent | b7b33fd9d6bfe683d6c3d96742aca57282a20d45 (diff) | |
download | mariadb-git-9a3e46c520e857c9e32eebc612fe00991dcc5fe3.tar.gz |
WL#5571 - Audit interface: MYSQL_AUDIT_GENERAL_STATUS event
include/mysql/plugin_audit.h:
Connection auditing class.
include/mysql/plugin_audit.h.pp:
Connection auditing class.
sql/mysqld.cc:
Notify disconnect to auditing.
sql/sql_audit.cc:
Connection class event dispatcher.
sql/sql_audit.h:
mysql_audit_notify() is not available in embedded.
sql/sql_connect.cc:
Notify connect to auditing.
sql/sql_parse.cc:
Notify user change to auditing.
Diffstat (limited to 'sql/sql_audit.cc')
-rw-r--r-- | sql/sql_audit.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc index b7d363dc09a..74e9e603ebe 100644 --- a/sql/sql_audit.cc +++ b/sql/sql_audit.cc @@ -81,9 +81,34 @@ static void general_class_handler(THD *thd, uint event_subtype, va_list ap) } +static void connection_class_handler(THD *thd, uint event_subclass, va_list ap) +{ + mysql_event_connection event; + event.event_class= MYSQL_AUDIT_CONNECTION_CLASS; + event.event_subclass= event_subclass; + event.status= va_arg(ap, int); + event.thread_id= va_arg(ap, unsigned long); + event.user= va_arg(ap, const char *); + event.user_length= va_arg(ap, unsigned int); + event.priv_user= va_arg(ap, const char *); + event.priv_user_length= va_arg(ap, unsigned int); + event.external_user= va_arg(ap, const char *); + event.external_user_length= va_arg(ap, unsigned int); + event.proxy_user= va_arg(ap, const char *); + event.proxy_user_length= va_arg(ap, unsigned int); + event.host= va_arg(ap, const char *); + event.host_length= va_arg(ap, unsigned int); + event.ip= va_arg(ap, const char *); + event.ip_length= va_arg(ap, unsigned int); + event.database= va_arg(ap, const char *); + event.database_length= va_arg(ap, unsigned int); + event_class_dispatch(thd, (const mysql_event *) &event); +} + + static audit_handler_t audit_handlers[] = { - general_class_handler + general_class_handler, connection_class_handler }; static const uint audit_handlers_count= |