summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2006-04-27 06:59:00 +0000
committerAlin Năstac <mrness@gentoo.org>2006-04-27 06:59:00 +0000
commita2ae009ce069bb8dc3a8a5876cdcc6bb6b6ecea0 (patch)
tree4a9fdcd55dcfe6ed5b516a76fa1970cf6d643a1f /net-dns
parentadd nls-issue compile patch, #112496; thanks for the pointers, Spanky! (diff)
downloadgentoo-2-a2ae009ce069bb8dc3a8a5876cdcc6bb6b6ecea0.tar.gz
gentoo-2-a2ae009ce069bb8dc3a8a5876cdcc6bb6b6ecea0.tar.bz2
gentoo-2-a2ae009ce069bb8dc3a8a5876cdcc6bb6b6ecea0.zip
Fix segfault when build with debug USE flag enabled; submitted as x86 (#131341)
(Portage version: 2.0.54)
Diffstat (limited to 'net-dns')
-rw-r--r--net-dns/pdnsd/ChangeLog9
-rw-r--r--net-dns/pdnsd/Manifest3
-rw-r--r--net-dns/pdnsd/files/digest-pdnsd-1.2.4-r11
-rw-r--r--net-dns/pdnsd/files/pdnsd-1.2.4-dbg_file.patch51
-rw-r--r--net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild122
5 files changed, 185 insertions, 1 deletions
diff --git a/net-dns/pdnsd/ChangeLog b/net-dns/pdnsd/ChangeLog
index f91cd7443d5e..dabe3ba4c84e 100644
--- a/net-dns/pdnsd/ChangeLog
+++ b/net-dns/pdnsd/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-dns/pdnsd
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.55 2006/04/26 19:16:21 tcort Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/ChangeLog,v 1.56 2006/04/27 06:59:00 mrness Exp $
+
+*pdnsd-1.2.4-r1 (27 Apr 2006)
+
+ 27 Apr 2006; Alin Nastac <mrness@gentoo.org>
+ +files/pdnsd-1.2.4-dbg_file.patch, +pdnsd-1.2.4-r1.ebuild:
+ Fix segfault when build with debug USE flag enabled, thanks to Thomas Cort
+ <tcort@gentoo.org>. Submitted as stable on x86 wrt security bug #131341.
26 Apr 2006; <tcort@gentoo.org> pdnsd-1.2.4.ebuild:
Stable on amd64 wrt security Bug #131341.
diff --git a/net-dns/pdnsd/Manifest b/net-dns/pdnsd/Manifest
index 73e88ec01ae7..b4b4031b81ce 100644
--- a/net-dns/pdnsd/Manifest
+++ b/net-dns/pdnsd/Manifest
@@ -1,9 +1,12 @@
MD5 c619e260ff0c2625c4928958c991d79c ChangeLog 8244
MD5 841f98e9e42888ec6d3869f716017c5f files/digest-pdnsd-1.2.3 67
MD5 21ca3184ba7f84328d7cfbe1c4fcb596 files/digest-pdnsd-1.2.4 67
+MD5 21ca3184ba7f84328d7cfbe1c4fcb596 files/digest-pdnsd-1.2.4-r1 67
+MD5 8a12be746cefcb7e1114a74a02b8d0f2 files/pdnsd-1.2.4-dbg_file.patch 1366
MD5 2a7e9d9f54bd31a3675c491d0b6ee187 files/pdnsd.conf.test 377
MD5 27071ebe71d4f810d57d7cfbd4099788 files/pdnsd.online 452
MD5 65809ab9f525565a98ebe800edea45ab files/pdnsd.rc6 755
MD5 03c559c81ebc357c5f906e8247f1b79b metadata.xml 402
MD5 ff5367e7e1e820b6d58bbf69326d72a1 pdnsd-1.2.3.ebuild 4280
+MD5 ccd0268d2d1a8204715b301651bee0a8 pdnsd-1.2.4-r1.ebuild 3968
MD5 0bd9240a8e73728857da354bc687531e pdnsd-1.2.4.ebuild 3889
diff --git a/net-dns/pdnsd/files/digest-pdnsd-1.2.4-r1 b/net-dns/pdnsd/files/digest-pdnsd-1.2.4-r1
new file mode 100644
index 000000000000..3a3c31db1186
--- /dev/null
+++ b/net-dns/pdnsd/files/digest-pdnsd-1.2.4-r1
@@ -0,0 +1 @@
+MD5 aafb9d65d713b4bc2c6c4ba822e0bd3c pdnsd-1.2.4-par.tar.gz 537362
diff --git a/net-dns/pdnsd/files/pdnsd-1.2.4-dbg_file.patch b/net-dns/pdnsd/files/pdnsd-1.2.4-dbg_file.patch
new file mode 100644
index 000000000000..b7a39689c75a
--- /dev/null
+++ b/net-dns/pdnsd/files/pdnsd-1.2.4-dbg_file.patch
@@ -0,0 +1,51 @@
+diff -Nru pdnsd-1.2.4.orig/src/main.c pdnsd-1.2.4/src/main.c
+--- pdnsd-1.2.4.orig/src/main.c 2005-11-12 22:03:42.000000000 +0200
++++ pdnsd-1.2.4/src/main.c 2006-04-27 09:38:38.000000000 +0300
+@@ -63,7 +63,7 @@
+ pthread_t main_thrid,servstat_thrid,statsock_thrid,tcps_thrid,udps_thrid;
+ uid_t init_uid;
+ #if DEBUG>0
+-FILE *dbg_file;
++FILE *dbg_file=NULL;
+ #endif
+ volatile int tcp_socket=-1;
+ volatile int udp_socket=-1;
+@@ -451,6 +451,19 @@
+ }
+ }
+
++#if DEBUG>0
++ if (global.daemon) {
++ if (debug_p) {
++ char dbgdir[strlen(global.cache_dir)+sizeof("/pdnsd.debug")];
++ stpcpy(stpcpy(dbgdir,global.cache_dir),"/pdnsd.debug");
++ if (!(dbg_file=fopen(dbgdir,"w")))
++ debug_p=0;
++ }
++ } else {
++ dbg_file=stdout;
++ }
++#endif
++
+ if (global.daemon && global.pidfile) {
+ if (unlink(global.pidfile)!=0 && errno!=ENOENT) {
+ log_error("Error: could not unlink pid file %s: %s",global.pidfile, strerror(errno));
+@@ -550,18 +563,6 @@
+ dup2(fd,1);
+ dup2(fd,2);
+ close(fd);
+-#if DEBUG>0
+- if (debug_p) {
+- char dbgdir[strlen(global.cache_dir)+sizeof("/pdnsd.debug")];
+- stpcpy(stpcpy(dbgdir,global.cache_dir),"/pdnsd.debug");
+- if (!(dbg_file=fopen(dbgdir,"w")))
+- debug_p=0;
+- }
+-#endif
+- } else {
+-#if DEBUG>0
+- dbg_file=stdout;
+-#endif
+ }
+ log_info(0,"pdnsd-%s starting.\n",VERSION);
+ DEBUG_MSG("Debug messages activated\n");
diff --git a/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild b/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild
new file mode 100644
index 000000000000..883ef9283664
--- /dev/null
+++ b/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/pdnsd-1.2.4-r1.ebuild,v 1.1 2006/04/27 06:59:00 mrness Exp $
+
+inherit eutils
+
+DESCRIPTION="Proxy DNS server with permanent caching"
+HOMEPAGE="http://www.phys.uu.nl/%7Erombouts/pdnsd.html http://www.phys.uu.nl/~rombouts/pdnsd.html"
+SRC_URI="http://www.phys.uu.nl/%7Erombouts/pdnsd/releases/${P}-par.tar.gz"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~s390 ~sparc x86"
+IUSE="ipv6 debug isdn nptl"
+
+pkg_setup() {
+ enewgroup pdnsd
+ enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
+}
+
+src_unpack() {
+ unpack ${A}
+
+ epatch "${FILESDIR}/${P}-dbg_file.patch"
+}
+
+src_compile() {
+ local myconf=""
+
+ if use debug; then
+ myconf="${myconf} --with-debug=3"
+ CFLAGS="${CFLAGS} -g"
+ fi
+ use nptl && myconf="${myconf} --with-thread-lib=NPTL"
+
+ [ -c /dev/urandom ] && myconf="${myconf} --with-random-device=/dev/urandom"
+
+ econf \
+ --sysconfdir=/etc/pdnsd \
+ --with-cachedir=/var/cache/pdnsd \
+ --infodir=/usr/share/info --mandir=/usr/share/man \
+ --with-default-id=pdnsd \
+ `use_enable ipv6` `use_enable isdn` \
+ ${myconf} \
+ || die "bad configure"
+
+ emake all || die "compile problem"
+}
+
+pkg_preinst() {
+ # Duplicated so that binary packages work
+ enewgroup pdnsd
+ enewuser pdnsd -1 -1 /var/lib/pdnsd pdnsd
+}
+
+src_test() {
+ if [ -x /usr/bin/dig ]; then
+ mkdir "${T}/pdnsd"
+ echo -n -e "pd12\0\0\0\0" > "${T}/pdnsd/pdnsd.cache"
+ IPS=$(grep ^nameserver "${ROOT}/etc/resolv.conf" | sed -e 's/nameserver \(.*\)/\tip=\1;/g' | xargs)
+ sed -e "s/\tip=/${IPS}/" -e "s:cache_dir=:cache_dir=${T}/pdnsd:" "${FILESDIR}/pdnsd.conf.test" \
+ > "${T}/pdnsd.conf.test"
+ src/pdnsd -c "${T}/pdnsd.conf.test" -g -s -d -p "${T}/pid" || die "couldn't start daemon"
+ sleep 3
+
+ find "${T}" -ls
+ [ -s "${T}/pid" ] || die "empty or no pid file created"
+ [ -S "${T}/pdnsd/pdnsd.status" ] || die "no socket created"
+ src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" server all up || die "failed to start the daemon"
+ src/pdnsd-ctl/pdnsd-ctl -c "${T}/pdnsd" status || die "failed to communicate with the daemon"
+ sleep 3
+
+ dig @127.0.0.1 -p 33455 www.gentoo.org | fgrep "status: NOERROR" || die "www.gentoo.org lookup failed"
+ kill $(<"${T}/pid") || die "failed to terminate daemon"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # Copy cache from prev older versions
+ [ -f "${ROOT}/var/lib/pdnsd/pdnsd.cache" ] && \
+ cp "${ROOT}/var/lib/pdnsd/pdnsd.cache" "${D}/var/cache/pdnsd/pdnsd.cache"
+
+ # Don't clobber existing cache - copy prev cache so unmerging prev version
+ # doesn't remove the cache.
+ [ -f "${ROOT}/var/cache/pdnsd/pdnsd.cache" ] && \
+ rm "${D}/var/cache/pdnsd/pdnsd.cache"
+
+ dodoc AUTHORS ChangeLog* NEWS README THANKS TODO README.par
+ docinto contrib ; dodoc contrib/{README,dhcp2pdnsd,pdnsd_dhcp.pl}
+ docinto html ; dohtml doc/html/*
+ docinto txt ; dodoc doc/txt/*
+ newdoc doc/pdnsd.conf pdnsd.conf.sample
+
+ newinitd "${FILESDIR}/pdnsd.rc6" pdnsd
+ newinitd "${FILESDIR}/pdnsd.online" pdnsd-online
+
+ keepdir /etc/conf.d
+ local config="${D}/etc/conf.d/pdnsd-online"
+
+ echo -e "# Enter the interface that connects you to the dns servers" >> "${config}"
+ echo "# This will correspond to /etc/init.d/net.${IFACE}" >> "${config}"
+ echo -e "\n# IMPORTANT: Be sure to run depscan.sh after modifiying IFACE" >> "${config}"
+ echo "IFACE=ppp0" >> "${config}"
+
+ config="${D}/etc/conf.d/pdnsd"
+ "${D}/usr/sbin/pdnsd" --help | sed "s/^/# /g" > "${config}"
+ echo "# Command line options" >> "${config}"
+ use ipv6 && echo PDNSDCONFIG="-a" >> "${config}" \
+ || echo PDNSDCONFIG="" >> "${config}"
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Add pdnsd to your default runlevel - rc-update add pdnsd default"
+ einfo ""
+ einfo "Add pdnsd-online to your online runlevel."
+ einfo "The online interface will be listed in /etc/conf.d/pdnsd-online"
+ einfo ""
+ einfo "Sample config file in /etc/pdnsd/pdnsd.conf.sample"
+}