[icinga-checkins] icinga.org: icinga-core/master: macros: only warn on not escaped $ signs ( refs #3404)

git at icinga.org git at icinga.org
Tue Oct 30 17:42:10 CET 2012


Module: icinga-core
Branch: master
Commit: f78e44348b276f8f2c4a21f98f29409c7b6806d5
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=f78e44348b276f8f2c4a21f98f29409c7b6806d5

Author: Michael Friedrich <michael.friedrich at gmail.com>
Date:   Mon Oct 29 19:09:49 2012 +0100

macros: only warn on not escaped $ signs (refs #3404)

---

 common/macros.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/common/macros.c b/common/macros.c
index 4463ab2..0b4a32c 100644
--- a/common/macros.c
+++ b/common/macros.c
@@ -204,7 +204,10 @@ int process_macros_r(icinga_macros *mac, char *input_buffer, char **output_buffe
 
 			/* an error occurred - we couldn't parse the macro, so continue on */
 			if (result == ERROR) {
-				logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: An error occurred processing macro '%s'!\n", temp_buffer);
+				/* empty string still could mean that we hit the escaped $, so log an error in all other cases */
+				if(strcmp(temp_buffer, ""))
+					logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: An error occurred processing macro '%s'!\n", temp_buffer);
+
 				if (free_macro == TRUE)
 					my_free(selected_macro);
 			}





More information about the icinga-checkins mailing list