[PATCH 3/3] Macros: All macros should be possible to urlencode

Max Sikstrom max.sikstrom at op5.com
Mon Aug 5 14:24:22 CEST 2013


From: Max Sikström <msikstrom at op5.com>

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 <msikstrom at op5.com>
---
 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


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list