diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2022-04-28 09:34:21 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2022-04-28 11:28:49 +0400 |
commit | add5137d84a41c3f45f18b149bd90099e7256cb7 (patch) | |
tree | dcaf5a81341a4a6763024ba735ecfcfc415cddfa /plugin | |
parent | 0806592ac8fb7c6071defccb51e762a89f5bd8d9 (diff) | |
download | mariadb-git-add5137d84a41c3f45f18b149bd90099e7256cb7.tar.gz |
MDEV-28429 audit plugin report OOOOO.
Few initializations to the connection_info structure added.
I think they can be removed if we are sure the bug was fixed.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/server_audit/server_audit.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 12f43c3e330..80b4b644732 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -15,7 +15,7 @@ #define PLUGIN_VERSION 0x104 -#define PLUGIN_STR_VERSION "1.4.13" +#define PLUGIN_STR_VERSION "1.4.14" #define _my_thread_var loc_thread_var @@ -945,7 +945,19 @@ static unsigned long long query_counter= 1; static struct connection_info *get_loc_info(MYSQL_THD thd) { + /* + This is the original code and supposed to be returned + bach to this as the MENT-1438 is finally understood/resolved. return (struct connection_info *) THDVAR(thd, loc_info); + */ + struct connection_info *ci= (struct connection_info *) THDVAR(thd, loc_info); + if ((size_t) ci->user_length > sizeof(ci->user)) + { + ci->user_length= 0; + ci->host_length= 0; + ci->ip_length= 0; + } + return ci; } @@ -1373,6 +1385,16 @@ static size_t log_header(char *message, size_t message_len, host= userip; } + /* + That was added to find the possible cause of the MENT-1438. + Supposed to be removed after that. + */ + if (username_len > 1024) + { + username= "unknown_user"; + username_len= (unsigned int) strlen(username); + } + if (output_type == OUTPUT_SYSLOG) return my_snprintf(message, message_len, "%.*s,%.*s,%.*s,%d,%lld,%s", |