900526
diff -up bind-9.8.1rc1/bin/named-sdb/main.c.sdb-sqlite-bld bind-9.8.1rc1/bin/named-sdb/main.c
900526
--- bind-9.8.1rc1/bin/named-sdb/main.c.sdb-sqlite-bld	2011-08-31 14:41:15.646020840 +0200
900526
+++ bind-9.8.1rc1/bin/named-sdb/main.c	2011-08-31 14:41:35.132019452 +0200
900526
@@ -85,6 +85,7 @@
900526
 /* #include "xxdb.h" */
900526
 #include "ldapdb.h"
900526
 #include "pgsqldb.h"
900526
+#include "sqlitedb.h"
900526
 #include "dirdb.h"
900526
 
900526
 #ifdef CONTRIB_DLZ
900526
@@ -792,6 +793,7 @@ setup(void) {
900526
 
900526
 	ldapdb_clear();
900526
 	pgsqldb_clear();
900526
+	sqlitedb_clear();
900526
 	dirdb_clear();
900526
 
900526
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
900526
@@ -921,6 +923,23 @@ setup(void) {
900526
                           ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded."
900526
                          );
900526
 
900526
+        result = sqlitedb_init();
900526
+        if (result != ISC_R_SUCCESS)
900526
+        {
900526
+             isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
900526
+                          ISC_LOG_ERROR, 
900526
+                          "SDB sqlite3 module initialisation failed: %s.",
900526
+                          isc_result_totext(result)
900526
+                );
900526
+            isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
900526
+                          ISC_LOG_ERROR, 
900526
+                          "SDB sqlite3 zone database will be unavailable."
900526
+                );
900526
+        }else
900526
+            isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
900526
+                          ISC_LOG_NOTICE, "SDB sqlite3 DB zone database module loaded."
900526
+                         );
900526
+
900526
         result = dirdb_init();
900526
         if (result != ISC_R_SUCCESS)
900526
         {
900526
@@ -971,6 +990,7 @@ cleanup(void) {
900526
 
900526
         ldapdb_clear();
900526
         pgsqldb_clear();
900526
+        sqlitedb_clear();
900526
         dirdb_clear();
900526
 
900526
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
900526
diff -up bind-9.8.1rc1/bin/named-sdb/Makefile.in.sdb-sqlite-bld bind-9.8.1rc1/bin/named-sdb/Makefile.in
900526
--- bind-9.8.1rc1/bin/named-sdb/Makefile.in.sdb-sqlite-bld	2011-08-31 14:41:15.646020840 +0200
900526
+++ bind-9.8.1rc1/bin/named-sdb/Makefile.in	2011-08-31 14:41:15.658020839 +0200
900526
@@ -28,10 +28,10 @@ top_srcdir =	@top_srcdir@
900526
 #
900526
 # Add database drivers here.
900526
 #
900526
-DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ dirdb.@O@
900526
-DBDRIVER_SRCS =	ldapdb.c pgsqldb.c dirdb.c
900526
+DBDRIVER_OBJS =	ldapdb.@O@ pgsqldb.@O@ sqlitedb.@O@ dirdb.@O@
900526
+DBDRIVER_SRCS =	ldapdb.c pgsqldb.c sqlitedb.c dirdb.c
900526
 DBDRIVER_INCLUDES =
900526
-DBDRIVER_LIBS =	-lldap -llber -lpq
900526
+DBDRIVER_LIBS =	-lldap -llber -lpq -lsqlite3
900526
 
900526
 DLZ_DRIVER_DIR =	${top_srcdir}/contrib/dlz/drivers
900526
 
900526
diff -up bind-9.8.1rc1/bin/sdb_tools/Makefile.in.sdb-sqlite-bld bind-9.8.1rc1/bin/sdb_tools/Makefile.in
900526
--- bind-9.8.1rc1/bin/sdb_tools/Makefile.in.sdb-sqlite-bld	2011-08-31 14:41:15.651020840 +0200
900526
+++ bind-9.8.1rc1/bin/sdb_tools/Makefile.in	2011-08-31 14:41:15.658020839 +0200
900526
@@ -32,11 +32,11 @@ DEPLIBS =	${LWRESDEPLIBS} ${DNSDEPLIBS} 
900526
 LIBS =		${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
900526
 		${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@
900526
 
900526
-TARGETS =	zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@
900526
+TARGETS =	zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@
900526
 
900526
-OBJS	=	zone2ldap.@O@ ldap2zone.@O@ zonetodb.@O@
900526
+OBJS	=	zone2ldap.@O@ ldap2zone.@O@ zonetodb.@O@ zone2sqlite.@O@
900526
 
900526
-SRCS    =       zone2ldap.c ldap2zone.c zonetodb.c
900526
+SRCS    =       zone2ldap.c ldap2zone.c zonetodb.c zone2sqlite.c
900526
 
900526
 MANPAGES =      zone2ldap.1
900526
 
900526
@@ -50,6 +50,9 @@ zone2ldap@EXEEXT@: zone2ldap.@O@ ${DEPLI
900526
 zonetodb@EXEEXT@: zonetodb.@O@  ${DEPLIBS}
900526
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS}
900526
 
900526
+zone2sqlite@EXEEXT@: zone2sqlite.@O@  ${DEPLIBS}
900526
+	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ zone2sqlite.@O@ -lsqlite3 -lssl ${LIBS}
900526
+
900526
 ldap2zone@EXEEXT@: ldap2zone.@O@ ${DEPLIBS}
900526
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ldap2zone.@O@ -lldap -llber ${LIBS}
900526
 
900526
@@ -64,4 +67,5 @@ install:: ${TARGETS} installdirs
900526
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap@EXEEXT@ ${DESTDIR}${sbindir}
900526
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ldap2zone@EXEEXT@ ${DESTDIR}${sbindir}
900526
 	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb@EXEEXT@  ${DESTDIR}${sbindir}
900526
+	${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2sqlite@EXEEXT@  ${DESTDIR}${sbindir}
900526
 	${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1