[Pkg-nagios-changes] [pkg-nrpe] 01/05: New upstream version 3.2.1

Bas Couwenberg sebastic at debian.org
Sun Sep 3 09:02:36 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pkg-nrpe.

commit b33b060eba7900cb10a89a0d4a372d4288357ceb
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Sep 3 10:45:16 2017 +0200

    New upstream version 3.2.1
---
 CHANGELOG.md              | 10 +++++++++
 configure                 | 28 ++++++++++++------------
 configure.ac              |  8 +++----
 include/common.h.in       |  4 ++--
 nrpe.spec.in              |  6 +++---
 sample-config/nrpe.cfg.in | 31 ++++++++++++++-------------
 src/check_nrpe.c          |  2 ++
 src/nrpe.c                | 25 +++++++++++++---------
 src/utils.c               | 33 +++++++++++++++++++----------
 startup/openrc-conf.in    |  6 +++---
 startup/openrc-init.in    | 54 ++++++++++-------------------------------------
 update-version            |  6 ++++--
 12 files changed, 106 insertions(+), 107 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c3e6659..1029755 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,16 @@
 NRPE Changelog
 ==============
 
+[3.2.1](https://github.com/NagiosEnterprises/nrpe/releases/tag/nrpe-3.2.1) - 2017-08-31
+---------------------------------------------------------------------------------------
+**FIXES**
+* Change seteuid error messages to warning/debug (Bryan Heden)
+* Fix segfault when no nrpe_user is specified (Stephen Smoogen, Bryan Heden)
+* Added additional strings to error messages to remove duplicates (Bryan Heden)
+* Fix nrpe.spec for rpmbuild (Bryan Heden)
+* Fix error for drop_privileges when using inetd (xalasys-luc, Bryan Heden)
+
+
 [3.2.0](https://github.com/NagiosEnterprises/nrpe/releases/tag/nrpe-3.2.0) - 2017-06-26
 ---------------------------------------------------------------------------------------
 **ENHANCEMENTS**
diff --git a/configure b/configure
index 02bbed3..66462fd 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for nrpe 3.2.0.
+# Generated by GNU Autoconf 2.69 for nrpe newdate.
 #
 # Report bugs to <nagios-users at lists.sourceforge.net>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='nrpe'
 PACKAGE_TARNAME='nrpe'
-PACKAGE_VERSION='3.2.0'
-PACKAGE_STRING='nrpe 3.2.0'
+PACKAGE_VERSION='newdate'
+PACKAGE_STRING='nrpe newdate'
 PACKAGE_BUGREPORT='nagios-users at lists.sourceforge.net'
 PACKAGE_URL='https://www.nagios.org/downloads/nagios-core-addons/'
 
@@ -1320,7 +1320,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures nrpe 3.2.0 to adapt to many kinds of systems.
+\`configure' configures nrpe newdate to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1370,7 +1370,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of nrpe 3.2.0:";;
+     short | recursive ) echo "Configuration of nrpe newdate:";;
    esac
   cat <<\_ACEOF
 
@@ -1516,7 +1516,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-nrpe configure 3.2.0
+nrpe configure newdate
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by nrpe $as_me 3.2.0, which was
+It was created by nrpe $as_me newdate, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2487,9 +2487,9 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 PKG_NAME=nrpe
-PKG_VERSION="3.2.0"
+PKG_VERSION="3.2.1"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="2017-06-27"
+PKG_REL_DATE="2017-09-01"
 RPM_RELEASE=1
 
 LANG=C
@@ -4349,7 +4349,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by nrpe $as_me 3.2.0, which was
+This file was extended by nrpe $as_me newdate, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4403,7 +4403,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-nrpe config.status 3.2.0
+nrpe config.status newdate
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -7293,7 +7293,7 @@ fi
 
 if test x$check_for_ssl = xyes; then
 	# need_dh should only be set for NRPE
-	need_dh=yes
+	#need_dh=yes
 
 
 # -------------------------------
@@ -8285,7 +8285,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by nrpe $as_me 3.2.0, which was
+This file was extended by nrpe $as_me newdate, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8348,7 +8348,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-nrpe config.status 3.2.0
+nrpe config.status newdate
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index df4e1be..b22b2d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,15 +5,15 @@ define([AC_CACHE_LOAD],)
 define([AC_CACHE_SAVE],)
 
 m4_include([build-aux/custom_help.m4])
-AC_INIT([nrpe],[3.2.0],[nagios-users at lists.sourceforge.net],[nrpe],[https://www.nagios.org/downloads/nagios-core-addons/])
+AC_INIT([nrpe],[newdate],[nagios-users at lists.sourceforge.net],[nrpe],[https://www.nagios.org/downloads/nagios-core-addons/])
 AC_CONFIG_SRCDIR([src/nrpe.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 
 PKG_NAME=nrpe
-PKG_VERSION="3.2.0"
+PKG_VERSION="3.2.1"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="2017-06-27"
+PKG_REL_DATE="2017-09-01"
 RPM_RELEASE=1
 
 LANG=C
@@ -313,7 +313,7 @@ AC_ARG_WITH([need_dh],
 dnl Optional SSL library and include paths
 if test x$check_for_ssl = xyes; then
 	# need_dh should only be set for NRPE
-	need_dh=yes
+	#need_dh=yes
 	AC_NAGIOS_GET_SSL
 fi
 
diff --git a/include/common.h.in b/include/common.h.in
index cb17698..90f6272 100644
--- a/include/common.h.in
+++ b/include/common.h.in
@@ -37,8 +37,8 @@
 # endif
 #endif
 
-#define PROGRAM_VERSION "3.2.0"
-#define MODIFICATION_DATE "2017-06-27"
+#define PROGRAM_VERSION "3.2.1"
+#define MODIFICATION_DATE "2017-09-01"
 
 #define OK							0
 #define ERROR						-1
diff --git a/nrpe.spec.in b/nrpe.spec.in
index 919e26b..572c245 100644
--- a/nrpe.spec.in
+++ b/nrpe.spec.in
@@ -22,7 +22,7 @@
 %define _sysconfdir /etc/nagios
 
 %define name @PACKAGE_NAME@
-%define version 3.2.0
+%define version 3.2.1
 %define release @RPM_RELEASE@
 %define nsusr @nrpe_user@
 %define nsgrp @nrpe_group@
@@ -169,13 +169,13 @@ rm -rf $RPM_BUILD_ROOT
 @tmpfilesd@
 %endif
 %{_bindir}/nrpe-uninstall
-%doc Changelog LEGAL README.md README.SSL.md SECURITY.md
+%doc CHANGELOG.md LEGAL README.md README.SSL.md SECURITY.md
 
 %files plugin
 %defattr(755,%{nsusr},%{nsgrp})
 %{_libexecdir}
 %defattr(644,%{nsusr},%{nsgrp})
-%doc Changelog LEGAL README.md
+%doc CHANGELOG.md LEGAL README.md
 
 %changelog
 * Thu Aug 18 2016 John Frickson jfrickson<@>nagios.com
diff --git a/sample-config/nrpe.cfg.in b/sample-config/nrpe.cfg.in
index 604d74e..1d503c9 100644
--- a/sample-config/nrpe.cfg.in
+++ b/sample-config/nrpe.cfg.in
@@ -271,21 +271,6 @@ connection_timeout=300
 # nasty_metachars="|`&><'\\[]{};\r\n"
 
 
-# INCLUDE CONFIG FILE
-# This directive allows you to include definitions from an external config file.
-
-#include=<somefile.cfg>
-
-
-
-# INCLUDE CONFIG DIRECTORY
-# This directive allows you to include definitions from config files (with a
-# .cfg extension) in one or more directories (with recursion).
-
-#include_dir=<somedirectory>
-#include_dir=<someotherdirectory>
-
-
 
 # COMMAND DEFINITIONS
 # Command definitions that this daemon will run.  Definitions
@@ -358,3 +343,19 @@ command[check_total_procs]=@pluginsdir@/check_procs -w 150 -c 200
 #command[check_asterisk_channels]=@pluginsdir@/nagisk.pl -c channels 
 #command[check_asterisk_zaptel]=@pluginsdir@/nagisk.pl -c zaptel 
 #command[check_asterisk_span]=@pluginsdir@/nagisk.pl -c span -s 1
+
+
+
+# INCLUDE CONFIG FILE
+# This directive allows you to include definitions from an external config file.
+
+#include=<somefile.cfg>
+
+
+
+# INCLUDE CONFIG DIRECTORY
+# This directive allows you to include definitions from config files (with a
+# .cfg extension) in one or more directories (with recursion).
+
+#include_dir=<somedirectory>
+#include_dir=<someotherdirectory>
diff --git a/src/check_nrpe.c b/src/check_nrpe.c
index 3cd58f5..ace7041 100644
--- a/src/check_nrpe.c
+++ b/src/check_nrpe.c
@@ -580,6 +580,8 @@ int read_config_file(char *fname)
 		argv[argc] = my_strsep(&bufp, delims);
 		if (!argv[argc++])
 			break;
+		if (!bufp)
+			break;
 	}
 
 	fclose(f);
diff --git a/src/nrpe.c b/src/nrpe.c
index 561f2a1..8e92764 100644
--- a/src/nrpe.c
+++ b/src/nrpe.c
@@ -687,8 +687,10 @@ void set_stdio_sigs(void)
 		exit(STATE_CRITICAL);
 
 	clean_environ(keep_env_vars, nrpe_user);
-	drop_privileges(nrpe_user, nrpe_group, 0);	/* drop privileges */
-	check_privileges();			/* make sure we're not root */
+
+	/* drop and then check privileges */
+	drop_privileges(nrpe_user, nrpe_group, 0);
+	check_privileges();
 }
 
 void cleanup(void)
