View | Details | Raw Unified | Return to bug 195015 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-8 / +9 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	pnp
4
PORTNAME=	pnp
5
PORTVERSION=	0.6.21
5
PORTVERSION=	0.6.24
6
CATEGORIES=	net-mgmt
6
CATEGORIES=	net-mgmt
7
MASTER_SITES=	SF
7
MASTER_SITES=	SF
8
MASTER_SITE_SUBDIR=pnp4nagios/PNP-0.6
8
MASTER_SITE_SUBDIR=pnp4nagios/PNP-0.6
Lines 41-47 Link Here
41
PNP_SPOOL=	${PNP_STATE}/perfspool
41
PNP_SPOOL=	${PNP_STATE}/perfspool
42
PNP_URL?=	${NAGIOSHTMURL}/pnp
42
PNP_URL?=	${NAGIOSHTMURL}/pnp
43
FPDF_DIR?=	share/fpdf
43
FPDF_DIR?=	share/fpdf
44
SPOOL_DIRS=	${PNP_STATE}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_RRDS}:${NAGIOSUSER}:${NAGIOSGROUP}:0750%${PNP_SPOOL}:${NAGIOSUSER}:${NAGIOSGROUP}:0750
45
44
46
.if ! ${PORT_OPTIONS:MPDF}
45
.if ! ${PORT_OPTIONS:MPDF}
47
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-disable-pdf
46
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-disable-pdf
Lines 64-75 Link Here
64
MAKE_ARGS=	INSTALL_OPTS=
63
MAKE_ARGS=	INSTALL_OPTS=
65
INSTALL_TARGET=	install install-config
64
INSTALL_TARGET=	install install-config
66
65
67
PLIST_SUB+=	NAGIOSDIR=${NAGIOSDIR}
66
PLIST_SUB+=	NAGIOSDIR=${NAGIOSDIR} \
68
SUB_FILES=	pkg-install \
67
		NAGIOSUSER=${NAGIOSUSER} \
69
		pkg-deinstall \
68
		NAGIOSGROUP=${NAGIOSGROUP} \
70
		pkg-message
69
		WWWOWN=${WWWOWN} \
71
SUB_LIST=	SPOOL_DIRS=${SPOOL_DIRS} \
70
		WWWGRP=${WWWGRP}
72
		PNP_RRDS=${PNP_RRDS} \
71
72
SUB_FILES=	pkg-message
73
SUB_LIST=	PNP_RRDS=${PNP_RRDS} \
73
		PNP_URL=${PNP_URL} \
74
		PNP_URL=${PNP_URL} \
74
		NAGIOSUSER=${NAGIOSUSER} \
75
		NAGIOSUSER=${NAGIOSUSER} \
75
		NAGIOSGROUP=${NAGIOSGROUP}
76
		NAGIOSGROUP=${NAGIOSGROUP}
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (pnp4nagios-0.6.21.tar.gz) = bb5d36a7cc49dcbcfcb424d437dc3739baa647816cffc610fb621216c4f5992a
1
SHA256 (pnp4nagios-0.6.24.tar.gz) = 87412ef01257c6096aa5c84fdb47db950b851c596e1306180be8ba45401793cf
2
SIZE (pnp4nagios-0.6.21.tar.gz) = 2917588
2
SIZE (pnp4nagios-0.6.24.tar.gz) = 2919182
(-)files/patch-sample-config__Makefile.in (-3 / +3 lines)
Lines 1-6 Link Here
1
--- ./sample-config/Makefile.in.orig	2013-03-24 17:25:56.000000000 +0100
1
--- sample-config/Makefile.in.orig	2014-07-30 10:32:23 UTC
2
+++ ./sample-config/Makefile.in	2014-05-02 09:00:07.000000000 +0200
2
+++ sample-config/Makefile.in
3
@@ -40,35 +40,18 @@
3
@@ -40,35 +40,18 @@ install:
4
 	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands
4
 	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands
5
 	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages
5
 	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages
6
 	$(INSTALL) -m 644 $(INSTALL_OPTS)  pnp/pnp4nagios_release $(DESTDIR)$(SYSCONFDIR)
6
 	$(INSTALL) -m 644 $(INSTALL_OPTS)  pnp/pnp4nagios_release $(DESTDIR)$(SYSCONFDIR)
