[zabbix] - updated to 1.8.3
Dan Horák
sharkcz at fedoraproject.org
Tue Aug 24 13:25:11 UTC 2010
commit f7288e69b0c3c73190f7eb918a64c53565f98b6f
Author: Dan Horák <dan at danny.cz>
Date: Tue Aug 24 15:25:07 2010 +0200
- updated to 1.8.3
.gitignore | 1 +
sources | 2 +-
zabbix-1.8.1-cloexec.patch | 99 --------------------------------
zabbix-1.8.2-config.patch | 13 ----
zabbix-1.8.2-fonts-config.patch | 12 ----
zabbix-1.8.2-zbx-2326.patch | 53 -----------------
zabbix-1.8.3-cloexec.patch | 119 +++++++++++++++++++++++++++++++++++++++
zabbix-1.8.3-config.patch | 13 ++++
zabbix-1.8.3-fonts-config.patch | 12 ++++
zabbix.spec | 21 +++----
10 files changed, 156 insertions(+), 189 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 063e3d0..b85c2ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
zabbix-1.8.2.tar.gz
+/zabbix-1.8.3.tar.gz
diff --git a/sources b/sources
index 0e54abe..d8a7299 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-fa4be4fa7ac20a33cc0aa5c27b827746 zabbix-1.8.2.tar.gz
+575c31880d73f6fe41e730874ebfc633 zabbix-1.8.3.tar.gz
diff --git a/zabbix-1.8.3-cloexec.patch b/zabbix-1.8.3-cloexec.patch
new file mode 100644
index 0000000..c39ea30
--- /dev/null
+++ b/zabbix-1.8.3-cloexec.patch
@@ -0,0 +1,119 @@
+From 0a674ab2e2eab5d0dbe8d08b8b3f2a7b4dbee09d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan at danny.cz>
+Date: Tue, 17 Aug 2010 10:57:36 +0200
+Subject: [PATCH] add CLOEXEC option to sockets and file descriptors
+
+---
+ src/libs/zbxcomms/comms.c | 28 ++++++++++++++++++++++++----
+ src/libs/zbxnix/pid.c | 6 +++++-
+ 2 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/src/libs/zbxcomms/comms.c b/src/libs/zbxcomms/comms.c
+index 7d4ba9c..adec49c 100644
+--- a/src/libs/zbxcomms/comms.c
++++ b/src/libs/zbxcomms/comms.c
+@@ -62,6 +62,10 @@
+ # define ZBX_SOCKLEN_T socklen_t
+ #endif
+
++#ifndef SOCK_CLOEXEC
++#define SOCK_CLOEXEC 0
++#endif
++
+ /******************************************************************************
+ * *
+ * Function: zbx_tcp_strerror *
+@@ -410,12 +414,16 @@ int zbx_tcp_connect(zbx_sock_t *s, const char *source_ip, const char *ip, unsign
+ goto out;
+ }
+
+- if (ZBX_SOCK_ERROR == (s->socket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)))
++ if (ZBX_SOCK_ERROR == (s->socket = socket(ai->ai_family, ai->ai_socktype | SOCK_CLOEXEC, ai->ai_protocol)))
+ {
+ zbx_set_tcp_strerror("Cannot create socket [%s]:%d [%s]", ip, port, strerror_from_system(zbx_sock_last_error()));
+ goto out;
+ }
+
++#if ! SOCK_CLOEXEC
++ fcntl(s->socket, F_SETFD, FD_CLOEXEC);
++#endif
++
+ if (NULL != source_ip)
+ {
+ memset(&hints, 0x00, sizeof(struct addrinfo));
+@@ -475,12 +483,16 @@ int zbx_tcp_connect(zbx_sock_t *s, const char *source_ip, const char *ip, unsign
+ servaddr_in.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr;
+ servaddr_in.sin_port = htons(port);
+
+- if (ZBX_SOCK_ERROR == (s->socket = socket(AF_INET, SOCK_STREAM, 0)))
++ if (ZBX_SOCK_ERROR == (s->socket = socket(AF_INET,SOCK_STREAM | SOCK_CLOEXEC,0)))
+ {
+ zbx_set_tcp_strerror("Cannot create socket [%s:%d] [%s]", ip, port, strerror_from_system(zbx_sock_last_error()));
+ return FAIL;
+ }
+
++#if ! SOCK_CLOEXEC
++ fcntl(s->socket, F_SETFD, FD_CLOEXEC);
++#endif
++
+ if (NULL != source_ip)
+ {
+ source_addr.sin_family = AF_INET;
+@@ -720,13 +732,17 @@ int zbx_tcp_listen(zbx_sock_t *s, const char *listen_ip, unsigned short listen_p
+ continue;
+
+ if (ZBX_SOCK_ERROR == (s->sockets[s->num_socks] =
+- socket(current_ai->ai_family, current_ai->ai_socktype, current_ai->ai_protocol)))
++ socket(current_ai->ai_family, current_ai->ai_socktype | SOCK_CLOEXEC, current_ai->ai_protocol)))
+ {
+ zbx_set_tcp_strerror("socket() for [[%s]:%s] failed with error %d: %s",
+ ip, port, zbx_sock_last_error(), strerror_from_system(zbx_sock_last_error()));
+ goto out;
+ }
+
++#if ! SOCK_CLOEXEC
++ fcntl(s->sockets[s->num_socks], F_SETFD, FD_CLOEXEC);
++#endif
++
+ /* Enable address reuse */
+ /* This is to immediately use the address even if it is in TIME_WAIT state */
+ /* http://www-128.ibm.com/developerworks/linux/library/l-sockpit/index.html */
+@@ -828,13 +844,17 @@ int zbx_tcp_listen(zbx_sock_t *s, const char *listen_ip, unsigned short listen_p
+ goto out;
+ }
+
+- if (ZBX_SOCK_ERROR == (s->sockets[s->num_socks] = socket(AF_INET, SOCK_STREAM, 0)))
++ if (ZBX_SOCK_ERROR == (s->sockets[s->num_socks] = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0)))
+ {
+ zbx_set_tcp_strerror("socket() for [[%s]:%hu] failed with error %d: %s",
+ ip, listen_port, zbx_sock_last_error(), strerror_from_system(zbx_sock_last_error()));
+ goto out;
+ }
+
++#if ! SOCK_CLOEXEC
++ fcntl(s->sockets[s->num_socks], F_SETFD, FD_CLOEXEC);
++#endif
++
+ /* Enable address reuse */
+ /* This is to immediately use the address even if it is in TIME_WAIT state */
+ /* http://www-128.ibm.com/developerworks/linux/library/l-sockpit/index.html */
+diff --git a/src/libs/zbxnix/pid.c b/src/libs/zbxnix/pid.c
+index 561af79..f55f3a3 100644
+--- a/src/libs/zbxnix/pid.c
++++ b/src/libs/zbxnix/pid.c
+@@ -83,7 +83,11 @@ int create_pid_file(const char *pidfile)
+ /* lock file */
+ fdpid = fileno(fpid);
+ #ifdef HAVE_FCNTL_H
+- if(-1 != fdpid) fcntl(fdpid, F_SETLK, &fl);
++ if(-1 != fdpid)
++ {
++ fcntl(fdpid, F_SETLK, &fl);
++ fcntl(fdpid, F_SETFD, FD_CLOEXEC);
++ }
+ #else
+ if(-1 != fdpid) flock(fdpid, LOCK_EX);
+ #endif /* HAVE_FCNTL_H */
+--
+1.7.2.1
+
diff --git a/zabbix-1.8.3-config.patch b/zabbix-1.8.3-config.patch
new file mode 100644
index 0000000..d4d5979
--- /dev/null
+++ b/zabbix-1.8.3-config.patch
@@ -0,0 +1,13 @@
+diff -up zabbix-1.8.3/frontends/php/include/config.inc.php.orig zabbix-1.8.3/frontends/php/include/config.inc.php
+--- zabbix-1.8.3/frontends/php/include/config.inc.php.orig 2010-08-16 10:19:33.000000000 +0200
++++ zabbix-1.8.3/frontends/php/include/config.inc.php 2010-08-17 09:02:34.000000000 +0200
+@@ -113,8 +113,7 @@ function __autoload($class_name){
+ $ZBX_LOCALNODEID = 0;
+ $ZBX_LOCMASTERID = 0;
+
+- $ZBX_CONFIGURATION_FILE = './conf/zabbix.conf.php';
+- $ZBX_CONFIGURATION_FILE = realpath(dirname($ZBX_CONFIGURATION_FILE)).'/'.basename($ZBX_CONFIGURATION_FILE);
++ $ZBX_CONFIGURATION_FILE = '/etc/zabbix/web/zabbix.conf.php';
+
+ // Include Tactical Overview modules
+ require_once('include/locales.inc.php');
diff --git a/zabbix-1.8.3-fonts-config.patch b/zabbix-1.8.3-fonts-config.patch
new file mode 100644
index 0000000..147ed99
--- /dev/null
+++ b/zabbix-1.8.3-fonts-config.patch
@@ -0,0 +1,12 @@
+diff -up zabbix-1.8.3/frontends/php/include/defines.inc.php.orig zabbix-1.8.3/frontends/php/include/defines.inc.php
+--- zabbix-1.8.3/frontends/php/include/defines.inc.php.orig 2010-08-16 10:19:33.000000000 +0200
++++ zabbix-1.8.3/frontends/php/include/defines.inc.php 2010-08-17 11:18:30.000000000 +0200
+@@ -35,7 +35,7 @@
+
+ define('ZBX_WIDGET_ROWS', 20);
+
+- define('ZBX_FONTPATH', realpath('fonts')); // where to search for font (GD > 2.0.18)
++ define('ZBX_FONTPATH', '/usr/share/font/dejavu'); // where to search for font (GD > 2.0.18)
+ define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans'); // font file name
+
+ define('ZBX_SCRIPT_TIMEOUT', 360); // in seconds
diff --git a/zabbix.spec b/zabbix.spec
index fa9d2b4..03c4db3 100644
--- a/zabbix.spec
+++ b/zabbix.spec
@@ -6,8 +6,8 @@
# various backup files (*.rpm{orig,new,save}, *~ etc) in that dir.
Name: zabbix
-Version: 1.8.2
-Release: 3%{?dist}
+Version: 1.8.3
+Release: 1%{?dist}
Summary: Open-source monitoring solution for your IT infrastructure
Group: Applications/Internet
@@ -20,13 +20,11 @@ Source3: zabbix-agent.init
Source4: zabbix-proxy.init
Source5: zabbix-logrotate.in
# local rules for config files
-Patch0: zabbix-1.8.2-config.patch
+Patch0: zabbix-1.8.3-config.patch
# close fd on exec - https://bugzilla.redhat.com/show_bug.cgi?id=559221
-Patch1: zabbix-1.8.1-cloexec.patch
+Patch1: zabbix-1.8.3-cloexec.patch
# local rules for config files - fonts
-Patch2: zabbix-1.8.2-fonts-config.patch
-# backported patch for https://support.zabbix.com/browse/ZBX-2326
-Patch3: zabbix-1.8.2-zbx-2326.patch
+Patch2: zabbix-1.8.3-fonts-config.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -256,8 +254,6 @@ Zabbix web frontend for SQLite
%if 0%{?fedora} || 0%{?rhel} >= 6
%patch2 -p1
-%patch3 -p1
-
# remove included fonts
rm -rf frontends/php/fonts
%endif
@@ -506,14 +502,14 @@ fi
%files
%defattr(-,root,root,-)
-%doc AUTHORS ChangeLog COPYING FAQ NEWS README
+%doc AUTHORS ChangeLog COPYING CREDITS NEWS README
%dir %{_sysconfdir}/zabbix
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/zabbix
%attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix
%files docs
%defattr(-,root,root,-)
-%doc docs/README
+%doc README
%files server
%defattr(-,root,root,-)
@@ -591,6 +587,9 @@ fi
%changelog
+* Tue Aug 17 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-1
+- updated to 1.8.3
+
* Wed Aug 11 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-3
- added patch for XSS in triggers page (#620809, ZBX-2326)
More information about the scm-commits
mailing list