[Nagios-devel] [PATCH 3/3] Macros: All macros should be possible to

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 3/3] Macros: All macros should be possible to

Post by Guest »

From: Max Sikström

Default behaviour is still that everything should be possible to urlencode. So
keep it that way.

When zeroing clean_option (=flags for which types of escaping the macro is
allowed to pass), it should actually be set to url encode, not zero.

Signed-off-by: Max Sikström
---
common/macros.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/macros.c b/common/macros.c
index fa22233..e30634a 100644
--- a/common/macros.c
+++ b/common/macros.c
@@ -407,8 +407,9 @@ int grab_macro_value_r(nagios_macros *mac, char *macro_buffer, char **output, in
if(macro_buffer == NULL || free_macro == NULL)
return ERROR;

+ /* Everything (if not stated otherwise) should be possible to urlencode */
if(clean_options)
- *clean_options = 0;
+ *clean_options = URL_ENCODE_MACRO_CHARS;

/*
* We handle argv and user macros first, since those are by far
--
1.7.1






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: msikstrom@op5.com
Locked