Skip to content

Commit

Permalink
FB8-96: Remove special formatting for user name when writing to audit…
Browse files Browse the repository at this point in the history
… plugin log (facebook#948) (facebook#948)

Summary:
Jira issue: https://jira.percona.com/browse/FB8-96

Reference patch: facebook@3b47dae
Reference patch: facebook@87e0683
Pull Request resolved: facebook#948

Reviewed By: lloyd

Differential Revision: D13941932

Pulled By: lth
  • Loading branch information
dutow authored and inikep committed May 15, 2024
1 parent 5686054 commit 7b3d267
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sql/sql_audit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ int mysql_audit_notify(THD *thd, mysql_event_general_subclass_t subclass,
const char *msg, size_t msg_len, const char *query_str,
size_t query_len) {
mysql_event_general event;
char user_buff[MAX_USER_HOST_SIZE];

assert(thd);

Expand All @@ -379,8 +378,8 @@ int mysql_audit_notify(THD *thd, mysql_event_general_subclass_t subclass,

Security_context *sctx = thd->security_context();

event.general_user.str = user_buff;
event.general_user.length = make_user_name(sctx, user_buff);
event.general_user.str = sctx->user().str;
event.general_user.length = sctx->user().str ? sctx->user().length : 0;
event.general_ip = sctx->ip();
event.general_host = sctx->host();
event.general_external_user = sctx->external_user();
Expand Down

0 comments on commit 7b3d267

Please sign in to comment.