diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2019-11-05 11:00:33 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-11-06 11:25:24 +0100 |
commit | 2aad3d9eaf3770666505bb0f59b639598561845c (patch) | |
tree | 4e90ee44e47c92f8a32caf44453ff01f4bcbeb64 | |
parent | 66ce511eb45529dac8c438e3f0e44bab6cd87763 (diff) |
#915 Validate POST /poweroff REST API parameters
This patch ensures that all required parameters are sent in the request.
-rw-r--r-- | admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp index cf06df52..99562e4a 100644 --- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp +++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp @@ -3862,6 +3862,9 @@ static int og_cmd_poweroff(json_t *element, struct og_msg_params *params) break; } + if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR)) + return -1; + return og_cmd_legacy_send(params, "Apagar", CLIENTE_OCUPADO); } |