From 731f58b891dd43e00eae5dbcb5f3f2f9f003ee1d Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Thu, 12 Dec 2002 19:53:20 +0000 Subject: [PATCH] heading up to 2.9.2 git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@67 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- ChangeLog | 26 +++++ Makefile.am | 1 + README | 2 +- TODO | 8 +- configure.in | 77 ++++++++++----- debian/changelog | 6 ++ debian/control | 35 +++++-- debian/pdns-backend-oracle.lintian | 0 debian/pdns-backend-pgmysql.lintian | 0 debian/pdns-backend-xdb.lintian | 0 debian/pdns.conffiles | 2 +- debian/rules | 40 +++----- modules/gmysqlbackend/Makefile.in | 28 +++--- modules/oraclebackend/Makefile.in | 21 ++++- modules/pipebackend/Makefile.am | 2 +- modules/xdbbackend/Makefile | 30 ------ modules/xdbbackend/Makefile.in | 52 ++++++++++ modules/xdbbackend/OBJECTFILES | 1 + modules/xdbbackend/OBJECTLIBS | 1 + modules/xdbbackend/xdb-fill.cc | 5 +- pdns/Makefile.am | 2 +- pdns/backends/bind/Makefile.am | 2 +- pdns/dnsbackend.cc | 15 ++- pdns/dnspacket.cc | 4 +- pdns/dnspacket.hh | 6 +- pdns/docs/pdns.sgml | 141 ++++++++++++++++++---------- pdns/receiver.cc | 8 +- pdns/resolver.cc | 23 +++-- pdns/ueberbackend.cc | 7 +- pdns/webserver.cc | 3 +- 30 files changed, 359 insertions(+), 189 deletions(-) create mode 100644 debian/pdns-backend-oracle.lintian create mode 100644 debian/pdns-backend-pgmysql.lintian create mode 100644 debian/pdns-backend-xdb.lintian delete mode 100644 modules/xdbbackend/Makefile create mode 100644 modules/xdbbackend/Makefile.in create mode 100644 modules/xdbbackend/OBJECTFILES create mode 100644 modules/xdbbackend/OBJECTLIBS diff --git a/ChangeLog b/ChangeLog index bf866fd51..89b150ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +Changes since 2.9.1: + - removed debugging output from the webserver (found by Paul Wouters) + - due to Solaris portability fixes, qtypes>127 were broken. + These include NAPTR, ANY and AXFR. The upshot is that powerdns + wasn't performing outgoing AXFRs nor ANY queries. These were the + 'question for type -1' warnings in the log + + - pdns/pdns now has a +x by default (suggested by Paul Wouters) + - bug in documentation (pgmysqlbackend != pgmysql backend) (Paul Wouters) + + - Red Hat has weird location for pgsql includes (Paul Wouters) + + - incoming AXFR could theoretically miss some trailing records + (not observed, but could happen) + + - with some remotes, an incoming AXFR would not terminate until a + timeout occured. + + - incoming AXFR did not support TXT records (spotted by Paul Wouters) + + - added xdb + + - dynamic modules work again! + + - openbsd compiles but crashes at startup + Changes since 2.9: - 'set' no longer allows setting non-existent variables - added db2 backend to distribution diff --git a/Makefile.am b/Makefile.am index f321a9134..1b713758d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS=modules pdns EXTRA_DIST=TODO WARNING README HACKING INSTALL ChangeLog debian pdns.spec install-exec-local: + -@chmod +x pdns/pdns @echo "***********************************************************" @echo @echo An init.d startup script has been made for you in pdns/pdns diff --git a/README b/README index f9076ba4b..dd2a25eaf 100644 --- a/README +++ b/README @@ -12,7 +12,7 @@ is built by default. To add multiple modules, try: -$ ./configure --with-modules="mysql mypgsql" --enable-mysql --enable-pgsql +$ ./configure --with-modules="mysql pgmysql" --enable-mysql --enable-pgsql See http://rtfm.powerdns.com/compiling-powerdns.html for more details. diff --git a/TODO b/TODO index e92785e20..e4f09cc94 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,11 @@ bugs: - bind backend ANY queries don't work +fixed bind backend ANY queries don't work +fixed records of unknown type are reported as -1? +fixed pdns/pdns should be +x + pdns.conf-dist contains old descriptions + redhat does not find postgresql includes by default + redhat does not find postgresql libraries by default + immediate issues: make install installs libraries with a static build which it should diff --git a/configure.in b/configure.in index 02d020c39..d6351b57e 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl intro AC_INIT(pdns/receiver.cc) -AM_INIT_AUTOMAKE(pdns, 2.9.1) +AM_INIT_AUTOMAKE(pdns, 2.9.2) AC_CANONICAL_HOST AM_CONFIG_HEADER(config.h) AC_C_BIGENDIAN @@ -30,17 +30,7 @@ dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror) -#AC_CHECK_LIB(resolv, inet_ntop) - -#dnl AC_MSG_NOTICE([Looking in libraries: $LIBS]) - -#AC_CHECK_FUNCS(inet_ntop, , AC_LIBOBJ(lib/inet_ntop)) -#AC_CHECK_FUNCS(inet_pton, , AC_LIBOBJ(lib/inet_pton)) - - -# # Check for libdl -# my_save_LIBS="$LIBS" LIBS="" @@ -49,6 +39,20 @@ LIBDL=$LIBS LIBS="$my_save_LIBS" AC_SUBST(LIBDL) +AC_MSG_CHECKING([for RTLD_NOW]); +ac_save_LIBS="$LIBS" +LIBS="$LIBS $LIBDL" +AC_TRY_LINK( +[#include ], +[ (void) dlopen("",RTLD_NOW); ], +has_RTLD_NOW=yes, has_RTLD_NOW=no) +AC_MSG_RESULT([$has_RTLD_NOW]) +if test "$has_RTLD_NOW" = "no" +then + AC_DEFINE(NEED_RTLD_NOW,,[If host OS misses RTLD_NOW]) +fi +LIBS=$ac_save_LIBS + # pthread_create is in standard libraries (As in BSDI 3.0) AC_MSG_CHECKING("for pthread_create in -libc"); AC_TRY_LINK( @@ -115,6 +119,12 @@ linux*) LDFLAGS="-pthread $LDFLAGS" CXXFLAGS="-pthread -D_GNU_SOURCE $CXXFLAGS" ;; +openbsd*) + AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6]) + DYNLINKFLAGS="-rdynamic" + LDFLAGS="-lc_r $LDFLAGS" + CXXFLAGS="-pthread $CXXFLAGS" + ;; *) AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6]) DYNLINKFLAGS="-rdynamic" @@ -159,6 +169,13 @@ AC_ARG_WITH(modules, [ --with-modules Which userbases to compile with ], modules="$withval" ]) +dynmodules="pipe" +AC_ARG_WITH(dynmodules, [ --with-dynmodules Which userbases to build for dynamic loading ], +[ + dynmodules="$withval" +]) + + AC_SUBST(socketdir) socketdir="/var/run" @@ -187,7 +204,7 @@ AC_SUBST(moduledirs) AC_SUBST(moduleobjects) AC_SUBST(modulelibs) -for a in $modules +for a in $modules $dynmodules do case "$a" in pgmysql ) @@ -238,12 +255,14 @@ then if test -z "$MYSQL_libdir"; then AC_MSG_ERROR([Didn't find the mysql library dir in '$MYSQL_lib_check']) fi - case "$MYSQL_libdir" in + case "$MYSQL_libdir" in /usr/lib ) MYSQL_lib="" ;; /* ) MYSQL_lib=-L$MYSQL_libdir; LDFLAGS="$MYSQL_lib $LDFLAGS";; * ) AC_MSG_ERROR([The MySQL library directory ($MYSQL_libdir) must be an absolute path.]) ;; esac - AC_SUBST(MYSQL_lib) + + AC_SUBST(MYSQL_lib) + AC_MSG_RESULT([$MYSQL_libdir]) AC_MSG_CHECKING([for MySQL include directory]) MYSQL_incdir= @@ -257,13 +276,15 @@ then if test -z "$MYSQL_incdir"; then AC_MSG_ERROR([Didn't find the mysql include dir in '$MYSQL_inc_check']) fi - case "$MYSQL_incdir" in + + case "$MYSQL_incdir" in /* ) ;; * ) AC_MSG_ERROR([The MySQL include directory ($MYSQL_incdir) must be an absolute path.]) ;; esac - AC_SUBST(MYSQL_incdir) + + AC_SUBST(MYSQL_incdir) AC_MSG_RESULT([$MYSQL_incdir]) - LIBS="$LIBS -lmysqlclient" +# LIBS="$LIBS -lmysqlclient" fi @@ -275,7 +296,7 @@ then [PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib" PGSQL_inc_check="$withval/include/pgsql"], [PGSQL_lib_check="/usr/local/pgsql/lib/pgsql /usr/local/lib/pgsql /opt/pgsql/lib/pgsql /usr/lib/pgsql /usr/local/pgsql/lib /usr/local/lib /opt/pgsql/lib /usr/lib" - PGSQL_inc_check="/usr/local/pgsql/include/pgsql /usr/local/include/postgresql/ /usr/local/include /opt/pgsql/include/pgsql /opt/pgsql/include /usr/include/postgresql"]) + PGSQL_inc_check="/usr/local/pgsql/include/pgsql /usr/local/include/postgresql/ /usr/local/include /opt/pgsql/include/pgsql /opt/pgsql/include /usr/include/pgsql/ /usr/include/postgresql"]) AC_ARG_WITH(pgsql-lib, [ --with-pgsql-lib= directory path of PgSQL library installation], [PGSQL_lib_check="$withval/lib/pgsql $withval/pgsql $withval"]) @@ -301,7 +322,8 @@ then /* ) PGSQL_lib=-L$PGSQL_libdir; LDFLAGS="$PGSQL_lib $LDFLAGS";; * ) AC_MSG_ERROR([The PgSQL library directory ($PGSQL_libdir) must be an absolute path.]) ;; esac - AC_SUBST(PGSQL_lib) + + AC_SUBST(PGSQL_lib) AC_MSG_RESULT([$PGSQL_libdir]) AC_MSG_CHECKING([for PgSQL include directory]) PGSQL_incdir= @@ -322,7 +344,7 @@ then AC_SUBST(PGSQL_incdir) AC_MSG_RESULT([$PGSQL_incdir]) - LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto" +# LIBS="$LIBS -lpq++ -lpq -lssl -lcrypt -lcrypto" fi @@ -332,17 +354,19 @@ do case "$a" in pgmysql) - rm -f $srcdir/modules/pgmysqlbackend/OBJECTFILES - cat /dev/null > $srcdir/modules/pgmysqlbackend/OBJECTLIBS + rm -f $srcdir/modules/pgmysqlbackend/OBJECTFILES $srcdir/modules/pgmysqlbackend/OBJECTLIBS + echo gmysqlbackend.o > $srcdir/modules/pgmysqlbackend/OBJECTFILES if test -n "$domysql" then echo smysql.o >> $srcdir/modules/pgmysqlbackend/OBJECTFILES + echo -lmysql >> $srcdir/modules/pgmysqlbackend/OBJECTLIBS fi if test -n "$dopgsql" then echo spgsql.o >> $srcdir/modules/pgmysqlbackend/OBJECTFILES + echo -lpq++ -lpq -lssl -lcrypt -lcrypto >> $srcdir/modules/pgmysqlbackend/OBJECTLIBS fi ;; esac @@ -354,10 +378,17 @@ do done modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" done + +for a in $dynmodules +do + moduledirs="$moduledirs ${a}backend" +done + export moduledirs moduleobjects modulelibs AC_OUTPUT(Makefile modules/Makefile pdns/Makefile pdns/codedocs/Makefile \ pdns/backends/Makefile pdns/backends/bind/Makefile pdns/pdns \ modules/mysqlbackend/Makefile modules/pdnsbackend/Makefile \ modules/pgmysqlbackend/Makefile modules/db2backend/Makefile \ -modules/pipebackend/Makefile modules/oraclebackend/Makefile) +modules/pipebackend/Makefile modules/oraclebackend/Makefile \ +modules/xdbbackend/Makefile) diff --git a/debian/changelog b/debian/changelog index 0aa6c44fa..3fd0de948 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pdns (2.9.2-1) unstable; urgency=low + + * upstream updates + + -- bert hubert Wed, 11 Dec 2002 15:04:52 +0100 + pdns (2.9-1) unstable; urgency=low * Initial packaging diff --git a/debian/control b/debian/control index 5a8fb1c3d..135a52500 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: extra Standards-Version: 3.5.8 Maintainer: Wichert Akkerman -Build-Depends: automake1.5, autoconf, libtool, flex, bison, docbook-utils, libmysqlclient10-dev, postgresql-dev, libstdc++-dev +Build-Depends: automake1.5, autoconf, libtool, flex, bison, docbook-utils, libmysqlclient10-dev, postgresql-dev Package: pdns Architecture: any @@ -21,14 +21,14 @@ Description: PowerDNS manual how to install and configure it as well as how to write new backend modules. -Package: pdns-backend-bind +Package: pdns-backend-pipe Architecture: any Depends: pdns (= ${dpkg:Version}), ${shlibs:Depends} Provides: pdns-backend -Description: bind backend for pDNS - This package contains the bind backend for the PowerDNS nameserver. This - allows pDNS to use the configuration and zone files from the ISC bind - nameserver. +Description: pipe/coprocess backend for pDNS + This package contains the pipe backend for the PowerDNS nameserver. This + allows PowerDNS to retrieve domain info from a process that accepts + questions on stdin and returns answers on stdout. Package: pdns-backend-mysql Architecture: any @@ -37,3 +37,26 @@ Provides: pdns-backend Description: MySQL backend for pDNS This package contains a MySQL backend for the PowerDNS nameserver. +Package: pdns-backend-pgmysql +Architecture: any +Depends: pdns (= ${dpkg:Version}), ${shlibs:Depends} +Provides: pdns-backend +Description: Generic PostgreSQL and MySQL backend for pDNS + This package contains a generic PostgreSQL and MySQL backend + for the PowerDNS nameserver. It has configurable SQL statements. + +Package: pdns-backend-xdb +Architecture: any +Depends: pdns (= ${dpkg:Version}), ${shlibs:Depends} +Provides: pdns-backend +Description: XDB/tdb/gdb backend for pDNS + This package contains a table backend for PowerDNS. Currently includes TDB, + the Trivial Database or Tridgell Database. + +Package: pdns-backend-oracle +Architecture: any +Depends: pdns (= ${dpkg:Version}), ${shlibs:Depends} +Provides: pdns-backend +Description: Oracle backend for pDNS + This package contains a generic Oracle backend for PowerDNS. + diff --git a/debian/pdns-backend-oracle.lintian b/debian/pdns-backend-oracle.lintian new file mode 100644 index 000000000..e69de29bb diff --git a/debian/pdns-backend-pgmysql.lintian b/debian/pdns-backend-pgmysql.lintian new file mode 100644 index 000000000..e69de29bb diff --git a/debian/pdns-backend-xdb.lintian b/debian/pdns-backend-xdb.lintian new file mode 100644 index 000000000..e69de29bb diff --git a/debian/pdns.conffiles b/debian/pdns.conffiles index 30d7bbc1f..52ba0562b 100644 --- a/debian/pdns.conffiles +++ b/debian/pdns.conffiles @@ -1,2 +1,2 @@ -/etc/pdns.conf +/etc/powerdns/pdns.conf /etc/init.d/pdns diff --git a/debian/rules b/debian/rules index 2eee4c65d..00fba1a60 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f tmpdir := $(shell pwd)/debian/tmp -backends := bind mysql +backends := mysql pipe xdb pgmysql oracle configure: ./bootstrap @@ -49,9 +49,12 @@ build-main: configure ./configure \ --prefix=/usr \ --libexecdir='$${prefix}/lib' \ - --sysconfdir=/etc \ + --libdir='$${prefix}/lib/powerdns' \ + --sysconfdir=/etc/powerdns \ --infodir='$${datadir}/info' \ - --mandir='$${datadir}/man' + --mandir='$${datadir}/man' \ + --with-dynmodules="$(backends)" \ + --with-modules="" make touch build-main @@ -70,7 +73,7 @@ binary-main: build-main "$(tmpdir)"/usr/bin/zone2sql \ "$(tmpdir)"/usr/sbin/pdns_server \ "$(tmpdir)"/usr/bin/pdns_control - mv "$(tmpdir)"/etc/pdns.conf-dist "$(tmpdir)"/etc/pdns.conf + mv "$(tmpdir)"/etc/powerdns/pdns.conf-dist "$(tmpdir)"/etc/powerdns/pdns.conf install -d -m 755 -o root -g root "$(tmpdir)"/etc/init.d install -p -m 755 -o root -g root pdns/pdns \ @@ -104,24 +107,7 @@ binary-main: build-main dpkg --build "$(tmpdir)" .. -build-backend: configure - if [ -e build-main ] ; then make distclean ; fi - rm -f build-main - - ./configure \ - --prefix=/usr \ - --libexecdir='$${prefix}/lib' \ - --sysconfdir=/etc \ - --infodir='$${datadir}/info' \ - --mandir='$${datadir}/man' \ - --enable-pgsql \ - --enable-mysql \ - --with-modules="mysql pgmysql" - make - touch build-backend - - -binary-backend: build-backend +binary-backend: build-main rm -f debian/substvars rm -rf "$(tmpdir)" "$(tmpdir)"-* @@ -129,14 +115,14 @@ binary-backend: build-backend make DESTDIR="$(tmpdir)" install strip --remove-section=.comment --remove-section=.note \ - --strip-unneeded "$(tmpdir)"/usr/lib/*.so - chmod 644 "$(tmpdir)"/usr/lib/* + --strip-unneeded "$(tmpdir)"/usr/lib/powerdns/*.so + chmod 644 "$(tmpdir)"/usr/lib/powerdns/* set -e ; for be in $(backends) ; do \ rm -f debian/substvars ; \ pkg=pdns-backend-$$be ; \ - install -d -m 755 -o root -g root "$(tmpdir)"-$$be/usr/lib ; \ - mv "$(tmpdir)"/usr/lib/*$$be* "$(tmpdir)"-$$be/usr/lib/ ; \ + install -d -m 755 -o root -g root "$(tmpdir)"-$$be/usr/lib/powerdns ; \ + mv "$(tmpdir)"/usr/lib/powerdns/lib$$be* "$(tmpdir)"-$$be/usr/lib/powerdns ; \ install -d -m 755 -o root -g root "$(tmpdir)"-$$be/usr/share/doc ; \ ln -s pdns "$(tmpdir)"-$$be/usr/share/doc/$$pkg ; \ \ @@ -149,7 +135,7 @@ binary-backend: build-backend "$(tmpdir)"-$$be/DEBIAN/postinst ; \ install -p -m 755 -o root -g root debian/pdns-backend-general.postrm \ "$(tmpdir)"-$$be/DEBIAN/postrm ; \ - dpkg-shlibdeps "$(tmpdir)"-$$be/usr/lib/*.so ; \ + dpkg-shlibdeps "$(tmpdir)"-$$be/usr/lib/powerdns/*.so ; \ dpkg-gencontrol -isp -p$$pkg -P"$(tmpdir)"-$$be ; \ dpkg --build "$(tmpdir)"-$$be .. ; \ done diff --git a/modules/gmysqlbackend/Makefile.in b/modules/gmysqlbackend/Makefile.in index 8298ec631..489478da7 100644 --- a/modules/gmysqlbackend/Makefile.in +++ b/modules/gmysqlbackend/Makefile.in @@ -1,11 +1,5 @@ -distclean: - rm -f *.o *.so *~ *.d deps Makefile - -clean: - rm -f *.o *.so *~ *.d deps - PDNS_HOME = ../../pdns -PDNS_LIBDIR = /usr/lib/powerdns +PDNS_LIBDIR = @libdir@ MYSQL_INCLUDES = @MYSQL_incdir@ MYSQL_LIB = @MYSQL_lib@ @@ -13,7 +7,7 @@ MYSQL_LIBS = -lmysqlclient PGSQL_INCLUDES = @PGSQL_incdir@ PGSQL_LIB = @PGSQL_lib@ -PGSQL_LIBS = -Wl,-Bstatic -lpq++ -lpq -Wl,-Bdynamic -lssl -lcrypt -lcrypto +PGSQL_LIBS = -Wl,-Bstatic -lpq++ -lpq -Wl,-Bdynamic -lssl -lcrypt -lcrypto INCLUDES=-I$(PDNS_HOME) -I../.. @@ -29,17 +23,17 @@ endif ifneq ($(domysql),) TARGETS:=$(TARGETS) smysql.o CXXFLAGS:=-DPDNS_DOMYSQL -I$(MYSQL_INCLUDES) $(CXXFLAGS) - ELIBS:=$(MYGRES_LIB) $(MYGRES_LIBS) $(ELIBS) + ELIBS:=$(MYSQL_LIB) $(MYSQL_LIBS) $(ELIBS) endif +all: libpgmysqlbackend.so gmysqlbackend.o $(TARGETS) OBJECTFILES -all: gmysqlbackend.o $(TARGETS) OBJECTFILES +distclean: + rm -f *.o *.so *~ *.d deps Makefile -OBJECTFILES: - echo $(TARGETS) > OBJECTFILES +clean: + rm -f *.o *.so *~ *.d deps -OBJECTLIBS: - echo $(ELIBS) > OBJECTLIBS PACKAGE = @PACKAGE@ @@ -77,6 +71,12 @@ deps: .cc.o: g++ -MD -g -c $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) $< +libpgmysqlbackend.so: $(TARGETS) gmysqlbackend.o + g++ -shared $^ $(ELIBS) -o $@ +mkinstalldirs = $(SHELL) @top_srcdir@/mkinstalldirs +prefix=@prefix@ install: + $(mkinstalldirs) $(DESTDIR)@libdir@ + install -s libpgmysqlbackend.so $(DESTDIR)@libdir@ diff --git a/modules/oraclebackend/Makefile.in b/modules/oraclebackend/Makefile.in index 717d71d9f..0b2fc5bdd 100644 --- a/modules/oraclebackend/Makefile.in +++ b/modules/oraclebackend/Makefile.in @@ -2,7 +2,7 @@ ## File : Makefile ## Author : Stefan Arentz ## Project : PowerDNS -## Version : $Id: Makefile.in,v 1.1 2002/12/10 13:36:26 ahu Exp $ +## Version : $Id: Makefile.in,v 1.2 2002/12/12 19:53:19 ahu Exp $ ## ORACLE_HOME = /opt/oracle @@ -11,14 +11,13 @@ PDNS_HOME = ../../pdns INCLUDE = -I$(ORACLE_HOME)/rdbms/demo \ -I$(ORACLE_HOME)/rdbms/public \ -I$(PDNS_HOME) -I../.. -VERSION=2.1 -all: oraclebackend.o - -install: +ORACLE_DYN_LIBS = -L/opt/oracle/lib -lclntsh +all: liboraclebackend.so oraclebackend.o PACKAGE = @PACKAGE@ VERSION = @VERSION@ + DISTFILES=*.cc *.hh Makefile.in OBJECTFILES OBJECTLIBS top_distdir = ../.. @@ -48,3 +47,15 @@ distdir: $(DISTFILES) clean: rm -f *.o *.so *~ + + +liboraclebackend.so: oraclebackend.o + g++ -shared $^ -Wl,-rpath,$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/lib $(ORACLE_DYN_LIBS) -o $@ + +mkinstalldirs = $(SHELL) @top_srcdir@/mkinstalldirs + +prefix=@prefix@ +install: liboraclebackend.so + $(mkinstalldirs) $(DESTDIR)@libdir@ + install -s liboraclebackend.so $(DESTDIR)@libdir@ + diff --git a/modules/pipebackend/Makefile.am b/modules/pipebackend/Makefile.am index 3abaad45e..a0af665b3 100644 --- a/modules/pipebackend/Makefile.am +++ b/modules/pipebackend/Makefile.am @@ -6,6 +6,6 @@ EXTRA_DIST=OBJECTFILES OBJECTLIBS lib_LTLIBRARIES = libpipebackend.la - libpipebackend_la_SOURCES=pipebackend.cc pipebackend.hh coprocess.cc coprocess.hh +libpipebackend_la_LDFLAGS=-module diff --git a/modules/xdbbackend/Makefile b/modules/xdbbackend/Makefile deleted file mode 100644 index 70837bd93..000000000 --- a/modules/xdbbackend/Makefile +++ /dev/null @@ -1,30 +0,0 @@ - -PDNS_HOME = ../../ -XDB_LIBS = -Wl,-Bstatic -lgdbm -ltdb -Wl,-Bdynamic -VERSION = 2.6 - -all: libxdbbackend.so - -CPPFLAGS=-I$(PDNS_HOME) -O3 -pthread - -LIBS= $(XDB_LIBS) -DIRNAME=pdns-xdbbackend-$(VERSION) - -dist: - mkdir $(DIRNAME) - cp pgsqlbackend.cc pgsqlbackend.hh Makefile $(DIRNAME) - tar cvzf $(DIRNAME).tar.gz $(DIRNAME) - rm -rf $(DIRNAME) - -xdb-fill: xdb-fill.o xgdbm.o xtdb.o - g++ xdb-fill.o xgdbm.o xtdb.o $(XDB_LIBS) -o xdb-fill - -libxdbbackend.so: xdbbackend.o xtdb.o - g++ xdbbackend.o $(XDB_LIBS) -shared -o libxdbbackend.so - -.cc.o: - g++ -MD -g -c $(CXXFLAGS) $(CPPFLAGS) $< - -clean: - rm -f *.o *.so *~ *.d - diff --git a/modules/xdbbackend/Makefile.in b/modules/xdbbackend/Makefile.in new file mode 100644 index 000000000..bef2f2450 --- /dev/null +++ b/modules/xdbbackend/Makefile.in @@ -0,0 +1,52 @@ +XDB_LIBS = -ltdb +PDNS_HOME = ../../pdns +INCLUDES = -I$(PDNS_HOME) -I../.. +CXXFLAGS = @CXXFLAGS@ + +all: xdb-fill xdbbackend.o xtdb.o libxdbbackend.so + +xdb-fill: xdb-fill.o xtdb.o + g++ $^ $(XDB_LIBS) -o xdb-fill + +distclean: clean + +clean: + rm -f *.o *.so *~ *.d + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +DISTFILES=*.cc *.hh Makefile.in OBJECTFILES OBJECTLIBS + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + +.cc.o: + g++ -MD -g -c $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) $< + +libxdbbackend.so: xdbbackend.o xtdb.o + g++ -shared $^ $(XDB_LIBS) -o $@ + +mkinstalldirs = $(SHELL) @top_srcdir@/mkinstalldirs + +prefix=@prefix@ +install: + $(mkinstalldirs) $(DESTDIR)@libdir@ + install -s libxdbbackend.so $(DESTDIR)@libdir@ + diff --git a/modules/xdbbackend/OBJECTFILES b/modules/xdbbackend/OBJECTFILES new file mode 100644 index 000000000..ccbf5b197 --- /dev/null +++ b/modules/xdbbackend/OBJECTFILES @@ -0,0 +1 @@ +xdbbackend.o xtdb.o diff --git a/modules/xdbbackend/OBJECTLIBS b/modules/xdbbackend/OBJECTLIBS new file mode 100644 index 000000000..ad81f2d50 --- /dev/null +++ b/modules/xdbbackend/OBJECTLIBS @@ -0,0 +1 @@ +-ltdb diff --git a/modules/xdbbackend/xdb-fill.cc b/modules/xdbbackend/xdb-fill.cc index e9f48779f..e3e0f8f1b 100644 --- a/modules/xdbbackend/xdb-fill.cc +++ b/modules/xdbbackend/xdb-fill.cc @@ -1,8 +1,9 @@ #include "pdns/utility.hh" -#include "pdns/xgdbm.hh" -#include "pdns/xtdb.hh" +#include "xgdbm.hh" +#include "xtdb.hh" #include "pdns/ahuexception.hh" #include "pdns/logger.hh" +#include #include #include diff --git a/pdns/Makefile.am b/pdns/Makefile.am index e334afa5e..e244a4709 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DBINDIR=\"@bindir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind +AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind AM_CPPFLAGS=-Ibackends/bind EXTRA_DIST = codedocs/Makefile codedocs/doxygen.conf docs/Makefile \ diff --git a/pdns/backends/bind/Makefile.am b/pdns/backends/bind/Makefile.am index 362f107c2..d8aa9534f 100644 --- a/pdns/backends/bind/Makefile.am +++ b/pdns/backends/bind/Makefile.am @@ -1,5 +1,5 @@ INCLUDES=-I../.. -lib_LTLIBRARIES = libbindbackend.la +noinst_LTLIBRARIES = libbindbackend.la libbindbackend_la_SOURCES=bindbackend.cc bindbackend.hh bindparser.yy \ bindlexer.l zoneparser2.cc ../../misc.cc huffman.cc huffman.hh zoneparser.hh \ diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index d9e5375ca..84ceffcf9 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "utility.hh" +#include "utility.hh" #include "dnsbackend.hh" #include "arguments.hh" #include "ueberbackend.hh" @@ -162,8 +162,8 @@ vector BackendMakerClass::getModules() } void BackendMakerClass::load_all() -{ - // TODO: Implement this? +{ + // TODO: Implement this? #ifndef WIN32 DIR *dir=opendir(arg()["module-dir"].c_str()); if(!dir) { @@ -173,12 +173,11 @@ void BackendMakerClass::load_all() struct dirent *entry; while((entry=readdir(dir))) { if(!strncmp(entry->d_name,"lib",3) && - entry->d_name[strlen(entry->d_name)-1]=='o' && - entry->d_name[strlen(entry->d_name)-2]=='s' && - entry->d_name[strlen(entry->d_name)-3]=='.') + strlen(entry->d_name)>13 && + !strcmp(entry->d_name+strlen(entry->d_name)-10,"backend.so")) load(entry->d_name); } - closedir(dir); + closedir(dir); #endif // WIN32 } @@ -194,7 +193,7 @@ void BackendMakerClass::load(const string &module) res=UeberBackend::loadmodule(arg()["module-dir"]+"/"+module); if(res==false) { - L< @@ -1252,7 +1252,7 @@ vector DNSPacket::getAnswers() case QType::TXT: - rr.content.assign(datapos+offset+2,(int)(256*datapos[offset] + datapos[offset+1])); + rr.content.assign(datapos+offset+1,(int)datapos[offset]); break; case QType::CNAME: diff --git a/pdns/dnspacket.hh b/pdns/dnspacket.hh index ae83dc614..55dbe892d 100644 --- a/pdns/dnspacket.hh +++ b/pdns/dnspacket.hh @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// $Id: dnspacket.hh,v 1.4 2002/12/09 16:24:17 ahu Exp $ +// $Id: dnspacket.hh,v 1.5 2002/12/12 19:53:19 ahu Exp $ #ifndef DNSPACKET_HH #define DNSPACKET_HH @@ -295,8 +295,8 @@ int DNSPacket::parse(const char *mesg, int length) d_qlen=offset+4; // this points to the start of any answers } - qtype=stringbuffer[12+offset]*256+stringbuffer[13+offset]; - qclass=stringbuffer[14+offset]*256+stringbuffer[15+offset]; + qtype=((unsigned char)stringbuffer[12+offset])*256+(unsigned char)stringbuffer[13+offset]; + qclass=((unsigned char)stringbuffer[14+offset]*256)+(unsigned char)stringbuffer[15+offset]; return 0; } diff --git a/pdns/docs/pdns.sgml b/pdns/docs/pdns.sgml index ebb5f9a46..9743ff410 100644 --- a/pdns/docs/pdns.sgml +++ b/pdns/docs/pdns.sgml @@ -15,7 +15,7 @@ - v2.1 $Date: 2002/12/10 13:36:26 $ + v2.1 $Date: 2002/12/12 19:53:20 $ @@ -85,6 +85,66 @@ Before proceeding, it is advised to check the release notes for your PDNS version, as specified in the name of the distribution file. + Version 2.9.2 + + Bugfixes galore. Solaris porting created some issues on all platforms. Bugs fixed: + + + + + + Silly debugging output removed from the webserver (found by Paul Wouters) + + + + + SEVERE: due to Solaris portability fixes, qtypes<127 were broken. + These include NAPTR, ANY and AXFR. The upshot is that powerdns + wasn't performing outgoing AXFRs nor ANY queries. These were the + 'question for type -1' warnings in the log + + + + + incoming AXFR could theoretically miss some trailing records (not observed, but could happen) + + + + + incoming AXFR did not support TXT records (spotted by Paul Wouters) + + + + + with some remotes, an incoming AXFR would not terminate until a + timeout occured (observed by Paul Wouters) + + + + + Documentation bug, pgmysql != mypgsql + + + + + + Features: + + + + pdns init.d script is now +x by default + + + + + Mysterious xdb backend added - see . + + + + + + + Version 2.9.1 Thanks to the great enthusiasm from around the world, powerdns is now available for Solaris and FreeBSD users again! @@ -149,7 +209,7 @@ Heap of Solaris work (with help from Edvard Tuinder, Stefan Van Steen, Koos van den Hout, Roel van der Made and especially Mark Bakker). - Now compiles in 2.7 and 2.8. May be a bit dysfunctional on 2.7 though - it won't do IPv6 and it won't serve AAAA. Patches + Now compiles in 2.7 and 2.8, haven't tried 2.9. May be a bit dysfunctional on 2.7 though - it won't do IPv6 and it won't serve AAAA. Patches welcome! @@ -175,8 +235,7 @@ - Removal of bzero and other less portable constructs. Discovered that recent Linux glibc's need -D_GNU_SOURCE (Wichert Akkerman). - + Removal of bzero and other less portable constructs. Discovered that recent Linux glibc's need -D_GNU_SOURCE (Wichert Akkerman). @@ -2231,46 +2290,10 @@ name IN A 1.2.3.4 -Installing on Unix - - -After unpacking the PDNS distribution the files need to be moved to -appropriate locations. - - - -PDNS can be installed in a variety of directories, which can easily be -customised to local policy. Two ways are available - manual and via a menu. - - - -The menu is invoked by executing the './choosepaths' script and answering the -questions. The manual way involves editing the 'pathconfig' file. The choice -is up to you. - - - -After deciding paths, change to root and execute the 'installer' script. -This will: - - - Configure the PowerDNS binary so it knows where the configuration directory is - - - If necessary, create the configuration directory - - - Write sample configuration file (not overwriting existing one) - - - Write a SysV-style init.d script in the configured directory - - - Move binaries and libraries to the configured places - - - - + Installing on Unix + + You will typically install PDNS > 2.9 via source or via a package. Earlier versions used a clumsy binary installer. + Possible problems at this point @@ -2416,6 +2439,18 @@ This will: + + Multiple IP addresses on your server, PDNS sending out answers on the wrong one + Massive amounts of 'recvfrom gave error, ignoring: Connection refused' + + + If you have multiple IP addresses on the internet on one machine, UNIX often sends out answers over another interface + than which the packet came in on. In such cases, use local-address to bind to specific IP addresses, which + can be comma separated. The second error comes from remotes disregarding answers to questions it didn't ask to that IP address + and sending back ICMP errors. + + + @@ -3689,7 +3724,9 @@ local0.err /var/log/pdns.err local-address=... - Local IP address to which we bind. You can specify multiple addresses separated by commas or whitespace. + Local IP address to which we bind. You can specify multiple addresses separated by commas or whitespace. It is highly + advised to bind to specific interfaces and not use the default 'bind to any'. This causes big problems if you have multiple + IP addresses. Unix does not provide a way of figuring out what IP address a packet was sent to when binding to any. local-port=... @@ -5728,9 +5765,17 @@ insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RE The ODBC backend has been tested with Microsoft Access, MySQL (via MyODBC) and Microsoft SQLServer. As the SQL statements used are very basic, it is expected to work with many ODBC drivers. - - - + + XDB Backend + + Special purpose backend for grandiose performance. Can talk to Tridge's Trivial Database, or to regular *db tables on disk. Currently only sparsely + documented. Very useful if you need to do >50.000 queries/second, which we actually measured on the .ORG zone. + + + More documentation will follow. + + + PDNS internals PDNS is normally launched by the init.d script but is actually a binary called pdns_server. This diff --git a/pdns/receiver.cc b/pdns/receiver.cc index fa9aaa5b6..37809bc79 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// $Id: receiver.cc,v 1.2 2002/12/06 09:58:03 ahu Exp $ +// $Id: receiver.cc,v 1.3 2002/12/12 19:53:19 ahu Exp $ #include #include #include @@ -58,7 +58,7 @@ #include "dynhandler.hh" #include "communicator.hh" #include "dnsproxy.hh" -#include "utility.hh" +#include "utility.hh" #include "common_startup.hh" time_t s_starttime; @@ -314,7 +314,7 @@ static void UNIX_declareArguments() arg().set("config-name","Name of this virtual configuration - will rename the binary image")=""; arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; - arg().set("module-dir","Default directory for modules")=BINDIR+string("/../lib"); + arg().set("module-dir","Default directory for modules")=LIBDIR; arg().set("chroot","If set, chroot to this directory for more security")=""; arg().set("logging-facility","Log under a specific facility")=""; arg().set("daemon","Operate as a daemon")="no"; @@ -340,7 +340,7 @@ static void loadModules() res=UeberBackend::loadmodule(arg()["module-dir"]+"/"+module); if(res==false) { - L< #include @@ -73,6 +73,7 @@ Resolver::Resolver() { d_sock=-1; d_timeout=500000; + d_soacount=0; d_buf=new unsigned char[66000]; } @@ -328,6 +329,12 @@ int Resolver::getLength() int Resolver::axfrChunk(Resolver::res_t &res) { + if(d_soacount>1) { + Utility::closesocket(d_sock); + d_sock=-1; + return 0; + } + // d_sock is connected and is about to spit out a packet int len=getLength(); if(len<0) @@ -335,16 +342,16 @@ int Resolver::axfrChunk(Resolver::res_t &res) timeoutReadn((char *)d_buf,len); d_len=len; + res=result(); - if(!res.empty()) - if(res.begin()->qtype.getCode()==QType::SOA || res.end()->qtype.getCode()==QType::SOA) + for(res_t::const_iterator i=res.begin();i!=res.end();++i) + if(i->qtype.getCode()==QType::SOA) { d_soacount++; + } - if(d_soacount==2) { - Utility::closesocket(d_sock); - d_sock=-1; - return 0; - } + if(d_soacount>1 && !res.empty()) // chop off the last SOA + res.resize(res.size()-1); + return 1; } diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 167e8e24f..2885d6f39 100644 --- a/pdns/ueberbackend.cc +++ b/pdns/ueberbackend.cc @@ -16,9 +16,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// $Id: ueberbackend.cc,v 1.3 2002/12/09 18:34:45 ahu Exp $ +// $Id: ueberbackend.cc,v 1.4 2002/12/12 19:53:20 ahu Exp $ /* (C) Copyright 2002 PowerDNS.COM BV */ #include "utility.hh" +#include "config.h" #include #include #include @@ -53,6 +54,10 @@ pthread_cond_t UeberBackend::d_cond = PTHREAD_COND_INITIALIZER; int UeberBackend::s_s=-1; // ? +#ifdef NEED_RTLD_NOW +#define RTLD_NOW RTLD_LAZY +#endif + //! Loads a module and reports it to all UeberBackend threads bool UeberBackend::loadmodule(const string &name) { diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 8e4466645..8c0e13045 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "utility.hh" +#include "utility.hh" #include "webserver.hh" #include "session.hh" #include "misc.hh" @@ -229,7 +229,6 @@ void *WebServer::serveConnection(void *p) else varmap[parts[0]]=""; - L<<"'"<