summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin V. Arkhipov <voxus@gentoo.org>2005-03-25 22:28:20 +0000
committerKonstantin V. Arkhipov <voxus@gentoo.org>2005-03-25 22:28:20 +0000
commit9634fffdca7777f11409a99a49ebe01da8052573 (patch)
treeb9dc6260788b818ea68f727fe6bb14da41cf62e8 /net-dns
parentAdd old stable version for OpenHPI to use. (diff)
downloadgentoo-2-9634fffdca7777f11409a99a49ebe01da8052573.tar.gz
gentoo-2-9634fffdca7777f11409a99a49ebe01da8052573.tar.bz2
gentoo-2-9634fffdca7777f11409a99a49ebe01da8052573.zip
version bump, closes a lot of bugs
(Portage version: 2.0.51.19)
Diffstat (limited to 'net-dns')
-rw-r--r--net-dns/bind-tools/ChangeLog7
-rw-r--r--net-dns/bind-tools/Manifest14
-rw-r--r--net-dns/bind-tools/bind-tools-9.2.5.ebuild57
-rw-r--r--net-dns/bind-tools/files/digest-bind-tools-9.2.51
-rw-r--r--net-dns/bind/ChangeLog10
-rw-r--r--net-dns/bind/Manifest38
-rw-r--r--net-dns/bind/bind-9.2.5.ebuild229
-rw-r--r--net-dns/bind/files/bind-9.2.5-berkdb_fix.patch11
-rw-r--r--net-dns/bind/files/bind-9.2.5-dlz-mysql.patch402
-rw-r--r--net-dns/bind/files/bind-9.2.5-mysql.patch402
-rw-r--r--net-dns/bind/files/digest-bind-9.2.52
-rw-r--r--net-dns/bind/files/named.rc6-pid_fix13
12 files changed, 1162 insertions, 24 deletions
diff --git a/net-dns/bind-tools/ChangeLog b/net-dns/bind-tools/ChangeLog
index 705e45eafdcc..62b41c648be9 100644
--- a/net-dns/bind-tools/ChangeLog
+++ b/net-dns/bind-tools/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-dns/bind-tools
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind-tools/ChangeLog,v 1.32 2004/12/29 02:59:58 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind-tools/ChangeLog,v 1.33 2005/03/25 22:28:18 voxus Exp $
+
+*bind-tools-9.2.5 (26 Mar 2005)
+
+ 26 Mar 2005; Konstantin Arkhipov <voxus@gentoo.org> +bind-tools-9.2.5.ebuild:
+ Version bump. Closes bugs #79718 and #83736.
29 Dec 2004; Ciaran McCreesh <ciaranm@gentoo.org> :
Change encoding to UTF-8 for GLEP 31 compliance
diff --git a/net-dns/bind-tools/Manifest b/net-dns/bind-tools/Manifest
index 40f41daebc92..d0063e7f97a0 100644
--- a/net-dns/bind-tools/Manifest
+++ b/net-dns/bind-tools/Manifest
@@ -1,11 +1,13 @@
-MD5 cafdf5641907d0bb3b12ad89bff8a1ba ChangeLog 4287
-MD5 faf7b704ec9140b479d7399ebf5dfc0c bind-tools-9.2.2.ebuild 983
-MD5 4e58a10a9c95eef5d3c0abfb3c67b433 bind-tools-9.2.3-r1.ebuild 1293
MD5 029fef1a2f516b68ae910f4844ef8a55 bind-tools-9.2.3.ebuild 1711
-MD5 043de8e11b1e5b8825337b4a1965a92c metadata.xml 325
+MD5 4e58a10a9c95eef5d3c0abfb3c67b433 bind-tools-9.2.3-r1.ebuild 1293
+MD5 54d0259e985162fe9d00b16c9fa09870 bind-tools-9.2.5.ebuild 1364
+MD5 faf7b704ec9140b479d7399ebf5dfc0c bind-tools-9.2.2.ebuild 983
MD5 8e5b22b08d615682d2aa8954dcef325a bind-tools-9.2.2_rc1.ebuild 926
+MD5 2ff0640304d7965b607f9fa6b7537e32 ChangeLog 4448
+MD5 043de8e11b1e5b8825337b4a1965a92c metadata.xml 325
MD5 feb1027d97d15dcf8fdc57b2de185af2 files/digest-bind-tools-9.2.3-r1 63
-MD5 1d83f3065ae3bad0e88ae3bfe1e95ced files/nslookup.8 14638
-MD5 feb1027d97d15dcf8fdc57b2de185af2 files/digest-bind-tools-9.2.3 63
MD5 e020f0d41f68e0c47d196c4aa1a06c09 files/digest-bind-tools-9.2.2 63
+MD5 feb1027d97d15dcf8fdc57b2de185af2 files/digest-bind-tools-9.2.3 63
+MD5 0b0f1e16a0bf51db8f99fd21c01f7426 files/digest-bind-tools-9.2.5 63
MD5 8c87d7839f4a6caa9c690e5905a247f4 files/digest-bind-tools-9.2.2_rc1 66
+MD5 1d83f3065ae3bad0e88ae3bfe1e95ced files/nslookup.8 14638
diff --git a/net-dns/bind-tools/bind-tools-9.2.5.ebuild b/net-dns/bind-tools/bind-tools-9.2.5.ebuild
new file mode 100644
index 000000000000..791097d54ba4
--- /dev/null
+++ b/net-dns/bind-tools/bind-tools-9.2.5.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind-tools/bind-tools-9.2.5.ebuild,v 1.1 2005/03/25 22:28:18 voxus Exp $
+
+inherit flag-o-matic gnuconfig
+
+MY_P=${P//-tools}
+MY_P=${MY_P/_}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="bind tools: dig, nslookup, and host"
+HOMEPAGE="http://www.isc.org/products/BIND/bind9.html"
+SRC_URI="ftp://ftp.isc.org/isc/bind9/${PV/_}/${MY_P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~alpha ~arm ~hppa ~amd64 ~ia64 ~s390 ~mips ~ppc64"
+IUSE="ipv6"
+
+DEPEND="virtual/libc"
+
+src_compile() {
+ gnuconfig_update
+
+ use ipv6 && myconf="${myconf} --enable-ipv6" || myconf="${myconf} --enable-ipv6=no"
+
+ econf ${myconf} || die "Configure failed"
+
+ export MAKEOPTS="${MAKEOPTS} -j1"
+
+ cd ${S}/lib/isc
+ emake || die "make failed in /lib/isc"
+
+ cd ${S}/lib/dns
+ emake || die "make failed in /lib/dns"
+
+ cd ${S}/bin/dig
+ emake || die "make failed in /bin/dig"
+
+ cd ${S}/lib/lwres/
+ emake || die "make failed in /lib/lwres"
+
+ cd ${S}/bin/nsupdate/
+ emake || die "make failed in /bin/nsupdate"
+}
+
+src_install() {
+ dodoc README CHANGES FAQ
+
+ cd ${S}/bin/dig
+ dobin dig host nslookup || die
+ doman dig.1 host.1 nslookup.1 || die
+
+ cd ${S}/bin/nsupdate
+ dobin nsupdate || die
+ doman nsupdate.8 || die
+ dohtml nsupdate.html || die
+}
diff --git a/net-dns/bind-tools/files/digest-bind-tools-9.2.5 b/net-dns/bind-tools/files/digest-bind-tools-9.2.5
new file mode 100644
index 000000000000..0d6b63189fd6
--- /dev/null
+++ b/net-dns/bind-tools/files/digest-bind-tools-9.2.5
@@ -0,0 +1 @@
+MD5 35a265fb97a068c066e22306ea32fd1f bind-9.2.5.tar.gz 4504389
diff --git a/net-dns/bind/ChangeLog b/net-dns/bind/ChangeLog
index 6619596e0964..ba9a5de8af2d 100644
--- a/net-dns/bind/ChangeLog
+++ b/net-dns/bind/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-dns/bind
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.56 2005/02/07 02:28:31 kumba Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.57 2005/03/25 22:28:20 voxus Exp $
+
+*bind-9.2.5 (26 Mar 2005)
+
+ 26 Mar 2005; Konstantin Arkhipov <voxus@gentoo.org> +bind-9.2.5.ebuild,
+ +files/bind-9.2.5-berkdb_fix.patch, +files/bind-9.2.5-dlz-mysql.patch,
+ +files/bind-9.2.5-mysql.patch, +files/named.rc6-pid_fix:
+ Version bump. Also closes bugs: #45254, #32908, #48610, #58932, #51577,
+ #65885, #65885, #65885, #76348, #76820, #76820, #85292, #85419, #73257.
06 Feb 2005; Joshua Kinard <kumba@gentoo.org> bind-9.2.2-r3.ebuild:
Marked stable on mips.
diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
index effb0af7a679..a5c11aaa9fbf 100644
--- a/net-dns/bind/Manifest
+++ b/net-dns/bind/Manifest
@@ -1,33 +1,39 @@
-MD5 1321ce37bd02f45a330670aa31e3a407 ChangeLog 8946
-MD5 5a5afd0ab570b531cd0094bf16f6735d bind-9.2.2-r1.ebuild 4880
-MD5 242fac0b5f26fab0bc0a3bded1fccdfa bind-9.2.2-r2.ebuild 4895
+MD5 45b230cb3f1fd14ba338701d4080b4ba bind-9.2.3.ebuild 5875
MD5 23c809afe06852c286f137645287abb4 bind-9.2.2-r3.ebuild 5708
-MD5 0fce7dffc077cc801ceeaf46cce6ead0 bind-9.2.2-r4.ebuild 5828
+MD5 ef07085fb469dd3a70a5459c24f41944 bind-9.2.5.ebuild 7276
MD5 61a6fb5346e4f405c35bf0c823e75476 bind-9.2.2-r5.ebuild 6434
+MD5 e74705fa1f4ec70e05cf44eb7796ba0e bind-9.3.1_beta2.ebuild 5937
MD5 9676ca38b8a2af68a01785194ecd12d8 bind-9.2.2.ebuild 4678
-MD5 45b230cb3f1fd14ba338701d4080b4ba bind-9.2.3.ebuild 5875
MD5 01424b3848125e67c3f94c902f8f984f bind-9.3.0_rc2.ebuild 5892
-MD5 e74705fa1f4ec70e05cf44eb7796ba0e bind-9.3.1_beta2.ebuild 5937
+MD5 242fac0b5f26fab0bc0a3bded1fccdfa bind-9.2.2-r2.ebuild 4895
+MD5 0fce7dffc077cc801ceeaf46cce6ead0 bind-9.2.2-r4.ebuild 5828
+MD5 cd72383ad1ca331a6420cc16a347358a ChangeLog 9328
MD5 9878980f4b7a34ac4812812325b9ad85 metadata.xml 349
-MD5 42b5ed5adcee33cf40531d7955412b21 files/10bind.env 27
+MD5 5a5afd0ab570b531cd0094bf16f6735d bind-9.2.2-r1.ebuild 4880
MD5 51197afe8da37b1b453456de90ca4f25 files/127 227
-MD5 51197afe8da37b1b453456de90ca4f25 files/127.zone 227
-MD5 dca1f666d891ce36c77564bbf7eaeeb4 files/bind-9.2.2-mysql.patch 10993
-MD5 e020f0d41f68e0c47d196c4aa1a06c09 files/digest-bind-9.2.2 63
+MD5 9737865ebae92ab0721c61d7906d7a89 files/digest-bind-9.3.0_rc2 66
+MD5 75d14cac80e71b4ac0662775064c06e2 files/bind-9.2.5-dlz-mysql.patch 11296
+MD5 fa18c5f14f85becd0f8809b13d3156b9 files/digest-bind-9.3.1_beta2 68
MD5 e020f0d41f68e0c47d196c4aa1a06c09 files/digest-bind-9.2.2-r1 63
MD5 e020f0d41f68e0c47d196c4aa1a06c09 files/digest-bind-9.2.2-r2 63
MD5 309110e09d923344a34a803f8906fae3 files/digest-bind-9.2.2-r3 121
MD5 309110e09d923344a34a803f8906fae3 files/digest-bind-9.2.2-r4 121
MD5 ce78c05705c759f2494388ad313bdcbb files/digest-bind-9.2.2-r5 182
+MD5 a8ffc671392ffacafb5c49ffc1c6a4c6 files/named.rc6-pid_fix 488
+MD5 4346332cc9681502a3aedfd0a7a1ac41 files/bind-9.2.5-berkdb_fix.patch 537
+MD5 9a06b553558342585f8ba88bd5e4c569 files/bind-9.2.5-mysql.patch 11315
+MD5 e020f0d41f68e0c47d196c4aa1a06c09 files/digest-bind-9.2.2 63
MD5 feb1027d97d15dcf8fdc57b2de185af2 files/digest-bind-9.2.3 63
-MD5 9737865ebae92ab0721c61d7906d7a89 files/digest-bind-9.3.0_rc2 66
-MD5 fa18c5f14f85becd0f8809b13d3156b9 files/digest-bind-9.3.1_beta2 68
-MD5 2bb12cfcd70284e72fbf9e70e5e2974d files/dyndns-samples.tbz2 22866
+MD5 d47c8a742a2645377ba4d783907700dd files/digest-bind-9.2.5 127
+MD5 21e3efd21e18f4c660155978105f8ebe files/named.confd 351
+MD5 51197afe8da37b1b453456de90ca4f25 files/127.zone 227
MD5 ccfca63035b534556c3910270d40a4b9 files/localhost 412
-MD5 ccfca63035b534556c3910270d40a4b9 files/localhost.zone 412
-MD5 e83e7a76e253debfdd120311fda73fb6 files/named.ca 2518
MD5 b3af799ce2505e78a14bb16868cf0593 files/named.conf-r1 758
MD5 e9bb1e01cf0b7597e739e889499ddd7a files/named.conf-r2 768
MD5 be5fd752bdbd59385f2a559d603098d5 files/named.conf-r3 1314
-MD5 21e3efd21e18f4c660155978105f8ebe files/named.confd 351
+MD5 ccfca63035b534556c3910270d40a4b9 files/localhost.zone 412
+MD5 dca1f666d891ce36c77564bbf7eaeeb4 files/bind-9.2.2-mysql.patch 10993
+MD5 2bb12cfcd70284e72fbf9e70e5e2974d files/dyndns-samples.tbz2 22866
MD5 412d666c947769b6015a65a42bb8ea00 files/named.rc6 1434
+MD5 42b5ed5adcee33cf40531d7955412b21 files/10bind.env 27
+MD5 e83e7a76e253debfdd120311fda73fb6 files/named.ca 2518
diff --git a/net-dns/bind/bind-9.2.5.ebuild b/net-dns/bind/bind-9.2.5.ebuild
new file mode 100644
index 000000000000..6a3d85d812cf
--- /dev/null
+++ b/net-dns/bind/bind-9.2.5.ebuild
@@ -0,0 +1,229 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.2.5.ebuild,v 1.1 2005/03/25 22:28:20 voxus Exp $
+
+inherit eutils gnuconfig libtool
+
+IUSE="ssl ipv6 doc dlz postgres berkdb bind-mysql mysql odbc ldap selinux \
+ idn caps"
+
+DLZ_VER=0.7.0
+DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server"
+SRC_URI="ftp://ftp.isc.org/isc/bind9/${PV}/${P}.tar.gz
+ dlz? ( http://dev.gentoo.org/~voxus/dlz/dlz-${PV}.patch.bz2 )"
+# dlz? ( mirror://sourceforge/bind-dlz/DLZ-${DLZ_VER}.tar.gz )"
+HOMEPAGE="http://www.isc.org/products/BIND/bind9.html"
+
+# this ebuild contains the very untested dlz extension, hard-masking it for now
+KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~amd64 ~ppc64"
+
+LICENSE="as-is"
+SLOT="0"
+
+DEPEND="sys-apps/groff
+ sys-devel/autoconf
+ >=sys-apps/sed-4
+ ssl? ( >=dev-libs/openssl-0.9.6g )
+ mysql? ( >=dev-db/mysql-4 )
+ ldap? ( >=net-nds/openldap )"
+
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-bind )"
+
+src_unpack() {
+ unpack ${A} && cd ${S}
+
+ # Adjusting PATHs in manpages
+ for i in `echo bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8}`; do
+ sed -i -e 's:/etc/named.conf:/etc/bind/named.conf:g' \
+ -e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \
+ -e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \
+ ${i}
+ done
+
+ # it should be installed by bind-tools
+ sed "s:nsupdate ::g" ${S}/bin/Makefile.in > ${T}/Makefile
+ mv ${T}/Makefile ${S}/bin/Makefile.in
+
+ if use dlz; then
+ epatch ${DISTDIR}/dlz-${PV}.patch.bz2
+ epatch ${FILESDIR}/${P}-berkdb_fix.patch
+ fi
+
+ if use bind-mysql; then
+ if use dlz; then
+ epatch ${FILESDIR}/${P}-dlz-mysql.patch
+ else
+ epatch ${FILESDIR}/${P}-mysql.patch
+ fi
+ fi
+
+ if use idn; then
+ epatch ${S}/contrib/idn/idnkit-1.0-src/patch/bind9/${P}-patch
+ fi
+
+ cp ${FILESDIR}/named.rc6 ${T}
+ cd ${T} && epatch ${FILESDIR}/named.rc6-pid_fix
+
+ gnuconfig_update
+
+ cd ${S}
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
+}
+
+src_compile() {
+ local myconf=""
+
+ use ssl && myconf="${myconf} --with-openssl"
+ use ipv6 && myconf="${myconf} --enable-ipv6" || myconf="${myconf} --enable-ipv6=no"
+ use dlz && {
+ myconf="${myconf} --disable-threads --with-dlz-filesystem --with-dlz-stub" || myconf="${myconf} --enable-threads"
+ use postgres && myconf="${myconf} --with-dlz-postgres"
+ use mysql && myconf="${myconf} --with-dlz-mysql"
+ use berkdb && myconf="${myconf} --with-dlz-bdb"
+ use ldap && myconf="${myconf} --with-dlz-ldap"
+ use odbc && myconf="${myconf} --with-dlz-odbc"
+ }
+ use caps || myconf="${myconf} --disable-linux-caps"
+
+ econf \
+ --sysconfdir=/etc/bind \
+ --localstatedir=/var \
+ --with-libtool \
+ ${myconf} || die "econf failed"
+
+ emake -j1 || die "failed to compile bind"
+
+ if use idn; then
+ cd ${S}/contrib/idn/idnkit-1.0-src
+ econf || die "idn econf failed"
+ emake || die "idn emake failed"
+ fi
+}
+
+src_install() {
+ einstall || die "failed to install bind"
+
+ dodoc CHANGES COPYRIGHT FAQ README
+
+ use doc && {
+ docinto misc ; dodoc doc/misc/*
+ docinto html ; dohtml doc/arm/*
+ docinto draft ; dodoc doc/draft/*
+ docinto rfc ; dodoc doc/rfc/*
+ docinto contrib ; dodoc contrib/named-bootconf/named-bootconf.sh \
+ contrib/nanny/nanny.pl
+ }
+
+ insinto /etc/env.d
+ newins ${FILESDIR}/10bind.env 10bind
+
+ # some handy-dandy dynamic dns examples
+ cd ${D}/usr/share/doc/${PF}
+ tar pjxf ${FILESDIR}/dyndns-samples.tbz2
+
+ dodir /etc/bind /var/bind/{pri,sec}
+ keepdir /var/bind/sec
+
+ insinto /etc/bind ; newins ${FILESDIR}/named.conf-r2 named.conf
+ # ftp://ftp.rs.internic.net/domain/named.ca:
+ insinto /var/bind ; doins ${FILESDIR}/named.ca
+ insinto /var/bind/pri ; doins ${FILESDIR}/{127,localhost}.zone
+
+ exeinto /etc/init.d ; newexe ${T}/named.rc6 named
+ insinto /etc/conf.d ; newins ${FILESDIR}/named.confd named
+
+ dosym ../../var/bind/named.ca /var/bind/root.cache
+ dosym ../../var/bind/pri /etc/bind/pri
+ dosym ../../var/bind/sec /etc/bind/sec
+
+ if use idn; then
+ cd ${S}/contrib/idn/idnkit-1.0-src
+ einstall || die "failed to install idn kit"
+ docinto idn
+ dodoc ChangeLog INSTALL{,.ja} README{,.ja} NEWS
+ fi
+
+ # Let's get rid of those tools and their manpages since they're provided by bind-tools
+ rm -f ${D}/usr/share/man/man1/{dig.1,host.1,nslookup.1}
+ rm -f ${D}/usr/bin/{dig,host,nslookup}
+}
+
+pkg_postinst() {
+ if [ ! -f '/etc/bind/rndc.key' ]; then
+ /usr/sbin/rndc-confgen -a -u named
+ fi
+
+ install -d -o named -g named ${ROOT}/var/run/named \
+ ${ROOT}/var/bind/pri ${ROOT}/var/bind/sec
+ chown -R named:named ${ROOT}/var/bind
+
+ einfo "The default zone files are now installed as *.zone,"
+ einfo "be careful merging config files if you have modified"
+ einfo "/var/bind/pri/127 or /var/bind/pri/localhost"
+ einfo
+ einfo "You can edit /etc/conf.d/named to customize named settings"
+ einfo
+ einfo "The BIND ebuild now includes chroot support."
+ einfo "If you like to run bind in chroot AND this is a new install OR"
+ einfo "your bind doesn't already run in chroot, simply run:"
+ einfo "\`ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\`"
+ einfo "Before running the above command you might want to change the chroot"
+ einfo "dir in /etc/conf.d/named. Otherwise /chroot/dns will be used."
+ echo
+ einfo "Recently verisign added a wildcard A record to the .COM and .NET TLD"
+ einfo "zones making all .com and .net domains appear to be registered"
+ einfo "This causes many problems such as breaking important anti-spam checks"
+ einfo "which verify source domains exist. ISC released a patch for BIND which"
+ einfo "adds 'delegation-only' zones to allow admins to return the .com and .net"
+ einfo "domain resolution to their normal function."
+ echo
+ einfo "There is no need to create a com or net data file. Just the"
+ einfo "entries to the named.conf file is enough."
+ echo
+ einfo " zone "com" IN { type delegation-only; };"
+ einfo " zone "net" IN { type delegation-only; };"
+}
+
+pkg_config() {
+
+ CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/named 2>/dev/null`
+ EXISTS="no"
+
+ if [ -z "${CHROOT}" -a ! -d "/chroot/dns" ]; then
+ CHROOT="/chroot/dns"
+ elif [ -d ${CHROOT} ]; then
+ eerror; eerror "${CHROOT:-/chroot/dns} already exists. Quitting."; eerror; EXISTS="yes"
+ fi
+
+ if [ ! "$EXISTS" = yes ]; then
+ einfo ; einfon "Setting up the chroot directory..."
+ mkdir -m 700 -p ${CHROOT}
+ mkdir -p ${CHROOT}/{dev,etc,var/run/named}
+ chown -R named:named ${CHROOT}/var/run/named
+ cp -R /etc/bind ${CHROOT}/etc/
+ cp /etc/localtime ${CHROOT}/etc/localtime
+ chown named:named ${CHROOT}/etc/bind/rndc.key
+ cp -R /var/bind ${CHROOT}/var/
+ chown -R named:named ${CHROOT}/var/
+ mknod ${CHROOT}/dev/zero c 1 5
+ mknod ${CHROOT}/dev/random c 1 8
+ chmod 666 ${CHROOT}/dev/{random,zero}
+ chown named:named ${CHROOT}
+
+ grep -q "^#[[:blank:]]\?CHROOT" /etc/conf.d/named ; RETVAL=$?
+ if [ $RETVAL = 0 ]; then
+ sed 's/^# \?\(CHROOT.*\)$/\1/' /etc/conf.d/named > /etc/conf.d/named.orig 2>/dev/null
+ mv --force /etc/conf.d/named.orig /etc/conf.d/named
+ fi
+
+ sleep 1; echo " Done."; sleep 1
+ einfo
+ einfo "Add the following to your root .bashrc or .bash_profile: "
+ einfo " alias rndc='rndc -k ${CHROOT}/etc/bind/rndc.key'"
+ einfo "Then do the following: "
+ einfo " source /root/.bashrc or .bash_profile"
+ einfo
+ fi
+}
+
diff --git a/net-dns/bind/files/bind-9.2.5-berkdb_fix.patch b/net-dns/bind/files/bind-9.2.5-berkdb_fix.patch
new file mode 100644
index 000000000000..ba6bc3f1758a
--- /dev/null
+++ b/net-dns/bind/files/bind-9.2.5-berkdb_fix.patch
@@ -0,0 +1,11 @@
+--- configure.in.orig 2005-03-25 23:33:33.000000000 +0300
++++ configure.in 2005-03-25 23:34:04.000000000 +0300
+@@ -453,7 +453,7 @@
+ then
+ use_dlz_bdb=$d
+ DLZ_BDB_INCDIR=$use_dlz_bdb/include
+- DLB_BDB_LIB="-ldb"
++ DLZ_BDB_LIB="-ldb"
+ break
+ fi
+ done
diff --git a/net-dns/bind/files/bind-9.2.5-dlz-mysql.patch b/net-dns/bind/files/bind-9.2.5-dlz-mysql.patch
new file mode 100644
index 000000000000..e4ac2e94f4cb
--- /dev/null
+++ b/net-dns/bind/files/bind-9.2.5-dlz-mysql.patch
@@ -0,0 +1,402 @@
+diff -uraN bind-9.2.5-dlz/bin/named/include/mysqldb.h bind-9.2.5-dlz-mysql/bin/named/include/mysqldb.h
+--- bind-9.2.5-dlz/bin/named/include/mysqldb.h 1970-01-01 03:00:00.000000000 +0300
++++ bind-9.2.5-dlz-mysql/bin/named/include/mysqldb.h 2005-03-25 21:41:25.000000000 +0300
+@@ -0,0 +1,7 @@
++
++#include <isc/types.h>
++
++isc_result_t mysqldb_init(void);
++
++void mysqldb_clear(void);
++
+diff -uraN bind-9.2.5-dlz/bin/named/main.c bind-9.2.5-dlz-mysql/bin/named/main.c
+--- bind-9.2.5-dlz/bin/named/main.c 2005-03-25 21:41:01.000000000 +0300
++++ bind-9.2.5-dlz-mysql/bin/named/main.c 2005-03-25 21:41:25.000000000 +0300
+@@ -68,6 +68,7 @@
+ * Include header files for database drivers here.
+ */
+ /* #include "xxdb.h" */
++#include "mysqldb.h"
+
+ #ifdef DLZ_STUB
+ #include <named/dlz_stub_driver.h>
+@@ -594,6 +595,7 @@
+ * Add calls to register sdb drivers here.
+ */
+ /* xxdb_init(); */
++ mysqldb_init ();
+
+ #ifdef DLZ_STUB
+ dlz_stub_init();
+@@ -637,6 +639,7 @@
+ * Add calls to unregister sdb drivers here.
+ */
+ /* xxdb_clear(); */
++ mysqldb_clear ();
+
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "exiting");
+diff -uraN bind-9.2.5-dlz/bin/named/Makefile.in bind-9.2.5-dlz-mysql/bin/named/Makefile.in
+--- bind-9.2.5-dlz/bin/named/Makefile.in 2005-03-25 21:41:01.000000000 +0300
++++ bind-9.2.5-dlz-mysql/bin/named/Makefile.in 2005-03-25 21:41:25.000000000 +0300
+@@ -26,10 +26,10 @@
+ #
+ # Add database drivers here.
+ #
+-DBDRIVER_OBJS =
+-DBDRIVER_SRCS =
+-DBDRIVER_INCLUDES =
+-DBDRIVER_LIBS =
++DBDRIVER_OBJS = mysqldb.@O@
++DBDRIVER_SRCS = mysqldb.c
++DBDRIVER_INCLUDES = -I/usr/local/include
++DBDRIVER_LIBS = -L/usr/local/lib/mysql -lmysqlclient
+
+ DLZINCLUDES = @DLZ_BDB_INC@ @DLZ_POSTGRES_INC@ @DLZ_ODBC_INC@ \
+ @DLZ_MYSQL_INC@ @DLZ_LDAP_INC@
+diff -uraN bind-9.2.5-dlz/bin/named/mysqldb.c bind-9.2.5-dlz-mysql/bin/named/mysqldb.c
+--- bind-9.2.5-dlz/bin/named/mysqldb.c 1970-01-01 03:00:00.000000000 +0300
++++ bind-9.2.5-dlz-mysql/bin/named/mysqldb.c 2005-03-25 21:41:25.000000000 +0300
+@@ -0,0 +1,342 @@
++/*
++ * Copyright (C) 2002 Mihai Chelaru ( kefren@netbastards.org )
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND I DISCLAIM ALL WARRANTIES WITH
++ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS. IN NO EVENT SHALL I BE LIABLE FOR ANY SPECIAL, DIRECT,
++ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
++ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++
++#include <config.h>
++#include <stdio.h>
++#include <malloc.h>
++#include <mysql/mysql.h>
++#include <isc/mem.h>
++#include <dns/sdb.h>
++#include <dns/result.h>
++#include <named/globals.h>
++
++#include <mysqldb.h>
++
++#define ROWS 20
++#define MAXCOLUMN 200
++
++/*
++#define ONEDATABASE
++#define MDEBUG
++*/
++struct mysqlrow {
++ char *s[ROWS];
++};
++
++static dns_sdbimplementation_t *mysqldb = NULL;
++
++struct mydbinfo {
++ MYSQL *conn;
++ char *database;
++ char *table;
++ char *host;
++ char *user;
++ char *passwd;
++};
++
++/* My internal functions */
++
++int mysql_dbcon(struct mydbinfo *);
++
++int
++mysql_dbcon(struct mydbinfo * dbi)
++{
++#ifdef MDEBUG
++ printf("Connecting\n");
++#endif
++ dbi->conn=mysql_init(NULL);
++ if (dbi->conn == NULL) return 0;
++ if (!mysql_real_connect(dbi->conn, dbi->host, dbi->user, dbi->passwd, dbi->database, 3306, NULL, 0))
++ return 0;
++#ifdef MDEBUG
++ printf("Connected\n");
++#endif
++ return 1;
++}
++
++/* External functions */
++
++static isc_result_t
++mysqldb_lookup(const char *zone, const char *name, void *dbdata, dns_sdblookup_t * lookup)
++{
++ char *querystring = NULL, seclook[150];
++ struct mydbinfo *dbi = (struct mydbinfo *) dbdata;
++ MYSQL_RES *result;
++ struct mysqlrow myrow;
++ int i, j, totlen;
++ MYSQL_ROW row;
++ int num_fields, putrr_success=0;
++#ifdef MDEBUG
++ printf("Lookup in %.200s for %.200s ", zone, name);
++#endif
++ querystring = (char *) malloc(200);
++ if (!querystring)
++ return ISC_R_NOMEMORY;
++ snprintf(querystring, 200, "SELECT TTL,RDTYPE,RDATA FROM %s where name='%.150s'", dbi->table, name);
++#ifdef MDEBUG
++ printf("Query = %s\n", querystring);
++#endif
++ mysql_ping(dbi->conn);
++ if (mysql_query(dbi->conn, querystring)) {
++ printf("Query Error in lookup\n");
++ free(querystring);
++ return ISC_R_FAILURE;
++ }
++ free(querystring);
++ result = mysql_store_result(dbi->conn);
++
++ num_fields = mysql_num_fields(result);
++ if (num_fields > ROWS) {
++ printf("Incorrect database format\n");
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ /* allocate to fetch */
++ for (i = 0; i < ROWS; i++)
++ if (!(myrow.s[i] = (char *) malloc(MAXCOLUMN))) {
++ for (j = 0; j < i; j++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_NOMEMORY;
++ }
++ /* Ok. we found no reason why to not let fetch */
++ while ((row = mysql_fetch_row(result))) {
++ unsigned long *lengths;
++ lengths = mysql_fetch_lengths(result);
++ totlen = 0;
++ for (i = 0; i < num_fields; i++) {
++ totlen += lengths[i];
++ snprintf(myrow.s[i], MAXCOLUMN, "%.*s", (int) lengths[i], row[i] ? row[i] : "NULL");
++ }
++#ifdef MDEBUG
++ printf("Lookup: %s %s %s\n", myrow.s[0], myrow.s[1], myrow.s[2]);
++#endif
++ if (dns_sdb_putrr(lookup, myrow.s[1], strtol(myrow.s[0], NULL, 10), myrow.s[2]) != ISC_R_SUCCESS) {
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ printf("Lookup Failure\n");
++ return ISC_R_FAILURE;
++ } else putrr_success=1;
++ }
++#ifdef MDEBUG
++ printf ("Bailing out lookup\n");
++#endif
++ /* Ok. success. bail out. */
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++
++ /* Check if there is any *.foo.com available and return it in case that this is not a *.foo.com call */
++ if ((!putrr_success)&&(name[0]!='*')) {
++#ifdef MDEBUG
++printf ("Cannot find it. Trying to check * record\n");
++#endif
++ snprintf (seclook,150,"*.%s",zone);
++ return mysqldb_lookup (zone, seclook, dbdata, lookup);
++ }
++
++ /* else return SUCCESS */
++ return ISC_R_SUCCESS;
++}
++
++static isc_result_t
++mysqldb_allnodes(const char *zone, void *dbdata, dns_sdballnodes_t * allnodes)
++{
++ char *querystring = NULL;
++ struct mydbinfo *dbi = (struct mydbinfo *) dbdata;
++ MYSQL_RES *result;
++ struct mysqlrow myrow;
++ MYSQL_ROW row;
++ int num_fields;
++ int i, totlen, j;
++#ifdef MDEBUG
++ printf("All Nodes\n");
++#endif
++ querystring = (char *) malloc(200);
++ if (!querystring)
++ return ISC_R_NOMEMORY;
++ snprintf(querystring, 200, "SELECT TTL,NAME,RDTYPE,RDATA FROM %s where name like('%%%.150s')", dbi->table, zone);
++ mysql_ping(dbi->conn);
++ if (mysql_query(dbi->conn, querystring)) {
++ printf("Query Error\n");
++ free(querystring);
++ return ISC_R_FAILURE;
++ }
++ free(querystring);
++ result = mysql_store_result(dbi->conn);
++
++ num_fields = mysql_num_fields(result);
++ if (num_fields > ROWS) {
++ printf("Incorrect database format\n");
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ /* allocate to fetch */
++ for (i = 0; i < ROWS; i++)
++ if (!(myrow.s[i] = (char *) malloc(MAXCOLUMN))) {
++ for (j = 0; j < i; j++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_NOMEMORY;
++ }
++ /* Ok. we found no reason why to not let fetch */
++ while ((row = mysql_fetch_row(result))) {
++ unsigned long *lengths;
++ lengths = mysql_fetch_lengths(result);
++ totlen = 0;
++ for (i = 0; i < num_fields; i++) {
++ totlen += lengths[i];
++ snprintf(myrow.s[i], MAXCOLUMN, "%.*s", (int) lengths[i], row[i] ? row[i] : "NULL");
++ }
++#ifdef MDEBUG
++ printf("All Nodes: %s %s %s %s\n", myrow.s[0], myrow.s[1], myrow.s[2], myrow.s[3]);
++#endif
++ if (dns_sdb_putnamedrr(allnodes, myrow.s[1], myrow.s[2], strtol(myrow.s[0], NULL, 10), myrow.s[3]) != ISC_R_SUCCESS) {
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ }
++
++ /* Ok. success. bail out. */
++ mysql_free_result(result);
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ return ISC_R_SUCCESS;
++}
++
++
++
++/*
++ * Open database argv[i]=database,table,hostname,user,passwd
++ */
++
++static isc_result_t
++mysqldb_create(const char *zone, int argc, char **argv, void *driverdata, void **dbdata)
++{
++ struct mydbinfo *dbi;
++ #ifdef ONEDATABASE
++ static MYSQL *dbconstat;
++ #endif
++
++ /* Argument count checking */
++ if (argc < 5)
++ return ISC_R_FAILURE;
++
++ /* dbi init */
++
++ dbi = (struct mydbinfo *) isc_mem_get(ns_g_mctx, sizeof(struct mydbinfo));
++ if (!dbi)
++ return ISC_R_NOMEMORY;
++ dbi->database = NULL;
++ dbi->table = NULL;
++ dbi->host = NULL;
++ dbi->user = NULL;
++ dbi->passwd = NULL;
++
++ dbi->database = isc_mem_strdup(ns_g_mctx, argv[0]);
++ dbi->table = isc_mem_strdup(ns_g_mctx, argv[1]);
++ dbi->host = isc_mem_strdup(ns_g_mctx, argv[2]);
++ dbi->user = isc_mem_strdup(ns_g_mctx, argv[3]);
++ dbi->passwd = isc_mem_strdup(ns_g_mctx, argv[4]);
++
++ if ((!dbi->database) || (!dbi->table) || (!dbi->host) || (!dbi->user) || (!dbi->passwd)) {
++ printf("Cannot strdup\n");
++ if (dbi->conn)
++ mysql_close(dbi->conn);
++ if (dbi->database)
++ isc_mem_free(ns_g_mctx, dbi->database);
++ if (dbi->table)
++ isc_mem_free(ns_g_mctx, dbi->table);
++ if (dbi->host)
++ isc_mem_free(ns_g_mctx, dbi->host);
++ if (dbi->user)
++ isc_mem_free(ns_g_mctx, dbi->user);
++ if (dbi->passwd)
++ isc_mem_free(ns_g_mctx, dbi->passwd);
++ isc_mem_put(ns_g_mctx, dbi, sizeof(struct mydbinfo));
++ return ISC_R_NOMEMORY;
++ }
++ /* connect to database */
++ #ifdef ONEDATABASE
++ if (!((dbconstat) && (!mysql_ping(dbconstat))))
++ #endif
++ if (!mysql_dbcon(dbi)) {
++ printf("Cannot connect to database\n");
++ return ISC_R_FAILURE;
++ }
++ #ifdef ONEDATABASE
++ if (dbconstat) dbi->conn = dbconstat; else dbconstat = dbi->conn;
++ #endif
++ *dbdata = dbi;
++ return ISC_R_SUCCESS;
++}
++
++static void
++mysqldb_destroy(const char *zone, void *driverdata, void **dbdata)
++{
++ struct mydbinfo *dbi;
++
++ dbi = (struct mydbinfo *) (*dbdata);
++ if (!dbi)
++ return;
++ if (dbi->conn)
++ mysql_close(dbi->conn);
++ if (dbi->database)
++ isc_mem_free(ns_g_mctx, dbi->database);
++ if (dbi->table)
++ isc_mem_free(ns_g_mctx, dbi->table);
++ if (dbi->host)
++ isc_mem_free(ns_g_mctx, dbi->host);
++ if (dbi->user)
++ isc_mem_free(ns_g_mctx, dbi->user);
++ if (dbi->passwd)
++ isc_mem_free(ns_g_mctx, dbi->passwd);
++ isc_mem_put(ns_g_mctx, dbi, sizeof(struct mydbinfo));
++#ifdef MDEBUG
++ printf("Destroyed\n");
++#endif
++}
++
++
++/* SDB methods */
++
++static dns_sdbmethods_t mysqldb_methods = {
++ mysqldb_lookup,
++ NULL, /* authority */
++ mysqldb_allnodes,
++ mysqldb_create,
++ mysqldb_destroy
++};
++
++
++
++isc_result_t
++mysqldb_init()
++{
++ unsigned int flags = 0;
++ return dns_sdb_register("mysql", &mysqldb_methods, NULL, flags, ns_g_mctx, &mysqldb);
++}
++
++void
++mysqldb_clear()
++{
++ if (mysqldb)
++ dns_sdb_unregister(&mysqldb);
++}
diff --git a/net-dns/bind/files/bind-9.2.5-mysql.patch b/net-dns/bind/files/bind-9.2.5-mysql.patch
new file mode 100644
index 000000000000..28b02f375d5b
--- /dev/null
+++ b/net-dns/bind/files/bind-9.2.5-mysql.patch
@@ -0,0 +1,402 @@
+diff -uraN bind-9.2.5-orig/bin/named/include/mysqldb.h bind-9.2.5-mysql/bin/named/include/mysqldb.h
+--- bind-9.2.5-orig/bin/named/include/mysqldb.h 1970-01-01 03:00:00.000000000 +0300
++++ bind-9.2.5-mysql/bin/named/include/mysqldb.h 2005-03-25 21:35:47.000000000 +0300
+@@ -0,0 +1,7 @@
++
++#include <isc/types.h>
++
++isc_result_t mysqldb_init(void);
++
++void mysqldb_clear(void);
++
+diff -uraN bind-9.2.5-orig/bin/named/main.c bind-9.2.5-mysql/bin/named/main.c
+--- bind-9.2.5-orig/bin/named/main.c 2004-10-25 04:50:53.000000000 +0400
++++ bind-9.2.5-mysql/bin/named/main.c 2005-03-25 21:35:47.000000000 +0300
+@@ -68,6 +68,7 @@
+ * Include header files for database drivers here.
+ */
+ /* #include "xxdb.h" */
++#include "mysqldb.h"
+
+ static isc_boolean_t want_stats = ISC_FALSE;
+ static char program_name[ISC_DIR_NAMEMAX] = "named";
+@@ -565,6 +566,7 @@
+ * Add calls to register sdb drivers here.
+ */
+ /* xxdb_init(); */
++ mysqldb_init ();
+
+ ns_server_create(ns_g_mctx, &ns_g_server);
+ }
+@@ -579,6 +581,7 @@
+ * Add calls to unregister sdb drivers here.
+ */
+ /* xxdb_clear(); */
++ mysqldb_clear ();
+
+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
+ ISC_LOG_NOTICE, "exiting");
+diff -uraN bind-9.2.5-orig/bin/named/Makefile.in bind-9.2.5-mysql/bin/named/Makefile.in
+--- bind-9.2.5-orig/bin/named/Makefile.in 2004-09-07 01:42:06.000000000 +0400
++++ bind-9.2.5-mysql/bin/named/Makefile.in 2005-03-25 21:35:47.000000000 +0300
+@@ -26,10 +26,10 @@
+ #
+ # Add database drivers here.
+ #
+-DBDRIVER_OBJS =
+-DBDRIVER_SRCS =
+-DBDRIVER_INCLUDES =
+-DBDRIVER_LIBS =
++DBDRIVER_OBJS = mysqldb.@O@
++DBDRIVER_SRCS = mysqldb.c
++DBDRIVER_INCLUDES = -I/usr/local/include
++DBDRIVER_LIBS = -L/usr/local/lib/mysql -lmysqlclient
+
+ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include \
+ ${LWRES_INCLUDES} ${DNS_INCLUDES} \
+diff -uraN bind-9.2.5-orig/bin/named/mysqldb.c bind-9.2.5-mysql/bin/named/mysqldb.c
+--- bind-9.2.5-orig/bin/named/mysqldb.c 1970-01-01 03:00:00.000000000 +0300
++++ bind-9.2.5-mysql/bin/named/mysqldb.c 2005-03-25 21:35:47.000000000 +0300
+@@ -0,0 +1,342 @@
++/*
++ * Copyright (C) 2002 Mihai Chelaru ( kefren@netbastards.org )
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND I DISCLAIM ALL WARRANTIES WITH
++ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS. IN NO EVENT SHALL I BE LIABLE FOR ANY SPECIAL, DIRECT,
++ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
++ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++
++#include <config.h>
++#include <stdio.h>
++#include <malloc.h>
++#include <mysql/mysql.h>
++#include <isc/mem.h>
++#include <dns/sdb.h>
++#include <dns/result.h>
++#include <named/globals.h>
++
++#include <mysqldb.h>
++
++#define ROWS 20
++#define MAXCOLUMN 200
++
++/*
++#define ONEDATABASE
++#define MDEBUG
++*/
++struct mysqlrow {
++ char *s[ROWS];
++};
++
++static dns_sdbimplementation_t *mysqldb = NULL;
++
++struct mydbinfo {
++ MYSQL *conn;
++ char *database;
++ char *table;
++ char *host;
++ char *user;
++ char *passwd;
++};
++
++/* My internal functions */
++
++int mysql_dbcon(struct mydbinfo *);
++
++int
++mysql_dbcon(struct mydbinfo * dbi)
++{
++#ifdef MDEBUG
++ printf("Connecting\n");
++#endif
++ dbi->conn=mysql_init(NULL);
++ if (dbi->conn == NULL) return 0;
++ if (!mysql_real_connect(dbi->conn, dbi->host, dbi->user, dbi->passwd, dbi->database, 3306, NULL, 0))
++ return 0;
++#ifdef MDEBUG
++ printf("Connected\n");
++#endif
++ return 1;
++}
++
++/* External functions */
++
++static isc_result_t
++mysqldb_lookup(const char *zone, const char *name, void *dbdata, dns_sdblookup_t * lookup)
++{
++ char *querystring = NULL, seclook[150];
++ struct mydbinfo *dbi = (struct mydbinfo *) dbdata;
++ MYSQL_RES *result;
++ struct mysqlrow myrow;
++ int i, j, totlen;
++ MYSQL_ROW row;
++ int num_fields, putrr_success=0;
++#ifdef MDEBUG
++ printf("Lookup in %.200s for %.200s ", zone, name);
++#endif
++ querystring = (char *) malloc(200);
++ if (!querystring)
++ return ISC_R_NOMEMORY;
++ snprintf(querystring, 200, "SELECT TTL,RDTYPE,RDATA FROM %s where name='%.150s'", dbi->table, name);
++#ifdef MDEBUG
++ printf("Query = %s\n", querystring);
++#endif
++ mysql_ping(dbi->conn);
++ if (mysql_query(dbi->conn, querystring)) {
++ printf("Query Error in lookup\n");
++ free(querystring);
++ return ISC_R_FAILURE;
++ }
++ free(querystring);
++ result = mysql_store_result(dbi->conn);
++
++ num_fields = mysql_num_fields(result);
++ if (num_fields > ROWS) {
++ printf("Incorrect database format\n");
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ /* allocate to fetch */
++ for (i = 0; i < ROWS; i++)
++ if (!(myrow.s[i] = (char *) malloc(MAXCOLUMN))) {
++ for (j = 0; j < i; j++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_NOMEMORY;
++ }
++ /* Ok. we found no reason why to not let fetch */
++ while ((row = mysql_fetch_row(result))) {
++ unsigned long *lengths;
++ lengths = mysql_fetch_lengths(result);
++ totlen = 0;
++ for (i = 0; i < num_fields; i++) {
++ totlen += lengths[i];
++ snprintf(myrow.s[i], MAXCOLUMN, "%.*s", (int) lengths[i], row[i] ? row[i] : "NULL");
++ }
++#ifdef MDEBUG
++ printf("Lookup: %s %s %s\n", myrow.s[0], myrow.s[1], myrow.s[2]);
++#endif
++ if (dns_sdb_putrr(lookup, myrow.s[1], strtol(myrow.s[0], NULL, 10), myrow.s[2]) != ISC_R_SUCCESS) {
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ printf("Lookup Failure\n");
++ return ISC_R_FAILURE;
++ } else putrr_success=1;
++ }
++#ifdef MDEBUG
++ printf ("Bailing out lookup\n");
++#endif
++ /* Ok. success. bail out. */
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++
++ /* Check if there is any *.foo.com available and return it in case that this is not a *.foo.com call */
++ if ((!putrr_success)&&(name[0]!='*')) {
++#ifdef MDEBUG
++printf ("Cannot find it. Trying to check * record\n");
++#endif
++ snprintf (seclook,150,"*.%s",zone);
++ return mysqldb_lookup (zone, seclook, dbdata, lookup);
++ }
++
++ /* else return SUCCESS */
++ return ISC_R_SUCCESS;
++}
++
++static isc_result_t
++mysqldb_allnodes(const char *zone, void *dbdata, dns_sdballnodes_t * allnodes)
++{
++ char *querystring = NULL;
++ struct mydbinfo *dbi = (struct mydbinfo *) dbdata;
++ MYSQL_RES *result;
++ struct mysqlrow myrow;
++ MYSQL_ROW row;
++ int num_fields;
++ int i, totlen, j;
++#ifdef MDEBUG
++ printf("All Nodes\n");
++#endif
++ querystring = (char *) malloc(200);
++ if (!querystring)
++ return ISC_R_NOMEMORY;
++ snprintf(querystring, 200, "SELECT TTL,NAME,RDTYPE,RDATA FROM %s where name like('%%%.150s')", dbi->table, zone);
++ mysql_ping(dbi->conn);
++ if (mysql_query(dbi->conn, querystring)) {
++ printf("Query Error\n");
++ free(querystring);
++ return ISC_R_FAILURE;
++ }
++ free(querystring);
++ result = mysql_store_result(dbi->conn);
++
++ num_fields = mysql_num_fields(result);
++ if (num_fields > ROWS) {
++ printf("Incorrect database format\n");
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ /* allocate to fetch */
++ for (i = 0; i < ROWS; i++)
++ if (!(myrow.s[i] = (char *) malloc(MAXCOLUMN))) {
++ for (j = 0; j < i; j++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_NOMEMORY;
++ }
++ /* Ok. we found no reason why to not let fetch */
++ while ((row = mysql_fetch_row(result))) {
++ unsigned long *lengths;
++ lengths = mysql_fetch_lengths(result);
++ totlen = 0;
++ for (i = 0; i < num_fields; i++) {
++ totlen += lengths[i];
++ snprintf(myrow.s[i], MAXCOLUMN, "%.*s", (int) lengths[i], row[i] ? row[i] : "NULL");
++ }
++#ifdef MDEBUG
++ printf("All Nodes: %s %s %s %s\n", myrow.s[0], myrow.s[1], myrow.s[2], myrow.s[3]);
++#endif
++ if (dns_sdb_putnamedrr(allnodes, myrow.s[1], myrow.s[2], strtol(myrow.s[0], NULL, 10), myrow.s[3]) != ISC_R_SUCCESS) {
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ mysql_free_result(result);
++ return ISC_R_FAILURE;
++ }
++ }
++
++ /* Ok. success. bail out. */
++ mysql_free_result(result);
++ for (i = 0; i < ROWS; i++)
++ free(myrow.s[i]);
++ return ISC_R_SUCCESS;
++}
++
++
++
++/*
++ * Open database argv[i]=database,table,hostname,user,passwd
++ */
++
++static isc_result_t
++mysqldb_create(const char *zone, int argc, char **argv, void *driverdata, void **dbdata)
++{
++ struct mydbinfo *dbi;
++ #ifdef ONEDATABASE
++ static MYSQL *dbconstat;
++ #endif
++
++ /* Argument count checking */
++ if (argc < 5)
++ return ISC_R_FAILURE;
++
++ /* dbi init */
++
++ dbi = (struct mydbinfo *) isc_mem_get(ns_g_mctx, sizeof(struct mydbinfo));
++ if (!dbi)
++ return ISC_R_NOMEMORY;
++ dbi->database = NULL;
++ dbi->table = NULL;
++ dbi->host = NULL;
++ dbi->user = NULL;
++ dbi->passwd = NULL;
++
++ dbi->database = isc_mem_strdup(ns_g_mctx, argv[0]);
++ dbi->table = isc_mem_strdup(ns_g_mctx, argv[1]);
++ dbi->host = isc_mem_strdup(ns_g_mctx, argv[2]);
++ dbi->user = isc_mem_strdup(ns_g_mctx, argv[3]);
++ dbi->passwd = isc_mem_strdup(ns_g_mctx, argv[4]);
++
++ if ((!dbi->database) || (!dbi->table) || (!dbi->host) || (!dbi->user) || (!dbi->passwd)) {
++ printf("Cannot strdup\n");
++ if (dbi->conn)
++ mysql_close(dbi->conn);
++ if (dbi->database)
++ isc_mem_free(ns_g_mctx, dbi->database);
++ if (dbi->table)
++ isc_mem_free(ns_g_mctx, dbi->table);
++ if (dbi->host)
++ isc_mem_free(ns_g_mctx, dbi->host);
++ if (dbi->user)
++ isc_mem_free(ns_g_mctx, dbi->user);
++ if (dbi->passwd)
++ isc_mem_free(ns_g_mctx, dbi->passwd);
++ isc_mem_put(ns_g_mctx, dbi, sizeof(struct mydbinfo));
++ return ISC_R_NOMEMORY;
++ }
++ /* connect to database */
++ #ifdef ONEDATABASE
++ if (!((dbconstat) && (!mysql_ping(dbconstat))))
++ #endif
++ if (!mysql_dbcon(dbi)) {
++ printf("Cannot connect to database\n");
++ return ISC_R_FAILURE;
++ }
++ #ifdef ONEDATABASE
++ if (dbconstat) dbi->conn = dbconstat; else dbconstat = dbi->conn;
++ #endif
++ *dbdata = dbi;
++ return ISC_R_SUCCESS;
++}
++
++static void
++mysqldb_destroy(const char *zone, void *driverdata, void **dbdata)
++{
++ struct mydbinfo *dbi;
++
++ dbi = (struct mydbinfo *) (*dbdata);
++ if (!dbi)
++ return;
++ if (dbi->conn)
++ mysql_close(dbi->conn);
++ if (dbi->database)
++ isc_mem_free(ns_g_mctx, dbi->database);
++ if (dbi->table)
++ isc_mem_free(ns_g_mctx, dbi->table);
++ if (dbi->host)
++ isc_mem_free(ns_g_mctx, dbi->host);
++ if (dbi->user)
++ isc_mem_free(ns_g_mctx, dbi->user);
++ if (dbi->passwd)
++ isc_mem_free(ns_g_mctx, dbi->passwd);
++ isc_mem_put(ns_g_mctx, dbi, sizeof(struct mydbinfo));
++#ifdef MDEBUG
++ printf("Destroyed\n");
++#endif
++}
++
++
++/* SDB methods */
++
++static dns_sdbmethods_t mysqldb_methods = {
++ mysqldb_lookup,
++ NULL, /* authority */
++ mysqldb_allnodes,
++ mysqldb_create,
++ mysqldb_destroy
++};
++
++
++
++isc_result_t
++mysqldb_init()
++{
++ unsigned int flags = 0;
++ return dns_sdb_register("mysql", &mysqldb_methods, NULL, flags, ns_g_mctx, &mysqldb);
++}
++
++void
++mysqldb_clear()
++{
++ if (mysqldb)
++ dns_sdb_unregister(&mysqldb);
++}
diff --git a/net-dns/bind/files/digest-bind-9.2.5 b/net-dns/bind/files/digest-bind-9.2.5
new file mode 100644
index 000000000000..917f82e7d0d6
--- /dev/null
+++ b/net-dns/bind/files/digest-bind-9.2.5
@@ -0,0 +1,2 @@
+MD5 35a265fb97a068c066e22306ea32fd1f bind-9.2.5.tar.gz 4504389
+MD5 3bb820ced02fa2db7ae37e5288a73706 dlz-9.2.5.patch.bz2 135932
diff --git a/net-dns/bind/files/named.rc6-pid_fix b/net-dns/bind/files/named.rc6-pid_fix
new file mode 100644
index 000000000000..3f3c4fa787d5
--- /dev/null
+++ b/net-dns/bind/files/named.rc6-pid_fix
@@ -0,0 +1,13 @@
+--- files/named.rc6 2004-07-15 03:36:02.000000000 +0400
++++ named 2005-03-25 20:19:16.000000000 +0300
+@@ -33,7 +33,9 @@
+ start() {
+ ebegin "Starting ${CHROOT:+chrooted }named"
+ checkconfig || return 1
+- start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT}
++ start-stop-daemon --start --quiet --exec /usr/sbin/named \
++ --pid ${CHROOT}/var/run/named/named.pid \
++ -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT}
+ eend $?
+ }
+