commit nagios for openSUSE:Factory
Hello community, here is the log from the commit of package nagios for openSUSE:Factory checked in at 2014-04-15 11:46:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nagios (Old) and /work/SRC/openSUSE:Factory/.nagios.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "nagios" Changes: -------- --- /work/SRC/openSUSE:Factory/nagios/nagios.changes 2014-03-30 12:19:37.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.nagios.new/nagios.changes 2014-04-15 11:46:48.000000000 +0200 @@ -1,0 +2,11 @@ +Sat Apr 12 14:04:27 UTC 2014 - lars@linux-schulserver.de + +- update to 4.0.5: + + Fixed bug #595: Nagios 4 security fix + + Fixed bug #594: Nagios 4 fix contactgroups parsing + + Fixed bug #577: Nagios 4 checks stalled when write to socket failed + + Fixed bug #580: Nagios 4 memory leak + + Fixed bug where audio alerts wouldn't work with a 0 height and + width - http://support.nagios.com/forum/viewtopic.php?t=26387 + +------------------------------------------------------------------- Old: ---- nagios-4.0.4.tar.bz2 New: ---- nagios-4.0.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nagios.spec ++++++ --- /var/tmp/diff_new_pack.wOf4rK/_old 2014-04-15 11:46:49.000000000 +0200 +++ /var/tmp/diff_new_pack.wOf4rK/_new 2014-04-15 11:46:49.000000000 +0200 @@ -17,7 +17,7 @@ Name: nagios -Version: 4.0.4 +Version: 4.0.5 Release: 0 Summary: The Nagios Network Monitor License: GPL-2.0+ ++++++ nagios-4.0.4.tar.bz2 -> nagios-4.0.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/Changelog new/nagios-4.0.5/Changelog --- old/nagios-4.0.4/Changelog 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/Changelog 2014-04-11 20:37:42.000000000 +0200 @@ -2,6 +2,17 @@ Nagios Core 4 Change Log ######################## +4.0.5 - 04/11/2014 +------------------ +* Fixed bug #595: Nagios 4 security fix (Alexey Dvoryanchikov, Eric Stanley) +* Fixed bug #594: Nagios 4 fix contactgroups parsing (Alexey Dvoryanchikov, Eric Stanley) +* Fixed bug #577: Nagios 4 checks stalled when write to socket failed (Alexey Dvoryanchikov) +* Fixed bug #580: Nagios 4 memory leak (Eric Stanley) +* Fixed init script to remove the switching of users when performing configuration verification which was causing failures if nagios user was set to nologin (Scott Wilkerson) +* Fixed auto creation of RAMDISK via environment variables in init script to properly check existence using $RAMDISK_DIR environment variable. (Scott Wilkerson) +* Fixed unreferenced variable NagiosVarDir in daemon-init (Eric Mislivec) +* Fixed bug where audio alerts wouldn't work with a 0 height and width - http://support.nagios.com/forum/viewtopic.php?t=26387 (Scott Wilkerson) + 4.0.4 - 03/14/2014 ------------------ ENHANCEMENTS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/base/checks.c new/nagios-4.0.5/base/checks.c --- old/nagios-4.0.4/base/checks.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/base/checks.c 2014-04-11 20:37:42.000000000 +0200 @@ -308,7 +308,7 @@ my_free(processed_command); clear_volatile_macros_r(&mac); - return OK; + return runchk_result; } @@ -2107,7 +2107,7 @@ clear_volatile_macros_r(&mac); my_free(processed_command); - return OK; + return runchk_result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/base/notifications.c new/nagios-4.0.5/base/notifications.c --- old/nagios-4.0.4/base/notifications.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/base/notifications.c 2014-04-11 20:37:42.000000000 +0200 @@ -259,9 +259,13 @@ */ clear_summary_macros_r(&mac); clear_contact_macros_r(&mac); + clear_contactgroup_macros_r(&mac); clear_argv_macros_r(&mac); clear_host_macros_r(&mac); + clear_hostgroup_macros_r(&mac); clear_service_macros_r(&mac); + clear_servicegroup_macros_r(&mac); + clear_datetime_macros_r(&mac); if(type == NOTIFICATION_NORMAL) { @@ -1202,8 +1206,11 @@ */ clear_summary_macros_r(&mac); clear_contact_macros_r(&mac); + clear_contactgroup_macros_r(&mac); clear_argv_macros_r(&mac); clear_host_macros_r(&mac); + clear_hostgroup_macros_r(&mac); + clear_datetime_macros_r(&mac); if(type == NOTIFICATION_NORMAL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/base/workers.c new/nagios-4.0.5/base/workers.c --- old/nagios-4.0.4/base/workers.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/base/workers.c 2014-04-11 20:37:42.000000000 +0200 @@ -683,7 +683,11 @@ if (error_reason) { logit(NSLOG_RUNTIME_ERROR, TRUE, "wproc: %s job %d from worker %s %s", wpjob_type_name(job->type), job->id, wp->name, error_reason); +#ifdef DEBUG + /* The log below could leak sensitive information, such as + passwords, so only enable it if you neally need it */ logit(NSLOG_RUNTIME_ERROR, TRUE, "wproc: command: %s\n", job->command); +#endif if (job->type != WPJOB_CHECK && oj) { logit(NSLOG_RUNTIME_ERROR, TRUE, "wproc: host=%s; service=%s; contact=%s\n", oj->host_name ? oj->host_name : "(none)", @@ -999,7 +1003,8 @@ kvvec_destroy(env_kvvp, KVVEC_FREE_KEYS); } else { - kvvec_addkv(&kvv, "env", env_kvvb->buf); + kvvec_addkv_wlen(&kvv, "env", strlen("env"), env_kvvb->buf, + env_kvvb->buflen); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/cgi/status.c new/nagios-4.0.5/cgi/status.c --- old/nagios-4.0.4/cgi/status.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/cgi/status.c 2014-04-11 20:37:42.000000000 +0200 @@ -440,7 +440,7 @@ else if(problem_services_unknown == 0 && problem_services_warning == 0 && problem_services_critical == 0 && problem_hosts_down == 0 && problem_hosts_unreachable == 0 && normal_sound != NULL) sound = normal_sound; if(sound != NULL) { - printf("<object type=\"audio/x-wav\" data=\"%s%s\" height=\"0\" width=\"0\">", url_media_path, sound); + printf("<object type=\"audio/x-wav\" data=\"%s%s\" height=\"1\" width=\"1\">", url_media_path, sound); printf("<param name=\"filename\" value=\"%s%s\">", url_media_path, sound); printf("<param name=\"autostart\" value=\"true\">"); printf("<param name=\"playcount\" value=\"1\">"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/cgi/tac.c new/nagios-4.0.5/cgi/tac.c --- old/nagios-4.0.4/cgi/tac.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/cgi/tac.c 2014-04-11 20:37:42.000000000 +0200 @@ -239,7 +239,7 @@ else if(services_unknown_unacknowledged == 0 && services_warning_unacknowledged == 0 && services_critical_unacknowledged == 0 && hosts_down_unacknowledged == 0 && hosts_unreachable_unacknowledged == 0 && normal_sound != NULL) sound = normal_sound; if(sound != NULL) { - printf("<object type=\"audio/x-wav\" data=\"%s%s\" height=\"-\" width=\"0\">", url_media_path, sound); + printf("<object type=\"audio/x-wav\" data=\"%s%s\" height=\"1\" width=\"1\">", url_media_path, sound); printf("<param name=\"filename\" value=\"%s%s\">", url_media_path, sound); printf("<param name=\"autostart\" value=\"true\">"); printf("<param name=\"playcount\" value=\"1\">"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/common/macros.c new/nagios-4.0.5/common/macros.c --- old/nagios-4.0.4/common/macros.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/common/macros.c 2014-04-11 20:37:42.000000000 +0200 @@ -1018,6 +1018,7 @@ case MACRO_SHORTDATETIME: case MACRO_DATE: case MACRO_TIME: + *free_macro = TRUE; case MACRO_TIMET: case MACRO_ISVALIDTIME: case MACRO_NEXTVALIDTIME: @@ -1483,19 +1484,19 @@ break; case MACRO_TIMET: - *output = strdup(mkstr("%lu", (unsigned long)current_time)); + *output = (char *)mkstr("%lu", (unsigned long)current_time); break; #ifdef NSCORE case MACRO_ISVALIDTIME: - *output = strdup(mkstr("%d", (check_time_against_period(test_time, temp_timeperiod) == OK) ? 1 : 0)); + *output = (char *)mkstr("%d", (check_time_against_period(test_time, temp_timeperiod) == OK) ? 1 : 0); break; case MACRO_NEXTVALIDTIME: get_next_valid_time(test_time, &next_valid_time, temp_timeperiod); if(next_valid_time == test_time && check_time_against_period(test_time, temp_timeperiod) == ERROR) next_valid_time = (time_t)0L; - *output = strdup(mkstr("%lu", (unsigned long)next_valid_time)); + *output = (char *)mkstr("%lu", (unsigned long)next_valid_time); break; #endif @@ -1542,66 +1543,66 @@ switch(macro_type) { case MACRO_HOSTNAME: - *output = strdup(temp_host->name); + *output = temp_host->name; break; case MACRO_HOSTDISPLAYNAME: if(temp_host->display_name) - *output = strdup(temp_host->display_name); + *output = temp_host->display_name; break; case MACRO_HOSTALIAS: - *output = strdup(temp_host->alias); + *output = temp_host->alias; break; case MACRO_HOSTADDRESS: - *output = strdup(temp_host->address); + *output = temp_host->address; break; #ifdef NSCORE case MACRO_HOSTSTATE: - *output = strdup(host_state_name(temp_host->current_state)); + *output = (char *)host_state_name(temp_host->current_state); break; case MACRO_HOSTSTATEID: - *output = strdup(mkstr("%d", temp_host->current_state)); + *output = (char *)mkstr("%d", temp_host->current_state); break; case MACRO_LASTHOSTSTATE: - *output = strdup(host_state_name(temp_host->last_state)); + *output = (char *)host_state_name(temp_host->last_state); break; case MACRO_LASTHOSTSTATEID: - *output = strdup(mkstr("%d", temp_host->last_state)); + *output = (char *)mkstr("%d", temp_host->last_state); break; case MACRO_HOSTCHECKTYPE: - *output = strdup(check_type_name(temp_host->check_type)); + *output = (char *)check_type_name(temp_host->check_type); break; case MACRO_HOSTSTATETYPE: - *output = strdup(state_type_name(temp_host->state_type)); + *output = (char *)state_type_name(temp_host->state_type); break; case MACRO_HOSTOUTPUT: if(temp_host->plugin_output) - *output = strdup(temp_host->plugin_output); + *output = temp_host->plugin_output; break; case MACRO_LONGHOSTOUTPUT: if(temp_host->long_plugin_output) - *output = strdup(temp_host->long_plugin_output); + *output = temp_host->long_plugin_output; break; case MACRO_HOSTPERFDATA: if(temp_host->perf_data) - *output = strdup(temp_host->perf_data); + *output = temp_host->perf_data; break; #endif case MACRO_HOSTCHECKCOMMAND: if(temp_host->check_command) - *output = strdup(temp_host->check_command); + *output = temp_host->check_command; break; #ifdef NSCORE case MACRO_HOSTATTEMPT: - *output = strdup(mkstr("%d", temp_host->current_attempt)); + *output = (char *)mkstr("%d", temp_host->current_attempt); break; case MACRO_MAXHOSTATTEMPTS: - *output = strdup(mkstr("%d", temp_host->max_attempts)); + *output = (char *)mkstr("%d", temp_host->max_attempts); break; case MACRO_HOSTDOWNTIME: - *output = strdup(mkstr("%d", temp_host->scheduled_downtime_depth)); + *output = (char *)mkstr("%d", temp_host->scheduled_downtime_depth); break; case MACRO_HOSTPERCENTCHANGE: - *output = strdup(mkstr("%.2f", temp_host->percent_state_change)); + *output = (char *)mkstr("%.2f", temp_host->percent_state_change); break; case MACRO_HOSTDURATIONSEC: case MACRO_HOSTDURATION: @@ -1609,7 +1610,7 @@ duration = (unsigned long)(current_time - temp_host->last_state_change); if(macro_type == MACRO_HOSTDURATIONSEC) - *output = strdup(mkstr("%lu", duration)); + *output = (char *)mkstr("%lu", duration); else { days = duration / 86400; @@ -1619,60 +1620,60 @@ minutes = duration / 60; duration -= (minutes * 60); seconds = duration; - *output = strdup(mkstr("%dd %dh %dm %ds", days, hours, minutes, seconds)); + *output = (char *)mkstr("%dd %dh %dm %ds", days, hours, minutes, seconds); } break; case MACRO_HOSTEXECUTIONTIME: - *output = strdup(mkstr("%.3f", temp_host->execution_time)); + *output = (char *)mkstr("%.3f", temp_host->execution_time); break; case MACRO_HOSTLATENCY: - *output = strdup(mkstr("%.3f", temp_host->latency)); + *output = (char *)mkstr("%.3f", temp_host->latency); break; case MACRO_LASTHOSTCHECK: - *output = strdup(mkstr("%lu", (unsigned long)temp_host->last_check)); + *output = (char *)mkstr("%lu", (unsigned long)temp_host->last_check); break; case MACRO_LASTHOSTSTATECHANGE: - *output = strdup(mkstr("%lu", (unsigned long)temp_host->last_state_change)); + *output = (char *)mkstr("%lu", (unsigned long)temp_host->last_state_change); break; case MACRO_LASTHOSTUP: - *output = strdup(mkstr("%lu", (unsigned long)temp_host->last_time_up)); + *output = (char *)mkstr("%lu", (unsigned long)temp_host->last_time_up); break; case MACRO_LASTHOSTDOWN: - *output = strdup(mkstr("%lu", (unsigned long)temp_host->last_time_down)); + *output = (char *)mkstr("%lu", (unsigned long)temp_host->last_time_down); break; case MACRO_LASTHOSTUNREACHABLE: - *output = strdup(mkstr("%lu", (unsigned long)temp_host->last_time_unreachable)); + *output = (char *)mkstr("%lu", (unsigned long)temp_host->last_time_unreachable); break; case MACRO_HOSTNOTIFICATIONNUMBER: - *output = strdup(mkstr("%d", temp_host->current_notification_number)); + *output = (char *)mkstr("%d", temp_host->current_notification_number); break; case MACRO_HOSTNOTIFICATIONID: - *output = strdup(mkstr("%lu", temp_host->current_notification_id)); + *output = (char *)mkstr("%lu", temp_host->current_notification_id); break; case MACRO_HOSTEVENTID: - *output = strdup(mkstr("%lu", temp_host->current_event_id)); + *output = (char *)mkstr("%lu", temp_host->current_event_id); break; case MACRO_LASTHOSTEVENTID: - *output = strdup(mkstr("%lu", temp_host->last_event_id)); + *output = (char *)mkstr("%lu", temp_host->last_event_id); break; case MACRO_HOSTPROBLEMID: - *output = strdup(mkstr("%lu", temp_host->current_problem_id)); + *output = (char *)mkstr("%lu", temp_host->current_problem_id); break; case MACRO_LASTHOSTPROBLEMID: - *output = strdup(mkstr("%lu", temp_host->last_problem_id)); + *output = (char *)mkstr("%lu", temp_host->last_problem_id); break; #endif case MACRO_HOSTACTIONURL: if(temp_host->action_url) - *output = strdup(temp_host->action_url); + *output = temp_host->action_url; break; case MACRO_HOSTNOTESURL: if(temp_host->notes_url) - *output = strdup(temp_host->notes_url); + *output = temp_host->notes_url; break; case MACRO_HOSTNOTES: if(temp_host->notes) - *output = strdup(temp_host->notes); + *output = temp_host->notes; break; #ifdef NSCORE case MACRO_HOSTGROUPNAMES: @@ -1725,22 +1726,27 @@ } /* these macros are time-intensive to compute, and will likely be used together, so save them all for future use */ - mac->x[MACRO_TOTALHOSTSERVICES] = strdup(mkstr("%d", total_host_services)); - mac->x[MACRO_TOTALHOSTSERVICESOK] = strdup(mkstr("%d", total_host_services_ok)); - mac->x[MACRO_TOTALHOSTSERVICESWARNING] = strdup(mkstr("%d", total_host_services_warning)); - mac->x[MACRO_TOTALHOSTSERVICESUNKNOWN] = strdup(mkstr("%d", total_host_services_unknown)); - mac->x[MACRO_TOTALHOSTSERVICESCRITICAL] = strdup(mkstr("%d", total_host_services_critical)); + mac->x[MACRO_TOTALHOSTSERVICES] = + (char *)mkstr("%d", total_host_services); + mac->x[MACRO_TOTALHOSTSERVICESOK] = + (char *)mkstr("%d", total_host_services_ok); + mac->x[MACRO_TOTALHOSTSERVICESWARNING] = + (char *)mkstr("%d", total_host_services_warning); + mac->x[MACRO_TOTALHOSTSERVICESUNKNOWN] = + (char *)mkstr("%d", total_host_services_unknown); + mac->x[MACRO_TOTALHOSTSERVICESCRITICAL] = + (char *)mkstr("%d", total_host_services_critical); } /* return only the macro the user requested */ *output = mac->x[macro_type]; break; case MACRO_HOSTIMPORTANCE: - *output = strdup(mkstr("%u", temp_host->hourly_value)); + *output = (char *)mkstr("%u", temp_host->hourly_value); break; case MACRO_HOSTANDSERVICESIMPORTANCE: - *output = strdup(mkstr("%u", temp_host->hourly_value + - host_services_value(temp_host))); + *output = (char *)mkstr("%u", temp_host->hourly_value + + host_services_value(temp_host)); break; #endif @@ -1801,11 +1807,11 @@ /* get the macro value */ switch(macro_type) { case MACRO_HOSTGROUPNAME: - *output = strdup(temp_hostgroup->group_name); + *output = temp_hostgroup->group_name; break; case MACRO_HOSTGROUPALIAS: if(temp_hostgroup->alias) - *output = strdup(temp_hostgroup->alias); + *output = temp_hostgroup->alias; break; case MACRO_HOSTGROUPMEMBERS: /* make the calculations for total string length */ @@ -1849,15 +1855,15 @@ break; case MACRO_HOSTGROUPACTIONURL: if(temp_hostgroup->action_url) - *output = strdup(temp_hostgroup->action_url); + *output = temp_hostgroup->action_url; break; case MACRO_HOSTGROUPNOTESURL: if(temp_hostgroup->notes_url) - *output = strdup(temp_hostgroup->notes_url); + *output = temp_hostgroup->notes_url; break; case MACRO_HOSTGROUPNOTES: if(temp_hostgroup->notes) - *output = strdup(temp_hostgroup->notes); + *output = temp_hostgroup->notes; break; default: log_debug_info(DEBUGL_MACROS, 0, "UNHANDLED HOSTGROUP MACRO #%d! THIS IS A BUG!\n", macro_type); @@ -1911,89 +1917,89 @@ /* get the macro value */ switch(macro_type) { case MACRO_SERVICEDESC: - *output = strdup(temp_service->description); + *output = temp_service->description; break; case MACRO_SERVICEDISPLAYNAME: if(temp_service->display_name) - *output = strdup(temp_service->display_name); + *output = temp_service->display_name; break; #ifdef NSCORE case MACRO_SERVICEOUTPUT: if(temp_service->plugin_output) - *output = strdup(temp_service->plugin_output); + *output = temp_service->plugin_output; break; case MACRO_LONGSERVICEOUTPUT: if(temp_service->long_plugin_output) - *output = strdup(temp_service->long_plugin_output); + *output = temp_service->long_plugin_output; break; case MACRO_SERVICEPERFDATA: if(temp_service->perf_data) - *output = strdup(temp_service->perf_data); + *output = temp_service->perf_data; break; #endif case MACRO_SERVICECHECKCOMMAND: if(temp_service->check_command) - *output = strdup(temp_service->check_command); + *output = temp_service->check_command; break; #ifdef NSCORE case MACRO_SERVICECHECKTYPE: - *output = strdup(check_type_name(temp_service->check_type)); + *output = (char *)check_type_name(temp_service->check_type); break; case MACRO_SERVICESTATETYPE: - *output = strdup(state_type_name(temp_service->state_type)); + *output = (char *)state_type_name(temp_service->state_type); break; case MACRO_SERVICESTATE: - *output = strdup(service_state_name(temp_service->current_state)); + *output = (char *)service_state_name(temp_service->current_state); break; case MACRO_SERVICESTATEID: - *output = strdup(mkstr("%d", temp_service->current_state)); + *output = (char *)mkstr("%d", temp_service->current_state); break; case MACRO_LASTSERVICESTATE: - *output = strdup(service_state_name(temp_service->last_state)); + *output = (char *)service_state_name(temp_service->last_state); break; case MACRO_LASTSERVICESTATEID: - *output = strdup(mkstr("%d", temp_service->last_state)); + *output = (char *)mkstr("%d", temp_service->last_state); break; #endif case MACRO_SERVICEISVOLATILE: - *output = strdup(mkstr("%d", temp_service->is_volatile)); + *output = (char *)mkstr("%d", temp_service->is_volatile); break; #ifdef NSCORE case MACRO_SERVICEATTEMPT: - *output = strdup(mkstr("%d", temp_service->current_attempt)); + *output = (char *)mkstr("%d", temp_service->current_attempt); break; case MACRO_MAXSERVICEATTEMPTS: - *output = strdup(mkstr("%d", temp_service->max_attempts)); + *output = (char *)mkstr("%d", temp_service->max_attempts); break; case MACRO_SERVICEEXECUTIONTIME: - *output = strdup(mkstr("%.3f", temp_service->execution_time)); + *output = (char *)mkstr("%.3f", temp_service->execution_time); break; case MACRO_SERVICELATENCY: - *output = strdup(mkstr("%.3f", temp_service->latency)); + *output = (char *)mkstr("%.3f", temp_service->latency); break; case MACRO_LASTSERVICECHECK: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_check)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_check); break; case MACRO_LASTSERVICESTATECHANGE: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_state_change)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_state_change); break; case MACRO_LASTSERVICEOK: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_time_ok)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_time_ok); break; case MACRO_LASTSERVICEWARNING: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_time_warning)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_time_warning); break; case MACRO_LASTSERVICEUNKNOWN: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_time_unknown)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_time_unknown); break; case MACRO_LASTSERVICECRITICAL: - *output = strdup(mkstr("%lu", (unsigned long)temp_service->last_time_critical)); + *output = (char *)mkstr("%lu", (unsigned long)temp_service->last_time_critical); break; case MACRO_SERVICEDOWNTIME: - *output = strdup(mkstr("%d", temp_service->scheduled_downtime_depth)); + *output = (char *)mkstr("%d", temp_service->scheduled_downtime_depth); break; case MACRO_SERVICEPERCENTCHANGE: - *output = strdup(mkstr("%.2f", temp_service->percent_state_change)); + *output = (char *)mkstr("%.2f", temp_service->percent_state_change); break; case MACRO_SERVICEDURATIONSEC: case MACRO_SERVICEDURATION: @@ -2003,7 +2009,7 @@ /* get the state duration in seconds */ if(macro_type == MACRO_SERVICEDURATIONSEC) - *output = strdup(mkstr("%lu", duration)); + *output = (char *)mkstr("%lu", duration); /* get the state duration */ else { @@ -2014,39 +2020,39 @@ minutes = duration / 60; duration -= (minutes * 60); seconds = duration; - *output = strdup(mkstr("%dd %dh %dm %ds", days, hours, minutes, seconds)); + *output = (char *)mkstr("%dd %dh %dm %ds", days, hours, minutes, seconds); } break; case MACRO_SERVICENOTIFICATIONNUMBER: - *output = strdup(mkstr("%d", temp_service->current_notification_number)); + *output = (char *)mkstr("%d", temp_service->current_notification_number); break; case MACRO_SERVICENOTIFICATIONID: - *output = strdup(mkstr("%lu", temp_service->current_notification_id)); + *output = (char *)mkstr("%lu", temp_service->current_notification_id); break; case MACRO_SERVICEEVENTID: - *output = strdup(mkstr("%lu", temp_service->current_event_id)); + *output = (char *)mkstr("%lu", temp_service->current_event_id); break; case MACRO_LASTSERVICEEVENTID: - *output = strdup(mkstr("%lu", temp_service->last_event_id)); + *output = (char *)mkstr("%lu", temp_service->last_event_id); break; case MACRO_SERVICEPROBLEMID: - *output = strdup(mkstr("%lu", temp_service->current_problem_id)); + *output = (char *)mkstr("%lu", temp_service->current_problem_id); break; case MACRO_LASTSERVICEPROBLEMID: - *output = strdup(mkstr("%lu", temp_service->last_problem_id)); + *output = (char *)mkstr("%lu", temp_service->last_problem_id); break; #endif case MACRO_SERVICEACTIONURL: if(temp_service->action_url) - *output = strdup(temp_service->action_url); + *output = temp_service->action_url; break; case MACRO_SERVICENOTESURL: if(temp_service->notes_url) - *output = strdup(temp_service->notes_url); + *output = temp_service->notes_url; break; case MACRO_SERVICENOTES: if(temp_service->notes) - *output = strdup(temp_service->notes); + *output = temp_service->notes; break; #ifdef NSCORE @@ -2067,7 +2073,7 @@ } break; case MACRO_SERVICEIMPORTANCE: - *output = strdup(mkstr("%u", temp_service->hourly_value)); + *output = (char *)mkstr("%u", temp_service->hourly_value); break; #endif @@ -2127,11 +2133,11 @@ /* get the macro value */ switch(macro_type) { case MACRO_SERVICEGROUPNAME: - *output = strdup(temp_servicegroup->group_name); + *output = temp_servicegroup->group_name; break; case MACRO_SERVICEGROUPALIAS: if(temp_servicegroup->alias) - *output = strdup(temp_servicegroup->alias); + *output = temp_servicegroup->alias; break; case MACRO_SERVICEGROUPMEMBERS: /* make the calculations for total string length */ @@ -2174,15 +2180,15 @@ break; case MACRO_SERVICEGROUPACTIONURL: if(temp_servicegroup->action_url) - *output = strdup(temp_servicegroup->action_url); + *output = temp_servicegroup->action_url; break; case MACRO_SERVICEGROUPNOTESURL: if(temp_servicegroup->notes_url) - *output = strdup(temp_servicegroup->notes_url); + *output = temp_servicegroup->notes_url; break; case MACRO_SERVICEGROUPNOTES: if(temp_servicegroup->notes) - *output = strdup(temp_servicegroup->notes); + *output = temp_servicegroup->notes; break; default: log_debug_info(DEBUGL_MACROS, 0, "UNHANDLED SERVICEGROUP MACRO #%d! THIS IS A BUG!\n", macro_type); @@ -2780,64 +2786,27 @@ int clear_volatile_macros_r(nagios_macros *mac) { register int x = 0; - for(x = 0; x < MACRO_X_COUNT; x++) { - switch(x) { + log_debug_info(DEBUGL_FUNCTIONS, 0, "clear_volatile_macros_r()\n"); - case MACRO_ADMINEMAIL: - case MACRO_ADMINPAGER: - case MACRO_MAINCONFIGFILE: - case MACRO_STATUSDATAFILE: - case MACRO_RETENTIONDATAFILE: - case MACRO_OBJECTCACHEFILE: - case MACRO_TEMPFILE: - case MACRO_LOGFILE: - case MACRO_RESOURCEFILE: - case MACRO_COMMANDFILE: - case MACRO_HOSTPERFDATAFILE: - case MACRO_SERVICEPERFDATAFILE: - case MACRO_PROCESSSTARTTIME: - case MACRO_TEMPPATH: - case MACRO_EVENTSTARTTIME: - case MACRO_TOTALHOSTSERVICES: - case MACRO_TOTALHOSTSERVICESOK: - case MACRO_TOTALHOSTSERVICESWARNING: - case MACRO_TOTALHOSTSERVICESUNKNOWN: - case MACRO_TOTALHOSTSERVICESCRITICAL: - /* these don't change during the course of monitoring, so no need to free them */ - break; - default: - my_free(mac->x[x]); - break; - } - } + clear_host_macros_r(mac); + clear_service_macros_r(mac); + clear_summary_macros_r(mac); + clear_hostgroup_macros_r(mac); + clear_servicegroup_macros_r(mac); + clear_contactgroup_macros_r(mac); + clear_contact_macros_r(mac); + clear_datetime_macros_r(mac); /* contact address macros */ for(x = 0; x < MAX_CONTACT_ADDRESSES; x++) my_free(mac->contactaddress[x]); - /* clear macro pointers */ - mac->host_ptr = NULL; - mac->hostgroup_ptr = NULL; - mac->service_ptr = NULL; - mac->servicegroup_ptr = NULL; - mac->contact_ptr = NULL; - mac->contactgroup_ptr = NULL; - /* clear on-demand macro */ my_free(mac->ondemand); /* clear ARGx macros */ clear_argv_macros_r(mac); - /* clear custom host variables */ - clear_custom_vars(&(mac->custom_host_vars)); - - /* clear custom service variables */ - clear_custom_vars(&(mac->custom_service_vars)); - - /* clear custom contact variables */ - clear_custom_vars(&(mac->custom_contact_vars)); - return OK; } @@ -2847,11 +2816,20 @@ } +/* clear datetime macros */ +int clear_datetime_macros_r(nagios_macros *mac) { + my_free(mac->x[MACRO_LONGDATETIME]); + my_free(mac->x[MACRO_SHORTDATETIME]); + my_free(mac->x[MACRO_DATE]); + my_free(mac->x[MACRO_TIME]); + + return OK; + } + /* clear service macros */ int clear_service_macros_r(nagios_macros *mac) { /* these are recursive but persistent. what to do? */ - my_free(mac->x[MACRO_SERVICECHECKCOMMAND]); my_free(mac->x[MACRO_SERVICEACTIONURL]); my_free(mac->x[MACRO_SERVICENOTESURL]); my_free(mac->x[MACRO_SERVICENOTES]); @@ -2875,7 +2853,6 @@ int clear_host_macros_r(nagios_macros *mac) { /* these are recursive but persistent. what to do? */ - my_free(mac->x[MACRO_HOSTCHECKCOMMAND]); my_free(mac->x[MACRO_HOSTACTIONURL]); my_free(mac->x[MACRO_HOSTNOTESURL]); my_free(mac->x[MACRO_HOSTNOTES]); @@ -2975,7 +2952,6 @@ return clear_contactgroup_macros_r(&global_macros); } - /* clear summary macros */ int clear_summary_macros_r(nagios_macros *mac) { register int x; @@ -3288,6 +3264,7 @@ service *temp_service = NULL; contact *temp_contact = NULL; char *customvarname = NULL; + char *customvarvalue = NULL; log_debug_info(DEBUGL_FUNCTIONS, 1, "add_custom_macro_environment_vars_r()\n"); @@ -3309,12 +3286,18 @@ for(temp_customvariablesmember = mac->custom_host_vars; temp_customvariablesmember != NULL; temp_customvariablesmember = temp_customvariablesmember->next) { - /* Allocate memory for each environment variable name, but not the - values because when kvvec_destroy() is called, it is called with - KVVEC_FREE_KEYS */ - kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue = clean_macro_chars(temp_customvariablesmember->variable_value, - STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS)); + STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS); + if(NULL != customvarvalue) { + my_free(temp_customvariablesmember->variable_value); + temp_customvariablesmember->variable_value = customvarvalue; + /* Allocate memory for each environment variable name, but not the + values because when kvvec_destroy() is called, it is called with + KVVEC_FREE_KEYS */ + kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue); + } } /***** CUSTOM SERVICE VARIABLES *****/ @@ -3335,12 +3318,18 @@ for(temp_customvariablesmember = mac->custom_service_vars; temp_customvariablesmember != NULL; temp_customvariablesmember = temp_customvariablesmember->next) { - /* Allocate memory for each environment variable name, but not the - values because when kvvec_destroy() is called, it is called with - KVVEC_FREE_KEYS */ - kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue = clean_macro_chars(temp_customvariablesmember->variable_value, - STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS)); + STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS); + if(NULL != customvarvalue) { + my_free(temp_customvariablesmember->variable_value); + temp_customvariablesmember->variable_value = customvarvalue; + /* Allocate memory for each environment variable name, but not the + values because when kvvec_destroy() is called, it is called with + KVVEC_FREE_KEYS */ + kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue); + } } /***** CUSTOM CONTACT VARIABLES *****/ @@ -3361,12 +3350,18 @@ for(temp_customvariablesmember = mac->custom_contact_vars; temp_customvariablesmember != NULL; temp_customvariablesmember = temp_customvariablesmember->next) { - /* Allocate memory for each environment variable name, but not the - values because when kvvec_destroy() is called, it is called with - KVVEC_FREE_KEYS */ - kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue = clean_macro_chars(temp_customvariablesmember->variable_value, - STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS)); + STRIP_ILLEGAL_MACRO_CHARS | ESCAPE_MACRO_CHARS); + if(NULL != customvarvalue) { + my_free(temp_customvariablesmember->variable_value); + temp_customvariablesmember->variable_value = customvarvalue; + /* Allocate memory for each environment variable name, but not the + values because when kvvec_destroy() is called, it is called with + KVVEC_FREE_KEYS */ + kvvec_addkv(kvvp, strdup(temp_customvariablesmember->variable_name), + customvarvalue); + } } return OK; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/configure new/nagios-4.0.5/configure --- old/nagios-4.0.4/configure 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/configure 2014-04-11 20:37:42.000000000 +0200 @@ -1872,9 +1872,9 @@ PKG_NAME=nagios -PKG_VERSION="4.0.4" +PKG_VERSION="4.0.5" PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="03-14-2014" +PKG_REL_DATE="04-11-2014" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/configure.in new/nagios-4.0.5/configure.in --- old/nagios-4.0.4/configure.in 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/configure.in 2014-04-11 20:37:42.000000000 +0200 @@ -9,9 +9,9 @@ AC_PREFIX_DEFAULT(/usr/local/nagios) PKG_NAME=nagios -PKG_VERSION="4.0.4" +PKG_VERSION="4.0.5" PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="03-14-2014" +PKG_REL_DATE="04-11-2014" dnl Figure out how to invoke "install" and what install options to use. AC_PROG_INSTALL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/daemon-init.in new/nagios-4.0.5/daemon-init.in --- old/nagios-4.0.4/daemon-init.in 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/daemon-init.in 2014-04-11 20:37:42.000000000 +0200 @@ -70,7 +70,7 @@ # Automate addition of RAMDISK based on environment variables USE_RAMDISK=${USE_RAMDISK:-0} if test "$USE_RAMDISK" -ne 0 && test "$RAMDISK_SIZE"X != "X"; then - ramdisk=`mount |grep "$ramdiskdir type tmpfs"` + ramdisk=`mount |grep "${RAMDISK_DIR} type tmpfs"` if [ "$ramdisk"X == "X" ]; then mkdir -p -m 0755 ${RAMDISK_DIR} mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR} @@ -81,7 +81,7 @@ check_config() { TMPFILE=$(mktemp /tmp/.configtest.XXXXXXXX) - su - $NagiosUser -c "$NagiosBin -vp $NagiosCfgFile" > "$TMPFILE" + $NagiosBin -vp $NagiosCfgFile > "$TMPFILE" WARN=`grep ^"Total Warnings:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g` ERR=`grep ^"Total Errors:" "$TMPFILE" |awk -F: '{print \$2}' |sed s/' '//g` @@ -183,10 +183,10 @@ check_config fi if [ $? -eq 0 ]; then - su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" + touch $NagiosVarDir/nagios.log $NagiosRetentionFile rm -f $NagiosCommandFile touch $NagiosRunFile - chown $NagiosUser:$NagiosGroup $NagiosRunFile + chown $NagiosUser:$NagiosGroup $NagiosRunFile $NagiosVarDir/nagios.log $NagiosRetentionFile $NagiosBin -d $NagiosCfgFile if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi echo " done." @@ -234,7 +234,7 @@ checkconfig) if test "$checkconfig" = "true"; then - printf "Running configuration check..." + printf "Running configuration check...\n" check_config fi @@ -248,7 +248,7 @@ restart) if test "$checkconfig" = "true"; then - printf "Running configuration check..." + printf "Running configuration check...\n" check_config fi @@ -259,7 +259,7 @@ reload|force-reload) if test "$checkconfig" = "true"; then - printf "Running configuration check..." + printf "Running configuration check...\n" check_config fi @@ -268,7 +268,7 @@ else pid_nagios if status_nagios > /dev/null; then - printf "Reloading nagios configuration..." + printf "Reloading nagios configuration...\n" killproc_nagios nagios -HUP echo "done" else @@ -280,7 +280,7 @@ ;; configtest) - su - $NagiosUser -c "$NagiosBin -vp $NagiosCfgFile" + $NagiosBin -vp $NagiosCfgFile ;; *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/doxy.conf new/nagios-4.0.5/doxy.conf --- old/nagios-4.0.4/doxy.conf 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/doxy.conf 2014-04-11 20:37:42.000000000 +0200 @@ -1,5 +1,5 @@ PROJECT_NAME = Nagios -PROJECT_NUMBER = 4.0.4 +PROJECT_NUMBER = 4.0.5 PROJECT_BRIEF = "Dev docs for Nagios core and neb-module hackers" INPUT = lib/ docs/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/html/main.php new/nagios-4.0.5/html/main.php --- old/nagios-4.0.4/html/main.php 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/html/main.php 2014-04-11 20:37:42.000000000 +0200 @@ -1,7 +1,7 @@ <?php include_once(dirname(__FILE__).'/includes/utils.inc.php'); -$this_version="4.0.4"; +$this_version="4.0.5"; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> @@ -38,9 +38,9 @@ <div id="currentversioninfo"> <div class="product">Nagios<sup><span style="font-size: small;">®</span></sup> Core<sup><span style="font-size: small;">™</span></sup></div> -<div class="version">Version 4.0.4</div> -<div class="releasedate">March 14, 2014</div> -<div class="checkforupdates"><a href="http://www.nagios.org/checkforupdates/?version=4.0.4&product=nagioscore" target="_blank">Check for updates</a></div> +<div class="version">Version 4.0.5</div> +<div class="releasedate">April 11, 2014</div> +<div class="checkforupdates"><a href="http://www.nagios.org/checkforupdates/?version=4.0.5&product=nagioscore" target="_blank">Check for updates</a></div> <!--<div class="whatsnew"><a href="http://go.nagios.com/nagioscore/whatsnew">Read what's new in Nagios Core 3</a></div>--> </div> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/include/common.h new/nagios-4.0.5/include/common.h --- old/nagios-4.0.4/include/common.h 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/include/common.h 2014-04-11 20:37:42.000000000 +0200 @@ -24,8 +24,8 @@ #include "shared.h" -#define PROGRAM_VERSION "4.0.4" -#define PROGRAM_MODIFICATION_DATE "03-14-2014" +#define PROGRAM_VERSION "4.0.5" +#define PROGRAM_MODIFICATION_DATE "04-11-2014" NAGIOS_BEGIN_DECL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/include/macros.h new/nagios-4.0.5/include/macros.h --- old/nagios-4.0.4/include/macros.h 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/include/macros.h 2014-04-11 20:37:42.000000000 +0200 @@ -316,6 +316,7 @@ int clear_contact_macros_r(nagios_macros *mac); int clear_contactgroup_macros_r(nagios_macros *mac); int clear_summary_macros_r(nagios_macros *mac); +int clear_datetime_macros_r(nagios_macros *mac); #ifndef NSCGI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/lib/runcmd.c new/nagios-4.0.5/lib/runcmd.c --- old/nagios-4.0.4/lib/runcmd.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/lib/runcmd.c 2014-04-11 20:37:42.000000000 +0200 @@ -423,7 +423,6 @@ if(NULL != env) { char **envpp = env; while(NULL != *envpp && NULL != *(envpp+1)) { - fprintf(stderr, "ENV: '%s'='%s'\n", *envpp, *(envpp+1)); update_environment(*envpp, *(envpp+1), 1); envpp += 2; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/nagios.spec new/nagios-4.0.5/nagios.spec --- old/nagios-4.0.4/nagios.spec 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/nagios.spec 2014-04-11 20:37:42.000000000 +0200 @@ -21,7 +21,7 @@ Summary: Open Source host, service and network monitoring program Name: nagios -Version: 4.0.4 +Version: 4.0.5 Release: 2%{?dist} License: GPL Group: Applications/System diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/update-version new/nagios-4.0.5/update-version --- old/nagios-4.0.4/update-version 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/update-version 2014-04-11 20:37:42.000000000 +0200 @@ -10,10 +10,10 @@ fi # Current version number -CURRENTVERSION=4.0.4 +CURRENTVERSION=4.0.5 # Last date -LASTDATE=03-14-2014 +LASTDATE=04-11-2014 if [ "x$1" = "x" ] then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagios-4.0.4/xdata/xodtemplate.c new/nagios-4.0.5/xdata/xodtemplate.c --- old/nagios-4.0.4/xdata/xodtemplate.c 2014-03-14 18:24:57.000000000 +0100 +++ new/nagios-4.0.5/xdata/xodtemplate.c 2014-04-11 20:37:42.000000000 +0200 @@ -6132,7 +6132,7 @@ for(temp_contactgroup = xodtemplate_contactgroup_list; temp_contactgroup; temp_contactgroup = temp_contactgroup->next) { objectlist *next, *list, *accept = NULL; - if(temp_contactgroup->members == NULL) + if(temp_contactgroup->members == NULL && temp_contactgroup->contactgroup_members == NULL) continue; /* @@ -8702,6 +8702,7 @@ my_free(this_service->template); my_free(this_service->name); + my_free(this_service->parents); my_free(this_service->display_name); my_free(this_service->check_command); my_free(this_service->check_period); -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de