- removed bind-sdb package (default named has compiled SDB backend now)

- integrated DLZ (Dynamically loadable zones) drivers
- integrated GSS-TSIG support (RFC 3645)
- build with -O0 (many new features, potential core dumps will be more
    useful)
This commit is contained in:
Adam Tkac 2007-07-20 11:31:19 +00:00
parent 969b1cbd8f
commit 2be0bc65f4
9 changed files with 145 additions and 313 deletions

View File

@ -1,26 +0,0 @@
--- bind-9.4.0/bin/named/Makefile.in.dbus_archdep_libdir 2007-03-06 14:18:14.000000000 +0100
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 14:20:39.000000000 +0100
@@ -43,8 +43,9 @@
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES = @USE_DLZ@
--- bind-9.4.0/bin/named_sdb/Makefile.in.dbus_archdep_libdir 2007-03-06 14:18:14.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/Makefile.in 2007-03-06 14:21:09.000000000 +0100
@@ -43,8 +43,9 @@
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES = @USE_DLZ@

View File

@ -1,83 +0,0 @@
--- bind-9.4.0/bin/named_sdb/Makefile.in.sdb_dbus 2007-03-06 14:12:30.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/Makefile.in 2007-03-06 14:16:45.000000000 +0100
@@ -43,6 +43,9 @@
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_INCLUDES = \
+ -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+
CDEFINES = @USE_DLZ@
CWARNINGS =
@@ -60,6 +63,7 @@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
+DBUSLIBS= -ldbus-1
DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
@@ -80,6 +84,7 @@
zoneconf.o \
lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
+ dbus_service.o dbus_mgr.o \
${DLZDRIVER_OBJS} ${DBDRIVER_OBJS}
UOBJS = unix/os.o
@@ -92,6 +97,7 @@
zoneconf.c \
lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
+ dbus_service.c dbus_mgr.c \
${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
MANPAGES = named.8 lwresd.8 named.conf.5
@@ -120,9 +126,14 @@
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
+dbus_service.o: dbus_service.c
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+ ${DBUS_INCLUDES} \
+ -c ${srcdir}/dbus_service.c
+
named_sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
- ${OBJS} ${UOBJS} ${LIBS}
+ ${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS}
doc man:: ${MANOBJS}
--- bind-9.4.0/bin/named_sdb/main.c.sdb_dbus 2007-03-06 14:12:30.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/main.c 2007-03-06 14:17:51.000000000 +0100
@@ -251,7 +251,8 @@
"usage: named [-4|-6] [-c conffile] [-d debuglevel] "
"[-f|-g] [-n number_of_cpus]\n"
" [-p port] [-s] [-t chrootdir] [-u username]\n"
- " [-m {usage|trace|record|size|mctx}]\n");
+ " [-m {usage|trace|record|size|mctx}]\n"
+ " [-D ]\n");
}
static void
@@ -359,7 +360,7 @@
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
- "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:")) != -1) {
+ "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:D")) != -1) {
switch (ch) {
case '4':
if (disable4)
@@ -448,6 +449,9 @@
case 'v':
printf("BIND %s\n", ns_g_version);
exit(0);
+ case 'D':
+ ns_g_dbus = 1;
+ break;
case '?':
usage();
ns_main_earlyfatal("unknown option '-%c'",

View File

@ -1,15 +1,6 @@
--- bind-9.4.0/configure.in.sdb 2007-03-06 12:59:32.000000000 +0100
+++ bind-9.4.0/configure.in 2007-03-06 12:59:32.000000000 +0100
@@ -2457,6 +2457,8 @@
bin/check/Makefile
bin/named/Makefile
bin/named/unix/Makefile
+ bin/named_sdb/Makefile
+ bin/named_sdb/unix/Makefile
bin/rndc/Makefile
bin/rndc/unix/Makefile
bin/dig/Makefile
@@ -2478,6 +2480,7 @@
@@ -2478,6 +2478,7 @@
bin/tests/system/tkey/Makefile
bin/tests/headerdep_test.sh
bin/dnssec/Makefile
@ -24,12 +15,12 @@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig dnssec tests nsupdate check
+SUBDIRS = named named_sdb rndc dig dnssec tests nsupdate check sdb_tools
+SUBDIRS = named rndc dig dnssec tests nsupdate check sdb_tools
TARGETS =
@BIND9_MAKE_RULES@
--- bind-9.4.0/bin/named_sdb/main.c.sdb 2006-11-10 19:51:14.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/main.c 2007-03-06 13:43:31.000000000 +0100
--- bind-9.4.0/bin/named/main.c.sdb 2006-11-10 19:51:14.000000000 +0100
+++ bind-9.4.0/bin/named/main.c 2007-03-06 13:43:31.000000000 +0100
@@ -72,6 +72,9 @@
* Include header files for database drivers here.
*/
@ -120,8 +111,8 @@
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_NOTICE, "exiting");
ns_log_shutdown();
--- bind-9.4.0/bin/named_sdb/Makefile.in.sdb 2007-03-06 12:59:32.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/Makefile.in 2007-03-06 12:59:32.000000000 +0100
--- bind-9.4.0/bin/named/Makefile.in.sdb 2007-03-06 12:59:32.000000000 +0100
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 12:59:32.000000000 +0100
@@ -26,10 +26,10 @@
#
# Add database drivers here.
@ -135,47 +126,3 @@
+DBDRIVER_LIBS = -lldap -llber -lpq
DLZ_DRIVER_DIR = ${top_srcdir}/contrib/dlz/drivers
@@ -70,7 +70,7 @@
SUBDIRS = unix
-TARGETS = named@EXEEXT@ lwresd@EXEEXT@
+TARGETS = named_sdb@EXEEXT@
OBJS = builtin.o client.o config.o control.o \
controlconf.o interfacemgr.o \
@@ -120,14 +120,10 @@
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-c ${srcdir}/config.c
-named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
+named_sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
${OBJS} ${UOBJS} ${LIBS}
-lwresd@EXEEXT@: named@EXEEXT@
- rm -f lwresd@EXEEXT@
- @LN@ named@EXEEXT@ lwresd@EXEEXT@
-
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
@@ -138,14 +134,9 @@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
-install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir}
- (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@)
- ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8
- ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5
+install:: named_sdb@EXEEXT@ installdirs
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named_sdb@EXEEXT@ ${DESTDIR}${sbindir}
+
@DLZ_DRIVER_RULES@

View File

@ -1,5 +1,5 @@
--- bind-9.4.0/bin/named_sdb/main.c.sdb-sqlite-bld 2007-03-12 14:00:05.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/main.c 2007-03-12 14:02:34.000000000 +0100
--- bind-9.4.0/bin/named/main.c.sdb-sqlite-bld 2007-03-12 14:00:05.000000000 +0100
+++ bind-9.4.0/bin/named/main.c 2007-03-12 14:02:34.000000000 +0100
@@ -74,6 +74,7 @@
/* #include "xxdb.h" */
#include "ldapdb.h"
@ -48,8 +48,8 @@
dirdb_clear();
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
--- bind-9.4.0/bin/named_sdb/Makefile.in.sdb-sqlite-bld 2007-03-12 14:00:05.000000000 +0100
+++ bind-9.4.0/bin/named_sdb/Makefile.in 2007-03-12 14:00:05.000000000 +0100
--- bind-9.4.0/bin/named/Makefile.in.sdb-sqlite-bld 2007-03-12 14:00:05.000000000 +0100
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-12 14:00:05.000000000 +0100
@@ -26,10 +26,10 @@
#
# Add database drivers here.

View File

@ -1,5 +1,5 @@
--- bind-9.3.4/bin/named_sdb/Makefile.in.ldap-api 2007-05-18 16:21:21.000000000 +0200
+++ bind-9.3.4/bin/named_sdb/Makefile.in 2007-05-18 16:22:16.000000000 +0200
--- bind-9.3.4/bin/named/Makefile.in.ldap-api 2007-05-18 16:21:21.000000000 +0200
+++ bind-9.3.4/bin/named/Makefile.in 2007-05-18 16:22:16.000000000 +0200
@@ -96,7 +96,7 @@ HTMLPAGES = named.html lwresd.html named
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@ -9,3 +9,15 @@
@BIND9_MAKE_RULES@
diff -up bind-9.5.0a5/bin/sdb_tools/Makefile.in.new-api bind-9.5.0a5/bin/sdb_tools/Makefile.in
--- bind-9.5.0a5/bin/sdb_tools/Makefile.in.new-api 2007-07-18 11:07:07.000000000 +0200
+++ bind-9.5.0a5/bin/sdb_tools/Makefile.in 2007-07-18 11:07:18.000000000 +0200
@@ -38,7 +38,7 @@ SRCS = zone2ldap.c ldap2zone.c
MANPAGES = zone2ldap.1
-EXT_CFLAGS = -fPIE
+EXT_CFLAGS = -fPIE -DLDAP_DEPRECATED
@BIND9_MAKE_RULES@

View File

@ -0,0 +1,13 @@
--- bind-9.4.0/bin/named/Makefile.in.dbus_archdep_libdir 2007-03-06 14:18:14.000000000 +0100
+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 14:20:39.000000000 +0100
@@ -43,8 +43,9 @@
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
+DBUS_ARCHDEP_LIBDIR ?= lib
DBUS_INCLUDES = \
- -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
+ -I/usr/${DBUS_ARCHDEP_LIBDIR}/dbus-1.0/include -I/usr/include/dbus-1.0
CDEFINES = @USE_DLZ@

204
bind.spec
View File

@ -9,6 +9,8 @@
%{?!bind_uid: %define bind_uid 25}
%{?!bind_gid: %define bind_gid 25}
%{?!selinux: %define selinux 1}
%{?!DLZ: %define DLZ 1}
%{?!GSSTSIG: %define GSSTSIG 1}
%define bind_dir /var/named
%define chroot_prefix %{bind_dir}/chroot
#
@ -16,7 +18,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind
License: BSD-like
Version: 9.5.0a5
Release: 3.2%{?dist}
Release: 3.9%{?dist}
Epoch: 31
Url: http://www.isc.org/products/BIND/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -69,8 +71,7 @@ Patch17: bind-9.3.2b1-fix_sdb_ldap.patch
# D-BUS patches
Patch15: bind-9.5.0-dbus.patch
Patch22: bind-9.3.1-sdb_dbus.patch
Patch23: bind-9.3.1-dbus_archdep_libdir.patch
Patch23: bind-9.5-dbus_archdep_libdir.patch
# IDN paches
Patch64: bind-9.4.0-idnkit-autotools.patch
@ -91,6 +92,11 @@ Requires(post): policycoreutils
BuildRequires: gcc, glibc-devel >= 2.2.5-26, glibc-kernheaders >= 2.4-7.10, openssl-devel, libtool, autoconf, pkgconfig
%if %{SDB}
BuildRequires: openldap-devel, postgresql-devel, sqlite-devel
Requires(pre): /etc/openldap/schema
%endif
%if %{DLZ}
BuildRequires: openldap-devel, postgresql-devel, mysql-devel, db4-devel, unixODBC-devel
Requires: openldap, postgresql, mysql, db4, unixODBC
%endif
%if %{WITH_DBUS}
BuildRequires: dbus-devel
@ -98,6 +104,10 @@ BuildRequires: dbus-devel
%if %{test}
BuildRequires: net-tools, perl
%endif
%if %{GSSTSIG}
BuildRequires: krb5-devel
Requires: krb5-libs
%endif
%description
BIND (Berkeley Internet Name Domain) is an implementation of the DNS
@ -106,6 +116,13 @@ which resolves host names to IP addresses; a resolver library
(routines for applications to use when interfacing with DNS); and
tools for verifying that the DNS server is operating properly.
%if %{SDB}
It also include SDB (Simplified Database Backend) which includes support for
using alternative Zone Databases stored in an LDAP server (ldapdb),
a postgreSQL database (pgsqldb), an sqlite database (sqlitedb),
or in the filesystem (dirdb), in addition to the standard in-memory RBT
(Red Black Tree) zone database.
%endif
%package libs
Summary: Libraries used by the BIND DNS packages
@ -162,37 +179,6 @@ This package contains a tree of files which can be used as a
chroot(2) jail for the named(8) program from the BIND package.
Based off code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
%if %{SDB}
%package sdb
Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server with database backends.
Group: System Environment/Daemons
Requires: bind = %{epoch}:%{version}-%{release}
Requires: bind-utils = %{epoch}:%{version}-%{release}
Requires(pre): /etc/openldap/schema
Requires(post): grep, mktemp
Requires(preun): grep
%if %{selinux}
Requires(post): policycoreutils
Conflicts: selinux-policy-strict < 2.2.0
Conflicts: selinux-policy-targeted < 2.2.0
%endif
%description sdb
BIND (Berkeley Internet Name Domain) is an implementation of the DNS
(Domain Name System) protocols. BIND includes a DNS server (named),
which resolves host names to IP addresses; a resolver library
(routines for applications to use when interfacing with DNS); and
tools for verifying that the DNS server is operating properly.
BIND SDB (Simplified Database Backend) provides named_sdb, the DNS
name server compiled to include support for using alternative Zone Databases
stored in an LDAP server (ldapdb), a postgreSQL database (pgsqldb), an
sqlite database (sqlitedb), or in the filesystem (dirdb), in addition
to the standard in-memory RBT (Red Black Tree) zone database.
%endif
%prep
%setup -q -n %{name}-%{version}
@ -205,18 +191,16 @@ to the standard in-memory RBT (Red Black Tree) zone database.
%patch69 -p1 -b .generate-xml
%if %{SDB}
%patch11 -p1 -b .sdbsrc
# BUILD 'Simplified Database Backend' (SDB) version of named: named_sdb
cp -rfp bin/named bin/named_sdb
# SDB ldap
cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named_sdb
cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named
# SDB postgreSQL
cp -fp contrib/sdb/pgsql/pgsqldb.[ch] bin/named_sdb
cp -fp contrib/sdb/pgsql/pgsqldb.[ch] bin/named
# SDB sqlite
cp -fp contrib/sdb/sqlite/sqlitedb.[ch] bin/named_sdb
cp -fp contrib/sdb/sqlite/sqlitedb.[ch] bin/named
# SDB Berkeley DB - needs to be ported to DB4!
#cp -fp contrib/sdb/bdb/bdb.[ch] bin/named_sdb
# SDB dir
cp -fp contrib/sdb/dir/dirdb.[ch] bin/named_sdb
cp -fp contrib/sdb/dir/dirdb.[ch] bin/named
# SDB tools
mkdir -p bin/sdb_tools
cp -fp %{SOURCE7} bin/sdb_tools/Makefile.in
@ -233,9 +217,6 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools
%patch16 -p1 -b .redhat_doc
%if %{WITH_DBUS}
%patch15 -p1 -b .dbus
%if %{SDB}
%patch22 -p1 -b .sdb_dbus
%endif
%patch23 -p1 -b .dbus_archdep_libdir
%endif
%if %{SDB}
@ -247,12 +228,6 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools
#
cp -fp contrib/dbus/{dbus_mgr.c,dbus_service.c} bin/named
cp -fp contrib/dbus/{dbus_mgr.h,dbus_service.h} bin/named/include/named
%if %{SDB}
cp -fp contrib/dbus/{dbus_mgr.c,dbus_service.c} bin/named_sdb
cp -fp contrib/dbus/{dbus_mgr.h,dbus_service.h} bin/named_sdb/include/named
cp -fp bin/named/{log.c,server.c} bin/named_sdb
cp -fp bin/named/include/named/{globals.h,server.h,log.h,types.h} bin/named_sdb/include/named
%endif
%endif
%patch32 -p1 -b .prctl_set_dumpable
%patch52 -p1 -b .edns
@ -270,7 +245,7 @@ popd
%build
export CFLAGS="$RPM_OPT_FLAGS"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -O0"
pushd contrib/idn/idnkit-1.0-src
libtoolize --copy --force; aclocal; automake -a; autoconf
@ -308,6 +283,17 @@ export LDFLAGS=-lefence
--with-idn \
--disable-openssl-version-check \
CFLAGS="$CFLAGS" \
%if %{DLZ}
--with-dlz-ldap=yes \
--with-dlz-postgres=yes \
--with-dlz-mysql=yes \
--with-dlz-bdb=yes \
--with-dlz-filesystem=yes \
--with-dlz-odbc=yes \
%endif
%if %{GSSTSIG}
--with-gssapi=yes \
%endif
;
if [ -s openssl_config.h ]; then cat openssl_config.h >> config.h ; fi;
make %{?_smp_mflags}
@ -452,14 +438,49 @@ if [ "$1" -eq 1 ]; then
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/named.conf >/dev/null 2>&1 || :;
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/named.rfc1912.zones >/dev/null 2>&1 || :;
[ -x /usr/sbin/bind-chroot-admin ] && /usr/sbin/bind-chroot-admin --sync;
%if %{SDB}
# check that dnszone.schema is installed in OpenLDAP's slapd.conf
if [ -f /etc/openldap/slapd.conf ]; then
# include the LDAP dnszone.schema in slapd.conf:
if ! /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
tf=`/bin/mktemp /tmp/XXXXXX`
let n=`/bin/grep -n '^include.*\.schema' /etc/openldap/slapd.conf | /usr/bin/tail -1 | /bin/sed 's/:.*//'`
if [ "$n" -gt 0 ]; then
/bin/cp -fp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.rpmsave;
/usr/bin/head -$n /etc/openldap/slapd.conf > $tf
echo 'include /etc/openldap/schema/dnszone.schema' >> $tf
let n='n+1'
/usr/bin/tail -n +$n /etc/openldap/slapd.conf >> $tf
/bin/mv -f $tf /etc/openldap/slapd.conf;
/bin/chmod --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
[ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
fi
rm -f $tf >/dev/null 2>&1 || :;
fi;
fi;
%endif
fi
:;
%preun
if [ "$1" = 0 ]; then
if [ "$1" -eq 0 ]; then
/sbin/service named stop >/dev/null 2>&1 || :;
/sbin/chkconfig --del named || :;
fi
%if %{SDB}
if [ -f /etc/openldap/slapd.conf ]; then
if /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
tf=`/bin/mktemp /tmp/XXXXXX`
/bin/egrep -v '^include.*dnszone\.schema' /etc/openldap/slapd.conf > $tf
/bin/mv -f $tf /etc/openldap/slapd.conf;
rm -f $tf >/dev/null 2>&1
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
[ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1 || :;
fi;
fi;
%endif
fi;
:;
%postun
@ -506,48 +527,6 @@ if [ "$1" -eq 0 ]; then
fi
:;
%if %{SDB}
%post sdb
if [ "$1" -ge 1 ]; then
# check that dnszone.schema is installed in OpenLDAP's slapd.conf
if [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
# include the LDAP dnszone.schema in slapd.conf:
if ! /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
tf=`/bin/mktemp /tmp/XXXXXX`
let n=`/bin/grep -n '^include.*\.schema' /etc/openldap/slapd.conf | /usr/bin/tail -1 | /bin/sed 's/:.*//'`
if [ "$n" -gt 0 ]; then
/bin/cp -fp /etc/openldap/slapd.conf /etc/openldap/slapd.conf.rpmsave;
/usr/bin/head -$n /etc/openldap/slapd.conf > $tf
echo 'include /etc/openldap/schema/dnszone.schema' >> $tf
let n='n+1'
/usr/bin/tail -n +$n /etc/openldap/slapd.conf >> $tf
/bin/mv -f $tf /etc/openldap/slapd.conf;
/bin/chmod --reference=/etc/openldap/slapd.conf.rpmsave /etc/openldap/slapd.conf
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
[ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1
fi
rm -f $tf >/dev/null 2>&1 || :;
fi;
fi;
fi;
:;
%preun sdb
if [ "$1" -eq 0 ] && [ -x /usr/sbin/named_sdb ] && [ -f /etc/openldap/slapd.conf ]; then
if /bin/egrep -q '^include.*\dnszone.schema' /etc/openldap/slapd.conf; then
tf=`/bin/mktemp /tmp/XXXXXX`
/bin/egrep -v '^include.*dnszone\.schema' /etc/openldap/slapd.conf > $tf
/bin/mv -f $tf /etc/openldap/slapd.conf;
rm -f $tf >/dev/null 2>&1
[ -x /sbin/restorecon ] && /sbin/restorecon /etc/openldap/slapd.conf >/dev/null 2>&1 || :;
[ -x /etc/init.d/ldap ] && /etc/init.d/ldap condrestart >/dev/null 2>&1 || :;
fi;
fi;
:;
%endif # SDB
%clean
rm -rf ${RPM_BUILD_ROOT}
:;
@ -592,6 +571,12 @@ rm -rf ${RPM_BUILD_ROOT}
%{_sbindir}/named-bootconf
%{_sbindir}/rndc*
%{_sbindir}/named-compilezone
%if %{SDB}
%{_sbindir}/zone2ldap
%{_sbindir}/ldap2zone
%{_sbindir}/zonetodb
%{_sbindir}/zone2sqlite
%endif
%defattr(0644,root,root,0755)
%{_mandir}/man5/named.conf.5*
%{_mandir}/man5/rndc.conf.5*
@ -603,6 +588,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/named-checkzone.8*
%{_mandir}/man8/named-compilezone.8*
%{_mandir}/man8/rndc-confgen.8*
%if %{SDB}
%{_mandir}/man1/zone2ldap.1*
%doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap contrib/sdb/pgsql/README.sdb_pgsql
%endif
%doc CHANGES COPYRIGHT README
%doc doc/arm doc/misc
%doc sample/
@ -613,6 +602,10 @@ rm -rf ${RPM_BUILD_ROOT}
%attr(750,root,root) %{_sbindir}/namedGetForwarders
%attr(750,root,root) %{_sbindir}/namedSetForwarders
%endif
%if %{SDB}
%config(noreplace) /etc/openldap/schema/dnszone.schema
%endif
%files libs
%defattr(-,root,root,0755)
@ -685,24 +678,13 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(0750,root,root,0755)
%{_sbindir}/bind-chroot-admin
%if %{SDB}
%files sdb
%defattr(0750,root,named,0755)
%{_sbindir}/named_sdb
%{_sbindir}/zone2ldap
%{_sbindir}/ldap2zone
%{_sbindir}/zonetodb
%{_sbindir}/zone2sqlite
%defattr(0644,root,root,0755)
%config(noreplace) /etc/openldap/schema/dnszone.schema
%defattr(0644,root,named,0755)
%{_mandir}/man1/zone2ldap.1*
%doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap contrib/sdb/pgsql/README.sdb_pgsql
%endif
%changelog
* Wed Jul 18 2007 Adam Tkac <atkac redhat com> 31:9.5.0a5-3.9.fc8
- removed bind-sdb package (default named has compiled SDB backend now)
- integrated DLZ (Dynamically loadable zones) drivers
- integrated GSS-TSIG support (RFC 3645)
- build with -O0 (many new features, potential core dumps will be more useful)
* Tue Jul 17 2007 Adam Tkac <atkac redhat com> 31:9.5.0a5-3.2.fc8
- initscript should be ready for parallel booting (#246878)

View File

@ -36,12 +36,6 @@ if [ -n "$ROOTDIR" ]; then
fi;
fi
# Run SDB backend?
named='named'
if `echo "$ENABLE_SDB" | grep -q ^[yY1].*`; then
named='named_sdb';
fi;
# Manage forwarders through D-BUS?
for a in $OPTIONS; do
if [ $a = "-D" ]; then
@ -68,7 +62,7 @@ start()
[ "${NETWORKING}" = "no" ] && exit 1
[ -x /usr/sbin/$named ] || exit 5
[ -x /usr/sbin/named ] || exit 5
# Handle -c option
previous_option='unspecified';
@ -87,9 +81,9 @@ start()
fi;
# all pre-start is done, lets start named
echo -n $"Starting $named: "
if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
echo -n $"$named: already running"
echo -n $"Starting named: "
if [ -n "`/sbin/pidof -o %PPID named`" ]; then
echo -n $"named: already running"
failure
echo
exit 1;
@ -117,21 +111,19 @@ start()
# check if configuration is correct
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
daemon /usr/sbin/$named -u named ${OPTIONS};
daemon /usr/sbin/named -u named ${OPTIONS};
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f /var/run/named.pid;
rm -f /var/run/named_sdb.pid;
ln -s $ROOTDIR/var/run/named/named.pid /var/run/named.pid;
[ "$named" = "named_sdb" ] && ln -s $ROOTDIR/var/run/named/named.pid /var/run/named_sdb.pid;
fi;
if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
if [ -n "`/sbin/pidof -o %PPID named`" ]; then
# Verify that named actually started (JM 2006-10-04)
if [ ! -e $ROOTDIR/var/run/named/named.pid ]; then
# If there is not a file containing the PID of the now running named daemon then create it (JM 2006-10-04)
echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named.pid;
[ "$named" = "named_sdb" ] && echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named_sdb.pid;
echo `/sbin/pidof -o %PPID named` > $ROOTDIR/var/run/named/named.pid;
fi;
fi;
else
@ -155,16 +147,16 @@ start()
stop() {
# Stop daemons.
echo -n $"Stopping $named: "
echo -n $"Stopping named: "
[ -x /usr/sbin/rndc ] && /usr/sbin/rndc stop >/dev/null 2>&1;
RETVAL=$?
# is it still here?
if /sbin/pidof -o %PPID $named >/dev/null; then
if /sbin/pidof -o %PPID named >/dev/null; then
timeout=0
while : ; do
if /sbin/pidof -o %PPID $named >/dev/null; then
if /sbin/pidof -o %PPID named >/dev/null; then
if [ $timeout -ge $NAMED_SHUTDOWN_TIMEOUT ]; then
killproc $named -TERM >/dev/null 2>&1
killproc named -TERM >/dev/null 2>&1
RETVAL=$?
echo $"no response, killing with -TERM "
break
@ -182,7 +174,6 @@ stop() {
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/named
rm -f /var/run/named.pid
rm -f /var/run/named_sdb.pid
fi;
# unmount mounted filesystems/directories
@ -209,7 +200,7 @@ stop() {
rhstatus() {
[ -x /usr/sbin/rndc ] && /usr/sbin/rndc status;
status /usr/bin/$named;
status /usr/bin/named;
return $?
}
restart() {
@ -217,14 +208,14 @@ restart() {
start
}
reload() {
echo -n $"Reloading $named: "
p=`/sbin/pidof -o %PPID $named`
echo -n $"Reloading named: "
p=`/sbin/pidof -o %PPID named`
RETVAL=$?
if [ "$RETVAL" -eq 0 ]; then
/usr/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p;
RETVAL=$?
fi
[ "$RETVAL" -eq 0 ] && success $"$named reload" || failure $"$named reload"
[ "$RETVAL" -eq 0 ] && success $"named reload" || failure $"named reload"
echo
return $RETVAL
}

View File

@ -10,10 +10,6 @@
# OPTIONS="whatever" -- These additional options will be passed to named
# at startup. Don't add -t here, use ROOTDIR instead.
#
# ENABLE_SDB=yes -- This enables use of 'named_sdb', which has support
# -- for the ldap, pgsql and dir zone database backends
# -- compiled in, to be used instead of named.
#
# DISABLE_NAMED_DBUS=[1y]-- If NetworkManager is enabled in any runlevel, then
# the initscript will by default enable named's D-BUS
# support with the named -D option. This setting disables