[PATCH] notifications.c: fix HOSTACKAUTHOR/ALIAS macros not populated on host notification

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

[PATCH] notifications.c: fix HOSTACKAUTHOR/ALIAS macros not populated on host notification

Post by Guest »

This is a multi-part message in MIME format.
--------------080001070602050604060002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

just found that while checking on the macro free'ing order in icinga,
and for my personal understanding a host notification should be well
aware of the HOSTACK* macros, and not the SERVICEACK* macros at that stage.
even if those macros are deprecated, lots of people still use those and
will run into possible memory leaks next to unwanted behaviour.

attached git diff against current head.

kind regards,
michael

--
DI (FH) Michael Friedrich

Vienna University Computer Center
Universitaetsstrasse 7 A-1010 Vienna, Austria

email: michael.friedrich@univie.ac.at
phone: +43 1 4277 14359
mobile: +43 664 60277 14359
fax: +43 1 4277 14338
web: http://www.univie.ac.at/zid
http://www.aco.net

Icinga Core& IDOUtils Developer
http://www.icinga.org


--------------080001070602050604060002
Content-Type: text/x-diff;
name="0001-notifications.c-fix-HOSTACKAUTHOR-ALIAS-macros-not-p.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0001-notifications.c-fix-HOSTACKAUTHOR-ALIAS-macros-not-p.pa";
filename*1="tch"

From e9aabcc69f0d6f624c0b4efb4365ff66212e654b Mon Sep 17 00:00:00 2001
From: Michael Friedrich
Date: Mon, 5 Sep 2011 17:10:16 +0200
Subject: [PATCH] notifications.c: fix HOSTACKAUTHOR/ALIAS macros not populated on host notification

although those macros are marked deprecated, their
behaviour is wrong and therefore fixed with this patch.
---
base/notifications.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/base/notifications.c b/base/notifications.c
index d4b7b4b..6f5a5ab 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -1114,8 +1114,8 @@ int host_notification(host *hst, int type, char *not_author, char *not_data, int
mac.x[MACRO_HOSTACKCOMMENT] = strdup(not_data);

if(temp_contact != NULL) {
- mac.x[MACRO_SERVICEACKAUTHORNAME] = strdup(temp_contact->name);
- mac.x[MACRO_SERVICEACKAUTHORALIAS] = strdup(temp_contact->alias);
+ mac.x[MACRO_HOSTACKAUTHORNAME] = strdup(temp_contact->name);
+ mac.x[MACRO_HOSTACKAUTHORALIAS] = strdup(temp_contact->alias);
}
}

--
1.7.1.1


--------------080001070602050604060002--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: michael.friedrich@univie.ac.at
Locked