Page 1 of 1

[Nagios-devel] [PATCH 2/2] checks: Check command output does not

Posted: Fri Feb 22, 2013 3:21 pm
by Guest
Why would you think it did?

Since we assumed that check output was escaped, we tried to unescape
it, and that becomes highly weird.

So, this bug meant that, unless a command is quoted (which, as shown in
the parent commit, you couldn't do), if you're trying to test quoting by
writing a check command that echoes your input, you needed four
backslashes in your input to get one in your output. Trying to read the
quad-escaped commands in the input, in turn, quickly makes a user want
to escape from this application.

Signed-off-by: Robin Sonefors
---
base/checks.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/checks.c b/base/checks.c
index b534bd4..c8e8726 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -442,7 +442,7 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
else {

/* parse check output to get: (1) short output, (2) long output, (3) perf data */
- parse_check_output(queued_check_result->output, &temp_service->plugin_output, &temp_service->long_plugin_output, &temp_service->perf_data, TRUE, TRUE);
+ parse_check_output(queued_check_result->output, &temp_service->plugin_output, &temp_service->long_plugin_output, &temp_service->perf_data, TRUE, FALSE);

/* make sure the plugin output isn't null */
if(temp_service->plugin_output == NULL)
@@ -2160,7 +2160,7 @@ int execute_sync_host_check(host *hst) {
hst->check_type = CHECK_TYPE_ACTIVE;

/* parse the output: short and long output, and perf data */
- parse_check_output(temp_plugin_output, &hst->plugin_output, &hst->long_plugin_output, &hst->perf_data, TRUE, TRUE);
+ parse_check_output(temp_plugin_output, &hst->plugin_output, &hst->long_plugin_output, &hst->perf_data, TRUE, FALSE);

/* free memory */
my_free(temp_plugin_output);
@@ -2545,7 +2545,7 @@ int handle_async_host_check_result(host *temp_host, check_result *queued_check_r
my_free(temp_host->perf_data);

/* parse check output to get: (1) short output, (2) long output, (3) perf data */
- parse_check_output(queued_check_result->output, &temp_host->plugin_output, &temp_host->long_plugin_output, &temp_host->perf_data, TRUE, TRUE);
+ parse_check_output(queued_check_result->output, &temp_host->plugin_output, &temp_host->long_plugin_output, &temp_host->perf_data, TRUE, FALSE);

/* make sure we have some data */
if(temp_host->plugin_output == NULL || !strcmp(temp_host->plugin_output, "")) {
--
1.7.11.7






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]