summaryrefslogtreecommitdiff
path: root/plugin/server_audit
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2020-12-01 14:13:05 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2020-12-01 14:13:05 +0400
commit178d32f03b84004af3611aab7c6fb9ce0b1388f4 (patch)
tree9298911cb7493ae3bd53afc82c88fa0136d4d41a /plugin/server_audit
parente6b3e38d62d13206ae982fc7b740d5d8024b207a (diff)
downloadmariadb-git-178d32f03b84004af3611aab7c6fb9ce0b1388f4.tar.gz
MDEV-24318 server_audit doesn't respect filters for PROXY_CONNECT
events. The log line should be added behind the filters.
Diffstat (limited to 'plugin/server_audit')
-rw-r--r--plugin/server_audit/server_audit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index a4884f17c75..fe8bf4478fc 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -2067,13 +2067,9 @@ static void update_connection_info(struct connection_info *cn,
{
case MYSQL_AUDIT_CONNECTION_CONNECT:
setup_connection_connect(cn, event);
- if (event->status == 0 && event->proxy_user && event->proxy_user[0])
- log_proxy(cn, event);
break;
case MYSQL_AUDIT_CONNECTION_CHANGE_USER:
*after_action= AA_CHANGE_USER;
- if (event->proxy_user && event->proxy_user[0])
- log_proxy(cn, event);
break;
default:;
}
@@ -2191,6 +2187,8 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
{
case MYSQL_AUDIT_CONNECTION_CONNECT:
log_connection(cn, event, event->status ? "FAILED_CONNECT": "CONNECT");
+ if (event->status == 0 && event->proxy_user && event->proxy_user[0])
+ log_proxy(cn, event);
break;
case MYSQL_AUDIT_CONNECTION_DISCONNECT:
if (use_event_data_for_disconnect)
@@ -2200,6 +2198,8 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
break;
case MYSQL_AUDIT_CONNECTION_CHANGE_USER:
log_connection(cn, event, "CHANGEUSER");
+ if (event->proxy_user && event->proxy_user[0])
+ log_proxy(cn, event);
break;
default:;
}