Merge pull request #11726 from zhongwencool/audit-cli-args-bin
fix: cli's args in audit log should be array
This commit is contained in:
commit
4898d2377b
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_ctl, [
|
||||
{description, "Backend for emqx_ctl script"},
|
||||
{vsn, "0.1.4"},
|
||||
{vsn, "0.1.5"},
|
||||
{registered, []},
|
||||
{mod, {emqx_ctl_app, []}},
|
||||
{applications, [
|
||||
|
|
|
@ -331,13 +331,14 @@ safe_to_existing_atom(Str) ->
|
|||
is_initialized() ->
|
||||
ets:info(?CMD_TAB) =/= undefined.
|
||||
|
||||
audit_log(Level, From, Log) ->
|
||||
audit_log(Level, From, Log = #{args := Args}) ->
|
||||
case lookup_command(audit) of
|
||||
{error, _} ->
|
||||
ignore;
|
||||
{ok, {Mod, Fun}} ->
|
||||
try
|
||||
apply(Mod, Fun, [Level, From, Log])
|
||||
Log1 = Log#{args => [unicode:characters_to_binary(A) || A <- Args]},
|
||||
apply(Mod, Fun, [Level, From, Log1])
|
||||
catch
|
||||
_:Reason:Stacktrace ->
|
||||
?LOG_ERROR(#{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{application, emqx_dashboard, [
|
||||
{description, "EMQX Web Dashboard"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "5.0.28"},
|
||||
{vsn, "5.0.29"},
|
||||
{modules, []},
|
||||
{registered, [emqx_dashboard_sup]},
|
||||
{applications, [
|
||||
|
|
|
@ -70,7 +70,7 @@ admins(_) ->
|
|||
unload() ->
|
||||
emqx_ctl:unregister_command(admins).
|
||||
|
||||
bin(S) -> iolist_to_binary(S).
|
||||
bin(S) -> unicode:characters_to_binary(S).
|
||||
|
||||
print_error(Reason) when is_binary(Reason) ->
|
||||
emqx_ctl:print("Error: ~s~n", [Reason]).
|
||||
|
|
Loading…
Reference in New Issue