From: Bert Hubert Date: Tue, 10 Dec 2002 13:36:26 +0000 (+0000) Subject: lots X-Git-Tag: pdns-2.9.1~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=178d51342eee992bd32ef355509f9b72d226be7f;p=thirdparty%2Fpdns.git lots git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@64 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/Makefile.am b/Makefile.am index c394f38dd8..f321a9134d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ SUBDIRS=modules pdns -EXTRA_DIST=TODO WARNING README HACKING INSTALL ChangeLog debian +EXTRA_DIST=TODO WARNING README HACKING INSTALL ChangeLog debian pdns.spec install-exec-local: @echo "***********************************************************" diff --git a/README b/README index 59a866e552..f9076ba4b9 100644 --- a/README +++ b/README @@ -19,7 +19,8 @@ See http://rtfm.powerdns.com/compiling-powerdns.html for more details. SOLARIS NOTES ------------- -You need gcc 3.x, preferably 3.2! +You need gcc 3.x, preferably 3.2! The 'Sunpro' compiler is currently not +supported (patches are welcome if not too intrusive). If you encounter problems with the Solaris make, gmake is advised IPv6 is currently (2.9.1.) broken in Solaris, awaiting patches! diff --git a/configure.in b/configure.in index 34cb77c491..02d020c392 100644 --- a/configure.in +++ b/configure.in @@ -30,12 +30,12 @@ dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(gethostname gettimeofday mkdir mktime select socket strerror) -AC_CHECK_LIB(resolv, inet_ntop) +#AC_CHECK_LIB(resolv, inet_ntop) -dnl AC_MSG_NOTICE([Looking in libraries: $LIBS]) +#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)) +#AC_CHECK_FUNCS(inet_ntop, , AC_LIBOBJ(lib/inet_ntop)) +#AC_CHECK_FUNCS(inet_pton, , AC_LIBOBJ(lib/inet_pton)) # @@ -94,25 +94,37 @@ then fi fi +DYNLINKFLAGS="" case "$host_os" in -solaris2*) +solaris2.8 | solaris2.9 ) AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined]) AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype]) - LIBS="-lposix4 -lnsl -lsocket -lpthread $LIBS" + AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6]) + LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS" + CXXFLAGS="-D_REENTRANT $CXXFLAGS" + ;; +solaris2.6 | solaris2.7) + AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined]) + AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype]) + LIBS="-lposix4 -lresolv -lnsl -lsocket -lpthread $LIBS" CXXFLAGS="-D_REENTRANT $CXXFLAGS" ;; linux*) AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6]) + DYNLINKFLAGS="-rdynamic" LDFLAGS="-pthread $LDFLAGS" CXXFLAGS="-pthread -D_GNU_SOURCE $CXXFLAGS" ;; *) AC_DEFINE(HAVE_IPV6,1,[If the host operating system understands IPv6]) + DYNLINKFLAGS="-rdynamic" LDFLAGS="-pthread $LDFLAGS" CXXFLAGS="-pthread $CXXFLAGS" ;; esac +AC_SUBST(DYNLINKFLAGS) + AC_MSG_CHECKING(whether we will be doing verbose logging) AC_ARG_ENABLE(verbose-logging, [ --enable-verbose-logging Do verbose logging],enable_verbose_logging=yes ,enable_verbose_logging=no) @@ -348,4 +360,4 @@ 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/pipebackend/Makefile modules/oraclebackend/Makefile) diff --git a/modules/oraclebackend/Makefile b/modules/oraclebackend/Makefile deleted file mode 100644 index 953fcf29b9..0000000000 --- a/modules/oraclebackend/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -## -## File : Makefile -## Author : Stefan Arentz -## Project : PowerDNS -## Version : $Id: Makefile,v 1.1 2002/11/27 15:35:52 ahu Exp $ -## - -ORACLE_HOME = /opt/oracle -PDNS_HOME = ../ahudns - -INCLUDE = -I$(ORACLE_HOME)/rdbms/demo \ - -I$(ORACLE_HOME)/rdbms/public \ - -I$(PDNS_HOME) -VERSION=2.1 - -all: liboraclebackend.so - - -DIRNAME=pdns-oraclebackend-$(VERSION) - -dist: - mkdir $(DIRNAME) - cp oraclebackend.cc oraclebackend.hh Makefile README LICENSE $(DIRNAME) - - tar cvzf $(DIRNAME).tar.gz $(DIRNAME) - rm -rf $(DIRNAME) - - -liboraclebackend.so: oraclebackend.o - g++ -shared -o liboraclebackend.so oraclebackend.o -L$(ORACLE_HOME)/lib -lclntsh -lwtc8 - -liboraclebackend.o: oraclebackend.cc oraclebackend.hh - -install: liboraclebackend.so - cp liboraclebackend.so /usr/lib/powerdns/ - -.SUFFIXES: -.SUFFIXES: .cc .o - -.cc.o: - g++ -g -c $(LCFLAGS) $(INCLUDE) $< - -clean: - rm -f *.o *.so - diff --git a/modules/oraclebackend/Makefile.in b/modules/oraclebackend/Makefile.in new file mode 100644 index 0000000000..717d71d9fb --- /dev/null +++ b/modules/oraclebackend/Makefile.in @@ -0,0 +1,50 @@ +## +## File : Makefile +## Author : Stefan Arentz +## Project : PowerDNS +## Version : $Id: Makefile.in,v 1.1 2002/12/10 13:36:26 ahu Exp $ +## + +ORACLE_HOME = /opt/oracle +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: + +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++ -g -c $(CXXFLAGS) $(INCLUDE) $< + +clean: + rm -f *.o *.so *~ + diff --git a/modules/oraclebackend/OBJECTFILES b/modules/oraclebackend/OBJECTFILES new file mode 100644 index 0000000000..ac8cc257b2 --- /dev/null +++ b/modules/oraclebackend/OBJECTFILES @@ -0,0 +1 @@ +oraclebackend.o diff --git a/modules/oraclebackend/OBJECTLIBS b/modules/oraclebackend/OBJECTLIBS new file mode 100644 index 0000000000..3c460f05a3 --- /dev/null +++ b/modules/oraclebackend/OBJECTLIBS @@ -0,0 +1 @@ +-ldl -L/opt/oracle/lib -ldl -lclient8 -ldl -lclntst8 \ No newline at end of file diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 2708eceeda..e334afa5e8 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -4,8 +4,7 @@ AM_CPPFLAGS=-Ibackends/bind EXTRA_DIST = codedocs/Makefile codedocs/doxygen.conf docs/Makefile \ docs/gslb-operations.sgml docs/powerdns-case.sgml docs/powerdns-install.sgml \ docs/powerdns-overview.sgml docs/powerdns-technical.sgml \ -pdns.spec release-scripts/ docs/pdns.sgml \ -choosepaths mtasker.cc + release-scripts/ docs/pdns.sgml mtasker.cc noinst_SCRIPTS = pdns sysconf_DATA = pdns.conf-dist @@ -31,7 +30,7 @@ backends/bind/bindparser.cc backends/bind/bindlexer.c \ backends/bind/huffman.cc # -pdns_server_LDFLAGS=-rdynamic @LIBDL@ @moduleobjects@ @modulelibs@ +pdns_server_LDFLAGS=@DYNLINKFLAGS@ @LIBDL@ @moduleobjects@ @modulelibs@ pdns_server_INCLUDES= diff --git a/pdns/choosepaths b/pdns/choosepaths deleted file mode 100755 index cbe32357dc..0000000000 --- a/pdns/choosepaths +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -IB="dialog --inputbox" -MB="dialog --msgbox" -YN="dialog --yesno" - -. ./pathconfig - -$MB "\nWelcome to the PowerDNS installation program!\n\nPlease select \ -locations for the different PowerDNS files." 11 60 - -redo=1 -while [ "$redo" = "1" ] -do -echo $redo - -askPath() -{ - val=`eval echo \\$$2` - $IB "$1\n\n" 10 60 $val 2> ./dialog.tmp - if [ "$?" != "0" ] ; then exit ; fi - eval $2=`cat ./dialog.tmp` -} - -askPath "Intended location of your init.d scripts" INITDPATH -askPath "Intended location of your binaries" BINARYPATH -askPath "Intended location of your configuration files" CONFIGPATH -askPath "Intended location of the controlsocket directory" SOCKETPATH -askPath "Intended location of the PowerDNS plugins directory" LIBRARYPATH -askPath "Intended location of the PowerDNS documentation directory" DOCPATH - -$MB "\nPowerDNS can be configured to run as an\n\ -unprivileged user.\n\ -This is highly recommended. You should\n\ -now create a user and a group for PDNS\n\ -to run as and then press enter, \n\ -after which you will be asked for\n\ -the identity." 15 60 - -askPath "Intended user id for PDNS to run as" PDNSUID -askPath "Intended group id for PDNS to run as" PDNSGID - -$YN "Do you accept these values?\n\ninit.d: $INITDPATH\n\ -binaries: $BINARYPATH\n\ -configuration: $CONFIGPATH\n\ -sockets: $SOCKETPATH\n\ -plugins: $LIBRARYPATH\n\ -documentation: $DOCPATH\n\ -uid: $PDNSUID\n\ -gid: $PDNSGID\n" 15 60 -redo=$? -echo $ready -done - -mv pathconfig pathconfig.old 2> /dev/null > /dev/null - -(echo INITDPATH=$INITDPATH -echo BINARYPATH=$BINARYPATH -echo CONFIGPATH=$CONFIGPATH -echo SOCKETPATH=$SOCKETPATH -echo LIBRARYPATH=$LIBRARYPATH -echo PDNSUID=$PDNSUID -echo DOCPATH=$DOCPATH -echo PDNSGID=$PDNSGID) > pathconfig - -$MB "\nDone recording your directory preferences." 7 70 - - diff --git a/pdns/docs/pdns.sgml b/pdns/docs/pdns.sgml index 4784e5b837..ebb5f9a46d 100644 --- a/pdns/docs/pdns.sgml +++ b/pdns/docs/pdns.sgml @@ -15,7 +15,7 @@ - v2.1 $Date: 2002/12/09 16:24:17 $ + v2.1 $Date: 2002/12/10 13:36:26 $ @@ -85,6 +85,102 @@ 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.1 + + Thanks to the great enthusiasm from around the world, powerdns is now available for Solaris and FreeBSD users again! + Furthermore, the Windows build is back. We are very grateful for the help of: + + + + Michel Stol + Wichert Akkerman + Edvard Tuinder + Koos van den Hout + Niels Bakker + Erik Bos + Alex Bleker + steven stillaway + Roel van der Made + Steven Van Steen + + + + We are happy to have been able to work with the open source community to improve PowerDNS! + + + Changes: + + + + The monitor command set no longer allows the changing of non-existant variables. + + + + + IBM Universal Database DB2 backend now included in source distribution (untested!) + + + + + Oracle backend now included in source distribution (sligthly tested!) + + + + + configure script now searches for postgresql and mysql includes + + + + + Bind parser now no longer dies on records with a ' in them (Erik Bos) + + + + + The pipebackend was accidentally left out of 2.9 + + + + + FreeBSD fixes (with help from Erik Bos, Alex Bleeker, Niels Bakker) + + + + + 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 + welcome! + + + + + Windows 32 build is back! Michel Stol updated his earlier work to the current version. + + + + + S/Linux (Linux on Sparc) build works now (with help from steven stillaway). + + + + + Silly debugging message ('sd.ttl from cache') removed + + + + + .debs are back, hopefully in 'sid' soon! (Wichert Akkerman) + + + + + Removal of bzero and other less portable constructs. Discovered that recent Linux glibc's need -D_GNU_SOURCE (Wichert Akkerman). + + + + + Version 2.9 Open source release. Do not deploy unless you know what you are @@ -6548,7 +6644,7 @@ static RandomLoader randomloader; Compiling PowerDNS on Windows - By Michael Stol (michael@physos.info). + By Michel Stol (michel@powerdns.com). Assumptions I will assume these things from you: @@ -6915,7 +7011,7 @@ static RandomLoader randomloader; If you are pretty sure that it's a bug, either in the PowerDNS sources, the build - system or in this article, then please send an e-mail to powerdns-dev@mailman.powerdns.com describing your + system or in this article, then please send an e-mail to pdns-dev@mailman.powerdns.com describing your problem. We will then try to fix it. @@ -6991,7 +7087,7 @@ static RandomLoader randomloader; If you have a comment, or a bug report concerning either this document or the PowerDNS sources - you can contact powerdns-dev@mailman.powerdns.com + you can contact pdns-dev@mailman.powerdns.com @@ -7006,7 +7102,7 @@ static RandomLoader randomloader; If you want to praise my work, ask me to marry you, deposit $1.000.000 on my bank account or flame me to death, then - you can mail me at michel@physos.info :) + you can mail me at michel@powerdns.com :) diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index f8d1e2fe7f..1ef97afe52 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -15,7 +15,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: nameserver.cc,v 1.2 2002/12/09 16:24:17 ahu Exp $ +// $Id: nameserver.cc,v 1.3 2002/12/10 13:36:26 ahu Exp $ #include "utility.hh" #include #include @@ -148,31 +148,30 @@ void UDPNameserver::bindIPv6() int s; for(vector::const_iterator i=locals.begin();i!=locals.end();++i) { string localname(*i); - struct sockaddr_in6 locala; s=socket(AF_INET6,SOCK_DGRAM,0); if(s<0) throw AhuException("Unable to acquire a UDPv6 socket: "+string(strerror(errno))); - memset(&locala,0,sizeof(locala)); - locala.sin6_family=AF_INET6; - if(localname=="::0") { L<h_addr,16); + sockaddr_in6 locala; + locala.sin6_port=ntohs(arg().asNum("local-port")); + if(!inet_pton(AF_INET6, localname.c_str(), (void *)&locala.sin6_addr)) { + addrinfo *addrinfos; + addrinfo hints; + memset(&hints,0,sizeof(hints)); + hints.ai_socktype=SOCK_DGRAM; + hints.ai_family=AF_INET6; + + if(getaddrinfo(localname.c_str(),arg()["local-port"].c_str(),&hints,&addrinfos)) + throw AhuException("Unable to resolve local IPv6 address '"+localname+"'"); + memcpy(&locala,addrinfos->ai_addr,addrinfos->ai_addrlen); + } - locala.sin6_port=htons(arg().asNum("local-port")); - - if(bind(s, (sockaddr*)&locala,sizeof(locala))<0) { + if(bind(s, (sockaddr*)&locala, sizeof(locala))<0) { L<::const_iterator laddr=locals6.begin();laddr!=locals6.end();++laddr) { - struct sockaddr_in6 local; int s=socket(AF_INET6,SOCK_STREAM,0); if(s<0) throw AhuException("Unable to acquire TCPv6 socket: "+stringerror()); - - memset(&local,0,sizeof(local)); - local.sin6_family=AF_INET6; - struct hostent *h; - h=gethostbyname2(laddr->c_str(),AF_INET6); - - if(!h) - throw AhuException("Unable to resolve local address '"+*laddr+"'"); + + sockaddr_in6 locala; + locala.sin6_port=ntohs(arg().asNum("local-port")); + + if(!inet_pton(AF_INET6, laddr->c_str(), (void *)&locala.sin6_addr)) { + addrinfo *addrinfos; + addrinfo hints; + memset(&hints,0,sizeof(hints)); + hints.ai_socktype=SOCK_STREAM; + hints.ai_family=AF_INET6; - memcpy(&local.sin6_addr.s6_addr,h->h_addr,16); - local.sin6_port=htons(arg().asNum("local-port")); + if(getaddrinfo(laddr->c_str(),arg()["local-port"].c_str(),&hints,&addrinfos)) + throw AhuException("Unable to resolve local IPv6 address '"+*laddr+"'"); + + memcpy(&locala,addrinfos->ai_addr,addrinfos->ai_addrlen); + } int tmp=1; if(setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char*)&tmp,sizeof tmp)<0) { @@ -461,7 +465,7 @@ TCPNameserver::TCPNameserver() exit(1); } - if(bind(s, (sockaddr*)&local,sizeof(local))<0) { + if(bind(s, (const sockaddr*)&locala, sizeof(locala))<0) { L<