[icinga-checkins] icinga.org: icinga-core/master: fix format errors for logging eventhandlers (Guillaume Rousse)

git at icinga.org git at icinga.org
Mon Sep 20 09:53:39 CEST 2010


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Sep 14 13:40:28 2010 +0200

fix format errors for logging eventhandlers (Guillaume Rousse)

fixes #779

---

 Changelog         |    1 +
 THANKS            |    1 +
 base/sehandlers.c |    8 ++++----
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Changelog b/Changelog
index 000bc44..6947593 100644
--- a/Changelog
+++ b/Changelog
@@ -22,6 +22,7 @@ FIXES
 * core: fix send comments to the broker with proper expiration_time (Matthieu Kermagoret)
 * core: fix segfault in escalation conditions when using object tricks (Vitali Voroth)
 * core: fix for retaining host display name and alias, as well as service display name (Folkert van Heusden)
+* core: fix format errors for logging eventhandlers (Guillaume Rousse)
 
 * classic ui: update jquery for multiple cmds dropdown, resolve conflicts with pnp
 * classic ui: fix delay sorting of comments/downtimes (Ton Voon)
diff --git a/THANKS b/THANKS
index 4a1a901..40c77cd 100644
--- a/THANKS
+++ b/THANKS
@@ -234,6 +234,7 @@ in various ways.  If we missed your name, let us know.
 * Ralph Rossner
 * Chris Rothecker
 * John Rouillard
+* Guillaume Rousse
 * Yves Rubin
 * Mattias Ryrlen
 * Jonathan Saggau
diff --git a/base/sehandlers.c b/base/sehandlers.c
index bea9bce..0b8c47e 100644
--- a/base/sehandlers.c
+++ b/base/sehandlers.c
@@ -296,7 +296,7 @@ int run_global_service_event_handler(service *svc){
 	if(log_event_handlers==TRUE){
 		asprintf(&raw_logentry,"GLOBAL SERVICE EVENT HANDLER: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",svc->host_name,svc->description,global_service_event_handler);
 		process_macros(raw_logentry,&processed_logentry,macro_options);
-		logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry);
+		logit(NSLOG_EVENT_HANDLER,FALSE,"%s",processed_logentry);
 		}
 
 #ifdef USE_EVENT_BROKER
@@ -395,7 +395,7 @@ int run_service_event_handler(service *svc){
 	if(log_event_handlers==TRUE){
 		asprintf(&raw_logentry,"SERVICE EVENT HANDLER: %s;%s;$SERVICESTATE$;$SERVICESTATETYPE$;$SERVICEATTEMPT$;%s\n",svc->host_name,svc->description,svc->event_handler);
 		process_macros(raw_logentry,&processed_logentry,macro_options);
-		logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry);
+		logit(NSLOG_EVENT_HANDLER,FALSE,"%s",processed_logentry);
 		}
 
 #ifdef USE_EVENT_BROKER
@@ -541,7 +541,7 @@ int run_global_host_event_handler(host *hst){
 	if(log_event_handlers==TRUE){
 		asprintf(&raw_logentry,"GLOBAL HOST EVENT HANDLER: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",hst->name,global_host_event_handler);
 		process_macros(raw_logentry,&processed_logentry,macro_options);
-		logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry);
+		logit(NSLOG_EVENT_HANDLER,FALSE,"%s",processed_logentry);
 		}
 
 #ifdef USE_EVENT_BROKER
@@ -639,7 +639,7 @@ int run_host_event_handler(host *hst){
 	if(log_event_handlers==TRUE){
 		asprintf(&raw_logentry,"HOST EVENT HANDLER: %s;$HOSTSTATE$;$HOSTSTATETYPE$;$HOSTATTEMPT$;%s\n",hst->name,hst->event_handler);
 		process_macros(raw_logentry,&processed_logentry,macro_options);
-		logit(NSLOG_EVENT_HANDLER,FALSE,processed_logentry);
+		logit(NSLOG_EVENT_HANDLER,FALSE,"%s",processed_logentry);
 		}
 
 #ifdef USE_EVENT_BROKER





More information about the icinga-checkins mailing list