Ver código fonte

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

Zaiming (Stone) Shi 2 anos atrás
pai
commit
d3779a3219
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      bin/nodetool

+ 3 - 2
bin/nodetool

@@ -140,11 +140,12 @@ 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]);
+                    io:format("~p~n", [Value]);
                 {badrpc, Reason} ->
                     io:format("RPC to ~p failed: ~p~n", [TargetNode, Reason]),
                     halt(1)