Skip to content

Commit

Permalink
fix backslashes in plugin_output
Browse files Browse the repository at this point in the history
Previously naemon required backslashes to be unescaped in order to appear correctly.
Seems like this is no longer required and backslashes can be passed through like they
are.

- introduced by #99
  • Loading branch information
sni committed Feb 20, 2024
1 parent 61e7a09 commit facd6a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
This file documents the revision history for mod_gearman.

next:
- fix backslashes in plugin_output

5.1.3 Tue Oct 17 23:32:07 CEST 2023
- check_dummy: fix crash if output is empty
- check_dummy: support putting return code in quotes
Expand Down
7 changes: 1 addition & 6 deletions neb_module_naemon/result_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,10 @@ void *get_results( gearman_job_st *job, __attribute__((__unused__)) void *contex
char *tmp_newline = replace_str(value, "\\n", "\n");
if (tmp_newline == NULL)
chk_result->output = gm_strdup("(null)");

char *tmp_backslash = replace_str(tmp_newline, "\\\\", "\\");
if (tmp_backslash == NULL)
chk_result->output = gm_strdup("(null)");
else
chk_result->output = gm_strdup( tmp_backslash );
chk_result->output = gm_strdup( tmp_newline );

gm_free(tmp_newline);
gm_free(tmp_backslash);
}
}

Expand Down

0 comments on commit facd6a8

Please sign in to comment.