+++ /dev/null
-/*
- PowerDNS Versatile Database Driven Nameserver
- Copyright (C) 2002 PowerDNS.COM BV
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2
- as published by the Free Software Foundation
-
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-#include <iostream>
-#include <cstdio>
-#include <cstring>
-#include <cstdlib>
-#include <unistd.h>
-#include <errno.h>
-#include <climits>
-#include <string>
-#include <map>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include <sys/stat.h>
-
-
-#include "namespaces.hh"
-
-static void imbue(char *pname, const char *search, const string &replace);
-static string stringerror();
-static off_t filesize(int fd);
-
-int main(int argc, char **argv)
-{
- if(argc!=3) {
- cerr<<"Syntax: binpatch binary configuration-directory"<<endl;
- exit(0);
- }
-
- imbue(argv[1],"!@@SYSCONFDIR@@:",argv[2]);
-}
-
-static void imbue(char *pname, const char *search, const string &replace)
-{
- int fd=open(pname, O_RDWR);
- if(fd<0) {
- cerr<<"Unable to open executable read/write for imbuing: "<<stringerror()<<endl;
- exit(1);
- }
- int fs=filesize(fd);
- void *ptr=mmap(0,fs,PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if(ptr==(caddr_t)-1) {
- cerr<<"Unable to mmap executable read/write for imbuing: "<<stringerror()<<endl;
- exit(1);
- }
-
- char *p=(char *)ptr;
- char *end=p+fs;
- for(;p<end;++p)
- if(*p==*search && *(p+1)==*(search+1) && !memcmp(p,search,strlen(search)))
- break;
-
- if(p==end) {
- cerr<<"Cannot find marker in binary, not imbuing"<<endl;
- exit(1);
- }
- strcpy(p+strlen(search),replace.c_str());
- munmap(ptr,filesize(fd));
- close(fd);
- cerr<<"Imbued configuration location '"<<replace<<"'"<<endl;
- return;
-}
-
-static off_t filesize(int fd)
-{
- struct stat buf;
- fstat(fd, &buf);
- return buf.st_size;
-}
-static string stringerror()
-{
- return strerror(errno);
-}
string s_programname="pdns";
string localdir;
- static char pietje[128]="!@@SYSCONFDIR@@:";
- ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=
- strcmp(pietje+1,"@@SYSCONFDIR@@:") ? pietje+strlen("@@SYSCONFDIR@@:")+1 : SYSCONFDIR;
-
+ ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=SYSCONFDIR;
::arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR;
::arg().set("remote-address","Remote address to query");
::arg().set("remote-port","Remote port to query")="53000";
+++ /dev/null
-#!/bin/sh
-
-DIR=pdns-nameserver-$(uname -m -s | tr L l | tr ' ' '-')-@VERSION@
-rm -rf $DIR
-mkdir $DIR
-cp backends/bind/zone2sql pdns_server pdns_control binpatch $DIR
-strip $DIR/*
-cp choosepaths installer pdns.in pathconfig LICENSE README $DIR
-
-
-if file ./pdns_server | grep -q dynamic
-then
- mkdir $DIR/libs
- cp libs/* $DIR/libs # backends
- strip $DIR/libs/*.so
-# ldd ./pdns_server | cut -f2 -d\> | cut -f1 -d\( | grep -v ld-linux.so | \
-# grep -v libm.so | grep -v libc.so | grep -v libpthread.so | grep -v libdl.so \
-# > libs.tmp
-# cp $(cat libs.tmp) $DIR/libs
-# rm libs.tmp
-fi
-
-
-mkdir $DIR/docs
-cp docs/pdns.pdf $DIR/docs
-cp docs/pdns.txt $DIR/docs
-cp docs/html.tar.gz $DIR/docs
-
-tar cvzf $DIR.tar.gz $DIR
static void UNIX_declareArguments()
{
- static char pietje[128]="!@@SYSCONFDIR@@:";
- ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=
- strcmp(pietje+1,"@@SYSCONFDIR@@:") ? pietje+strlen("@@SYSCONFDIR@@:")+1 : SYSCONFDIR;
-
+ ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=SYSCONFDIR;
::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")=LIBDIR;
+++ /dev/null
--ldl -L/opt/oracle/lib -ldl -lclient8 -ldl -lclntst8
+++ /dev/null
-#!/usr/local/bin/gmake -f
-
-all: compile package
-
-compile: compilation
-
-precompile:
- gmake clean
- gmake -k distclean
- ./bootstrap
- ./configure --enable-static-binaries
- cd ../pdns-pipebackend ; gmake clean; gmake
- cd ../ahudns-mysqlbackend ; gmake clean ; gmake
- cd ../pdns-gpgsqlbackend; gmake clean ; gmake
- cd ../pdns-gmysqlbackend; gmake clean ; gmake
- # cd backends/bind ; gmake
-
-extras: precompile
- -rm extra/*.o
- cd extra ; ln -s ../backends/bind/bindbackend.o .
- cd extra ; ln -s ../backends/bind/zoneparser2.o .
- cd extra ; ln -s ../backends/bind/bindparser.o .
- cd extra ; ln -s ../backends/bind/bindlexer.o .
- cd extra ; ln -s ../backends/bind/huffman.o .
- cd extra ; ln -s ../../pdns-pipebackend/*.o .
- cd extra; ln -s ../../ahudns-mysqlbackend/*.o .
- cd extra; ln -s ../../pdns-gpgsqlbackend/*.o .
- cd extra; ln -s ../../pdns-gmysqlbackend/*.o .
- echo "-L/usr/local/lib -lz -L/usr/local/lib/mysql -lmysqlclient -lz -lpq++ -lpq -lssl -lcrypt -lcrypto" > extra/ld
- -rm libs/*
-
-compilation: extras
- gmake
- gmake mkbindist
-
-
-package:
- mkdir -p release-files/freebsd-static
- cp backends/bind/zone2sql .
-
- -rm pdns*tar.gz
- cp pathconfig.bsd pathconfig
- . ./mkbindist
- mv pdns*tar.gz release-files/freebsd-static
-
-
+++ /dev/null
-#!/usr/bin/make -f
-
-all: compile package
-
-compile:
- make clean
- make -k distclean
- ./bootstrap
- ./configure
- cd ../pdns-pipebackend ; make clean; make
- cd ../ahudns-mysqlbackend ; make clean ; make
- cd ../ahudns-pdnsbackend ; make clean ; make
- cd ../pdns-gpgsqlbackend; make clean ; make
- cd ../pdns-gmysqlbackend; make clean ; make
-
- cd extra ; make clean ; make
- -rm libs/*
- cd libs ; ln -s ../backends/bind/.libs/libbindbackend.so .
- cd libs ; ln -s ../../pdns-pipebackend/.libs/libpipebackend.so .
- cd libs; ln -s ../../ahudns-mysqlbackend/.libs/libmysqlbackend.so .
- cd libs; ln -s ../../ahudns-pdnsbackend/.libs/libpdnsbackend.so .
- cd libs; ln -s ../../pdns-gpgsqlbackend/*.so .
- cd libs; ln -s ../../pdns-gmysqlbackend/*.so .
- echo "" > extra/ld
- make
- make mkbindist
-
-
-package:
- mkdir -p release-files/deb/unstable
- mkdir -p release-files/rpm-dynamic
- mkdir -p release-files/linux-dynamic
-
- rm -rf ../pdns_*deb
- rm -rf ../pdns-*rpm
-
- cp backends/bind/zone2sql .
-
- sudo debian/rules clean
- sudo debian/rules binary
-
- mv ../pdns_*deb release-files/deb/unstable
- DESTDIR=/tmp/pdns sudo ./installer
- sudo rpm -bb ./pdns-dynamic.spec
- mv ../pdns-*rpm release-files/rpm-dynamic
-
- . ./mkbindist
- mv pdns*tar.gz release-files/linux-dynamic
-
+++ /dev/null
-make clean
-make -k distclean
-./bootstrap
-./configure --enable-static-binaries
-cd extra
-ln -sf ../backends/bind/{bindbackend.o,zoneparser2.o,bindparser.o,bindlexer.o} .
-ln -sf ../backends/bind/huffman.o .
-ln -sf ../../pdns-oraclebackend/*.o .
-echo "-ldl -L/opt/oracle/lib -ldl -lclient8 -ldl -lclntst8" > ld
-cd ..
-rm libs/*
-make
-cp backends/bind/zone2sql .
-
+++ /dev/null
-make clean
-make -k distclean
-./bootstrap
-./configure --enable-static-binaries
-cd extra
-ln -sf ../backends/bind/{bindbackend.o,zoneparser2.o,bindparser.o,bindlexer.o} .
-ln -sf ../backends/bind/huffman.o .
-ln -sf ../../pdns-pipebackend/*.o .
-ln -sf ../../ahudns-mysqlbackend/*.o .
-ln -sf ../../ahudns-pdnsbackend/*.o .
-ln -sf ../../pdns-gpgsqlbackend/*.o .
-echo "-lmysqlclient -L/opt/postgresql/lib -lpq++ -lpq -lssl -lcrypt -lcrypto" > ld
-cd ..
-rm libs/*
-make
-cp backends/bind/zone2sql .
-
+++ /dev/null
-#!/usr/bin/make -f
-
-all: compile package
-
-compile:
- make distclean
- ./configure --enable-static-binaries
- cd ../pdns-pipebackend ; ./configure ; make clean; make
- cd ../ahudns-mysqlbackend ; ./configure ; make clean ; make && cd -
- cd ../ahudns-pdnsbackend ; ./configure ; make clean ; make && cd -
- cd ../pdns-gpgsqlbackend; ./configure ; make clean ; make && cd -
- cd ../pdns-gmysqlbackend; ./configure ; make clean ; make && cd -
- rm -f extra/*.o
- cd extra; ln -s ../backends/bind/{bindbackend.o,zoneparser2.o,bindparser.o,bindlexer.o} . ; cd -
- cd extra ; ln -s ../backends/bind/huffman.o . ; cd -
- cd extra ; ln -s ../../pdns-pipebackend/*.o . ; cd -
- cd extra; ln -s ../../ahudns-mysqlbackend/*.o . ; cd -
- cd extra; ln -s ../../ahudns-pdnsbackend/*.o . ; cd -
- cd extra; ln -s ../../pdns-gpgsqlbackend/*.o . ; cd -
- cd extra; ln -s ../../pdns-gmysqlbackend/*.o . ; cd -
- echo "-lmysqlclient -L/opt/postgresql/lib -lpq++ -lpq -lssl -lcrypt -lcrypto" > extra/ld
- rm -f libs/*
- make
- make mkbindist
-
-
-package:
- mkdir -p release-files/deb/stable
- mkdir -p release-files/linux-static
- mkdir -p release-files/rpm
-
- rm -rf ../pdns_*deb
- rm -rf ../pdns-*rpm
-
- cp backends/bind/zone2sql .
-
- sudo debian/rules.stable clean
- sudo debian/rules.stable binary
-
- mv ../pdns_*deb release-files/deb/stable
-
- cp pathconfig.redhat pathconfig
- DESTDIR=/tmp/pdns sudo ./installer
- sudo rpm -bb ./pdns.spec
- mv ../pdns-*rpm release-files/rpm
-
- rm -f pdns*tar.gz
-
- . ./mkbindist
- mv pdns*tar.gz release-files/linux-static
-
-
+++ /dev/null
-#!/usr/bin/make -f
-
-all: compile package
-
-compile: prepare realcompile
-
-prepare:
- make distclean
- ./configure --enable-static-binaries
- cd ../pdns-pipebackend ; ./configure ; make clean; make
- cd ../ahudns-mysqlbackend ; ./configure ; make clean ; make && cd -
- cd ../ahudns-pdnsbackend ; ./configure ; make clean ; make && cd -
- cd ../pdns-gpgsqlbackend; ./configure ; make clean ; make && cd -
- cd ../pdns-xdbbackend; make clean ; make && cd -
- cd ../pdns-gmysqlbackend; ./configure ; make clean ; make && cd -
- rm -f extra/*.o
- cd extra ; ln -s ../../pdns-pipebackend/*.o . ; cd -
- cd extra; ln -s ../../ahudns-mysqlbackend/*.o . ; cd -
- cd extra; ln -s ../../ahudns-pdnsbackend/*.o . ; cd -
- cd extra; ln -s ../../pdns-gpgsqlbackend/*.o . ; cd -
- cd extra; ln -s ../../pdns-gmysqlbackend/*.o . ; cd -
-# cd extra; ln -s ../../pdns-xdbbackend/*.o . ; cd -
- echo "-lmysqlclient -L/opt/postgresql-with-3.2/lib -lpq++ -lpq -lssl -lcrypt -lcrypto" > extra/ld
- rm -f libs/*
-
-realcompile:
- make
- make mkbindist
-
-
-package:
- mkdir -p release-files/deb/stable
- mkdir -p release-files/linux-static
- mkdir -p release-files/rpm
-
- rm -rf ../pdns_*deb
- rm -rf ../pdns-*rpm
-
- cp backends/bind/zone2sql .
-
- sudo debian/rules clean
- sudo debian/rules binary
-
- mv ../pdns_*deb release-files/deb/stable
-
- cp pathconfig.redhat pathconfig
- DESTDIR=/tmp/pdns sudo ./installer
- sudo rpm -bb ./pdns.spec
- mv ../pdns-*rpm release-files/rpm
-
- rm -f pdns*tar.gz
-
- . ./mkbindist
- mv pdns*tar.gz release-files/linux-static
-
-
+++ /dev/null
-; PowerDNS NSIS file
-;------------------------------------------------------
-
-
-; Defines.
-;------------------------------------------------------
-
-!define VERSION "2.9.13"
-
-
-; Output settings.
-;------------------------------------------------------
-
-SetCompressor bzip2
-
-!ifdef Debug
-OutFile "..\Debug\powerdns-${VERSION}-d.exe"
-!define INDIR "..\Debug\"
-!else
-OutFile "..\Release\powerdns-${VERSION}.exe"
-!define INDIR "..\Release\"
-!endif
-
-BrandingText " "
-XPStyle on
-
-InstType "Full"
-InstType "Minimal (no example zone)"
-
-InstallDir $PROGRAMFILES\PowerDNS
-InstallDirRegKey HKLM SOFTWARE\PowerDNS ""
-
-
-;Include Modern UI
-;------------------------------------------------------
-
-!include "MUI.nsh"
-
-
-; Names
-;------------------------------------------------------
-Name "PowerDNS"
-Caption "PowerDNS ${VERSION} for Windows Setup"
-
-
-;Interface Settings
-;------------------------------------------------------
-!define MUI_ABORTWARNING
-
-!define MUI_HEADERIMAGE
-!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "powerdns.bmp"
-
-!define MUI_COMPONENTSPAGE_NODESC
-
-!insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
-!insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\pixel-uninstall.ico"
-
-;Pages
-;------------------------------------------------------
-!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of PowerDNS for Windows.\r\n\r\n\r\n$_CLICK"
-
-!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_LICENSE "..\..\LICENSE"
-!insertmacro MUI_PAGE_COMPONENTS
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_INSTFILES
-
-!define MUI_FINISHPAGE_LINK "Visit the PowerDNS website for news and documentation."
-!define MUI_FINISHPAGE_LINK_LOCATION "http://www.powerdns.com/"
-
-!insertmacro MUI_PAGE_FINISH
-
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-;Languages
-;------------------------------------------------------
-!insertmacro MUI_LANGUAGE "English"
-
-
-;Sections
-;------------------------------------------------------
-Section "PowerDNS Nameserver (required)"
-
- SetDetailsPrint textonly
- DetailPrint "Installing PowerDNS..."
- SetDetailsPrint listonly
-
- SectionIn 1 2 RO
- SetOutPath $INSTDIR
- RMDir /r $SMPROGRAMS\PowerDNS
-
- SetOverwrite on
- File ${INDIR}\pdns.exe
- File ${INDIR}\pdns_control.exe
- File ${INDIR}\pdns_recursor.exe
- File ${INDIR}\pdnsmsg.dll
- File ${INDIR}\zone2sql.exe
- File ..\release-scripts\pdns.ico
- File ..\..\LICENSE
-
- WriteUninstaller $INSTDIR\uninst-pdns.exe
-
-WriteRegStr HKLM SOFTWARE\PowerDNS "" $INSTDIR
-
-WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \
- "DisplayName" "PowerDNS Nameserver (remove only)"
-WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS" \
- "UninstallString" "$INSTDIR\uninst-pdns.exe"
-
-
- SetOverwrite ifnewer
- ; $SYSDIR doesn't work?
- File C:\WINNT\System32\pthreadVCE.dll
- File C:\WINNT\System32\msvcrt.dll
-
-
- ; Create default pdns configuration file.
-IfFileExists "$INSTDIR\pdns.conf" NoConfWrite
- FileOpen $R1 "$INSTDIR\pdns.conf" "w"
-
- FileWrite $R1 "# PowerDNS configuration file.$\r$\n$\r$\n"
-
- FileWrite $R1 "# Use NT logging when running as a service:$\r$\n"
- FileWrite $R1 "use-ntlog=yes$\r$\n$\r$\n"
-
- FileWrite $R1 "# Backends to launch at startup:$\r$\n"
- FileWrite $R1 "launch=godbc$\r$\n$\r$\n"
-
- FileWrite $R1 "godbc-datasource=PowerDNS$\r$\n"
- FileWrite $R1 "godbc-username=PowerDNS$\r$\n"
- FileWrite $R1 "godbc-password=PowerDNS$\r$\n$\r$\n"
-
- FileWrite $R1 "# Point to the recursor:$\r$\n"
- FileWrite $R1 "recursor=127.0.0.1:5300$\r$\n$\r$\n"
-
- FileWrite $R1 "# Launch a statistical webserver:$\r$\n"
- FileWrite $R1 "webserver=yes$\r$\n"
- FileWrite $R1 "webserver-port=8081$\r$\n$\r$\n"
-
- FileWrite $R1 "# EOF$\r$\n"
-
- FileClose $R1
-
-NoConfWrite:
- ; Create default pdns configuration file.
- IfFileExists "$INSTDIR\recursor.conf" NoConfRecWrite
- FileOpen $R2 "$INSTDIR\recursor.conf" "w"
-
- FileWrite $R2 "# PowerDNS Recursor configuration file.$\r$\n$\r$\n"
-
- FileWrite $R2 "# Use NT logging when running as a service:$\r$\n"
- FileWrite $R2 "use-ntlog=yes$\r$\n$\r$\n"
-
- FileWrite $R2 "# Port to run the recursor on:$\r$\n"
- FileWrite $R2 "local-port=5300$\r$\n$\r$\n"
-
- FileWrite $R2 "# EOF$\r$\n"
-
- FileClose $R2
-
-NoConfRecWrite:
-
- Sleep 500
-
- MessageBox MB_YESNO "Do you want to register PowerDNS as a NT service?" IDNO NoReg
- Exec '"$INSTDIR\pdns.exe" --register-service'
- Exec '"$INSTDIR\pdns_recursor.exe" --register-service'
-
-NoReg:
-
-SectionEnd
-
-Section "Start menu + shortcuts"
- SectionIn 1 2
-
- CreateDirectory "$SMPROGRAMS\PowerDNS"
-
- WriteINIStr "$SMPROGRAMS\PowerDNS\PowerDNS Homepage.url" \
- "InternetShortcut" "URL" "http://www.powerdns.com/"
-
- WriteINIStr "$SMPROGRAMS\PowerDNS\PowerDNS Documentation.url" \
- "InternetShortcut" "URL" "http://doc.powerdns.com/"
-
- CreateShortCut "$SMPROGRAMS\PowerDNS\PowerDNS.lnk" \
- "$INSTDIR\pdns.exe" "" \
- "$INSTDIR\pdns.ico"
-
- CreateShortCut "$SMPROGRAMS\PowerDNS\Uninstall PowerDNS.lnk" \
- "$INSTDIR\uninst-pdns.exe"
-
-SectionEnd
-
-Section "Example zone"
- SectionIn 1
-
- IfFileExists $INSTDIR\powerdns.mdb Ask
- Goto OverwriteZone
-
-Ask:
- MessageBox MB_YESNO "powerdns.mdb already exists, overwrite?" IDNO StatusEnd
- SetOverwrite on
-
-OverwriteZone:
- File ..\..\modules\godbcbackend\powerdns.mdb
-
-StatusEnd:
-SectionEnd
-
-# Uninstall section.
-Section "Uninstall"
- MessageBox MB_YESNO "Are you sure you want to uninstall PowerDNS?" IDYES Proceed
- Quit
-
-Proceed:
- IfFileExists $INSTDIR\pdns.exe Skip
- MessageBox MB_YESNO "It does not appear that PowerDNS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)" IDYES FSkip
- Quit
-
-Skip:
- ExecWait '"$INSTDIR\pdns.exe" --unregister-service'
- ExecWait '"$INSTDIR\pdns_recursor.exe" --unregister-service'
-
-FSkip:
-
- DeleteRegKey HKLM "System\CurrentControlSet\Services\PDNS"
- DeleteRegKey HKLM "System\CurrentControlSet\Services\Eventlog\Application\PDNS"
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerDNS"
- DeleteRegKey HKLM "SOFTWARE\PowerDNS"
-
- RMDir /r $SMPROGRAMS\PowerDNS
-
- Delete $INSTDIR\LICENSE
- Delete $INSTDIR\pthreadVCE.dll
- Delete $INSTDIR\msvcrt.dll
- Delete $INSTDIR\pdnsmsg.dll
- Delete $INSTDIR\uninst-pdns.exe
- Delete $INSTDIR\pdns.ico
- Delete $INSTDIR\pdns.exe
- Delete $INSTDIR\zone2sql.exe
- Delete $INSTDIR\pdns_control.exe
- Delete $INSTDIR\pdns_recursor.exe
-
- RMDir $INSTDIR
-
-SectionEnd
-
-
-Function .onInstSuccess
- Sleep 500
-
- MessageBox MB_YESNO "Installation successful!$\r$\n$\r$\nTo use the ODBC functionality in PowerDNS you need to create a ODBC data source.$\r$\nFor more information about the ODBC backend please examine the documentation.$\r$\n$\r$\nDo you want to create a data source now?" IDNO NoODBC
- Exec '"rundll32.exe" shell32.dll,Control_RunDLL odbccp32.cpl'
-
-NoODBC:
-
-FunctionEnd
\ No newline at end of file