From b04fc1f83332c46eeac2c3d1c31cdd05373507d1 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Thu, 1 Jun 2006 08:36:32 +0000 Subject: [PATCH] upgrading package: nagios 2.3.1 -> 2.4 --- nagios/nagios.patch | 129 +++++++++++++++++++++++--------------------- nagios/nagios.spec | 4 +- 2 files changed, 69 insertions(+), 64 deletions(-) diff --git a/nagios/nagios.patch b/nagios/nagios.patch index 5f13773931..1432504e91 100644 --- a/nagios/nagios.patch +++ b/nagios/nagios.patch @@ -1,6 +1,28 @@ +Index: base/checks.c +--- base/checks.c.orig 2006-02-16 05:47:55 +0100 ++++ base/checks.c 2006-06-01 10:34:34 +0200 +@@ -483,7 +483,8 @@ + _exit(STATE_UNKNOWN); + + /* default return string in case nothing was returned */ +- strcpy(plugin_output,"(No output!)"); ++ snprintf(plugin_output,sizeof(plugin_output)-1,"(No output from command \"%s\")", processed_command); ++ plugin_output[sizeof(plugin_output)-1]='\x0'; + + /* grab the plugin output and clean it */ + fgets(plugin_output,sizeof(plugin_output)-1,fp); +@@ -505,7 +506,7 @@ + /* record check result info */ + strncpy(svc_msg.output,plugin_output,sizeof(svc_msg.output)-1); + svc_msg.output[sizeof(svc_msg.output)-1]='\x0'; +- svc_msg.return_code=WEXITSTATUS(pclose_result); ++ svc_msg.return_code=(WIFEXITED(pclose_result) ? WEXITSTATUS(pclose_result) : -1); + svc_msg.exited_ok=TRUE; + svc_msg.check_type=SERVICE_CHECK_ACTIVE; + svc_msg.finish_time=end_time; Index: base/logging.c --- base/logging.c.orig 2005-12-13 01:42:45 +0100 -+++ base/logging.c 2006-04-20 20:13:22 +0200 ++++ base/logging.c 2006-06-01 10:34:34 +0200 @@ -208,6 +208,7 @@ /* write something to the syslog facility */ @@ -14,55 +36,23 @@ Index: base/logging.c return OK; + /* OSSP fsl identification */ -+ if (!logopen) { -+ openlog("nagios", LOG_NDELAY, LOG_USER); -+ logopen = 1; -+ } ++ if (!logopen) { ++ openlog("nagios", LOG_NDELAY, LOG_USER); ++ logopen = 1; ++ } + /* write the buffer to the syslog facility */ syslog(LOG_USER|LOG_INFO,"%s",buffer); -Index: nagios-plugins-1.4.3/configure ---- nagios-plugins-1.4.3/configure.orig 2006-04-19 05:52:19 +0200 -+++ nagios-plugins-1.4.3/configure 2006-04-20 20:14:05 +0200 -@@ -25122,8 +25122,8 @@ - fi - - if test "$ac_cv_lib_ldap_main" = "yes"; then -- LDAPLIBS="-lldap -llber"\ -- LDAPINCLUDE="-I/usr/include/ldap" -+ LDAPLIBS="-lldap -llber -lssl -lcrypto" -+ LDAPINCLUDE="-I$prefix/include" - - - -@@ -29844,17 +29844,10 @@ - - echo "$as_me:$LINENO: checking for ICMP ping syntax" >&5 - echo $ECHO_N "checking for ICMP ping syntax... $ECHO_C" >&6 --ac_cv_ping_packets_first=no --ac_cv_ping_has_timeout=no - if test -n "$with_ping_command" - then - echo "$as_me:$LINENO: result: (command-line) $with_ping_command" >&5 - echo "${ECHO_T}(command-line) $with_ping_command" >&6 -- if test -n "$ac_cv_ping_packets_first" -- then -- ac_cv_ping_packets_first=yes -- ac_cv_ping_has_timeout=yes -- fi - - elif [ "z$ac_cv_uname_s" = "zUnixWare" ] && \ - $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ Index: base/utils.c ---- base/utils.c.orig 2006-04-07 23:45:33 +0200 -+++ base/utils.c 2006-04-20 22:52:43 +0200 +--- base/utils.c.orig 2006-05-20 20:37:29 +0200 ++++ base/utils.c 2006-06-01 10:34:34 +0200 @@ -2806,7 +2806,7 @@ /* report an error if we couldn't run the command */ if(fp==NULL){ - strncpy(buffer,"(Error: Could not execute command)\n",sizeof(buffer)-1); -+ snprintf(buffer,sizeof(buffer)-1,"(Error: Could not execute command \"%s\"", cmd); ++ snprintf(buffer,sizeof(buffer)-1,"(Error: Could not execute command \"%s\")", cmd); buffer[sizeof(buffer)-1]='\x0'; /* write the error back to the parent process */ @@ -71,7 +61,7 @@ Index: base/utils.c /* default return string in case nothing was returned */ - strcpy(buffer,"(No output!)"); -+ snprintf(buffer,sizeof(buffer)-1,"(No output from command \"%s\"", cmd); ++ snprintf(buffer,sizeof(buffer)-1,"(No output from command \"%s\")", cmd); + buffer[sizeof(buffer)-1]='\x0'; /* read in the first line of output from the command */ @@ -85,7 +75,7 @@ Index: base/utils.c /* write the output back to the parent process */ write(fd[1],buffer,strlen(buffer)+1); -@@ -2870,7 +2871,7 @@ +@@ -2870,11 +2871,11 @@ #endif /* get the exit code returned from the program */ @@ -94,25 +84,40 @@ Index: base/utils.c /* check for possibly missing scripts/binaries/etc */ if(result==126 || result==127){ -Index: base/checks.c ---- base/checks.c.orig 2006-02-16 05:47:55 +0100 -+++ base/checks.c 2006-04-20 22:52:42 +0200 -@@ -483,7 +483,8 @@ - _exit(STATE_UNKNOWN); +- snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,result); ++ snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" (timeout %ds) resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,timeout,result); + buffer[sizeof(buffer)-1]='\x0'; + write_to_logs_and_console(buffer,NSLOG_RUNTIME_WARNING,TRUE); + } +Index: nagios-plugins-1.4.3/configure +--- nagios-plugins-1.4.3/configure.orig 2006-04-19 05:52:19 +0200 ++++ nagios-plugins-1.4.3/configure 2006-06-01 10:34:34 +0200 +@@ -25122,8 +25122,8 @@ + fi - /* default return string in case nothing was returned */ -- strcpy(plugin_output,"(No output!)"); -+ snprintf(plugin_output,sizeof(plugin_output)-1,"(No output from command \"%s\"", processed_command); -+ plugin_output[sizeof(plugin_output)-1]='\x0'; + if test "$ac_cv_lib_ldap_main" = "yes"; then +- LDAPLIBS="-lldap -llber"\ +- LDAPINCLUDE="-I/usr/include/ldap" ++ LDAPLIBS="-lldap -llber -lssl -lcrypto" ++ LDAPINCLUDE="-I$prefix/include" - /* grab the plugin output and clean it */ - fgets(plugin_output,sizeof(plugin_output)-1,fp); -@@ -505,7 +506,7 @@ - /* record check result info */ - strncpy(svc_msg.output,plugin_output,sizeof(svc_msg.output)-1); - svc_msg.output[sizeof(svc_msg.output)-1]='\x0'; -- svc_msg.return_code=WEXITSTATUS(pclose_result); -+ svc_msg.return_code=(WIFEXITED(pclose_result) ? WEXITSTATUS(pclose_result) : -1); - svc_msg.exited_ok=TRUE; - svc_msg.check_type=SERVICE_CHECK_ACTIVE; - svc_msg.finish_time=end_time; + + +@@ -29844,17 +29844,10 @@ + + echo "$as_me:$LINENO: checking for ICMP ping syntax" >&5 + echo $ECHO_N "checking for ICMP ping syntax... $ECHO_C" >&6 +-ac_cv_ping_packets_first=no +-ac_cv_ping_has_timeout=no + if test -n "$with_ping_command" + then + echo "$as_me:$LINENO: result: (command-line) $with_ping_command" >&5 + echo "${ECHO_T}(command-line) $with_ping_command" >&6 +- if test -n "$ac_cv_ping_packets_first" +- then +- ac_cv_ping_packets_first=yes +- ac_cv_ping_has_timeout=yes +- fi + + elif [ "z$ac_cv_uname_s" = "zUnixWare" ] && \ + $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \ diff --git a/nagios/nagios.spec b/nagios/nagios.spec index 7a69594c2d..00c19fe1af 100644 --- a/nagios/nagios.spec +++ b/nagios/nagios.spec @@ -23,7 +23,7 @@ ## # package versions -%define V_nagios 2.3.1 +%define V_nagios 2.4 %define V_nagios_plugins 1.4.3 # package information @@ -37,7 +37,7 @@ Class: EVAL Group: Network License: GPL Version: %{V_nagios} -Release: 20060531 +Release: 20060601 # package options %option with_perl yes