fix(audit): make 'emqx eval' command auditable

This commit is contained in:
Zaiming (Stone) Shi 2023-09-26 12:08:07 +02:00
parent 1f8985d09e
commit d3779a3219
1 changed files with 3 additions and 2 deletions

View File

@ -140,9 +140,10 @@ do(Args) ->
io:format("~p\n", [Other])
end;
["eval" | ListOfArgs] ->
% parse args locally in the remsh node
Parsed = parse_eval_args(ListOfArgs),
% and evaluate it on the remote node
case rpc:call(TargetNode, emqx_ctl, eval_erl, [Parsed]) of
case rpc:call(TargetNode, emqx_ctl, run_command, [eval_erl, Parsed], infinity) of
{ok, Value} ->
io:format("~p~n", [Value]);
{badrpc, Reason} ->