(-)files/patch-share_pnp_application_controllers_graph.php (+11 lines)
Line 0 Link Here
1
--- share/pnp/application/controllers/graph.php.orig	2014-12-07 16:03:24 UTC
2
+++ share/pnp/application/controllers/graph.php
3
@@ -48,7 +48,7 @@ class Graph_Controller extends System_Co
4
         if($this->host != "" && $this->service != ""){
5
             $this->service = pnp::clean($this->service);
6
             $this->host    = pnp::clean($this->host);
7
-            $this->url     = "?host=".$this->host."&srv=".$this->service;
8
+            $this->url     = "?host=".urlencode($this->host)."&srv=".urlencode($this->service);
9
             $services      = $this->data->getServices($this->host);
10
             #Landingpage for mobile devices
11
             if($this->isMobileDevice()){
(-)files/patch-share_pnp_application_controllers_system.php (+19 lines)
Line 0 Link Here
1
--- share/pnp/application/controllers/system.php.orig	2014-12-07 16:04:45 UTC
2
+++ share/pnp/application/controllers/system.php
3
@@ -23,13 +23,13 @@ class System_Controller extends Template
4
         // Check for mod_rewrite
5
         $this->check_mod_rewrite();
6
 
7
-        $this->start             = pnp::clean($this->input->get('start',FALSE));
8
-        $this->end               = pnp::clean($this->input->get('end',FALSE));
9
+        $this->start             = $this->input->get('start',FALSE);
10
+        $this->end               = $this->input->get('end',FALSE);
11
         $this->theme             = pnp::clean($this->input->get('theme',FALSE));
12
         $this->view              = pnp::clean($this->input->get('view', ""));
13
         $this->host              = pnp::clean($this->input->get('host',NULL));
14
         $this->service           = pnp::clean($this->input->get('srv',NULL));
15
-        $this->source            = pnp::clean($this->input->get('source',0));
16
+        $this->source            = pnp::clean($this->input->get('source',NULL));
17
         $this->version           = pnp::clean($this->input->get('version',NULL));
18
         $this->tpl               = pnp::clean($this->input->get('tpl'));
19
         $this->controller        = Router::$controller;
(-)files/patch-share_pnp_application_controllers_zoom.php (+11 lines)
Line 0 Link Here
1
--- share/pnp/application/controllers/zoom.php.orig	2014-12-07 16:06:09 UTC
2
+++ share/pnp/application/controllers/zoom.php
3
@@ -70,7 +70,7 @@ class Zoom_Controller extends System_Con
4
             $this->template->source  = $this->source;
5
             $this->template->end     = $this->end;
6
             $this->template->start   = $this->start;
7
-            $this->url               = "?host=".$this->host."&srv=".$this->service;
8
+            $this->url               = "?host=".urlencode($this->host)."&srv=".urlencode($this->service);
9
             $this->template->graph_height = $this->graph_height;
10
             $this->template->graph_width  = $this->graph_width;
11
         }else{
(-)files/patch-share_pnp_application_helpers_pnp.php (+11 lines)
Line 0 Link Here
1
--- share/pnp/application/helpers/pnp.php.orig	2014-12-07 16:06:39 UTC
2
+++ share/pnp/application/helpers/pnp.php
3
@@ -44,6 +44,8 @@ class pnp_Core {
4
     *
5
     */
6
     public static function zoom_icon($host,$service,$start,$end,$source,$view,$graph_width,$graph_height){
7
+        $service = urlencode(urlencode($service));
8
+        $host = urlencode(urlencode($host));
9
         print "<a href=\"javascript:Gzoom('".url::base(TRUE)."zoom?host=$host&srv=$service&view=$view&source=$source&end=$end&start=$start&graph_width=$graph_width&graph_height=$graph_height');\" title=\"Zoom into the Graph\"><img src=\"".url::base()."media/images/zoom.png\"></a>\n";
10
     }
11
 
(-)files/patch-share_pnp_application_models_data.php (+11 lines)
Line 0 Link Here
1
--- share/pnp/application/models/data.php.orig	2014-12-07 16:07:13 UTC
2
+++ share/pnp/application/models/data.php
3
@@ -661,7 +661,7 @@ class Data_Model extends System_Model
4
             if(!is_numeric($end)){
5
                 $timestamp = strtotime($end);
6
                 if(!$timestamp){
7
-                    throw new Kohana_User_Exception('Wrong Format', "$end");
8
+                    throw new Kohana_User_Exception('Wrong Format', "End -> $end");
9
                 }else{
10
                     $end = $timestamp;
11
                 }
(-)files/patch-share_pnp_application_views_zoom.php (+10 lines)
Line 0 Link Here
1
--- share/pnp/application/views/zoom.php.orig	2014-12-07 16:07:48 UTC
2
+++ share/pnp/application/views/zoom.php
3
@@ -57,6 +57,7 @@ jQuery.noConflict();
4
 <div style="position:relative;">
5
 <?php 
6
 echo "<div start=$start end=$end style=\"width:".$graph_width."px; height:".$graph_height."px; position:absolute; top:33px\" class=\"graph\" id=\"".$this->url."\" ></div>";
7
+$srv = urlencode($srv);
8
 if(!empty($tpl)){
9
     echo "<img class=\"graph\" src=\"image?source=$source"
10
 	."&tpl=$tpl"
(-)files/patch-share_pnp_templates.dist_check__mssql__health.php (+11 lines)
Line 0 Link Here
1
--- share/pnp/templates.dist/check_mssql_health.php.orig	2014-12-07 16:08:37 UTC
2
+++ share/pnp/templates.dist/check_mssql_health.php
3
@@ -72,7 +72,7 @@ foreach ($this->DS as $KEY=>$VAL) {
4
         $def[$defcnt] .= rrd::area("ag","#$green");
5
         $def[$defcnt] .= rrd::area("ay","#$yellow");
6
         $def[$defcnt] .= rrd::area("ar","#$red");
7
-        $def[$defcnt] .= rrd::line1("fullscans","#000000", "Full table sacns");
8
+        $def[$defcnt] .= rrd::line1("fullscans","#000000", "Full table scans");
9
         $def[$defcnt] .= rrd::gprint("fullscans",array("MAX", "AVERAGE", "LAST"),"%3.2lf");
10
         $defcnt++;
11
     }
(-)files/pkg-deinstall.in (-57 lines)
Lines 1-57 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
6
SPOOL_DIRS=%%SPOOL_DIRS%%
7
NAGIOSUSER=%%NAGIOSUSER%%
8
NAGIOSGROUP=%%NAGIOSGROUP%%
9
10
dirs () {
11
	local kept spool_dirs_rev
12
13
	IFS=%
14
	for i in $SPOOL_DIRS; do
15
		if [ -z "$spool_dirs_rev" ]; then
16
			spool_dirs_rev="$i"
17
		else
18
			spool_dirs_rev="$i$IFS$spool_dirs_rev"
19
		fi
20
	done
21
	for i in $spool_dirs_rev; do
22
		d="${i%%:*}"
23
		if ! [ -d "$d" ]; then
24
			continue
25
		fi
26
		gom_std="${i#*:}"
27
		go_cur=`stat -f %Su:%Sg "$d"`
28
		m_cur=`stat -f %Op "$d" | sed -e's/^.*\(....\)$/\1/'`
29
		if [ "$gom_std" != "$go_cur:$m_cur" ]; then
30
			kept="$kept $d"
31
			continue
32
		fi
33
		if ! rmdir "$d" > /dev/null 2>&1; then
34
			kept="$kept $d"
35
			continue
36
		fi
37
	done
38
39
	if [ -n "$kept" ]; then
40
		echo
41
		cat << EOF
42
The following directories were not removed, because they are either
43
have non-default permissions or not empty:
44
EOF
45
		IFS=" "
46
		for i in $kept; do
47
			echo "  $i"
48
		done
49
		echo
50
		echo "Unless you're upgrading, remove them manually."
51
		echo
52
	fi
53
}
54
55
if [ "x$2" = "xPOST-DEINSTALL" ]; then
56
	dirs
57
fi
(-)files/pkg-install.in (-73 lines)
Lines 1-73 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
6
SPOOL_DIRS=%%SPOOL_DIRS%%
7
NAGIOSUSER=%%NAGIOSUSER%%
8
NAGIOSGROUP=%%NAGIOSGROUP%%
9
10
# Create directories with mode and ownership specified in SPOOL_DIRS
11
# as strings separated by '%' of format DIR:OWNER:GROUP:MODE
12
dirs () {
13
	IFS=%
14
	for i in $SPOOL_DIRS; do
15
		d="${i%%:*}"
16
		if ! [ -d "$d" ]; then
17
			go=`echo "$i" | cut -f 2-3 -d :`
18
			m="${i##*:}"
19
			mkdir -p "$d"
20
			chown "$go" "$d"
21
			chmod "$m" "$d"
22
		fi
23
	done
24
}
25
26
check_sanity () {
27
	if ! pw group show "$NAGIOSGROUP" 2>&1 > /dev/null; then
28
		echo "No group '$NAGIOSGROUP'.  Create it and try again."
29
		exit 1
30
	fi
31
	if ! pw user show "$NAGIOSUSER" 2>&1 > /dev/null; then
32
		echo "No user '$NAGIOSUSER'.  Create it and try again."
33
		exit 1
34
	fi
35
}
36
37
# I messed the proper way to create the configuration for PNP:
38
# config_local.php should be used for overrides and config.php
39
# will come modified at each upgrade.
40
#
41
# I was installing config.php as config.php-sample and hoping
42
# that people will use it as the base for original config.php.
43
#
44
# So, if we now have config.php at the installtion phase, then
45
# it means that config.php may be customized.  We save it as
46
# config.php.orig and informing the user about it.
47
fixup_config_local () {
48
	if [ -e "%%ETCDIR%%"/config.php ]; then
49
		cp "%%ETCDIR%%"/config.php "%%ETCDIR%%"/config.php.orig
50
		cat << "EOF"
51
======================================================================
52
WARNING:
53
54
You have config.php for PNP; this means that you are probably
55
upgrading from an old port version, where config.php-sample was
56
installed instead of config.php and it was meant that you will
57
cope with config.php yourself.
58
59
PNP's way to do the things is to let config.php be overwritten at each
60
upgrade and local overrides to it should go to config_local.php.
61
62
Your existing config.php was saved as config.php.orig, please, review
63
your modifications and put them to config_local.php.
64
======================================================================
65
EOF
66
	fi
67
}
68
69
if [ "x$2" = "xPRE-INSTALL" ]; then
70
	check_sanity
71
	dirs
72
	fixup_config_local
73
fi
(-)pkg-plist (-78 / +17 lines)
Lines 346-351 Link Here
346
%%WWWDIR%%/application/views/graph.php
346
%%WWWDIR%%/application/views/graph.php
347
%%WWWDIR%%/application/views/graph_content.php
347
%%WWWDIR%%/application/views/graph_content.php
348
%%WWWDIR%%/application/views/graph_content_special.php
348
%%WWWDIR%%/application/views/graph_content_special.php
349
%%WWWDIR%%/application/views/graph_tiny.php
349
%%WWWDIR%%/application/views/header.php
350
%%WWWDIR%%/application/views/header.php
350
%%WWWDIR%%/application/views/host_box.php
351
%%WWWDIR%%/application/views/host_box.php
351
%%WWWDIR%%/application/views/icon_box.php
352
%%WWWDIR%%/application/views/icon_box.php
Lines 655-735 Link Here
655
%%WWWDIR%%/templates.special/advanced_loop.php-sample
656
%%WWWDIR%%/templates.special/advanced_loop.php-sample
656
%%WWWDIR%%/templates.special/loop.php-sample
657
%%WWWDIR%%/templates.special/loop.php-sample
657
%%WWWDIR%%/templates.special/static.php-sample
658
%%WWWDIR%%/templates.special/static.php-sample
658
@dirrmtry %%ETCDIR%%/check_commands
659
@dir %%ETCDIR%%/check_commands
659
@dirrmtry %%ETCDIR%%/config.d
660
@dir %%ETCDIR%%/config.d
660
@dirrmtry %%ETCDIR%%/pages
661
@dir %%ETCDIR%%/pages
661
@dirrmtry %%ETCDIR%%
662
@dir %%ETCDIR%%
662
@dirrm lib/kohana/system/config
663
@dir(%%WWWOWN%%,%%WWWGRP%%,755) %%WWWDIR%%/application/cache
663
@dirrm lib/kohana/system/controllers
664
@dir(%%WWWOWN%%,%%WWWGRP%%,755) %%WWWDIR%%/application/config
664
@dirrm lib/kohana/system/core/utf8
665
@dir(%%WWWOWN%%,%%WWWGRP%%,755) %%WWWDIR%%/application/hooks
665
@dirrm lib/kohana/system/core
666
@dir %%WWWDIR%%/templates
666
@dirrm lib/kohana/system/fonts
667
@dir %%WWWDIR%%/templates.special
667
@dirrm lib/kohana/system/helpers
668
@dir %%WWWDIR%%
668
@dirrm lib/kohana/system/i18n/de_DE
669
@dir(%%WWWOWN%%,%%WWWGRP%%,0755) /var/log/kohana
669
@dirrm lib/kohana/system/i18n/en_US
670
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,0750) /var/log/stats
670
@dirrm lib/kohana/system/i18n/es_ES
671
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,0750) %%NAGIOSDIR%%/pnp/perfspool
671
@dirrm lib/kohana/system/i18n/fr_FR
672
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,0775) %%NAGIOSDIR%%/pnp/rrd
672
@dirrm lib/kohana/system/i18n/it_IT
673
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,0775) %%NAGIOSDIR%%/pnp
673
@dirrm lib/kohana/system/i18n/nl_NL
674
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,0775) %%NAGIOSDIR%%
674
@dirrm lib/kohana/system/i18n/ru_RU
675
@dirrm lib/kohana/system/i18n
676
@dirrm lib/kohana/system/libraries/drivers/Cache
677
@dirrm lib/kohana/system/libraries/drivers/Captcha
678
@dirrm lib/kohana/system/libraries/drivers/Database
679
@dirrm lib/kohana/system/libraries/drivers/Image
680
@dirrm lib/kohana/system/libraries/drivers/Session
681
@dirrm lib/kohana/system/libraries/drivers
682
@dirrm lib/kohana/system/libraries
683
@dirrm lib/kohana/system/views/kohana
684
@dirrm lib/kohana/system/views/pagination
685
@dirrm lib/kohana/system/views
686
@dirrm lib/kohana/system
687
@dirrm lib/kohana
688
@dirrm %%WWWDIR%%/application/cache
689
@dirrm %%WWWDIR%%/application/config
690
@dirrm %%WWWDIR%%/application/controllers
691
@dirrm %%WWWDIR%%/application/helpers
692
@dirrm %%WWWDIR%%/application/hooks
693
@dirrm %%WWWDIR%%/application/i18n/de_DE
694
@dirrm %%WWWDIR%%/application/i18n/en_US
695
@dirrm %%WWWDIR%%/application/i18n/es_ES
696
@dirrm %%WWWDIR%%/application/i18n/fr_FR
697
@dirrm %%WWWDIR%%/application/i18n/ru_RU
698
@dirrm %%WWWDIR%%/application/i18n
699
@dirrm %%WWWDIR%%/application/lib
700
@dirrm %%WWWDIR%%/application/models
701
@dirrm %%WWWDIR%%/application/vendor/fpdf/filters
702
@dirrm %%WWWDIR%%/application/vendor/fpdf/font
703
@dirrm %%WWWDIR%%/application/vendor/fpdf
704
@dirrm %%WWWDIR%%/application/vendor
705
@dirrm %%WWWDIR%%/application/views
706
@dirrm %%WWWDIR%%/application
707
@dirrm %%WWWDIR%%/documents/_media
708
@dirrm %%WWWDIR%%/documents/de_DE
709
@dirrm %%WWWDIR%%/documents/en_US
710
@dirrm %%WWWDIR%%/documents/images/smileys
711
@dirrm %%WWWDIR%%/documents/images
712
@dirrm %%WWWDIR%%/documents
713
@dirrm %%WWWDIR%%/media/css/images
714
@dirrm %%WWWDIR%%/media/css/ui-lightness/images
715
@dirrm %%WWWDIR%%/media/css/ui-lightness
716
@dirrm %%WWWDIR%%/media/css/ui-multisite/images
717
@dirrm %%WWWDIR%%/media/css/ui-multisite
718
@dirrm %%WWWDIR%%/media/css/ui-redmond/images
719
@dirrm %%WWWDIR%%/media/css/ui-redmond
720
@dirrm %%WWWDIR%%/media/css/ui-smoothness/images
721
@dirrm %%WWWDIR%%/media/css/ui-smoothness
722
@dirrm %%WWWDIR%%/media/css
723
@dirrm %%WWWDIR%%/media/images
724
@dirrm %%WWWDIR%%/media/js
725
@dirrm %%WWWDIR%%/media
726
@dirrmtry %%WWWDIR%%/templates
727
@dirrm %%WWWDIR%%/templates.dist
728
@dirrmtry %%WWWDIR%%/templates.special
729
@dirrmtry %%WWWDIR%%
730
@unexec rmdir "/var/log/kohana" >/dev/null 2>&1 || :
731
@unexec rmdir "/var/log/stats" >/dev/null 2>&1 || :
732
@unexec rmdir "%%NAGIOSDIR%%/pnp/perfspool" >/dev/null 2>&1 || :
733
@unexec rmdir "%%NAGIOSDIR%%/pnp/rrd" >/dev/null 2>&1 || :
734
@unexec rmdir "%%NAGIOSDIR%%/pnp" >/dev/null 2>&1 || :
735
@unexec rmdir "%%NAGIOSDIR%%" >/dev/null 2>&1 || :

Return to bug 195015