diff options
author | Konstantin V. Arkhipov <voxus@gentoo.org> | 2005-07-02 09:49:20 +0000 |
---|---|---|
committer | Konstantin V. Arkhipov <voxus@gentoo.org> | 2005-07-02 09:49:20 +0000 |
commit | 334e984ff2adcedb5835da433a5d3afa3ee93fac (patch) | |
tree | 4f119af1fe4b409f689da6f5365bc589e23e052d /net-dns | |
parent | version bump (diff) | |
download | gentoo-2-334e984ff2adcedb5835da433a5d3afa3ee93fac.tar.gz gentoo-2-334e984ff2adcedb5835da433a5d3afa3ee93fac.tar.bz2 gentoo-2-334e984ff2adcedb5835da433a5d3afa3ee93fac.zip |
a bit of cleanups before unmasking 9.3
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-dns')
-rw-r--r-- | net-dns/bind/ChangeLog | 10 | ||||
-rw-r--r-- | net-dns/bind/bind-9.2.2-r3.ebuild | 178 | ||||
-rw-r--r-- | net-dns/bind/bind-9.2.5.ebuild | 227 | ||||
-rw-r--r-- | net-dns/bind/files/bind-9.2.2-mysql.patch | 401 | ||||
-rw-r--r-- | net-dns/bind/files/digest-bind-9.2.2-r3 | 2 | ||||
-rw-r--r-- | net-dns/bind/files/digest-bind-9.2.5 | 2 |
6 files changed, 7 insertions, 813 deletions
diff --git a/net-dns/bind/ChangeLog b/net-dns/bind/ChangeLog index 20d073f33728..f6d4eda00d0c 100644 --- a/net-dns/bind/ChangeLog +++ b/net-dns/bind/ChangeLog @@ -1,6 +1,10 @@ # 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.80 2005/06/30 03:17:43 kumba Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.81 2005/07/02 09:49:20 voxus Exp $ + + 02 Jul 2005; Konstantin Arkhipov <voxus@gentoo.org> -bind-9.2.2-r3.ebuild, + -bind-9.2.5.ebuild, -files/bind-9.2.2-mysql.patch: + Cleaning up. 29 Jun 2005; Joshua Kinard <kumba@gentoo.org> bind-9.2.5-r4.ebuild: Marked stable on mips. @@ -15,7 +19,7 @@ 17 Jun 2005; Michael Hanselmann <hansmi@gentoo.org> bind-9.2.5-r4.ebuild: Stable on ppc. - 12 Jun 2005; Bryan Østergaard <kloeri@gentoo.org> bind-9.2.5-r4.ebuild: + 12 Jun 2005; Bryan ц≤stergaard <kloeri@gentoo.org> bind-9.2.5-r4.ebuild: Stable on alpha. 06 Jun 2005; Markus Rothe <corsair@gentoo.org> bind-9.2.5-r4.ebuild: @@ -71,7 +75,7 @@ 10 Apr 2005; Joshua Kinard <kumba@gentoo.org> bind-9.2.5.ebuild: Added ~mips to keywords. - 06 Apr 2005; Bryan Østergaard <kloeri@gentoo.org> bind-9.2.5.ebuild: + 06 Apr 2005; Bryan ц≤stergaard <kloeri@gentoo.org> bind-9.2.5.ebuild: Stable on alpha, bug 87902. 04 Apr 2005; Michael Hanselmann <hansmi@gentoo.org> bind-9.2.5.ebuild: diff --git a/net-dns/bind/bind-9.2.2-r3.ebuild b/net-dns/bind/bind-9.2.2-r3.ebuild deleted file mode 100644 index 57de6d9ba878..000000000000 --- a/net-dns/bind/bind-9.2.2-r3.ebuild +++ /dev/null @@ -1,178 +0,0 @@ -# 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.2-r3.ebuild,v 1.18 2005/02/07 02:28:31 kumba Exp $ - -inherit eutils gnuconfig libtool - -DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server" -HOMEPAGE="http://www.isc.org/products/BIND/bind9.html" -SRC_URI="ftp://ftp.isc.org/isc/bind9/${PV}/${P}.tar.gz - ftp://ftp.isc.org/isc/bind9/${PV}/patch.${PV}-P1" - -LICENSE="as-is" -SLOT="0" -KEYWORDS="~alpha amd64 arm hppa ppc ppc64 sparc x86 mips" -IUSE="doc ipv6 selinux ssl" - -DEPEND="sys-apps/groff - >=sys-apps/sed-4 - ssl? ( >=dev-libs/openssl-0.9.6g )" -RDEPEND="${DEPEND} - selinux? ( sec-policy/selinux-bind )" - -src_unpack() { - unpack ${A} - cd ${S} - - epatch ${DISTDIR}/patch.${PV}-P1 - - # Adjusting PATHs in manpages - for i in `echo bin/{named/named.8,check/named-checkconf.8,nsupdate/nsupdate.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} || die "sed $i" - done - - gnuconfig_update - uclibctoolize -} - -src_compile() { - local myconf="" - - use ssl && myconf="${myconf} --with-openssl" - use ipv6 && myconf="${myconf} --enable-ipv6" || myconf="${myconf} --enable-ipv6=no" - - econf \ - --sysconfdir=/etc/bind \ - --localstatedir=/var \ - --enable-threads \ - --with-libtool \ - ${myconf} \ - || die "econf failed" - - emake -j1 || die "failed to compile bind" -} - -src_install() { - einstall || die "failed to install bind" - - dodoc CHANGES FAQ README - - use doc && { - docinto misc ; dodoc doc/misc/* - docinto html ; dodoc 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 ${FILESDIR}/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 -} - -pkg_preinst() { - # 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.gz,host.1.gz} - 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/bind-9.2.5.ebuild b/net-dns/bind/bind-9.2.5.ebuild deleted file mode 100644 index 5ebfae3052d8..000000000000 --- a/net-dns/bind/bind-9.2.5.ebuild +++ /dev/null @@ -1,227 +0,0 @@ -# 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.11 2005/04/24 09:21:10 vapier Exp $ - -inherit eutils libtool - -DLZ_VER=0.7.0 -DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server" -HOMEPAGE="http://www.isc.org/products/BIND/bind9.html" -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 )" - -LICENSE="as-is" -SLOT="0" -# this ebuild contains the very untested dlz extension, hard-masking it for now -KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sparc x86" -IUSE="ssl ipv6 doc dlz postgres berkdb bind-mysql mysql odbc ldap selinux idn caps" - -DEPEND="sys-apps/groff - sys-devel/autoconf - 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 - - 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 - - # it should be installed by bind-tools - sed "s:nsupdate ::g" ${S}/bin/Makefile.in > ${T}/Makefile - mv ${T}/Makefile ${S}/bin/Makefile.in - - 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; };" - echo - ewarn "BIND >=9.2.5 makes the priority argument to MX records mandatory" - ewarn "when it was previously optional. If the priority is missing, BIND" - ewarn "won't load the zone file at all." - echo -} - -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.2-mysql.patch b/net-dns/bind/files/bind-9.2.2-mysql.patch deleted file mode 100644 index 845544e5ce42..000000000000 --- a/net-dns/bind/files/bind-9.2.2-mysql.patch +++ /dev/null @@ -1,401 +0,0 @@ ---- bin/named/Makefile.in 2001-06-01 03:45:00.000000000 +0300 -+++ bin/named/Makefile.in 2003-03-10 15:13:06.000000000 +0200 -@@ -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 -uNr bin/named/include/mysqldb.h bin/named/include/mysqldb.h ---- bin/named/include/mysqldb.h 1970-01-01 02:00:00.000000000 +0200 -+++ bin/named/include/mysqldb.h 2003-03-10 15:09:19.000000000 +0200 -@@ -0,0 +1,7 @@ -+ -+#include <isc/types.h> -+ -+isc_result_t mysqldb_init(void); -+ -+void mysqldb_clear(void); -+ -diff -uNr bin/named/main.c bin/named/main.c ---- bin/named/main.c 2002-08-05 09:57:01.000000000 +0300 -+++ bin/named/main.c 2003-03-10 15:44:36.000000000 +0200 -@@ -62,6 +62,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"; -@@ -527,6 +528,7 @@ - * Add calls to register sdb drivers here. - */ - /* xxdb_init(); */ -+ mysqldb_init (); - - ns_server_create(ns_g_mctx, &ns_g_server); - } -@@ -541,6 +543,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 -uNr bin/named/mysqldb.c bin/named/mysqldb.c ---- bin/named/mysqldb.c 1970-01-01 02:00:00.000000000 +0200 -+++ bin/named/mysqldb.c 2003-03-10 15:09:11.000000000 +0200 -@@ -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.2-r3 b/net-dns/bind/files/digest-bind-9.2.2-r3 deleted file mode 100644 index 95fe6b80e521..000000000000 --- a/net-dns/bind/files/digest-bind-9.2.2-r3 +++ /dev/null @@ -1,2 +0,0 @@ -MD5 6ea7d64a0856893ab3eb541ab7bbc725 bind-9.2.2.tar.gz 5054652 -MD5 063edc41c756ffc6a1051d5f1937fa2c patch.9.2.2-P1 40087 diff --git a/net-dns/bind/files/digest-bind-9.2.5 b/net-dns/bind/files/digest-bind-9.2.5 deleted file mode 100644 index 917f82e7d0d6..000000000000 --- a/net-dns/bind/files/digest-bind-9.2.5 +++ /dev/null @@ -1,2 +0,0 @@ -MD5 35a265fb97a068c066e22306ea32fd1f bind-9.2.5.tar.gz 4504389 -MD5 3bb820ced02fa2db7ae37e5288a73706 dlz-9.2.5.patch.bz2 135932 |