@@ -2009,7 +2011,7 @@ int read_packet(int sock, void *ssl_ptr, v2_packet * v2_pkt, v3_packet ** v3_pkt
 
 		packet_ver = ntohs(v2_pkt->packet_version);
 		if (packet_ver != NRPE_PACKET_VERSION_2 && packet_ver != NRPE_PACKET_VERSION_3) {
-			logit(LOG_ERR, "Error: Request packet version was invalid!");
+			logit(LOG_ERR, "Error: (use_ssl == false): Request packet version was invalid!");
 			return -1;
 		}
 
@@ -2037,7 +2039,7 @@ int read_packet(int sock, void *ssl_ptr, v2_packet * v2_pkt, v3_packet ** v3_pkt
 			buffer_size = ntohl(buffer_size);
 			pkt_size += buffer_size;
 			if ((*v3_pkt = calloc(1, pkt_size)) == NULL) {
-				logit(LOG_ERR, "Error: Could not allocate memory for packet");
+				logit(LOG_ERR, "Error: (use_ssl == false): Could not allocate memory for packet");
 				return -1;
 			}
 
@@ -2071,7 +2073,7 @@ int read_packet(int sock, void *ssl_ptr, v2_packet * v2_pkt, v3_packet ** v3_pkt
 
 		packet_ver = ntohs(v2_pkt->packet_version);
 		if (packet_ver != NRPE_PACKET_VERSION_2 && packet_ver != NRPE_PACKET_VERSION_3) {
-			logit(LOG_ERR, "Error: Request packet version was invalid!");
+			logit(LOG_ERR, "Error: (use_ssl == true): Request packet version was invalid!");
 			return -1;
 		}
 
@@ -2104,7 +2106,7 @@ int read_packet(int sock, void *ssl_ptr, v2_packet * v2_pkt, v3_packet ** v3_pkt
 			buffer_size = ntohl(buffer_size);
 			pkt_size += buffer_size;
 			if ((*v3_pkt = calloc(1, pkt_size)) == NULL) {
-				logit(LOG_ERR, "Error: Could not allocate memory for packet");
+				logit(LOG_ERR, "Error: (use_ssl == true): Could not allocate memory for packet");
 				return -1;
 			}
 
@@ -2221,8 +2223,8 @@ int my_system(char *command, int timeout, int *early_timeout, char **output)
 	if (pid == 0) {
 
 		/* get root back so the next call works correctly */
-		if (SETEUID(0) == -1)
-			logit(LOG_ERR, "ERROR: my_system() seteuid(0): %s", strerror(errno));
+		if (SETEUID(0) == -1 && debug)
+			logit(LOG_WARNING, "WARNING: my_system() seteuid(0): %s", strerror(errno));
 
 		drop_privileges(nrpe_user, nrpe_group, 1);	/* drop privileges */
 		close(fd[0]);			/* close pipe for reading */
@@ -2368,6 +2370,9 @@ int drop_privileges(char *user, char *group, int full_drop)
 	struct group *grp;
 	struct passwd *pw;
 
+	if (use_inetd == TRUE)
+		return OK;
+
 	/* set effective group ID */
 	if (group != NULL) {
 
@@ -2493,8 +2498,8 @@ int remove_pid_file(void)
 		return OK;				/* pid file was not written */
 
 	/* get root back so we can delete the pid file */
-	if (SETEUID(0) == -1)
-		logit(LOG_ERR, "ERROR: remove_pid_file() seteuid(0): %s", strerror(errno));
+	if (SETEUID(0) == -1 && debug)
+		logit(LOG_WARNING, "WARNING: remove_pid_file() seteuid(0): %s", strerror(errno));
 
 	if (unlink(pid_file) == -1) {
 		logit(LOG_ERR, "Cannot remove pidfile '%s' - check your privileges.", pid_file);
diff --git a/src/utils.c b/src/utils.c
index f8896f7..a5aa519 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -326,24 +326,35 @@ int clean_environ(const char *keep_env_vars, const char *nrpe_user)
 	free(keep);
 	free(kept);
 
-	setenv("PATH", path, 1);
-	setenv("IFS", " \t\n", 1);
-	setenv("LOGNAME", nrpe_user, 0);
-	setenv("USER", nrpe_user, 0);
 
-	pw = (struct passwd *)getpwnam(nrpe_user);
+	char * user = NULL;
+
+	if (nrpe_user != NULL) {
+		user = strdup(nrpe_user);
+		pw = (struct passwd *)getpwnam(nrpe_user);
+	}
+
+	if (nrpe_user == NULL || pw == NULL) {
+		pw = (struct passwd *)getpwuid(getuid());
+		if (pw != NULL) {
+			user = strdup(pw->pw_name);
+		}
+	}
+	
 	if (pw == NULL) {
-		char	*end = NULL;
-		uid_t	uid = strtol(nrpe_user, &end, 10);
-		if (uid > 0)
-			pw = (struct passwd *)getpwuid(uid);
-		if (pw == NULL || *end != '\0')
-			return OK;
+		free(user);
+		return OK;
 	}
 
+	setenv("PATH", path, 1);
+	setenv("IFS", " \t\n", 1);
+	setenv("LOGNAME", user, 0);
+	setenv("USER", user, 0);
 	setenv("HOME", pw->pw_dir, 0);
 	setenv("SHELL", pw->pw_shell, 0);
 
+	free(user);
+
 	return OK;
 }
 
diff --git a/startup/openrc-conf.in b/startup/openrc-conf.in
index 426042a..1e6bd84 100644
--- a/startup/openrc-conf.in
+++ b/startup/openrc-conf.in
@@ -1,7 +1,7 @@
 # /etc/conf.d/nrpe : config file for /etc/init.d/nrpe
 
-# Configuration file - default is @sysconfdir@/nrpe.cfg
-NRPE_CFG="@pgksysconfdir@/nrpe.cfg"
+# The configuration file to use.
+NRPE_CFG="@sysconfdir@/nrpe.cfg"
 
-# Any additional nrpe options (-n -4 -6)
+# Any additional options (e.g. -n -4 -6) to pass to the nrpe daemon.
 NRPE_OPTS=""
diff --git a/startup/openrc-init.in b/startup/openrc-init.in
index a935cfa..baac193 100644
--- a/startup/openrc-init.in
+++ b/startup/openrc-init.in
@@ -1,49 +1,17 @@
-#!/sbin/runscript
+#!/sbin/openrc-run
 #
-# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+# Copyright (c) 2017 Nagios(R) Core(TM) Development Team
 #
-# Start/stop the nrpe daemon.
-#
-# Goes in /etc/init.d - Config is in /etc/conf.d/nrpe
-
-opts="reload"
-# extra_started_commands="reload"		use this if OpenRC >= 0.9.4
-
-NRPE_BIN="@sbindir@/nrpe"
-NRPE_PID="@piddir@/nrpe.pid"
-
-depend() {
-	use logger dns net localmount netmount nfsmount
-}
 
-checkconfig() {
-	# Make sure the config file exists
-	if [ ! -f $NRPE_CFG ]; then
-		eerror "You need to setup $NRPE_CFG."
-		return 1
-	fi
-	return 0
-}
-
-start() {
-	checkconfig || return 1
-	ebegin "Starting nrpe"
-	# Make sure we have a sane current directory
-	cd /
-	start-stop-daemon --start --exec $NRPE_BIN --pidfile $PID_FILE \
-		--background -- -c $NRPE_CFG -f $NRPE_OPTS
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping nrpe"
-	start-stop-daemon --stop --exec $NRPE_BIN --pidfile $PID_FILE
-	eend $?
-}
+command="@sbindir@/nrpe"
+command_args="--config=${NRPE_CFG} ${NRPE_OPTS}"
+command_args_background="--daemon"
+description="Nagios Remote Plugin Executor (NRPE) daemon"
+extra_started_commands="reload"
+pidfile="@piddir@/nrpe.pid"
 
 reload() {
-	ebegin "Reloading nrpe"
-	start-stop-daemon --stop --oknodo --exec $NRPE_BIN \
-		--pidfile $PID_FILE --signal HUP
-	eend $?
+    ebegin "Reloading ${SVCNAME}"
+    start-stop-daemon --signal HUP --pidfile "${pidfile}"
+    eend $?
 }
diff --git a/update-version b/update-version
index 2249614..fe242c1 100755
--- a/update-version
+++ b/update-version
@@ -28,10 +28,10 @@ else
 fi
 
 # Current version number
-CURRENTVERSION=3.2.0
+CURRENTVERSION=3.2.1
 
 # Last date
-LASTDATE=2017-06-27
+LASTDATE=2017-09-01
 
 if [ "x$1" = "x" ]
 then
@@ -41,6 +41,8 @@ then
         echo "update version number and modification date in files."
         echo "Use the \"newdate\" argument if you want to keep the current version"
         echo "number and just update the modification date."
+        echo "When using \"newdate\" you can specify the release date with"
+        echo "a second argument in the form of YYYY-MM-DD."
         echo ""
         echo "Current version=$CURRENTVERSION"
         echo "Current Modification date=$LASTDATE"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nrpe.git



More information about the Pkg-nagios-changes mailing list