summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2012-06-08 18:50:14 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2012-06-08 18:50:14 +0000
commit3f81f1d2cf2d993901bff9ff84e36c363092b95c (patch)
tree5b7b6a906dab7ba5f120ff705b6ebab4c01e4d67 /app-admin
parentMask dev-perl/CPAN-Mini-Phalanx for removal (#420075) (diff)
downloadgentoo-2-3f81f1d2cf2d993901bff9ff84e36c363092b95c.tar.gz
gentoo-2-3f81f1d2cf2d993901bff9ff84e36c363092b95c.tar.bz2
gentoo-2-3f81f1d2cf2d993901bff9ff84e36c363092b95c.zip
Add a couple of upstream patches
(Portage version: 2.1.10.49/cvs/Linux x86_64)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/syslog-ng/ChangeLog9
-rw-r--r--app-admin/syslog-ng/files/syslog-ng-3.3.5-threading.patch61
-rw-r--r--app-admin/syslog-ng/files/syslog-ng-3.3.5-utmpx.patch139
-rw-r--r--app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild131
4 files changed, 339 insertions, 1 deletions
diff --git a/app-admin/syslog-ng/ChangeLog b/app-admin/syslog-ng/ChangeLog
index 2b8e759b9915..cdcdea2bf362 100644
--- a/app-admin/syslog-ng/ChangeLog
+++ b/app-admin/syslog-ng/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/syslog-ng
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/ChangeLog,v 1.327 2012/05/29 20:44:11 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/ChangeLog,v 1.328 2012/06/08 18:50:14 mr_bones_ Exp $
+
+*syslog-ng-3.3.5-r1 (08 Jun 2012)
+
+ 08 Jun 2012; Michael Sterrett <mr_bones_@gentoo.org>
+ +syslog-ng-3.3.5-r1.ebuild, +files/syslog-ng-3.3.5-threading.patch,
+ +files/syslog-ng-3.3.5-utmpx.patch:
+ Add a couple of upstream patches
29 May 2012; Michael Sterrett <mr_bones_@gentoo.org>
-files/syslog-ng-3.3.4-compile.patch, -files/syslog-ng-3.3.4-memleak.patch,
diff --git a/app-admin/syslog-ng/files/syslog-ng-3.3.5-threading.patch b/app-admin/syslog-ng/files/syslog-ng-3.3.5-threading.patch
new file mode 100644
index 000000000000..bf99ac3246fc
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng-3.3.5-threading.patch
@@ -0,0 +1,61 @@
+From c0afec5b46eb3508fd3b1449e37b7e550f7d35e2 Mon Sep 17 00:00:00 2001
+From: Gergely Nagy <algernon@balabit.hu>
+Date: Fri, 08 Jun 2012 15:28:33 +0200
+Subject: dnscache: Fix a memory corruption when destroying the DNS cache
+
+The DNS cache gets destroyed every time a worker thread quits, which
+is fine, as most of the dns cache variables are thread local.
+
+However, dns_cache_hosts is not, it's a global static, and
+dns_cache_destroy() was freeing that aswell.
+
+The solution is to not free dns_cache_hosts when a worker stops, but
+do so when syslog-ng stops. This patch introduces dns_cache_deinit()
+which does just that, and removes the same thing from
+dns_cache_destroy(), which now only touches thread-local variables.
+
+Reported-by: EgonB <egon@local.ee>
+Signed-off-by: Gergely Nagy <algernon@balabit.hu>
+---
+diff --git a/lib/dnscache.c b/lib/dnscache.c
+index 49102b7..9cdc2c0 100644
+--- a/lib/dnscache.c
++++ b/lib/dnscache.c
+@@ -361,6 +361,12 @@ dns_cache_destroy(void)
+ cache_last.prev = NULL;
+ persist_first.next = NULL;
+ persist_last.prev = NULL;
++}
++
++void
++dns_cache_deinit(void)
++{
+ if (dns_cache_hosts)
+ g_free(dns_cache_hosts);
++ dns_cache_hosts = NULL;
+ }
+diff --git a/lib/dnscache.h b/lib/dnscache.h
+index 8bae5f1..647ba19 100644
+--- a/lib/dnscache.h
++++ b/lib/dnscache.h
+@@ -34,5 +34,6 @@ void dns_cache_store(gboolean persistent, gint family, void *addr, const gchar *
+ void dns_cache_set_params(gint cache_size, gint expire, gint expire_failed, const gchar *hosts);
+ void dns_cache_init(void);
+ void dns_cache_destroy(void);
++void dns_cache_deinit(void);
+
+ #endif
+diff --git a/lib/mainloop.c b/lib/mainloop.c
+index 1203098..e294fa3 100644
+--- a/lib/mainloop.c
++++ b/lib/mainloop.c
+@@ -585,6 +585,7 @@ main_loop_exit_finish(void)
+ /* deinit the current configuration, as at this point we _know_ that no
+ * threads are running. This will unregister ivykis tasks and timers
+ * that could fire while the configuration is being destructed */
++ dns_cache_deinit();
+ cfg_deinit(current_configuration);
+ iv_quit();
+ }
+--
+cgit v0.8.3.4-1-gaabc
diff --git a/app-admin/syslog-ng/files/syslog-ng-3.3.5-utmpx.patch b/app-admin/syslog-ng/files/syslog-ng-3.3.5-utmpx.patch
new file mode 100644
index 000000000000..1014d7932068
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng-3.3.5-utmpx.patch
@@ -0,0 +1,139 @@
+From 4b450a09da83bc8e27bd7c8adccea3f125387fa7 Mon Sep 17 00:00:00 2001
+From: Gergely Nagy <algernon@balabit.hu>
+Date: Tue, 5 Jun 2012 14:40:08 +0200
+Subject: [PATCH] afuser: Use utmpx when available, instead of utmp
+
+FreeBSD 9 removed support for utmp, and one must use the
+POSIX-specified utmpx instead. The same utmpx is available on Linux
+too (and it is the same as utmp there).
+
+The patch below converts afuser to use utmpx when available, utmp
+otherwise. It is based on the post-build sed magic applied to
+syslog-ng within the FreeBSD ports collection, with other bits based
+on a patch from Alex Zimnitsky.
+
+Signed-off-by: Gergely Nagy <algernon@balabit.hu>
+---
+ configure.in | 4 ++--
+ lib/utils.c | 2 +-
+ lib/utils.h | 7 ++++++-
+ modules/afuser/afuser.c | 20 +++++++++++++++++++-
+ 4 files changed, 28 insertions(+), 5 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index aafb980..c76d7d9 100644
+--- a/configure.in
++++ b/configure.in
+@@ -383,7 +383,7 @@ dnl ***************************************************************************
+
+ AC_HEADER_STDC
+ AC_CHECK_HEADER(dmalloc.h)
+-AC_CHECK_HEADERS(strings.h getopt.h stropts.h sys/strlog.h door.h sys/capability.h sys/prctl.h)
++AC_CHECK_HEADERS(strings.h getopt.h stropts.h sys/strlog.h door.h sys/capability.h sys/prctl.h utmpx.h)
+ AC_CHECK_HEADERS(tcpd.h)
+
+
+@@ -479,7 +479,7 @@ if test "x$enable_linux_caps" = "xyes" -o "x$enable_linux_caps" = "xauto"; then
+ AC_CHECK_LIB(cap, cap_set_proc, LIBCAP_LIBS="-lcap")
+ fi
+
+-AC_CHECK_FUNCS(strdup strtol strtoll strtoimax inet_aton inet_ntoa getopt_long getaddrinfo getutent pread pwrite strcasestr memrchr localtime_r gmtime_r)
++AC_CHECK_FUNCS(strdup strtol strtoll strtoimax inet_aton inet_ntoa getopt_long getaddrinfo getutent getutxent pread pwrite strcasestr memrchr localtime_r gmtime_r)
+ old_LIBS=$LIBS
+ LIBS=$BASE_LIBS
+ AC_CHECK_FUNCS(clock_gettime)
+diff --git a/lib/utils.c b/lib/utils.c
+index 2b5c525..3c05426 100644
+--- a/lib/utils.c
++++ b/lib/utils.c
+@@ -47,7 +47,7 @@ int inet_aton(const char *cp, struct in_addr *addr)
+ }
+ #endif
+
+-#ifndef HAVE_GETUTENT
++#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT)
+
+ static int utent_fd = -1;
+
+diff --git a/lib/utils.h b/lib/utils.h
+index 86e3a7f..a0f3dcc 100644
+--- a/lib/utils.h
++++ b/lib/utils.h
+@@ -28,13 +28,18 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++
++#ifdef HAVE_UTMPX_H
++#include <utmpx.h>
++#else
+ #include <utmp.h>
++#endif
+
+ #ifndef HAVE_INET_ATON
+ int inet_aton(const char *cp, struct in_addr *addr);
+ #endif
+
+-#ifndef HAVE_GETUTENT
++#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT)
+ struct utmp *getutent(void);
+ void endutent(void);
+ #endif
+diff --git a/modules/afuser/afuser.c b/modules/afuser/afuser.c
+index 8f170e5..7d082b2 100644
+--- a/modules/afuser/afuser.c
++++ b/modules/afuser/afuser.c
+@@ -25,7 +25,13 @@
+ #include "alarms.h"
+ #include "messages.h"
+
++#ifdef HAVE_UTMPX_H
++#include <utmpx.h>
++#define ut_name ut_user
++#else
+ #include <utmp.h>
++#endif
++
+ #include <string.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -46,7 +52,11 @@
+ {
+ AFUserDestDriver *self = (AFUserDestDriver *) s;
+ gchar buf[8192];
++#ifdef HAVE_UTMPX_H
++ struct utmpx *ut;
++#else
+ struct utmp *ut;
++#endif
+ GString *timestamp;
+ time_t now;
+
+@@ -63,7 +73,11 @@
+ g_string_free(timestamp, TRUE);
+
+ /* NOTE: there's a private implementations of getutent in utils.c on Systems which do not provide one. */
+- while ((ut = getutent()))
++#ifdef HAVE_GETUTXENT
++ while ((ut = getutxent()))
++#else
++ while ((ut = getutent()))
++#endif
+ {
+ #if HAVE_MODERN_UTMP
+ if (ut->ut_type == USER_PROCESS &&
+@@ -106,7 +120,11 @@
+ }
+ }
+ }
++#if HAVE_UTMPX_H
++ endutxent();
++#else
+ endutent();
++#endif
+ finish:
+ log_msg_ack(msg, path_options);
+ log_msg_unref(msg);
+--
+1.7.10
+
diff --git a/app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild b/app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild
new file mode 100644
index 000000000000..fad3be94f069
--- /dev/null
+++ b/app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/syslog-ng-3.3.5-r1.ebuild,v 1.1 2012/06/08 18:50:14 mr_bones_ Exp $
+
+EAPI=2
+inherit autotools eutils multilib
+
+MY_PV=${PV/_/}
+DESCRIPTION="syslog replacement with advanced filtering features"
+HOMEPAGE="http://www.balabit.com/products/syslog_ng/"
+SRC_URI="http://www.balabit.com/downloads/files/syslog-ng/sources/${MY_PV}/source/syslog-ng_${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="caps hardened ipv6 json mongodb +pcre selinux spoof-source sql ssl static tcpd"
+RESTRICT="test"
+
+LIBS_DEPEND="
+ spoof-source? ( net-libs/libnet )
+ ssl? ( dev-libs/openssl )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ !static? (
+ >=dev-libs/eventlog-0.2.12
+ >=dev-libs/glib-2.10.1:2 )
+ json? ( >=dev-libs/json-glib-0.12 )
+ caps? ( sys-libs/libcap )
+ sql? ( >=dev-db/libdbi-0.8.3 )"
+RDEPEND="
+ !static? (
+ pcre? ( dev-libs/libpcre )
+ ${LIBS_DEPEND}
+ )"
+DEPEND="${RDEPEND}
+ ${LIBS_DEPEND}
+ static? (
+ >=dev-libs/eventlog-0.2.12[static-libs]
+ >=dev-libs/glib-2.10.1:2[static-libs] )
+ virtual/pkgconfig
+ sys-devel/flex"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-compile.patch \
+ "${FILESDIR}"/${P}-afsocket.patch \
+ "${FILESDIR}"/${P}-gprocess.patch \
+ "${FILESDIR}"/${P}-include.patch \
+ "${FILESDIR}"/${P}-threading.patch \
+ "${FILESDIR}"/${P}-utmpx.patch
+ sed -i \
+ -e '/libsyslog_ng_crypto_la_LIBADD/s/$/ -lssl -lcrypto/' \
+ lib/Makefile.am || die
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use static ; then
+ myconf="${myconf} --enable-static-linking"
+ else
+ myconf="${myconf} --enable-dynamic-linking"
+ fi
+ econf \
+ --disable-dependency-tracking \
+ --disable-systemd \
+ --with-ivykis=internal \
+ --sysconfdir=/etc/syslog-ng \
+ --localstatedir=/var/lib/misc \
+ --with-pidfile-dir=/var/run \
+ --with-module-dir=/usr/$(get_libdir)/syslog-ng \
+ $(use_enable caps linux-caps) \
+ $(use_enable ipv6) \
+ $(use_enable json) \
+ $(use_with json json-glib) \
+ $(use_enable mongodb) \
+ $(use_enable pcre) \
+ $(use_enable spoof-source) \
+ $(use_enable sql) \
+ $(use_enable ssl) \
+ $(use_enable tcpd tcp-wrapper) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodoc AUTHORS ChangeLog NEWS \
+ contrib/syslog-ng.conf* \
+ contrib/syslog2ng "${FILESDIR}/syslog-ng.conf."*
+
+ # Install default configuration
+ insinto /etc/syslog-ng
+ if use hardened || use selinux ; then
+ newins "${FILESDIR}/syslog-ng.conf.gentoo.hardened.${PV%.*}" syslog-ng.conf || die
+ elif use userland_BSD ; then
+ newins "${FILESDIR}/syslog-ng.conf.gentoo.fbsd.${PV%.*}" syslog-ng.conf || die
+ else
+ newins "${FILESDIR}/syslog-ng.conf.gentoo.${PV%.*}" syslog-ng.conf || die
+ fi
+
+ insinto /etc/logrotate.d
+ # Install snippet for logrotate, which may or may not be installed
+ if use hardened || use selinux ; then
+ newins "${FILESDIR}/syslog-ng.logrotate.hardened" syslog-ng || die
+ else
+ newins "${FILESDIR}/syslog-ng.logrotate" syslog-ng || die
+ fi
+
+ newinitd "${FILESDIR}/syslog-ng.rc6.${PV%.*}" syslog-ng || die
+ newconfd "${FILESDIR}/syslog-ng.confd" syslog-ng || die
+ keepdir /etc/syslog-ng/patterndb.d
+ find "${D}" -type f -name '*.la' -exec rm {} + || die
+ rmdir "${D}"/usr/libexec
+}
+
+pkg_postinst() {
+ elog "For detailed documentation please see the upstream website:"
+ elog "http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guides/syslog-ng-ose-v3.3-guide-admin-en.html/index.html"
+
+ # bug #355257
+ if ! has_version app-admin/logrotate ; then
+ echo
+ elog "It is highly recommended that app-admin/logrotate be emerged to"
+ elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
+ elog "for logrotate to use."
+ echo
+ fi
+}