update to Nagios 3.2.0

This commit is contained in:
sturm 2009-09-12 12:35:20 +00:00
parent ee595d2ae5
commit e37a40eaea
11 changed files with 68 additions and 132 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.36 2009/08/07 17:18:34 sthen Exp $
# $OpenBSD: Makefile,v 1.37 2009/09/12 12:35:20 sturm Exp $
COMMENT-main= host and service monitor
COMMENT-web= cgis and webpages for nagios
V= 3.0.6
V= 3.2.0
DISTNAME= nagios-${V}
PKGNAME-main= nagios-${V}p1
PKGNAME-web= nagios-web-${V}p0
PKGNAME-main= nagios-${V}
PKGNAME-web= nagios-web-${V}
CATEGORIES= net
HOMEPAGE= http://www.nagios.org/
@ -23,12 +23,10 @@ MULTI_PACKAGES= -main -web
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nagios/}
MODULES= devel/gettext
BUILD_DEPENDS= :gd-*:graphics/gd
LIB_DEPENDS= glib-2.0::devel/glib2 \
ltdl.>=4::devel/libtool,-ltdl
RUN_DEPENDS= :nagios-plugins-*:net/nagios/plugins
LIB_DEPENDS= ltdl.>=4::devel/libtool,-ltdl
RUN_DEPENDS= :nagios-plugins-*:net/nagios/plugins \
::www/php5/core
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS+=--datadir=/var/www/nagios \
@ -67,11 +65,8 @@ WANTLIB-web=
LIB_DEPENDS-web=
RUN_DEPENDS-web=:nagios-${V}-chroot:net/nagios/nagios,chroot
.else
WANTLIB-web= ${WANTLIB} fontconfig freetype jpeg z
LIB_DEPENDS-web=${MODGETTEXT_LIB_DEPENDS} \
glib-2.0::devel/glib2 \
gd::graphics/gd \
png::graphics/png
WANTLIB-web= ${WANTLIB} fontconfig freetype jpeg png z
LIB_DEPENDS-web=gd::graphics/gd
RUN_DEPENDS-web=:nagios-${V}-!chroot:net/nagios/nagios
.endif
@ -81,7 +76,7 @@ NO_REGRESS= Yes
CFLAGS+= -D_DIRENT_HAVE_D_TYPE
CONFIG_FILES0= cgi.cfg httpd.conf nagios.cfg resource.cfg
CONFIG_FILES0= cgi.cfg httpd.conf mrtg.cfg nagios.cfg resource.cfg
CONFIG_FILES1= commands.cfg contacts.cfg localhost.cfg printer.cfg switch.cfg \
templates.cfg timeperiods.cfg windows.cfg
EXDIR= ${PREFIX}/share/examples/nagios

View File

@ -1,5 +1,5 @@
MD5 (nagios-3.0.6.tar.gz) = kA4/QWT0sqGEhUIO6u/oEg==
RMD160 (nagios-3.0.6.tar.gz) = HCsCa03FCV8kGdI5BCt1IA2xuV8=
SHA1 (nagios-3.0.6.tar.gz) = 1r0gzcItK5Mfmtf5yzP/cdLLfXE=
SHA256 (nagios-3.0.6.tar.gz) = vt6ywf+/dSXsGayEpmutYKGdKwVEy/BQpTv8NjwJuyI=
SIZE (nagios-3.0.6.tar.gz) = 2735504
MD5 (nagios-3.2.0.tar.gz) = NWYWfMYN3qrTTn0uJu1KWA==
RMD160 (nagios-3.2.0.tar.gz) = IXfl68fKXM7nukBHKOiW0QBjsng=
SHA1 (nagios-3.2.0.tar.gz) = Bwqjz6lmUZAEjThvRxzU03dID5k=
SHA256 (nagios-3.2.0.tar.gz) = fL81ugMZ8k+ghZgsA4Q3xFFQA7J4Y8SJfchrGXpQpec=
SIZE (nagios-3.2.0.tar.gz) = 3170967

View File

