Hello community,
here is the log from the commit of package nagios-nrpe for openSUSE:Factory
checked in at Wed May 5 23:10:05 CEST 2010.
--------
--- nagios-nrpe/nagios-nrpe.changes 2010-04-29 17:35:40.000000000 +0200
+++ nagios-nrpe/nagios-nrpe.changes 2010-05-05 17:45:44.000000000 +0200
@@ -1,0 +2,21 @@
+Wed May 5 15:45:05 UTC 2010 - lars@linux-schulserver.de
+
+- set default values in init script
+
+-------------------------------------------------------------------
+Mon May 3 09:36:34 UTC 2010 - lars@linux-schulserver.de
+
+- fix file ownership in /etc
+- added nrpe manpage from debian
+- added adapted patches from Debian:
+ + nrpe-more_random.patch (overwrite the buffer with better
+ randomness)
+ + nrpe-improved_help.patch (list additional commandline options)
+ + nrpe-weird_output.patch (null the buffer before using it)
+ + nrpe-drop_privileges_before_writing_pidfile.patch (name says all)
+- added the following patches to fix compilation warnings:
+ + nrpe-return_value.patch
+ + nrpe-uninitialized_variable.patch
+ + nrpe-unused_variable.patch
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
nrpe-drop_privileges_before_writing_pidfile.patch
nrpe-improved_help.patch
nrpe-more_random.patch
nrpe-return_value.patch
nrpe-uninitialized_variable.patch
nrpe-unused_variable.patch
nrpe-weird_output.patch
nrpe.8
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nagios-nrpe.spec ++++++
--- /var/tmp/diff_new_pack.fj8cvr/_old 2010-05-05 23:07:58.000000000 +0200
+++ /var/tmp/diff_new_pack.fj8cvr/_new 2010-05-05 23:07:58.000000000 +0200
@@ -17,35 +17,38 @@
# norootforbuild
-%define realname nrpe
-# to enable support for really long plugin-output (available since nagios v3)
-# set the macro below to 1.
-# Note: this change is incompatible to old versions, therefore disabled per
# default
%define nagios3only 0
# Macro that print mesages to syslog at package (un)install time
%define nnmmsg logger -t %{name}/rpm
%define nsusr nagios
%define nsgrp nagios
-%define cmdgrp nagcmd
%define nrpeport 5666
%define _libexecdir %{_prefix}/lib/nagios/plugins
Name: nagios-nrpe
Summary: Nagios Remote Plug-In Executor
Version: 2.12
-Release: 6
+Release: 7
License: GPLv2+
Group: System/Monitoring
Url: http://www.nagios.org/
-Source0: %realname-%version.tar.bz2
+Source0: nrpe-%version.tar.bz2
Source1: nrpe.init
Source2: nagios-nrpe-rpmlintrc
Source3: nagios-nrpe-SuSEfirewall2
+Source4: nrpe.8
Source10: README.SuSE
Patch0: nrpe-2.12-Makefile.patch
Patch1: nrpe-2.12-xinetd.patch
Patch2: nagios-nrpe-buffersize.patch
+Patch3: nrpe-more_random.patch
+Patch4: nrpe-improved_help.patch
+Patch5: nrpe-weird_output.patch
+Patch6: nrpe-drop_privileges_before_writing_pidfile.patch
+Patch7: nrpe-unused_variable.patch
+Patch8: nrpe-return_value.patch
+Patch9: nrpe-uninitialized_variable.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq %fillup_prereq
PreReq: coreutils grep pwdutils sed
@@ -74,7 +77,7 @@
%endif
#
Provides: %{name}-client = %{version}
-Obsoletes: %{name}-client <= %{version}
+Obsoletes: %{name}-client < %{version}
%description
NRPE can be used to run nagios plug-ins on a remote machine for
@@ -111,7 +114,7 @@
Recommends: nagios
%endif
Provides: %{name}-server = %{version}
-Obsoletes: %{name}-server <= %{version}
+Obsoletes: %{name}-server < %{version}
%description -n nagios-plugins-nrpe
This package contains the plug-in for the host runing the Nagios
@@ -131,12 +134,19 @@
Ethan Galstad
%prep
-%setup -n %realname-%version
+%setup -n nrpe-%version
%patch0 -p1
%patch1 -p1
%if %{nagios3only}
%patch2
%endif
+%patch3 -p0
+%patch4 -p0
+%patch5 -p0
+%patch6 -p0
+%patch7 -p0
+%patch8 -p0
+%patch9 -p0
%{__cp} -a %{S:10} .
%build
@@ -171,6 +181,7 @@
INIT_OPTS=""
%{__install} -d %buildroot/var/run/nagios
+%{__install} -Dm 644 %{S:4} %buildroot%_mandir/man8/nrpe.8
%{__install} -Dm 755 %{S:1} %buildroot%_sysconfdir/init.d/nrpe
%{__ln_s} -f ../../etc/init.d/nrpe %buildroot%_sbindir/rcnrpe
@@ -230,15 +241,16 @@
%files
%defattr(-,root,root)
%doc README.SuSE
-%dir %attr(775,%{nsusr},%{cmdgrp}) %_sysconfdir/nagios/
-%dir %attr(755,%{nsusr},%{nsgrp}) /var/run/nagios
-%config(noreplace) %attr(664,%{nsusr},%{cmdgrp}) %_sysconfdir/nagios/nrpe.cfg
+%_mandir/man8/nrpe.8*
+%dir %_sysconfdir/nagios/
+%config(noreplace) %_sysconfdir/nagios/nrpe.cfg
%config(noreplace) %_sysconfdir/xinetd.d/nrpe
%if 0%{?suse_version} > 1020
%config %_sysconfdir/sysconfig/SuSEfirewall2.d/services/nrpe-service
%endif
%_sysconfdir/init.d/nrpe
-%_sbindir/*nrpe
+%_sbindir/nrpe
+%_sbindir/rcnrpe
%ghost %dir /var/run/nrpe
%ghost /var/run/nrpe/nrpe.pid
++++++ nrpe-drop_privileges_before_writing_pidfile.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -297,13 +297,13 @@ int main(int argc, char **argv){
/* log info to syslog facility */
syslog(LOG_NOTICE,"Starting up daemon");
+ /* drop privileges */
+ drop_privileges(nrpe_user,nrpe_group);
+
/* write pid file */
if(write_pid_file()==ERROR)
return STATE_CRITICAL;
- /* drop privileges */
- drop_privileges(nrpe_user,nrpe_group);
-
/* make sure we're not root */
check_privileges();
++++++ nrpe-improved_help.patch ++++++
Index: src/check_nrpe.c
===================================================================
--- src/check_nrpe.c.orig
+++ src/check_nrpe.c
@@ -96,6 +96,9 @@ int main(int argc, char **argv){
printf(" [arglist] = Optional arguments that should be passed to the command. Multiple\n");
printf(" arguments should be separated by a space. If provided, this must be\n");
printf(" the last option supplied on the command line.\n");
+ printf(" -h, --help Print this short help.\n");
+ printf(" -l,--license Print licensing information.\n");
+ printf(" -n,--no-ssl Do not initial an ssl handshake with the server, talk in plaintext.\n");
printf("\n");
printf("Note:\n");
printf("This plugin requires that you have the NRPE daemon running on the remote host.\n");
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -138,14 +138,17 @@ int main(int argc, char **argv){
else if(result!=OK || show_help==TRUE){
- printf("Usage: nrpe [-n] -c <mode>\n");
+ printf("Usage: nrpe [-n] -c <mode> [--help] [--license] [--no-ssl]\n");
printf("\n");
printf("Options:\n");
printf(" -n = Do not use SSL\n");
printf(" = Name of config file to use\n");
printf(" <mode> = One of the following two operating modes:\n");
- printf(" -i = Run as a service under inetd or xinetd\n");
- printf(" -d = Run as a standalone daemon\n");
+ printf(" -i, --inetd Run as a service under inetd or xinetd\n");
+ printf(" -d, --daemon Run as a standalone daemon\n");
+ printf(" -h, --help = Print this short help.\n");
+ printf(" -l, --license = Print licensing information.\n");
+ printf(" -n, --no-ssl = Do not initial an ssl handshake with the server, talk in plaintext.\n");
printf("\n");
printf("Notes:\n");
printf("This program is designed to process requests from the check_nrpe\n");
++++++ nrpe-more_random.patch ++++++
Index: src/utils.c
===================================================================
--- src/utils.c.orig
+++ src/utils.c
@@ -90,17 +90,13 @@ void randomize_buffer(char *buffer,int b
ends and the rest of the buffer (padded randomly) starts.
***************************************************************/
- /* try to get seed value from /dev/urandom, as its a better source of entropy */
- fp=fopen("/dev/urandom","r");
- if(fp!=NULL){
- seed=fgetc(fp);
- fclose(fp);
- }
-
- /* else fallback to using the current time as the seed */
- else
- seed=(int)time(NULL);
-
+ /***************************************************************
+ The randomness, produced by the original version, is just
+ between 0 and 255. The randomness generated by the line below
+ produces more randomness and does not reduce the amount of
+ entropy that the linux kernel thinks it has.
+ ***************************************************************/
+ seed=(int)time(NULL)*311-getpid()*359+getppid()*383;
srand(seed);
for(x=0;x0){
/* write the output back to the parent process */
- write(fd[1],buffer,bytes_read);
+ if (write(fd[1],buffer,bytes_read) == -1){
+ fprintf(stderr,"Failed to write the output back to the parent process\n");
+ return STATE_CRITICAL;
+ }
}
/* close the command and get termination status */
@@ -1618,7 +1639,10 @@ int write_pid_file(void){
/* write new pid file */
if((fd=open(pid_file,O_WRONLY | O_CREAT,0644))>=0){
sprintf(pbuf,"%d\n",(int)getpid());
- write(fd,pbuf,strlen(pbuf));
+ if (write(fd,pbuf,strlen(pbuf)) == -1){
+ fprintf(stderr,"Failed to write new pid file\n");
+ return STATE_CRITICAL;
+ }
close(fd);
wrote_pid_file=TRUE;
}
++++++ nrpe-uninitialized_variable.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -724,6 +724,9 @@ void wait_for_connections(void){
struct request_info req;
#endif
+ /* default: failed */
+ new_sd=-1;
+
/* create a socket for listening */
sock=socket(AF_INET,SOCK_STREAM,0);
++++++ nrpe-unused_variable.patch ++++++
Index: src/utils.c
===================================================================
--- src/utils.c.orig
+++ src/utils.c
@@ -76,7 +76,6 @@ unsigned long calculate_crc32(char *buff
/* fill a buffer with semi-random data */
void randomize_buffer(char *buffer,int buffer_size){
- FILE *fp;
int x;
int seed;
++++++ nrpe-weird_output.patch ++++++
Index: src/nrpe.c
===================================================================
--- src/nrpe.c.orig
+++ src/nrpe.c
@@ -1166,6 +1166,9 @@ void handle_connection(int sock){
/* disable connection alarm - a new alarm will be setup during my_system */
alarm(0);
+ // null buffer before using it - Debian Patch by
+ memset(buffer,0,sizeof(buffer));
+
/* if this is the version check command, just spew it out */
if(!strcmp(command_name,NRPE_HELLO_COMMAND)){
++++++ nrpe.8 ++++++
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH NAGIOS-NRPE 8 "January 14, 2004"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
nrpe \- Nagios Remote Plugin Executor - Server
.SH SYNOPSIS
.B nagios-nrpe
\fI-c <mode>\fR
.SH DESCRIPTION
.PP
The purpose of this addon is to allow you to execute Nagios plugins on a
remote host in as transparent a manner as possible.
.PP
This program runs as a background process on the remote host and processes
command execution requests from the check_nrpe plugin on the Nagios host.
.SH OPTIONS
.IP
= Name of config file to use
.IP
<mode> = One of the following two operating modes:
.TP
\fB\-i\fR
= Run as a service under inetd or xinetd
.TP
\fB\-d\fR
= Run as a standalone daemon
.PP
Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
.SH AUTHOR
This manual page was written by Jason Thomas ,
for the Debian project (but may be used by others).
++++++ nrpe.init ++++++
--- /var/tmp/diff_new_pack.fj8cvr/_old 2010-05-05 23:07:58.000000000 +0200
+++ /var/tmp/diff_new_pack.fj8cvr/_new 2010-05-05 23:07:58.000000000 +0200
@@ -53,27 +53,30 @@
start)
# Start daemons.
echo -n "Starting Nagios NRPE "
- pid_file="$(get_value pid_file)"
- nrpe_group="$(get_value nrpe_group)"
- nrpe_user="$(get_value nrpe_user)"
- PIDDIR=$(dirname $pid_file)
- case "$PIDDIR" in
- /var/run)
- if [ x"$nrpe_user" != x"root" ]; then
- DATESTRING=`date +"%Y%m%d"`
- mv -f "$NRPE_CONFIG" "$NRPE_CONFIG-$DATESTRING"
- sed -e "s|^pid_file.*|pid_file=$DEFAULT_PIDFILE|g" "$NRPE_CONFIG-$DATESTRING" > "$NRPE_CONFIG"
- /bin/logger -t rcnrpe "Configured $pid_file in $NRPE_CONFIG moved to $DEFAULT_PIDFILE. Backup is $NRPE_CONFIG-$DATESTRING"
- test -f "$pid_file" && rm "$pid_file"
- install -d -m755 -o$nrpe_user -g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
- else
- test -d "$PIDDIR" || mkdir -p "$PIDDIR"
- fi
- ;;
- *)
- test -d $(dirname "$DEFAULT_PIDFILE") || install -d -m755 -o$nrpe_user -g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
- ;;
- esac
+ pid_file="$(get_value pid_file)"
+ nrpe_group="$(get_value nrpe_group)"
+ nrpe_user="$(get_value nrpe_user)"
+ : ${pid_file=:=$DEFAULT_PIDFILE}
+ : ${nrpe_group:=nagios}
+ : ${nrpe_user:=nagios}
+ PIDDIR=$(dirname $pid_file)
+ case "$PIDDIR" in
+ /var/run)
+ if [ x"$nrpe_user" != x"root" ]; then
+ DATESTRING=`date +"%Y%m%d"`
+ mv -f "$NRPE_CONFIG" "$NRPE_CONFIG-$DATESTRING"
+ sed -e "s|^pid_file.*|pid_file=$DEFAULT_PIDFILE|g" "$NRPE_CONFIG-$DATESTRING" > "$NRPE_CONFIG"
+ /bin/logger -t rcnrpe "Configured $pid_file in $NRPE_CONFIG moved to $DEFAULT_PIDFILE. Backup is $NRPE_CONFIG-$DATESTRING"
+ test -f "$pid_file" && rm "$pid_file"
+ install -d -m755 -o$nrpe_user -g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
+ else
+ test -d "$PIDDIR" || mkdir -p "$PIDDIR"
+ fi
+ ;;
+ *)
+ test -d $(dirname "$DEFAULT_PIDFILE") || install -d -m755 -o$nrpe_user -g$nrpe_group $(dirname "$DEFAULT_PIDFILE")
+ ;;
+ esac
/sbin/startproc $NRPE_BIN -c $NRPE_CONFIG -d
# Remember status and be verbose
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org