@ -1,12 +1,11 @@
$OpenBSD: chroot-cgi_Makefile_in,v 1.2 2008/03/18 20:25:11 sturm Exp $
--- cgi/Makefile.in.orig Mon Jan 24 12:31:08 2005
+++ cgi/Makefile.in Mon Jan 24 12:31:39 2005
@@ -36,7 +36,7 @@ CFLAGS=@CFLAGS@ @DEFS@ -DNSCGI
--- cgi/Makefile.in.orig Thu Sep 10 07:17:08 2009
+++ cgi/Makefile.in Thu Sep 10 07:17:33 2009
@@ -36,7 +36,7 @@
#CFLAGS_DEBUG=-ggdb3 -g3
#CFLAGS+=$(CFLAGS_WARN) $(CFLAGS_DEBUG)
-LDFLAGS=@LDFLAGS@
+LDFLAGS=-static @LDFLAGS@
LIBS=@LIBS@ @GLIB_LIBS@
LIBS=@LIBS@
CGIS=avail.cgi cmd.cgi config.cgi extinfo.cgi history.cgi notifications.cgi outages.cgi showlog.cgi status.cgi statuswml.cgi summary.cgi tac.cgi $(CGIEXTRAS)

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-base_utils_c,v 1.6 2009/01/10 16:16:21 henning Exp $
--- base/utils.c.orig Sun Nov 30 18:22:58 2008
+++ base/utils.c Sat Jan 10 17:14:26 2009
@@ -610,8 +610,16 @@ int my_system(char *cmd,int timeout,int *early_timeout
/* handle errors */
if(bytes_read==-1){
/* we encountered a recoverable error, so try again */
- if(errno==EINTR || errno==EAGAIN)
+ if(errno==EINTR)
continue;
+ else if (errno == EAGAIN) {
+ struct pollfd pfd;
+
+ pfd.fd = fd[0];
+ pfd.events = POLLIN;
+ poll(&pfd, 1, -1);
+ continue;
+ }
else
break;
}

View File

@ -1,55 +0,0 @@
$OpenBSD: patch-cgi_statuswml_c,v 1.2 2009/08/07 17:18:34 sthen Exp $
Fix CVE-2009-2288.
--- cgi/statuswml.c.orig Sun Nov 30 18:13:11 2008
+++ cgi/statuswml.c Fri Aug 7 15:15:10 2009
@@ -67,6 +67,8 @@ extern char *ping_syntax;
void document_header(void);
void document_footer(void);
int process_cgivars(void);
+int validate_arguments(void);
+int is_valid_hostip(char *hostip);
int display_type=DISPLAY_INDEX;
int hostgroup_style=DISPLAY_HOSTGROUP_SUMMARY;
@@ -108,6 +110,13 @@ int main(void){
document_header();
+ /* validate arguments in URL */
+ result=validate_arguments();
+ if(result==ERROR){
+ document_footer();
+ return ERROR;
+ }
+
/* read the CGI configuration file */
result=read_cgi_config_file(get_cgi_config_location());
if(result==ERROR){
@@ -334,7 +343,25 @@ int process_cgivars(void){
return error;
}
+int validate_arguments(void){
+ int result=OK;
+ if((strcmp(ping_address,"")) && !is_valid_hostip(ping_address)) {
+ printf("<p>Invalid host name/ip</p>\n");
+ result=ERROR;
+ }
+ if(strcmp(traceroute_address,"") && !is_valid_hostip(traceroute_address)){
+ printf("<p>Invalid host name/ip</p>\n");
+ result=ERROR;
+ }
+ return result;
+ }
+int is_valid_hostip(char *hostip) {
+ char *valid_domain_chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-";
+ if(strcmp(hostip,"") && strlen(hostip)==strspn(hostip,valid_domain_chars) && hostip[0] != '-' && hostip[strlen(hostip)-1] != '-')
+ return TRUE;
+ return FALSE;
+ }
/* main intro screen */
void display_index(void){

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
--- configure.orig Tue Apr 1 21:32:03 2008
+++ configure Thu Apr 17 11:11:02 2008
@@ -571,7 +571,7 @@ do
$OpenBSD: patch-configure,v 1.10 2009/09/12 12:35:20 sturm Exp $
--- configure.orig Wed Aug 12 20:28:10 2009
+++ configure Thu Sep 10 07:13:52 2009
@@ -572,7 +572,7 @@ do
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
@ -10,7 +10,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
@@ -4872,13 +4872,13 @@ if test $ac_cv_lib_cma_pthread_create = yes; then
@@ -4875,13 +4875,13 @@ if test $ac_cv_lib_cma_pthread_create = yes; then
have_pthreads="yes"
fi
@ -27,7 +27,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4937,19 +4937,19 @@ fi
@@ -4940,19 +4940,19 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
if test $ac_cv_lib_pthread_pthread_create = yes; then
@ -51,7 +51,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -5008,7 +5008,7 @@ fi
@@ -5011,7 +5011,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6
if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
@ -60,7 +60,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
fi
if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
@@ -5398,7 +5398,7 @@ cat >>confdefs.h <<_ACEOF
@@ -5401,7 +5401,7 @@ cat >>confdefs.h <<_ACEOF
#define DEFAULT_NAGIOS_GROUP "$nagios_grp"
_ACEOF
@ -69,7 +69,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
@@ -5772,7 +5772,7 @@ echo $ECHO_N "checking for gdImagePng in -lgd (order 1
@@ -5775,7 +5775,7 @@ echo $ECHO_N "checking for gdImagePng in -lgd (order 1
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_save_LIBS="$LIBS"
@ -78,7 +78,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -5831,7 +5831,7 @@ fi
@@ -5834,7 +5834,7 @@ fi
echo "${ECHO_T}yes" >&6
GDLIBFOUND=yep
@ -87,7 +87,7 @@ $OpenBSD: patch-configure,v 1.9 2008/04/18 11:08:47 sturm Exp $
else
echo "$as_me:$LINENO: result: no" >&5
@@ -6782,9 +6782,9 @@ echo $ECHO_N "checking for linker flags for loadable m
@@ -6841,9 +6841,9 @@ echo $ECHO_N "checking for linker flags for loadable m
MOD_LDFLAGS="-shared"
MOD_CFLAGS="-fPIC"
;;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-html_Makefile_in,v 1.5 2008/11/09 10:18:56 sturm Exp $
--- html/Makefile.in.orig Wed Jan 9 18:51:25 2008
+++ html/Makefile.in Sat Mar 15 19:53:53 2008
@@ -33,39 +33,39 @@ distclean: clean
$OpenBSD: patch-html_Makefile_in,v 1.6 2009/09/12 12:35:20 sturm Exp $
--- html/Makefile.in.orig Wed Jul 8 00:34:51 2009
+++ html/Makefile.in Thu Sep 10 07:15:44 2009
@@ -33,46 +33,46 @@ distclean: clean
devclean: distclean
install:
@ -13,21 +13,27 @@ $OpenBSD: patch-html_Makefile_in,v 1.5 2008/11/09 10:18:56 sturm Exp $
- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTMLDIR)/docs/images
- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTMLDIR)/images
- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTMLDIR)/images/logos
- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTMLDIR)/includes
- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(HTMLDIR)/ssi
- $(INSTALL) -m 664 $(INSTALL_OPTS) robots.txt $(DESTDIR)$(HTMLDIR)
- $(INSTALL) -m 664 $(INSTALL_OPTS) docs/robots.txt $(DESTDIR)$(HTMLDIR)/docs
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)
+# $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/media
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/media
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/stylesheets
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/contexthelp
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/docs
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/docs/images
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/images
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/images/logos
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/includes
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(HTMLDIR)/ssi
+ $(BSD_INSTALL_DATA) robots.txt $(DESTDIR)$(HTMLDIR)
+ $(BSD_INSTALL_DATA) docs/robots.txt $(DESTDIR)$(HTMLDIR)/docs
for file in *.html; \
# Remove old HTML files (PHP files are used now)
rm -f $(DESTDIR)$(HTMLDIR)/index.html
rm -f $(DESTDIR)$(HTMLDIR)/main.html
rm -f $(DESTDIR)$(HTMLDIR)/side.html
for file in *.php; \
- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR); done
+ do $(BSD_INSTALL_DATA) $$file $(DESTDIR)$(HTMLDIR); done
# for file in media/*.wav; \
@ -60,6 +66,9 @@ $OpenBSD: patch-html_Makefile_in,v 1.5 2008/11/09 10:18:56 sturm Exp $
for file in images/logos/*.*; \
- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR)/images/logos; done
+ do $(BSD_INSTALL_DATA) $$file $(DESTDIR)$(HTMLDIR)/images/logos; done
for file in includes/*.*; \
- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(HTMLDIR)/includes; done
+ do $(BSD_INSTALL_DATA) $$file $(DESTDIR)$(HTMLDIR)/includes; done
install-unstripped:
$(MAKE) install

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-include_config_h_in,v 1.5 2008/11/09 10:18:56 sturm Exp $
--- include/config.h.in.orig Sun Nov 2 11:51:30 2008
+++ include/config.h.in Sun Nov 9 02:12:21 2008
$OpenBSD: patch-include_config_h_in,v 1.6 2009/09/12 12:35:20 sturm Exp $
--- include/config.h.in.orig Wed Jul 8 00:19:45 2009
+++ include/config.h.in Thu Sep 10 07:13:52 2009
@@ -124,11 +124,6 @@
#endif
#endif
@ -13,7 +13,7 @@ $OpenBSD: patch-include_config_h_in,v 1.5 2008/11/09 10:18:56 sturm Exp $
#undef HAVE_LIMITS_H
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -217,6 +212,11 @@
@@ -207,6 +202,11 @@
#undef HAVE_SYS_TIMEB_H
#if HAVE_SYS_TIMEB_H
#include <sys/timeb.h>

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-sample-config_cgi_cfg_in,v 1.4 2008/12/24 20:03:42 sturm Exp $
--- sample-config/cgi.cfg.in.orig Sun Nov 30 19:13:11 2008
+++ sample-config/cgi.cfg.in Wed Dec 24 20:54:08 2008
@@ -240,7 +240,7 @@ default_statuswrl_layout=4
$OpenBSD: patch-sample-config_cgi_cfg_in,v 1.5 2009/09/12 12:35:20 sturm Exp $
--- sample-config/cgi.cfg.in.orig Wed Jun 17 17:13:52 2009
+++ sample-config/cgi.cfg.in Thu Sep 10 07:13:52 2009
@@ -264,7 +264,7 @@ default_statuswrl_layout=4
# OS and distribution, so you may have to tweak this to
# work on your system.

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.6 2008/11/09 10:18:56 sturm Exp $
@comment $OpenBSD: PLIST-main,v 1.7 2009/09/12 12:35:20 sturm Exp $
@pkgpath ${BASE_PKGPATH}
@newgroup _nagios:550
@newuser _nagios:550:_nagios:daemon:Nagios user:/var/www/nagios:/sbin/nologin
@ -9,6 +9,7 @@ share/examples/nagios/
share/examples/nagios/cgi.cfg
@sample ${CHROOT}${SYSCONFDIR}/nagios/cgi.cfg
share/examples/nagios/httpd.conf
share/examples/nagios/mrtg.cfg
share/examples/nagios/nagios.cfg
@sample ${CHROOT}${SYSCONFDIR}/nagios/nagios.cfg
share/examples/nagios/objects/

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-web,v 1.4 2008/11/09 10:18:56 sturm Exp $
@comment $OpenBSD: PLIST-web,v 1.5 2009/09/12 12:35:20 sturm Exp $
cgi-bin/nagios/
@bin cgi-bin/nagios/avail.cgi
@bin cgi-bin/nagios/cmd.cgi
@ -16,6 +16,7 @@ cgi-bin/nagios/
@bin cgi-bin/nagios/summary.cgi
@bin cgi-bin/nagios/tac.cgi
@bin cgi-bin/nagios/trends.cgi
nagios/config.inc.php
nagios/contexthelp/
nagios/contexthelp/A1.html
nagios/contexthelp/A2.html
@ -177,6 +178,8 @@ nagios/docs/images/mrtg-servicestatechange.png
nagios/docs/images/multiple-templates1.png
nagios/docs/images/multiple-templates2.png
nagios/docs/images/nagios.jpg
nagios/docs/images/nagiosexchange.png
nagios/docs/images/nagiossupport.png
nagios/docs/images/ndoutils.png
nagios/docs/images/network-outage1.png
nagios/docs/images/network-outage2.png
@ -220,6 +223,7 @@ nagios/docs/index.html
nagios/docs/int-snmptrap.html
nagios/docs/int-tcpwrappers.html
nagios/docs/integration.html
nagios/docs/knownissues.html
nagios/docs/largeinstalltweaks.html
nagios/docs/macrolist.html
nagios/docs/macros.html
@ -306,8 +310,9 @@ nagios/images/redudancy.png
nagios/images/redundancy.png
nagios/images/restart.gif
nagios/images/right.gif
nagios/images/sblogo.jpg
nagios/images/sblogo.png
nagios/images/serviceevent.gif
nagios/images/sflogo.png
nagios/images/splunk1.gif
nagios/images/splunk2.gif
nagios/images/start.gif
@ -332,10 +337,13 @@ nagios/images/warning.png
nagios/images/weblogo1.png
nagios/images/zoom1.gif
nagios/images/zoom2.gif
nagios/index.html
nagios/main.html
nagios/includes/
nagios/includes/utils.inc.php
nagios/index.php
nagios/main.php
nagios/media/
nagios/robots.txt
nagios/side.html
nagios/side.php
nagios/ssi/
nagios/stylesheets/
nagios/stylesheets/avail.css