diff --git a/.cvsignore b/.cvsignore index 7085344..e66a330 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,4 +1,4 @@ -bind-9.4.1.tar.gz +bind-9.5.0a5.tar.gz bind-chroot.tar.bz2 -libbind-man.tar.gz config.tar +libbind-man.tar.gz diff --git a/bind-9.3.1beta2-openssl-suffix.patch b/bind-9.3.1beta2-openssl-suffix.patch deleted file mode 100644 index ef48cb1..0000000 --- a/bind-9.3.1beta2-openssl-suffix.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- bind-9.3.1beta2/configure.in.openssl_suffix 2004-12-08 23:07:10.000000000 -0500 -+++ bind-9.3.1beta2/configure.in 2005-01-27 17:03:49.394814000 -0500 -@@ -374,6 +374,10 @@ - fi - done - fi -+OSSUFFIX= -+if test "$host_cpu" = "x86_64"; then -+ OSSUFFIX=64 -+fi; - case "$use_openssl" in - no) - AC_MSG_RESULT(no) -@@ -416,11 +420,11 @@ - DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto" - ;; - *) -- DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto" -+ DNS_OPENSSL_LIBS="-L$use_openssl/lib${OSUFFIX} -lcrypto" - ;; - esac - fi -- AC_MSG_RESULT(using openssl from $use_openssl/lib and $use_openssl/include) -+ AC_MSG_RESULT(using openssl from $use_openssl/lib${OSSUFFIX} and $use_openssl/include) - - saved_cflags="$CFLAGS" - saved_libs="$LIBS" diff --git a/bind-9.3.3rc2-dbus.patch b/bind-9.3.3rc2-dbus.patch deleted file mode 100644 index a8fbc97..0000000 --- a/bind-9.3.3rc2-dbus.patch +++ /dev/null @@ -1,727 +0,0 @@ ---- bind-9.4.0/lib/isc/include/isc/socket.h.dbus 2006-06-07 02:29:45.000000000 +0200 -+++ bind-9.4.0/lib/isc/include/isc/socket.h 2007-03-06 13:58:11.000000000 +0100 -@@ -135,6 +135,10 @@ - #define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3) - #define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4) - -+#define ISC_SOCKEVENT_READ_READY (ISC_EVENTCLASS_SOCKET + 5) -+#define ISC_SOCKEVENT_WRITE_READY (ISC_EVENTCLASS_SOCKET + 6) -+#define ISC_SOCKEVENT_SELECTED (ISC_EVENTCLASS_SOCKET + 7) -+ - /* - * Internal events. - */ -@@ -144,7 +148,8 @@ - typedef enum { - isc_sockettype_udp = 1, - isc_sockettype_tcp = 2, -- isc_sockettype_unix = 3 -+ isc_sockettype_unix = 3, -+ isc_sockettype_fd = 8 - } isc_sockettype_t; - - /*@{*/ -@@ -747,6 +752,54 @@ - * \li #ISC_R_FAILURE - */ - -+isc_socketevent_t* -+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when the isc_sockettype_fd sock -+ * was select()-ed for read. If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when the isc_sockettype_fd sock -+ * was select()-ed for write. If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets -+ * have been select()-ed . If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when the isc_sockettype_fd sock -+ * was select()-ed for read. If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when the isc_sockettype_fd sock -+ * was select()-ed for write. If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ); -+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets -+ * have been select()-ed . If there is already an event registered, it -+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing -+ * registered event. -+ */ -+ - ISC_LANG_ENDDECLS - - #endif /* ISC_SOCKET_H */ ---- bind-9.4.0/lib/isc/unix/socket.c.dbus 2007-03-06 13:45:26.000000000 +0100 -+++ bind-9.4.0/lib/isc/unix/socket.c 2007-03-06 13:45:26.000000000 +0100 -@@ -159,6 +159,11 @@ - ISC_LIST(isc_socketevent_t) recv_list; - ISC_LIST(isc_socket_newconnev_t) accept_list; - isc_socket_connev_t *connect_ev; -+ -+ /* these are used only by isc_sockettype_fd sockets:*/ -+ isc_socketevent_t *read_ready_event; -+ isc_socketevent_t *write_ready_event; -+ isc_socketevent_t *selected_event; - - /* - * Internal events. Posted when a descriptor is readable or -@@ -315,7 +320,7 @@ - - static void - wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) { -- isc_socket_t *sock; -+ isc_socket_t *sock=0L; - - /* - * This is a wakeup on a socket. If the socket is not in the -@@ -1311,6 +1316,9 @@ - sock->connected = 0; - sock->connecting = 0; - sock->bound = 0; -+ sock->read_ready_event = 0L; -+ sock->write_ready_event = 0L; -+ sock->selected_event = 0L; - - /* - * initialize the lock -@@ -1426,13 +1434,16 @@ - case isc_sockettype_unix: - sock->fd = socket(pf, SOCK_STREAM, 0); - break; -+ -+ case isc_sockettype_fd: -+ sock->fd = pf; - } - - #ifdef F_DUPFD - /* - * Leave a space for stdio to work in. - */ -- if (sock->fd >= 0 && sock->fd < 20) { -+ if ( (type != isc_sockettype_fd) && (sock->fd >= 0) && (sock->fd < 20) ) { - int new, tmp; - new = fcntl(sock->fd, F_DUPFD, 20); - tmp = errno; -@@ -1486,7 +1497,7 @@ - } - } - -- if (make_nonblock(sock->fd) != ISC_R_SUCCESS) { -+ if ((type != isc_sockettype_fd) && (make_nonblock(sock->fd) != ISC_R_SUCCESS)) { - (void)close(sock->fd); - free_socket(&sock); - return (ISC_R_UNEXPECTED); -@@ -1777,6 +1788,38 @@ - isc_task_send(ev->ev_sender, (isc_event_t **)&iev); - } - -+static -+isc_event_t *dispatch_read_ready(isc_socketmgr_t *manager, isc_socket_t *sock) -+{ -+ isc_event_t *dev = (isc_event_t*)sock->read_ready_event, *ev; -+ -+ ev = isc_mem_get(manager->mctx, dev->ev_size); -+ memcpy(ev,dev,dev->ev_size); -+ ISC_LINK_INIT(ev,ev_link); -+ isc_task_send(dev->ev_sender, &ev ); -+ return (isc_event_t *)sock->selected_event; -+} -+ -+static -+isc_event_t *dispatch_write_ready(isc_socketmgr_t *manager,isc_socket_t *sock) -+{ -+ isc_event_t *dev = (isc_event_t*)sock->write_ready_event, *ev; -+ ev = isc_mem_get(manager->mctx, dev->ev_size); -+ memcpy(ev,dev,dev->ev_size); -+ ISC_LINK_INIT(ev,ev_link); -+ isc_task_send(dev->ev_sender, &ev ); -+ return (isc_event_t *)sock->selected_event; -+} -+ -+static -+void dispatch_selected(isc_socketmgr_t *manager, isc_event_t *dev) -+{ isc_event_t *ev; -+ ev = isc_mem_get(manager->mctx, dev->ev_size); -+ memcpy(ev,dev,dev->ev_size); -+ ISC_LINK_INIT(ev,ev_link); -+ isc_task_send(dev->ev_sender, &ev ); -+} -+ - /* - * Dequeue an item off the given socket's read queue, set the result code - * in the done event to the one provided, and send it to the task it was -@@ -2184,6 +2227,7 @@ - int i; - isc_socket_t *sock; - isc_boolean_t unlock_sock; -+ isc_event_t *sock_selected = 0L; - - REQUIRE(maxfd <= (int)FD_SETSIZE); - -@@ -2217,11 +2261,15 @@ - unlock_sock = ISC_TRUE; - LOCK(&sock->lock); - if (!SOCK_DEAD(sock)) { -+ if( sock->type != isc_sockettype_fd ) -+ { - if (sock->listener) - dispatch_accept(sock); - else - dispatch_recv(sock); -- } -+ }else -+ sock_selected = dispatch_read_ready(manager,sock); -+ } - FD_CLR(i, &manager->read_fds); - } - check_write: -@@ -2235,16 +2283,24 @@ - LOCK(&sock->lock); - } - if (!SOCK_DEAD(sock)) { -+ if( sock->type != isc_sockettype_fd ) -+ { - if (sock->connecting) - dispatch_connect(sock); - else - dispatch_send(sock); -+ }else -+ sock_selected = dispatch_write_ready(manager,sock); - } - FD_CLR(i, &manager->write_fds); - } - if (unlock_sock) - UNLOCK(&sock->lock); - } -+ if( sock_selected != 0L ) -+ { -+ dispatch_selected(manager, sock_selected); -+ } - } - - #ifdef ISC_PLATFORM_USETHREADS -@@ -2263,7 +2319,7 @@ - int cc; - fd_set readfds; - fd_set writefds; -- int msg, fd; -+ int msg, fd = -1; - int maxfd; - char strbuf[ISC_STRERRORSIZE]; - -@@ -3784,3 +3840,55 @@ - return (ISC_R_SUCCESS); - } - #endif /* ISC_PLATFORM_USETHREADS */ -+ -+isc_socketevent_t* -+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ) -+{ -+ REQUIRE(VALID_SOCKET(sock)); -+ if(dev != 0L) -+ { -+ sock->references=1; -+ sock->read_ready_event = dev; -+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ); -+ }else -+ { -+ dev = sock->read_ready_event ; -+ sock->read_ready_event = 0L ; -+ } -+ return dev; -+} -+ -+isc_socketevent_t* -+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ) -+{ -+ REQUIRE(VALID_SOCKET(sock)); -+ if(dev != 0L) -+ { -+ sock->references=1; -+ sock->write_ready_event = dev; -+ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); -+ }else -+ { -+ dev = sock->write_ready_event; -+ sock->write_ready_event = 0L; -+ } -+ return dev; -+} -+ -+isc_socketevent_t* -+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ) -+{ -+ REQUIRE(VALID_SOCKET(sock)); -+ if(dev != 0L) -+ { -+ sock->references=1; -+ sock->selected_event = dev; -+ }else -+ { -+ dev = sock->selected_event; -+ sock->selected_event = 0L; -+ sock->references=0; -+ destroy(&sock); -+ } -+ return dev; -+} ---- bind-9.4.0/lib/dns/forward.c.dbus 2005-07-12 03:22:20.000000000 +0200 -+++ bind-9.4.0/lib/dns/forward.c 2007-03-06 13:45:26.000000000 +0100 -@@ -197,3 +197,89 @@ - } - isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t)); - } -+ -+/*** -+ *** new D-BUS Dynamic Forwarding Zones functions: -+ ***/ -+isc_result_t -+dns_fwdtable_delete(dns_fwdtable_t *fwdtable, dns_name_t *name ) -+{ -+ isc_result_t result; -+ -+ REQUIRE(VALID_FWDTABLE(fwdtable)); -+ -+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_write); -+ -+ result = dns_rbt_deletename(fwdtable->table, name, ISC_FALSE); -+ -+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_write); -+ -+ return (result); -+} -+ -+isc_result_t -+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, -+ dns_name_t *name, -+ dns_name_t *foundname, -+ dns_forwarders_t **forwardersp) -+{ -+ isc_result_t result; -+ -+ REQUIRE(VALID_FWDTABLE(fwdtable)); -+ -+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read); -+ -+ result = dns_rbt_findname(fwdtable->table, name, 0, foundname, -+ (void **)forwardersp); -+ -+ if(result == DNS_R_PARTIALMATCH) -+ result = ISC_R_SUCCESS; -+ -+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read); -+ -+ return (result); -+} -+ -+isc_result_t -+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name, -+ dns_forwarders_t **forwardersp) -+{ -+ isc_result_t result; -+ -+ REQUIRE(VALID_FWDTABLE(fwdtable)); -+ -+ REQUIRE(forwardersp != 0L); -+ -+ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read); -+ -+ result = dns_rbt_findname(fwdtable->table, name, 0, NULL, -+ (void **)forwardersp); -+ -+ if( result != ISC_R_SUCCESS ) -+ *forwardersp = 0L; -+ -+ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read); -+ -+ return (result); -+} -+ -+static -+void dns_fwdtable_traverse -+( -+ dns_name_t *name, -+ void *node_data, -+ void *cbp, -+ void *cb_arg -+) -+{ -+ dns_fwdtable_callback_t cb = (dns_fwdtable_callback_t) cbp; -+ -+ (*cb)( name, node_data, cb_arg); -+} -+ -+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void *cb_arg ) -+{ -+ REQUIRE(VALID_FWDTABLE(fwdtable)); -+ -+ dns_rbt_traverse( fwdtable->table, dns_fwdtable_traverse, cb, cb_arg ); -+} ---- bind-9.4.0/lib/dns/rbt.c.dbus 2005-10-13 03:26:06.000000000 +0200 -+++ bind-9.4.0/lib/dns/rbt.c 2007-03-06 13:45:26.000000000 +0100 -@@ -2175,6 +2175,47 @@ - dns_rbt_printtree(rbt->root, NULL, 0); - } - -+static void -+dns_rbt_traverse_tree(dns_rbtnode_t *root, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) { -+/* -+ * This is used ONLY to traverse the forward table by dbus_mgr at the moment. -+ * Since the forward table is not likely to be large, this can be recursive. -+ */ -+ dns_name_t name; -+ dns_offsets_t offsets; -+ char buf[DNS_NAME_MAXWIRE]; -+ isc_buffer_t buffer; -+ -+ if (root != NULL) { -+ -+ if (DOWN(root)) -+ dns_rbt_traverse_tree(DOWN(root), cb, cb_arg1, cb_arg2); -+ -+ if( LEFT(root) != NULL ) -+ dns_rbt_traverse_tree(LEFT(root), cb, cb_arg1, cb_arg2); -+ -+ if( RIGHT(root) != NULL ) -+ dns_rbt_traverse_tree(RIGHT(root), cb, cb_arg1, cb_arg2); -+ -+ if( DATA(root) == 0L ) -+ return; -+ -+ dns_name_init(&name, offsets); -+ isc_buffer_init(&buffer, buf, DNS_NAME_MAXWIRE); -+ dns_name_setbuffer( &name, &buffer); -+ dns_rbt_fullnamefromnode(root, &name); -+ -+ (*cb)(&name, DATA(root), cb_arg1, cb_arg2); -+ } -+} -+ -+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) -+{ -+ REQUIRE(VALID_RBT(rbt)); -+ -+ dns_rbt_traverse_tree( rbt->root, cb, cb_arg1, cb_arg2 ); -+} -+ - /* - * Chain Functions - */ ---- bind-9.4.0/lib/dns/include/dns/rbt.h.dbus 2005-10-13 03:26:07.000000000 +0200 -+++ bind-9.4.0/lib/dns/include/dns/rbt.h 2007-03-06 13:45:26.000000000 +0100 -@@ -911,6 +911,17 @@ - } while (0) - #endif /* DNS_RBT_USEISCREFCOUNT */ - -+ -+typedef void (*dns_rbt_traverse_callback_t)( dns_name_t *name, -+ void *node_data, -+ void *cb_arg1, -+ void *cb_arg2); -+ -+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ); -+/* tree traversal function (only used by D-BUS dynamic forwarding dbus_mgr at -+ * the moment) -+ */ -+ - ISC_LANG_ENDDECLS - - #endif /* DNS_RBT_H */ ---- bind-9.4.0/lib/dns/include/dns/forward.h.dbus 2005-04-27 07:01:33.000000000 +0200 -+++ bind-9.4.0/lib/dns/include/dns/forward.h 2007-03-06 13:45:26.000000000 +0100 -@@ -113,6 +113,37 @@ - * \li all memory associated with the forwarding table is freed. - */ - -+ -+/* These are ONLY used by dbus_mgr : -+ */ -+ -+isc_result_t -+dns_fwdtable_delete( dns_fwdtable_t *fwdtable, dns_name_t *name ); -+/* -+ * Removes an entry from the forwarding table. -+ */ -+ -+isc_result_t -+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name, -+ dns_forwarders_t **forwardersp); -+/* -+ * Finds an exact match for "name" in the forwarding table. -+ */ -+ -+isc_result_t -+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, dns_name_t *name, dns_name_t *foundname, -+ dns_forwarders_t **forwardersp); -+/* -+ * Finds the closest match for "*name" in the forwarding table, returning -+ * the actual name matching in *name if different to *name passed in. -+ */ -+ -+typedef void (*dns_fwdtable_callback_t)( dns_name_t *, dns_forwarders_t *, void *); -+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void * ); -+/* Invoke cb for each member of fwdtable -+ */ -+ -+ - ISC_LANG_ENDDECLS - - #endif /* DNS_FORWARD_H */ ---- bind-9.4.0/bin/named/main.c.dbus 2006-11-10 19:51:14.000000000 +0100 -+++ bind-9.4.0/bin/named/main.c 2007-03-06 14:11:18.000000000 +0100 -@@ -248,7 +248,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 -@@ -356,7 +357,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) -@@ -445,6 +446,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'", ---- bind-9.4.0/bin/named/log.c.dbus 2006-06-09 02:54:08.000000000 +0200 -+++ bind-9.4.0/bin/named/log.c 2007-03-06 13:45:26.000000000 +0100 -@@ -44,6 +44,7 @@ - { "queries", 0 }, - { "unmatched", 0 }, - { "update-security", 0 }, -+ { "dbus", 0 }, - { NULL, 0 } - }; - -@@ -63,6 +64,7 @@ - { "notify", 0 }, - { "control", 0 }, - { "lwresd", 0 }, -+ { "dbus", 0 }, - { NULL, 0 } - }; - ---- bind-9.4.0/bin/named/include/named/server.h.dbus 2006-03-10 00:46:20.000000000 +0100 -+++ bind-9.4.0/bin/named/include/named/server.h 2007-03-06 14:12:02.000000000 +0100 -@@ -97,6 +97,8 @@ - ns_dispatchlist_t dispatches; - - dns_acache_t *acache; -+ -+ ns_dbus_mgr_t * dbus_mgr; - }; - - #define NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R') ---- bind-9.4.0/bin/named/include/named/types.h.dbus 2005-04-29 02:15:38.000000000 +0200 -+++ bind-9.4.0/bin/named/include/named/types.h 2007-03-06 13:45:26.000000000 +0100 -@@ -40,4 +40,6 @@ - typedef struct ns_dispatch ns_dispatch_t; - typedef ISC_LIST(ns_dispatch_t) ns_dispatchlist_t; - -+typedef struct ns_dbus_mgr ns_dbus_mgr_t ; -+ - #endif /* NAMED_TYPES_H */ ---- bind-9.4.0/bin/named/include/named/globals.h.dbus 2007-03-06 13:45:26.000000000 +0100 -+++ bind-9.4.0/bin/named/include/named/globals.h 2007-03-06 13:45:26.000000000 +0100 -@@ -114,6 +114,8 @@ - - EXTERN int ns_g_listen INIT(3); - -+EXTERN int ns_g_dbus INIT(0); -+ - #undef EXTERN - #undef INIT - ---- bind-9.4.0/bin/named/include/named/log.h.dbus 2005-04-29 02:15:35.000000000 +0200 -+++ bind-9.4.0/bin/named/include/named/log.h 2007-03-06 13:45:26.000000000 +0100 -@@ -36,6 +36,7 @@ - #define NS_LOGCATEGORY_QUERIES (&ns_g_categories[4]) - #define NS_LOGCATEGORY_UNMATCHED (&ns_g_categories[5]) - #define NS_LOGCATEGORY_UPDATE_SECURITY (&ns_g_categories[6]) -+#define NS_LOGCATEGORY_DBUS (&ns_g_categories[7]) - - /* - * Backwards compatibility. -@@ -53,6 +54,7 @@ - #define NS_LOGMODULE_NOTIFY (&ns_g_modules[8]) - #define NS_LOGMODULE_CONTROL (&ns_g_modules[9]) - #define NS_LOGMODULE_LWRESD (&ns_g_modules[10]) -+#define NS_LOGMODULE_DBUS (&ns_g_modules[11]) - - isc_result_t - ns_log_init(isc_boolean_t safe); ---- bind-9.4.0/bin/named/server.c.dbus 2006-12-07 06:24:19.000000000 +0100 -+++ bind-9.4.0/bin/named/server.c 2007-03-06 13:45:26.000000000 +0100 -@@ -167,6 +167,8 @@ - ISC_LINK(struct zonelistentry) link; - }; - -+#include -+ - /* - * These zones should not leak onto the Internet. - */ -@@ -1985,12 +1987,12 @@ - if (result != ISC_R_SUCCESS) { - char namebuf[DNS_NAME_FORMATSIZE]; - dns_name_format(origin, namebuf, sizeof(namebuf)); -- cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_WARNING, -- "could not set up forwarding for domain '%s': %s", -+ cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_NOTICE, -+ "setting up forwarding failed for domain '%s': %s", - namebuf, isc_result_totext(result)); - goto cleanup; - } -- -+ - result = ISC_R_SUCCESS; - - cleanup: -@@ -3418,6 +3420,20 @@ - - CHECKFATAL(load_zones(server, ISC_FALSE), "loading zones"); - -+ server->dbus_mgr = 0L; -+ if( ns_g_dbus ) -+ if( dbus_mgr_create -+ ( ns_g_mctx, ns_g_taskmgr, ns_g_socketmgr, ns_g_timermgr, -+ &server->dbus_mgr -+ ) != ISC_R_SUCCESS -+ ) -+ { -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, -+ NS_LOGMODULE_SERVER, ISC_LOG_WARNING, -+ "dbus_mgr initialization failed. D-BUS service is disabled." -+ ); -+ } -+ - ns_os_started(); - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, - ISC_LOG_NOTICE, "running"); -@@ -3481,6 +3497,9 @@ - - dns_db_detach(&server->in_roothints); - -+ if( server->dbus_mgr != 0L ) -+ dbus_mgr_shutdown(server->dbus_mgr); -+ - isc_task_endexclusive(server->task); - - isc_task_detach(&server->task); ---- bind-9.4.0/bin/named/Makefile.in.dbus 2007-03-06 13:45:26.000000000 +0100 -+++ bind-9.4.0/bin/named/Makefile.in 2007-03-06 14:08:10.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@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ -- ${OBJS} ${UOBJS} ${LIBS} -+ ${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS} - - lwresd@EXEEXT@: named@EXEEXT@ - rm -f lwresd@EXEEXT@ ---- bind-9.4.0/bin/named/named.8.dbus 2007-01-30 01:23:44.000000000 +0100 -+++ bind-9.4.0/bin/named/named.8 2007-03-06 13:45:26.000000000 +0100 -@@ -33,7 +33,7 @@ - named \- Internet domain name server - .SH "SYNOPSIS" - .HP 6 --\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] -+\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] [\fB\-D\fR] - .SH "DESCRIPTION" - .PP - \fBnamed\fR -@@ -172,6 +172,13 @@ - This option must not be used. It is only of interest to BIND 9 developers and may be removed or changed in a future release. - .RE - .RE -+.sp -+.TP -+\fB\-D\fR -+Enable dynamic management of the forwarding table with D-BUS -+messages. This option is required for Red Hat NetworkManager -+support. See doc/README.DBUS . -+.sp - .SH "SIGNALS" - .PP - In routine operation, signals should not be used to control the nameserver; diff --git a/bind-9.3.4-sdb-sqlite-src.patch b/bind-9.3.4-sdb-sqlite-src.patch deleted file mode 100644 index 6b84210..0000000 --- a/bind-9.3.4-sdb-sqlite-src.patch +++ /dev/null @@ -1,729 +0,0 @@ ---- bind-9.3.4/contrib/sdb/sqlite/sqlitedb.c.sdb-sqlite-src 2007-03-01 23:06:02.000000000 -0500 -+++ bind-9.3.4/contrib/sdb/sqlite/sqlitedb.c 2007-03-01 23:06:02.000000000 -0500 -@@ -0,0 +1,324 @@ -+/* -+ * Copyright (C) 2007 Internet Software Consortium. -+ * -+ * Permission to use, copy, modify, and distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+/* $Id: sqlitedb.c Exp $ */ -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+ -+#include "sqlitedb.h" -+ -+/* -+ * A simple database driver that interfaces to a SQLite database. -+ * -+ * The table must contain the fields "name", "rdtype", and "rdata", and -+ * is expected to contain a properly constructed zone. The program "zonetodb" -+ * creates such a table. -+ */ -+ -+static dns_sdbimplementation_t *sqlitedb = NULL; -+ -+typedef struct _dbinfo { -+ sqlite3 *db; -+ char *filename; -+ char *table; -+} dbinfo_t; -+ -+ -+static isc_result_t -+db_connect(dbinfo_t *dbi) -+{ -+ if (sqlite3_open(dbi->filename, &dbi->db) == SQLITE_OK) { -+ return (ISC_R_SUCCESS); -+ } else { -+ /* a connection is returned even if the open fails */ -+ sqlite3_close(dbi->db); -+ dbi->db = NULL; -+ return (ISC_R_FAILURE); -+ } -+} -+ -+ -+typedef struct _lookup_parm_t { -+ int i; -+ dns_sdblookup_t *lookup; -+ isc_result_t result; -+} lookup_parm_t; -+ -+ -+static int -+sqlitedb_lookup_cb(void *p, int cc, char **cv, char **cn) -+{ -+ lookup_parm_t *parm = p; -+ dns_ttl_t ttl; -+ char *endp; -+ -+ /* FIXME - check these(num/names); I'm assuming a mapping for now */ -+ char *ttlstr = cv[0]; -+ char *type = cv[1]; -+ char *data = cv[2]; -+ -+ UNUSED(cc); -+ UNUSED(cn); -+ -+ ttl = strtol(ttlstr, &endp, 10); -+ if (*endp) { -+ parm->result = DNS_R_BADTTL; -+ return 1; -+ } -+ -+ parm->result = dns_sdb_putrr(parm->lookup, type, ttl, data); -+ -+ if (parm->result != ISC_R_SUCCESS) -+ return 1; -+ -+ (parm->i)++; -+ -+ return 0; -+} -+ -+ -+static isc_result_t -+sqlitedb_lookup(const char *zone, -+ const char *name, void *dbdata, -+ dns_sdblookup_t *lookup) -+/* -+ * synchronous absolute name lookup -+ */ -+{ -+ dbinfo_t *dbi = (dbinfo_t *) dbdata; -+ char *sql; -+ lookup_parm_t parm = { 0, lookup, ISC_R_SUCCESS }; -+ char *errmsg = NULL; -+ int result; -+ -+ UNUSED(zone); -+ -+ sql = sqlite3_mprintf( -+ "SELECT TTL,RDTYPE,RDATA FROM \"%q\" WHERE " -+ "lower(NAME) = lower('%q')", -+ dbi->table, name); -+ -+ result = sqlite3_exec(dbi->db, sql, -+ &sqlitedb_lookup_cb, &parm, -+ &errmsg); -+ sqlite3_free(sql); -+ -+ if (result != SQLITE_OK) -+ return (ISC_R_FAILURE); -+ if (parm.i == 0) -+ return (ISC_R_NOTFOUND); -+ -+ return (ISC_R_SUCCESS); -+} -+ -+ -+typedef struct _allnodes_parm_t { -+ int i; -+ dns_sdballnodes_t *allnodes; -+ isc_result_t result; -+} allnodes_parm_t; -+ -+ -+static int -+sqlitedb_allnodes_cb(void *p, int cc, char **cv, char **cn) -+{ -+ allnodes_parm_t *parm = p; -+ dns_ttl_t ttl; -+ char *endp; -+ -+ /* FIXME - check these(num/names); I'm assuming a mapping for now */ -+ char *ttlstr = cv[0]; -+ char *name = cv[1]; -+ char *type = cv[2]; -+ char *data = cv[3]; -+ -+ UNUSED(cc); -+ UNUSED(cn); -+ -+ ttl = strtol(ttlstr, &endp, 10); -+ if (*endp) { -+ parm->result = DNS_R_BADTTL; -+ return 1; -+ } -+ -+ parm->result = dns_sdb_putnamedrr(parm->allnodes, name, type, ttl, data); -+ -+ if (parm->result != ISC_R_SUCCESS) -+ return 1; -+ -+ (parm->i)++; -+ -+ return 0; -+} -+ -+ -+static isc_result_t -+sqlitedb_allnodes(const char *zone, -+ void *dbdata, -+ dns_sdballnodes_t *allnodes) -+{ -+ dbinfo_t *dbi = (dbinfo_t *) dbdata; -+ char *sql; -+ allnodes_parm_t parm = { 0, allnodes, ISC_R_SUCCESS }; -+ char *errmsg = NULL; -+ int result; -+ -+ UNUSED(zone); -+ -+ sql = sqlite3_mprintf( -+ "SELECT TTL,NAME,RDTYPE,RDATA FROM \"%q\" ORDER BY NAME", -+ dbi->table); -+ -+ result = sqlite3_exec(dbi->db, sql, -+ &sqlitedb_allnodes_cb, &parm, -+ &errmsg); -+ sqlite3_free(sql); -+ -+ if (result != SQLITE_OK) -+ return (ISC_R_FAILURE); -+ if (parm.i == 0) -+ return (ISC_R_NOTFOUND); -+ -+ return (ISC_R_SUCCESS); -+} -+ -+ -+static void -+sqlitedb_destroy(const char *zone, void *driverdata, void **dbdata) -+{ -+ dbinfo_t *dbi = *dbdata; -+ -+ UNUSED(zone); -+ UNUSED(driverdata); -+ -+ if (dbi->db != NULL) -+ sqlite3_close(dbi->db); -+ if (dbi->table != NULL) -+ isc_mem_free(ns_g_mctx, dbi->table); -+ if (dbi->filename != NULL) -+ isc_mem_free(ns_g_mctx, dbi->filename); -+ -+ isc_mem_put(ns_g_mctx, dbi, sizeof(dbinfo_t)); -+} -+ -+ -+#define STRDUP_OR_FAIL(target, source) \ -+ do { \ -+ target = isc_mem_strdup(ns_g_mctx, source); \ -+ if (target == NULL) { \ -+ result = ISC_R_NOMEMORY; \ -+ goto cleanup; \ -+ } \ -+ } while (0); -+ -+/* -+ * Create a connection to the database and save any necessary information -+ * in dbdata. -+ * -+ * argv[0] is the name of the database file -+ * argv[1] is the name of the table -+ */ -+static isc_result_t -+sqlitedb_create(const char *zone, -+ int argc, char **argv, -+ void *driverdata, void **dbdata) -+{ -+ dbinfo_t *dbi; -+ isc_result_t result; -+ -+ UNUSED(zone); -+ UNUSED(driverdata); -+ -+ if (argc < 2) -+ return (ISC_R_FAILURE); -+ -+ dbi = isc_mem_get(ns_g_mctx, sizeof(dbinfo_t)); -+ if (dbi == NULL) -+ return (ISC_R_NOMEMORY); -+ dbi->db = NULL; -+ dbi->filename = NULL; -+ dbi->table = NULL; -+ -+ STRDUP_OR_FAIL(dbi->filename, argv[0]); -+ STRDUP_OR_FAIL(dbi->table, argv[1]); -+ -+ result = db_connect(dbi); -+ if (result != ISC_R_SUCCESS) -+ goto cleanup; -+ -+ *dbdata = dbi; -+ return (ISC_R_SUCCESS); -+ -+cleanup: -+ sqlitedb_destroy(zone, driverdata, (void **)&dbi); -+ return (result); -+} -+ -+ -+/* -+ * Since the SQL database corresponds to a zone, the authority data should -+ * be returned by the lookup() function. Therefore the authority() function -+ * is NULL. -+ */ -+static dns_sdbmethods_t sqlitedb_methods = { -+ sqlitedb_lookup, -+ NULL, /* authority */ -+ sqlitedb_allnodes, -+ sqlitedb_create, -+ sqlitedb_destroy -+}; -+ -+ -+/* -+ * Wrapper around dns_sdb_register(). -+ */ -+isc_result_t -+sqlitedb_init(void) -+{ -+ unsigned int flags; -+ flags = 0; -+ return (dns_sdb_register("sqlite", &sqlitedb_methods, NULL, flags, -+ ns_g_mctx, &sqlitedb)); -+} -+ -+ -+/* -+ * Wrapper around dns_sdb_unregister(). -+ */ -+void -+sqlitedb_clear(void) -+{ -+ if (sqlitedb != NULL) -+ dns_sdb_unregister(&sqlitedb); -+} ---- bind-9.3.4/contrib/sdb/sqlite/sqlitedb.h.sdb-sqlite-src 2007-03-01 23:06:02.000000000 -0500 -+++ bind-9.3.4/contrib/sdb/sqlite/sqlitedb.h 2007-03-01 23:06:02.000000000 -0500 -@@ -0,0 +1,25 @@ -+/* -+ * Copyright (C) 2000-2002 Internet Software Consortium. -+ * -+ * Permission to use, copy, modify, and distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+/* $Id: pgsqldb.h,v 1.2.4.2 2002/08/05 06:57:07 marka Exp $ */ -+ -+#include -+ -+isc_result_t sqlitedb_init(void); -+ -+void sqlitedb_clear(void); -+ ---- bind-9.3.4/contrib/sdb/sqlite/README.sdb_sqlite.sdb-sqlite-src 2007-03-01 23:06:02.000000000 -0500 -+++ bind-9.3.4/contrib/sdb/sqlite/README.sdb_sqlite 2007-03-01 23:17:01.000000000 -0500 -@@ -0,0 +1,67 @@ -+ SQLite BIND SDB driver -+ -+The SQLite BIND SDB "driver" is intended as an alternative both to the -+pgsqldb and dirdb drivers, for situations that would like the management -+simplicity and convenience of single filesystem files, with the additional -+capability of SQL databases. It is also intended as an alternative to -+the standard dynamic DNS update capability in bind, which effectively -+requires use of DNSSEC keys for authorization, and is limited to 'nsupdate' -+for updates. An sqlite database, by contrast, uses and requires only -+normal filesystem permissions, and may be updated however a typical SQLite -+database might be updated, e.g., via a web service with an SQLite backend. -+ -+This driver is not considered suitable for very high volume public -+nameserver use, while likely useful for smaller private nameserver -+applications, whether or not in a production environment. It should -+generally be suitable wherever SQLite is preferable over larger database -+engines, and not suitable where SQLite is not preferable. -+ -+Usage: -+ -+o Use the named_sdb process ( put ENABLE_SDB=yes in /etc/sysconfig/named ) -+ -+o Edit your named.conf to contain a database zone, eg.: -+ -+zone "mydomain.net." IN { -+ type master; -+ database "sqlite mydomain.db mydomain"; -+ # ^- DB name ^-Table -+}; -+ -+o Create the database zone table -+ The table must contain the columns "name", "rdtype", and "rdata", and -+ is expected to contain a properly constructed zone. The program -+ "zone2sqlite" creates such a table. -+ -+ zone2sqlite usage: -+ -+ zone2sqlite origin zonefile dbfile dbtable -+ -+ where -+ origin : zone origin, eg "mydomain.net." -+ zonefile : master zone database file, eg. mydomain.net.zone -+ dbfile : name of SQLite database file -+ dbtable : name of table in database -+ -+--- -+# mydomain.net.zone: -+$TTL 1H -+@ SOA localhost. root.localhost. ( 1 -+ 3H -+ 1H -+ 1W -+ 1H ) -+ NS localhost. -+host1 A 192.168.2.1 -+host2 A 192.168.2.2 -+host3 A 192.168.2.3 -+host4 A 192.168.2.4 -+host5 A 192.168.2.5 -+host6 A 192.168.2.6 -+host7 A 192.168.2.7 -+--- -+ -+# zone2sqlite mydomain.net. mydomain.net.zone mydomain.net.db mydomain -+ -+will create/update the 'mydomain' table in database file 'mydomain.net.db'. -+ ---- bind-9.3.4/contrib/sdb/sqlite/zone2sqlite.c.sdb-sqlite-src 2007-03-01 23:06:02.000000000 -0500 -+++ bind-9.3.4/contrib/sdb/sqlite/zone2sqlite.c 2007-03-01 23:06:02.000000000 -0500 -@@ -0,0 +1,301 @@ -+/* -+ * Copyright (C) 2007 Internet Software Consortium. -+ * -+ * Permission to use, copy, modify, and distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL -+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, -+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING -+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+/* $Id: zonetosqlite.c Exp $ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#ifndef UNUSED -+#define UNUSED(x) (x) = (x) -+#endif -+ -+/* -+ * Generate an SQLite table from a zone. -+ */ -+ -+typedef struct _dbinfo { -+ sqlite3 *db; -+ char *filename; -+ char *table; -+} dbinfo_t; -+ -+dbinfo_t dbi = { NULL, NULL, NULL }; -+ -+ -+static void -+closeandexit(int status) -+{ -+ if (dbi.db) { -+ sqlite3_close(dbi.db); -+ dbi.db = NULL; -+ } -+ exit(status); -+} -+ -+static void -+check_result(isc_result_t result, const char *message) -+{ -+ if (result != ISC_R_SUCCESS) { -+ fprintf(stderr, "%s: %s\n", message, -+ isc_result_totext(result)); -+ closeandexit(1); -+ } -+} -+ -+static isc_result_t -+db_connect(dbinfo_t *dbi) -+{ -+ if (sqlite3_open(dbi->filename, &dbi->db) == SQLITE_OK) { -+ return (ISC_R_SUCCESS); -+ } else { -+ /* a connection is returned even if the open fails */ -+ sqlite3_close(dbi->db); -+ dbi->db = NULL; -+ return (ISC_R_FAILURE); -+ } -+} -+ -+static int -+add_rdata_cb(void *parm, int cc, char **cv, char **cn) -+{ -+ UNUSED(parm); -+ UNUSED(cc); -+ UNUSED(cv); -+ UNUSED(cn); -+ -+ return 0; -+} -+ -+ -+static void -+addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata) -+{ -+ unsigned char namearray[DNS_NAME_MAXTEXT + 1]; -+ unsigned char typearray[20]; -+ unsigned char dataarray[2048]; -+ isc_buffer_t b; -+ isc_result_t result; -+ char *sql; -+ char *errmsg = NULL; -+ int res; -+ -+ isc_buffer_init(&b, namearray, sizeof(namearray) - 1); -+ result = dns_name_totext(name, ISC_TRUE, &b); -+ check_result(result, "dns_name_totext"); -+ namearray[isc_buffer_usedlength(&b)] = 0; -+ -+ isc_buffer_init(&b, typearray, sizeof(typearray) - 1); -+ result = dns_rdatatype_totext(rdata->type, &b); -+ check_result(result, "dns_rdatatype_totext"); -+ typearray[isc_buffer_usedlength(&b)] = 0; -+ -+ isc_buffer_init(&b, dataarray, sizeof(dataarray) - 1); -+ result = dns_rdata_totext(rdata, NULL, &b); -+ check_result(result, "dns_rdata_totext"); -+ dataarray[isc_buffer_usedlength(&b)] = 0; -+ -+ sql = sqlite3_mprintf( -+ "INSERT INTO %q (NAME, TTL, RDTYPE, RDATA)" -+ " VALUES ('%q', %d, '%q', '%q') ", -+ dbi.table, -+ namearray, ttl, typearray, dataarray); -+ printf("%s\n", sql); -+ res = sqlite3_exec(dbi.db, sql, add_rdata_cb, NULL, &errmsg); -+ sqlite3_free(sql); -+ -+ if (result != SQLITE_OK) { -+ fprintf(stderr, "INSERT failed: %s\n", errmsg); -+ closeandexit(1); -+ } -+} -+ -+int -+main(int argc, char *argv[]) -+{ -+ char *sql; -+ int res; -+ char *errmsg = NULL; -+ char *porigin, *zonefile; -+ dns_fixedname_t forigin, fname; -+ dns_name_t *origin, *name; -+ dns_db_t *db = NULL; -+ dns_dbiterator_t *dbiter; -+ dns_dbnode_t *node; -+ dns_rdatasetiter_t *rdsiter; -+ dns_rdataset_t rdataset; -+ dns_rdata_t rdata = DNS_RDATA_INIT; -+ isc_mem_t *mctx = NULL; -+ isc_buffer_t b; -+ isc_result_t result; -+ -+ if (argc != 5) { -+ printf("usage: %s \n", argv[0]); -+ exit(1); -+ } -+ -+ porigin = argv[1]; -+ zonefile = argv[2]; -+ -+ dbi.filename = argv[3]; -+ dbi.table = argv[4]; -+ -+ dns_result_register(); -+ -+ mctx = NULL; -+ result = isc_mem_create(0, 0, &mctx); -+ check_result(result, "isc_mem_create"); -+ -+ isc_buffer_init(&b, porigin, strlen(porigin)); -+ isc_buffer_add(&b, strlen(porigin)); -+ dns_fixedname_init(&forigin); -+ origin = dns_fixedname_name(&forigin); -+ result = dns_name_fromtext(origin, &b, dns_rootname, ISC_FALSE, NULL); -+ check_result(result, "dns_name_fromtext"); -+ -+ db = NULL; -+ result = dns_db_create(mctx, "rbt", origin, dns_dbtype_zone, -+ dns_rdataclass_in, 0, NULL, &db); -+ check_result(result, "dns_db_create"); -+ -+ result = dns_db_load(db, zonefile); -+ if (result == DNS_R_SEENINCLUDE) -+ result = ISC_R_SUCCESS; -+ check_result(result, "dns_db_load"); -+ -+ printf("Connecting to '%s'\n", dbi.filename); -+ -+ if ((result = db_connect(&dbi)) != ISC_R_SUCCESS) { -+ fprintf(stderr, "Connection to database '%s' failed\n", -+ dbi.filename); -+ closeandexit(1); -+ } -+ -+ sql = sqlite3_mprintf("DROP TABLE %q ", dbi.table); -+ printf("%s\n", sql); -+ res = sqlite3_exec(dbi.db, sql, NULL, NULL, &errmsg); -+ sqlite3_free(sql); -+#if 0 -+ if (res != SQLITE_OK) { -+ fprintf(stderr, "DROP TABLE %s failed: %s\n", -+ dbi.table, errmsg); -+ } -+#endif -+ -+#if 0 -+ sql = sqlite3_mprintf(sql, "BEGIN TRANSACTION"); -+ printf("%s\n", sql); -+ res = sqlite3_exec(dbi.db, sql, NULL, NULL, &errmsg); -+ sqlite3_free(sql); -+ if (res != SQLITE_OK) { -+ fprintf(stderr, "BEGIN TRANSACTION failed: %s\n", errmsg); -+ closeandexit(1); -+ } -+#endif -+ -+ sql = sqlite3_mprintf( -+ "CREATE TABLE %q " -+ "(NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT) ", -+ dbi.table); -+ printf("%s\n", sql); -+ res = sqlite3_exec(dbi.db, sql, NULL, NULL, &errmsg); -+ sqlite3_free(sql); -+ if (res != SQLITE_OK) { -+ fprintf(stderr, "CREATE TABLE %s failed: %s\n", -+ dbi.table, errmsg); -+ closeandexit(1); -+ } -+ -+ dbiter = NULL; -+ result = dns_db_createiterator(db, ISC_FALSE, &dbiter); -+ check_result(result, "dns_db_createiterator()"); -+ -+ result = dns_dbiterator_first(dbiter); -+ check_result(result, "dns_dbiterator_first"); -+ -+ dns_fixedname_init(&fname); -+ name = dns_fixedname_name(&fname); -+ dns_rdataset_init(&rdataset); -+ dns_rdata_init(&rdata); -+ -+ while (result == ISC_R_SUCCESS) { -+ node = NULL; -+ result = dns_dbiterator_current(dbiter, &node, name); -+ if (result == ISC_R_NOMORE) -+ break; -+ check_result(result, "dns_dbiterator_current"); -+ -+ rdsiter = NULL; -+ result = dns_db_allrdatasets(db, node, NULL, 0, &rdsiter); -+ check_result(result, "dns_db_allrdatasets"); -+ -+ result = dns_rdatasetiter_first(rdsiter); -+ -+ while (result == ISC_R_SUCCESS) { -+ dns_rdatasetiter_current(rdsiter, &rdataset); -+ result = dns_rdataset_first(&rdataset); -+ check_result(result, "dns_rdataset_first"); -+ while (result == ISC_R_SUCCESS) { -+ dns_rdataset_current(&rdataset, &rdata); -+ addrdata(name, rdataset.ttl, &rdata); -+ dns_rdata_reset(&rdata); -+ result = dns_rdataset_next(&rdataset); -+ } -+ dns_rdataset_disassociate(&rdataset); -+ result = dns_rdatasetiter_next(rdsiter); -+ } -+ dns_rdatasetiter_destroy(&rdsiter); -+ dns_db_detachnode(db, &node); -+ result = dns_dbiterator_next(dbiter); -+ } -+ -+#if 0 -+ sql = sqlite3_mprintf(sql, "COMMIT TRANSACTION "); -+ printf("%s\n", sql); -+ res = sqlite3_exec(dbi.db, sql, NULL, NULL, &errmsg); -+ sqlite3_free(sql); -+ if (res != SQLITE_OK) { -+ fprintf(stderr, "COMMIT TRANSACTION failed: %s\n", errmsg); -+ closeandexit(1); -+ } -+#endif -+ -+ dns_dbiterator_destroy(&dbiter); -+ dns_db_detach(&db); -+ isc_mem_destroy(&mctx); -+ -+ closeandexit(0); -+ -+ exit(0); -+} diff --git a/bind-9.4.0-dbus-race-condition.patch b/bind-9.4.0-dbus-race-condition.patch deleted file mode 100644 index 67892bc..0000000 --- a/bind-9.4.0-dbus-race-condition.patch +++ /dev/null @@ -1,299 +0,0 @@ ---- bind-9.4.0/contrib/dbus/dbus_service.c.race-condition 2006-09-28 07:53:47.000000000 +0200 -+++ bind-9.4.0/contrib/dbus/dbus_service.c 2007-04-27 15:10:03.000000000 +0200 -@@ -5,6 +5,7 @@ - * Provides MINIMAL utilities for construction of D-BUS "Services". - * - * Copyright(C) Jason Vas Dias, Red Hat Inc., 2005 -+ * Modified by Adam Tkac, Red Hat Inc., 2007 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -50,6 +51,7 @@ - #include - - #include -+#include - - typedef struct dbcs_s - { -@@ -914,38 +916,39 @@ - cs->status = SHUTDOWN; - } - --static DBusConnectionState * -+static isc_result_t - connection_setup --( DBusConnection *connection, -+( DBusConnection *connection, -+ DBUS_SVC *dbus, - dbus_svc_WatchHandler wh, - dbus_svc_ErrorHandler eh, - dbus_svc_ErrorHandler dh, - void *wh_arg - ) - { -- DBusConnectionState *cs = dbcs_new( connection ); -+ *dbus = dbcs_new( connection ); - -- if ( cs == 0L ) -+ if ( *dbus == 0L ) - { - if(eh)(*(eh))("connection_setup: out of memory"); - goto fail; - } -- cs->wh = wh; -- cs->wh_arg = wh_arg; -- cs->eh = eh; -- cs->dh = dh; -+ (*dbus)->wh = wh; -+ (*dbus)->wh_arg = wh_arg; -+ (*dbus)->eh = eh; -+ (*dbus)->dh = dh; - - if (!dbus_connection_set_watch_functions -- ( cs->connection, -+ ( (*dbus)->connection, - add_watch, - remove_watch, - toggle_watch, -- cs, -+ *dbus, - no_free - ) - ) - { -- if( cs->eh != 0L ) (*(cs->eh))("connection_setup: dbus_connection_set_watch_functions failed"); -+ if( (*dbus)->eh != 0L ) (*((*dbus)->eh))("connection_setup: dbus_connection_set_watch_functions failed"); - goto fail; - } - -@@ -954,43 +957,44 @@ - add_timeout, - remove_timeout, - toggle_timeout, -- cs, -+ *dbus, - no_free - ) - ) - { -- if( cs->eh != 0L ) (*(cs->eh))("connection_setup: dbus_connection_set_timeout_functions failed"); -+ if( (*dbus)->eh != 0L ) (*((*dbus)->eh))("connection_setup: dbus_connection_set_timeout_functions failed"); - goto fail; - } - - dbus_connection_set_dispatch_status_function - ( connection, - dispatch_status, -- cs, -+ *dbus, - no_free - ); - - if (dbus_connection_get_dispatch_status (connection) != DBUS_DISPATCH_COMPLETE) - dbus_connection_ref(connection); - -- return cs; -+ return ISC_R_SUCCESS; - - fail: -- if( cs != 0L ) -- free(cs); -+ if( *dbus != 0L ) -+ free(*dbus); - - dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL); - dbus_connection_set_watch_functions (connection, NULL, NULL, NULL, NULL, NULL); - dbus_connection_set_timeout_functions (connection, NULL, NULL, NULL, NULL, NULL); - -- return 0L; -+ return ISC_R_FAILURE; - } - --DBusConnectionState * -+isc_result_t - dbus_svc_init - ( - dbus_svc_DBUS_TYPE bus, - char *name, -+ DBUS_SVC *dbus, - dbus_svc_WatchHandler wh , - dbus_svc_ErrorHandler eh , - dbus_svc_ErrorHandler dh , -@@ -999,7 +1003,6 @@ - { - DBusConnection *connection; - DBusError error; -- DBusConnectionState *cs; - char *session_bus_address=0L; - - memset(&error,'\0',sizeof(DBusError)); -@@ -1015,7 +1018,7 @@ - if ( (connection = dbus_connection_open_private("unix:path=/var/run/dbus/system_bus_socket", &error)) == 0L ) - { - if(eh)(*eh)("dbus_svc_init failed: %s %s",error.name, error.message); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - - if ( ! dbus_bus_register(connection,&error) ) -@@ -1023,7 +1026,7 @@ - if(eh)(*eh)("dbus_bus_register failed: %s %s", error.name, error.message); - dbus_connection_close(connection); - free(connection); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - break; - -@@ -1033,13 +1036,13 @@ - if ( session_bus_address == 0L ) - { - if(eh)(*eh)("dbus_svc_init failed: DBUS_SESSION_BUS_ADDRESS environment variable not set"); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - - if ( (connection = dbus_connection_open_private(session_bus_address, &error)) == 0L ) - { - if(eh)(*eh)("dbus_svc_init failed: %s %s",error.name, error.message); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - - if ( ! dbus_bus_register(connection,&error) ) -@@ -1047,7 +1050,7 @@ - if(eh)(*eh)("dbus_bus_register failed: %s %s", error.name, error.message); - dbus_connection_close(connection); - free(connection); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - break; - -@@ -1057,27 +1060,27 @@ - if ( (connection = dbus_bus_get (bus, &error)) == 0L ) - { - if(eh)(*eh)("dbus_svc_init failed: %s %s",error.name, error.message); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - break; - - default: - if(eh)(*eh)("dbus_svc_init failed: unknown bus type %d", bus); -- return ( 0L ); -+ return ISC_R_FAILURE; - } - - dbus_connection_set_exit_on_disconnect(connection, FALSE); - -- if ( (cs = connection_setup(connection, wh, eh, dh, wh_arg)) == 0L ) -+ if ( (connection_setup(connection, dbus, wh, eh, dh, wh_arg)) != ISC_R_SUCCESS) - { - if(eh)(*eh)("dbus_svc_init failed: connection_setup failed"); -- return( 0L ); -+ return ISC_R_FAILURE; - } - - if( name == 0L ) -- return( cs ); -+ return ISC_R_SUCCESS; - -- cs->unique_name = dbus_bus_get_unique_name(connection); -+ (*dbus)->unique_name = dbus_bus_get_unique_name(connection); - - switch - ( dbus_bus_request_name -@@ -1102,19 +1105,19 @@ - if(eh)(*eh)("dbus_svc_init: dbus_bus_request_name failed: %s %s", error.name, error.message); - goto give_up; - } -- return ( cs ); -+ return ISC_R_SUCCESS; - - give_up: - dbus_connection_close( connection ); - dbus_connection_unref( connection ); -- if( cs ) -+ if( *dbus ) - { - dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL); - dbus_connection_set_watch_functions (connection, NULL, NULL, NULL, NULL, NULL); - dbus_connection_set_timeout_functions (connection, NULL, NULL, NULL, NULL, NULL); -- free(cs); -+ free(*dbus); - } -- return ( 0L ); -+ return ISC_R_FAILURE; - } - - const char *dbus_svc_unique_name(DBusConnectionState *cs) ---- bind-9.4.0/contrib/dbus/dbus_mgr.c.race-condition 2006-01-23 05:56:26.000000000 +0100 -+++ bind-9.4.0/contrib/dbus/dbus_mgr.c 2007-04-27 15:03:19.000000000 +0200 -@@ -4,6 +4,7 @@ - * response to D-BUS dhcp events or commands. - * - * Copyright(C) Jason Vas Dias, Red Hat Inc., 2005 -+ * Modified by Adam Tkac, Red Hat Inc., 2007 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -281,6 +282,7 @@ - dbus_mgr_init_dbus(ns_dbus_mgr_t * mgr) - { - char destination[]=DBUSMGR_DESTINATION; -+ isc_result_t result; - - if( mgr->sockets != 0L ) - { -@@ -296,14 +298,11 @@ - mgr->dbus = 0L; - } - -- mgr->dbus = -- dbus_svc_init -- ( DBUS_PRIVATE_SYSTEM, -- destination, -- dbus_mgr_watch_handler, -- 0L, 0L, -- mgr -- ); -+ result = dbus_svc_init(DBUS_PRIVATE_SYSTEM, destination, &mgr->dbus, -+ dbus_mgr_watch_handler, 0L, 0L, mgr); -+ -+ if(result != ISC_R_SUCCESS) -+ goto cleanup; - - if( mgr->dbus == 0L ) - { ---- bind-9.4.0/contrib/dbus/dbus_service.h.race-condition 2006-01-23 05:56:26.000000000 +0100 -+++ bind-9.4.0/contrib/dbus/dbus_service.h 2007-04-27 15:03:19.000000000 +0200 -@@ -3,6 +3,7 @@ - * Provides utilities for construction of D-BUS "Services" - * - * Copyright(C) Jason Vas Dias, Red Hat Inc., 2005 -+ * Modified by Adam Tkac, Red Hat Inc., 2007 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -22,6 +23,7 @@ - - #include - #include -+#include - - typedef struct dbcs_s* DBUS_SVC; - -@@ -124,9 +126,10 @@ - - #define SHUTDOWN 255 - --extern DBUS_SVC dbus_svc_init -+extern isc_result_t dbus_svc_init - ( dbus_svc_DBUS_TYPE bus, - char *name, /* name to register with D-BUS */ -+ DBUS_SVC *dbus, /* dbus handle */ - dbus_svc_WatchHandler wh, /* optional handler for watch events */ - dbus_svc_ErrorHandler eh, /* optional error log message handler */ - dbus_svc_ErrorHandler dh, /* optional debug / info log message handler */ diff --git a/bind-9.4.0-zone-freeze.patch b/bind-9.4.0-zone-freeze.patch deleted file mode 100644 index d782c7a..0000000 --- a/bind-9.4.0-zone-freeze.patch +++ /dev/null @@ -1,113 +0,0 @@ -Index: bind9/bin/named/server.c -diff -u bind9/bin/named/server.c:1.483 bind9/bin/named/server.c:1.483.10.1 ---- bind9/bin/named/server.c:1.483 Tue Apr 24 06:55:32 2007 -+++ bind9/bin/named/server.c Mon May 14 05:46:56 2007 -@@ -4124,23 +4124,28 @@ - result = dns_rdataclass_fromtext(&rdclass, &r); - if (result != ISC_R_SUCCESS) - goto fail1; -- } else { -+ } else - rdclass = dns_rdataclass_in; -- } - -- if (viewtxt == NULL) -- viewtxt = "_default"; -- result = dns_viewlist_find(&server->viewlist, viewtxt, -- rdclass, &view); -- if (result != ISC_R_SUCCESS) -- goto fail1; -+ if (viewtxt == NULL) { -+ result = dns_viewlist_findzone(&server->viewlist, -+ dns_fixedname_name(&name), -+ ISC_TF(classtxt == NULL), -+ rdclass, zonep); -+ } else { -+ result = dns_viewlist_find(&server->viewlist, viewtxt, -+ rdclass, &view); -+ if (result != ISC_R_SUCCESS) -+ goto fail1; - -- result = dns_zt_find(view->zonetable, dns_fixedname_name(&name), -- 0, NULL, zonep); -+ result = dns_zt_find(view->zonetable, dns_fixedname_name(&name), -+ 0, NULL, zonep); -+ dns_view_detach(&view); -+ } -+ - /* Partial match? */ - if (result != ISC_R_SUCCESS && *zonep != NULL) - dns_zone_detach(zonep); -- dns_view_detach(&view); - fail1: - return (result); - } -Index: bind9/lib/dns/view.c -diff -u bind9/lib/dns/view.c:1.141 bind9/lib/dns/view.c:1.141.18.1 ---- bind9/lib/dns/view.c:1.141 Thu Mar 29 06:36:30 2007 -+++ bind9/lib/dns/view.c Mon May 14 05:46:57 2007 -@@ -1147,6 +1147,40 @@ - } - - isc_result_t -+dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, -+ isc_boolean_t allclasses, dns_rdataclass_t rdclass, -+ dns_zone_t **zonep) -+{ -+ dns_view_t *view; -+ isc_result_t result; -+ dns_zone_t *zone1 = NULL, *zone2 = NULL; -+ -+ REQUIRE(list != NULL); -+ for (view = ISC_LIST_HEAD(*list); -+ view != NULL; -+ view = ISC_LIST_NEXT(view, link)) { -+ if (allclasses == ISC_FALSE && view->rdclass != rdclass) -+ continue; -+ result = dns_zt_find(view->zonetable, name, 0, NULL, -+ (zone1 == NULL) ? &zone1 : &zone2); -+ INSIST(result == ISC_R_SUCCESS || result == ISC_R_NOTFOUND); -+ if (zone2 != NULL) { -+ dns_zone_detach(&zone1); -+ dns_zone_detach(&zone2); -+ return (ISC_R_NOTFOUND); -+ } -+ } -+ -+ if (zone1 != NULL) { -+ dns_zone_attach(zone1, zonep); -+ dns_zone_detach(&zone1); -+ return (ISC_R_SUCCESS); -+ } -+ -+ return (ISC_R_NOTFOUND); -+} -+ -+isc_result_t - dns_view_load(dns_view_t *view, isc_boolean_t stop) { - - REQUIRE(DNS_VIEW_VALID(view)); -Index: bind9/lib/dns/include/dns/view.h -diff -u bind9/lib/dns/include/dns/view.h:1.105 bind9/lib/dns/include/dns/view.h:1.105.16.1 ---- bind9/lib/dns/include/dns/view.h:1.105 Thu Mar 29 23:47:04 2007 -+++ bind9/lib/dns/include/dns/view.h Mon May 14 05:46:57 2007 -@@ -595,6 +595,19 @@ - */ - - isc_result_t -+dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses, -+ dns_rdataclass_t rdclass, dns_zone_t **zonep); -+ -+/*%< -+ * Search zone with 'name' in view with 'rdclass' in viewlist 'list' -+ * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored -+ * -+ * Returns: -+ *\li #ISC_R_SUCCESS A matching zone was found. -+ *\li #ISC_R_NOTFOUND No matching zone was found. -+ */ -+ -+isc_result_t - dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep); - /*%< - * Search for the zone 'name' in the zone table of 'view'. diff --git a/bind-9.5.0-dbus.patch b/bind-9.5.0-dbus.patch new file mode 100644 index 0000000..aa5cae4 --- /dev/null +++ b/bind-9.5.0-dbus.patch @@ -0,0 +1,726 @@ +--- bind-9.5.0a5/lib/isc/include/isc/socket.h.dbus 2007-02-13 03:49:08.000000000 +0100 ++++ bind-9.5.0a5/lib/isc/include/isc/socket.h 2007-06-19 11:06:55.000000000 +0200 +@@ -136,6 +136,10 @@ struct isc_socket_connev { + #define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3) + #define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4) + ++#define ISC_SOCKEVENT_READ_READY (ISC_EVENTCLASS_SOCKET + 5) ++#define ISC_SOCKEVENT_WRITE_READY (ISC_EVENTCLASS_SOCKET + 6) ++#define ISC_SOCKEVENT_SELECTED (ISC_EVENTCLASS_SOCKET + 7) ++ + /* + * Internal events. + */ +@@ -147,6 +151,7 @@ typedef enum { + isc_sockettype_tcp = 2, + isc_sockettype_unix = 3, + isc_sockettype_fdwatch = 4, ++ isc_sockettype_fd = 8 + } isc_sockettype_t; + + /*@{*/ +@@ -823,6 +828,54 @@ isc_socketmgr_renderxml(isc_socketmgr_t + + #endif /* HAVE_LIBXML2 */ + ++isc_socketevent_t* ++isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when the isc_sockettype_fd sock ++ * was select()-ed for read. If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when the isc_sockettype_fd sock ++ * was select()-ed for write. If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets ++ * have been select()-ed . If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when the isc_sockettype_fd sock ++ * was select()-ed for read. If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when the isc_sockettype_fd sock ++ * was select()-ed for write. If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ); ++/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets ++ * have been select()-ed . If there is already an event registered, it ++ * is returned, otherwise 0 is returned. If dev is 0, removes any existing ++ * registered event. ++ */ ++ + ISC_LANG_ENDDECLS + + #endif /* ISC_SOCKET_H */ +--- bind-9.5.0a5/lib/isc/unix/socket.c.dbus 2007-05-21 03:55:10.000000000 +0200 ++++ bind-9.5.0a5/lib/isc/unix/socket.c 2007-06-19 11:14:48.000000000 +0200 +@@ -176,6 +176,11 @@ struct isc_socket { + ISC_LIST(isc_socketevent_t) recv_list; + ISC_LIST(isc_socket_newconnev_t) accept_list; + isc_socket_connev_t *connect_ev; ++ ++ /* these are used only by isc_sockettype_fd sockets:*/ ++ isc_socketevent_t *read_ready_event; ++ isc_socketevent_t *write_ready_event; ++ isc_socketevent_t *selected_event; + + /* + * Internal events. Posted when a descriptor is readable or +@@ -340,7 +345,7 @@ socket_log(isc_socket_t *sock, isc_socka + + static void + wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) { +- isc_socket_t *sock; ++ isc_socket_t *sock=0L; + + /* + * This is a wakeup on a socket. If the socket is not in the +@@ -1341,6 +1346,9 @@ allocate_socket(isc_socketmgr_t *manager + sock->connected = 0; + sock->connecting = 0; + sock->bound = 0; ++ sock->read_ready_event = 0L; ++ sock->write_ready_event = 0L; ++ sock->selected_event = 0L; + + /* + * initialize the lock +@@ -1499,6 +1507,8 @@ isc_socket_create(isc_socketmgr_t *manag + case isc_sockettype_fdwatch: + INSIST(type != isc_sockettype_fdwatch); + break; ++ case isc_sockettype_fd: ++ sock->fd = pf; + } + if (sock->fd == -1 && errno == EINTR && try++ < 42) + goto again; +@@ -1507,7 +1517,7 @@ isc_socket_create(isc_socketmgr_t *manag + /* + * Leave a space for stdio to work in. + */ +- if (sock->fd >= 0 && sock->fd < 20) { ++ if ( (type != isc_sockettype_fd) && (sock->fd >= 0 && sock->fd < 20) ) { + int new, tmp; + new = fcntl(sock->fd, F_DUPFD, 20); + tmp = errno; +@@ -1561,7 +1571,7 @@ isc_socket_create(isc_socketmgr_t *manag + } + } + +- if (make_nonblock(sock->fd) != ISC_R_SUCCESS) { ++ if ((type != isc_sockettype_fd) && (make_nonblock(sock->fd) != ISC_R_SUCCESS)) { + (void)close(sock->fd); + free_socket(&sock); + return (ISC_R_UNEXPECTED); +@@ -1933,6 +1943,38 @@ dispatch_connect(isc_socket_t *sock) { + isc_task_send(ev->ev_sender, (isc_event_t **)&iev); + } + ++static ++isc_event_t *dispatch_read_ready(isc_socketmgr_t *manager, isc_socket_t *sock) ++{ ++ isc_event_t *dev = (isc_event_t*)sock->read_ready_event, *ev; ++ ++ ev = isc_mem_get(manager->mctx, dev->ev_size); ++ memcpy(ev,dev,dev->ev_size); ++ ISC_LINK_INIT(ev,ev_link); ++ isc_task_send(dev->ev_sender, &ev ); ++ return (isc_event_t *)sock->selected_event; ++} ++ ++static ++isc_event_t *dispatch_write_ready(isc_socketmgr_t *manager,isc_socket_t *sock) ++{ ++ isc_event_t *dev = (isc_event_t*)sock->write_ready_event, *ev; ++ ev = isc_mem_get(manager->mctx, dev->ev_size); ++ memcpy(ev,dev,dev->ev_size); ++ ISC_LINK_INIT(ev,ev_link); ++ isc_task_send(dev->ev_sender, &ev ); ++ return (isc_event_t *)sock->selected_event; ++} ++ ++static ++void dispatch_selected(isc_socketmgr_t *manager, isc_event_t *dev) ++{ isc_event_t *ev; ++ ev = isc_mem_get(manager->mctx, dev->ev_size); ++ memcpy(ev,dev,dev->ev_size); ++ ISC_LINK_INIT(ev,ev_link); ++ isc_task_send(dev->ev_sender, &ev ); ++} ++ + /* + * Dequeue an item off the given socket's read queue, set the result code + * in the done event to the one provided, and send it to the task it was +@@ -2420,6 +2462,7 @@ process_fds(isc_socketmgr_t *manager, in + int i; + isc_socket_t *sock; + isc_boolean_t unlock_sock; ++ isc_event_t *sock_selected = 0L; + + REQUIRE(maxfd <= (int)FD_SETSIZE); + +@@ -2456,11 +2499,15 @@ process_fds(isc_socketmgr_t *manager, in + unlock_sock = ISC_TRUE; + LOCK(&sock->lock); + if (!SOCK_DEAD(sock)) { ++ if( sock->type != isc_sockettype_fd ) ++ { + if (sock->listener) + dispatch_accept(sock); + else + dispatch_recv(sock); +- } ++ }else ++ sock_selected = dispatch_read_ready(manager,sock); ++ } + FD_CLR(i, &manager->read_fds); + } + check_write: +@@ -2474,16 +2521,24 @@ process_fds(isc_socketmgr_t *manager, in + LOCK(&sock->lock); + } + if (!SOCK_DEAD(sock)) { ++ if( sock->type != isc_sockettype_fd ) ++ { + if (sock->connecting) + dispatch_connect(sock); + else + dispatch_send(sock); ++ }else ++ sock_selected = dispatch_write_ready(manager,sock); + } + FD_CLR(i, &manager->write_fds); + } + if (unlock_sock) + UNLOCK(&sock->lock); + } ++ if( sock_selected != 0L ) ++ { ++ dispatch_selected(manager, sock_selected); ++ } + } + + #ifdef ISC_PLATFORM_USETHREADS +@@ -2502,7 +2557,7 @@ watcher(void *uap) { + int cc; + fd_set readfds; + fd_set writefds; +- int msg, fd; ++ int msg, fd = -1; + int maxfd; + char strbuf[ISC_STRERRORSIZE]; + +@@ -4165,3 +4220,56 @@ isc_socketmgr_renderxml(isc_socketmgr_t + UNLOCK(&mgr->lock); + } + #endif /* HAVE_LIBXML2 */ ++ ++isc_socketevent_t* ++isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev ) ++{ ++ REQUIRE(VALID_SOCKET(sock)); ++ if(dev != 0L) ++ { ++ sock->references=1; ++ sock->read_ready_event = dev; ++ select_poke(sock->manager, sock->fd, SELECT_POKE_READ); ++ }else ++ { ++ dev = sock->read_ready_event ; ++ sock->read_ready_event = 0L ; ++ } ++ return dev; ++} ++ ++isc_socketevent_t* ++isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev ) ++{ ++ REQUIRE(VALID_SOCKET(sock)); ++ if(dev != 0L) ++ { ++ sock->references=1; ++ sock->write_ready_event = dev; ++ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE); ++ }else ++ { ++ dev = sock->write_ready_event; ++ sock->write_ready_event = 0L; ++ } ++ return dev; ++} ++ ++isc_socketevent_t* ++isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev ) ++{ ++ REQUIRE(VALID_SOCKET(sock)); ++ if(dev != 0L) ++ { ++ sock->references=1; ++ sock->selected_event = dev; ++ }else ++ { ++ dev = sock->selected_event; ++ sock->selected_event = 0L; ++ sock->references=0; ++ destroy(&sock); ++ } ++ return dev; ++} ++ +--- bind-9.5.0a5/lib/dns/forward.c.dbus 2005-07-12 03:00:15.000000000 +0200 ++++ bind-9.5.0a5/lib/dns/forward.c 2007-06-19 11:04:17.000000000 +0200 +@@ -197,3 +197,89 @@ auto_detach(void *data, void *arg) { + } + isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t)); + } ++ ++/*** ++ *** new D-BUS Dynamic Forwarding Zones functions: ++ ***/ ++isc_result_t ++dns_fwdtable_delete(dns_fwdtable_t *fwdtable, dns_name_t *name ) ++{ ++ isc_result_t result; ++ ++ REQUIRE(VALID_FWDTABLE(fwdtable)); ++ ++ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_write); ++ ++ result = dns_rbt_deletename(fwdtable->table, name, ISC_FALSE); ++ ++ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_write); ++ ++ return (result); ++} ++ ++isc_result_t ++dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, ++ dns_name_t *name, ++ dns_name_t *foundname, ++ dns_forwarders_t **forwardersp) ++{ ++ isc_result_t result; ++ ++ REQUIRE(VALID_FWDTABLE(fwdtable)); ++ ++ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read); ++ ++ result = dns_rbt_findname(fwdtable->table, name, 0, foundname, ++ (void **)forwardersp); ++ ++ if(result == DNS_R_PARTIALMATCH) ++ result = ISC_R_SUCCESS; ++ ++ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read); ++ ++ return (result); ++} ++ ++isc_result_t ++dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name, ++ dns_forwarders_t **forwardersp) ++{ ++ isc_result_t result; ++ ++ REQUIRE(VALID_FWDTABLE(fwdtable)); ++ ++ REQUIRE(forwardersp != 0L); ++ ++ RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read); ++ ++ result = dns_rbt_findname(fwdtable->table, name, 0, NULL, ++ (void **)forwardersp); ++ ++ if( result != ISC_R_SUCCESS ) ++ *forwardersp = 0L; ++ ++ RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read); ++ ++ return (result); ++} ++ ++static ++void dns_fwdtable_traverse ++( ++ dns_name_t *name, ++ void *node_data, ++ void *cbp, ++ void *cb_arg ++) ++{ ++ dns_fwdtable_callback_t cb = (dns_fwdtable_callback_t) cbp; ++ ++ (*cb)( name, node_data, cb_arg); ++} ++ ++void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void *cb_arg ) ++{ ++ REQUIRE(VALID_FWDTABLE(fwdtable)); ++ ++ dns_rbt_traverse( fwdtable->table, dns_fwdtable_traverse, cb, cb_arg ); ++} +--- bind-9.5.0a5/lib/dns/rbt.c.dbus 2005-10-13 03:19:12.000000000 +0200 ++++ bind-9.5.0a5/lib/dns/rbt.c 2007-06-19 11:04:17.000000000 +0200 +@@ -2175,6 +2175,47 @@ dns_rbt_printall(dns_rbt_t *rbt) { + dns_rbt_printtree(rbt->root, NULL, 0); + } + ++static void ++dns_rbt_traverse_tree(dns_rbtnode_t *root, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) { ++/* ++ * This is used ONLY to traverse the forward table by dbus_mgr at the moment. ++ * Since the forward table is not likely to be large, this can be recursive. ++ */ ++ dns_name_t name; ++ dns_offsets_t offsets; ++ char buf[DNS_NAME_MAXWIRE]; ++ isc_buffer_t buffer; ++ ++ if (root != NULL) { ++ ++ if (DOWN(root)) ++ dns_rbt_traverse_tree(DOWN(root), cb, cb_arg1, cb_arg2); ++ ++ if( LEFT(root) != NULL ) ++ dns_rbt_traverse_tree(LEFT(root), cb, cb_arg1, cb_arg2); ++ ++ if( RIGHT(root) != NULL ) ++ dns_rbt_traverse_tree(RIGHT(root), cb, cb_arg1, cb_arg2); ++ ++ if( DATA(root) == 0L ) ++ return; ++ ++ dns_name_init(&name, offsets); ++ isc_buffer_init(&buffer, buf, DNS_NAME_MAXWIRE); ++ dns_name_setbuffer( &name, &buffer); ++ dns_rbt_fullnamefromnode(root, &name); ++ ++ (*cb)(&name, DATA(root), cb_arg1, cb_arg2); ++ } ++} ++ ++void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) ++{ ++ REQUIRE(VALID_RBT(rbt)); ++ ++ dns_rbt_traverse_tree( rbt->root, cb, cb_arg1, cb_arg2 ); ++} ++ + /* + * Chain Functions + */ +--- bind-9.5.0a5/lib/dns/include/dns/rbt.h.dbus 2006-12-22 02:59:43.000000000 +0100 ++++ bind-9.5.0a5/lib/dns/include/dns/rbt.h 2007-06-19 11:04:17.000000000 +0200 +@@ -911,6 +911,17 @@ dns_rbtnodechain_next(dns_rbtnodechain_t + } while (0) + #endif /* DNS_RBT_USEISCREFCOUNT */ + ++ ++typedef void (*dns_rbt_traverse_callback_t)( dns_name_t *name, ++ void *node_data, ++ void *cb_arg1, ++ void *cb_arg2); ++ ++void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ); ++/* tree traversal function (only used by D-BUS dynamic forwarding dbus_mgr at ++ * the moment) ++ */ ++ + ISC_LANG_ENDDECLS + + #endif /* DNS_RBT_H */ +--- bind-9.5.0a5/lib/dns/include/dns/forward.h.dbus 2006-12-22 02:59:43.000000000 +0100 ++++ bind-9.5.0a5/lib/dns/include/dns/forward.h 2007-06-19 11:04:17.000000000 +0200 +@@ -113,6 +113,37 @@ dns_fwdtable_destroy(dns_fwdtable_t **fw + * \li all memory associated with the forwarding table is freed. + */ + ++ ++/* These are ONLY used by dbus_mgr : ++ */ ++ ++isc_result_t ++dns_fwdtable_delete( dns_fwdtable_t *fwdtable, dns_name_t *name ); ++/* ++ * Removes an entry from the forwarding table. ++ */ ++ ++isc_result_t ++dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name, ++ dns_forwarders_t **forwardersp); ++/* ++ * Finds an exact match for "name" in the forwarding table. ++ */ ++ ++isc_result_t ++dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, dns_name_t *name, dns_name_t *foundname, ++ dns_forwarders_t **forwardersp); ++/* ++ * Finds the closest match for "*name" in the forwarding table, returning ++ * the actual name matching in *name if different to *name passed in. ++ */ ++ ++typedef void (*dns_fwdtable_callback_t)( dns_name_t *, dns_forwarders_t *, void *); ++void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void * ); ++/* Invoke cb for each member of fwdtable ++ */ ++ ++ + ISC_LANG_ENDDECLS + + #endif /* DNS_FORWARD_H */ +--- bind-9.5.0a5/bin/named/main.c.dbus 2007-05-21 05:46:41.000000000 +0200 ++++ bind-9.5.0a5/bin/named/main.c 2007-06-19 11:04:17.000000000 +0200 +@@ -248,7 +248,8 @@ usage(void) { + "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 +@@ -356,7 +357,7 @@ parse_command_line(int argc, char *argv[ + + 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) +@@ -445,6 +446,9 @@ parse_command_line(int argc, char *argv[ + case 'v': + printf("BIND %s\n", ns_g_version); + exit(0); ++ case 'D': ++ ns_g_dbus = 1; ++ break; + case '?': + usage(); + if (isc_commandline_option == '?') +--- bind-9.5.0a5/bin/named/log.c.dbus 2006-12-22 02:44:59.000000000 +0100 ++++ bind-9.5.0a5/bin/named/log.c 2007-06-19 11:04:17.000000000 +0200 +@@ -44,6 +44,7 @@ static isc_logcategory_t categories[] = + { "queries", 0 }, + { "unmatched", 0 }, + { "update-security", 0 }, ++ { "dbus", 0 }, + { NULL, 0 } + }; + +@@ -63,6 +64,7 @@ static isc_logmodule_t modules[] = { + { "notify", 0 }, + { "control", 0 }, + { "lwresd", 0 }, ++ { "dbus", 0 }, + { NULL, 0 } + }; + +--- bind-9.5.0a5/bin/named/include/named/server.h.dbus 2006-12-21 07:02:30.000000000 +0100 ++++ bind-9.5.0a5/bin/named/include/named/server.h 2007-06-19 11:16:03.000000000 +0200 +@@ -102,6 +102,8 @@ struct ns_server { + + isc_httpdmgr_t *httpd; + isc_sockaddr_t httpd_sockaddr; ++ ++ ns_dbus_mgr_t * dbus_mgr; + }; + + #define NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R') +--- bind-9.5.0a5/bin/named/include/named/types.h.dbus 2006-12-22 02:59:43.000000000 +0100 ++++ bind-9.5.0a5/bin/named/include/named/types.h 2007-06-19 11:04:17.000000000 +0200 +@@ -42,4 +42,6 @@ typedef struct ns_controls ns_controls_ + typedef struct ns_dispatch ns_dispatch_t; + typedef ISC_LIST(ns_dispatch_t) ns_dispatchlist_t; + ++typedef struct ns_dbus_mgr ns_dbus_mgr_t ; ++ + #endif /* NAMED_TYPES_H */ +--- bind-9.5.0a5/bin/named/include/named/globals.h.dbus 2007-06-19 11:04:16.000000000 +0200 ++++ bind-9.5.0a5/bin/named/include/named/globals.h 2007-06-19 11:04:17.000000000 +0200 +@@ -115,6 +115,8 @@ EXTERN const char * ns_g_username INIT + EXTERN int ns_g_listen INIT(3); + EXTERN isc_time_t ns_g_boottime; + ++EXTERN int ns_g_dbus INIT(0); ++ + #undef EXTERN + #undef INIT + +--- bind-9.5.0a5/bin/named/include/named/log.h.dbus 2005-04-29 02:22:30.000000000 +0200 ++++ bind-9.5.0a5/bin/named/include/named/log.h 2007-06-19 11:04:17.000000000 +0200 +@@ -36,6 +36,7 @@ + #define NS_LOGCATEGORY_QUERIES (&ns_g_categories[4]) + #define NS_LOGCATEGORY_UNMATCHED (&ns_g_categories[5]) + #define NS_LOGCATEGORY_UPDATE_SECURITY (&ns_g_categories[6]) ++#define NS_LOGCATEGORY_DBUS (&ns_g_categories[7]) + + /* + * Backwards compatibility. +@@ -53,6 +54,7 @@ + #define NS_LOGMODULE_NOTIFY (&ns_g_modules[8]) + #define NS_LOGMODULE_CONTROL (&ns_g_modules[9]) + #define NS_LOGMODULE_LWRESD (&ns_g_modules[10]) ++#define NS_LOGMODULE_DBUS (&ns_g_modules[11]) + + isc_result_t + ns_log_init(isc_boolean_t safe); +--- bind-9.5.0a5/bin/named/server.c.dbus 2007-05-15 04:38:34.000000000 +0200 ++++ bind-9.5.0a5/bin/named/server.c 2007-06-19 11:04:17.000000000 +0200 +@@ -171,6 +171,8 @@ struct zonelistentry { + ISC_LINK(struct zonelistentry) link; + }; + ++#include ++ + /* + * These zones should not leak onto the Internet. + */ +@@ -2103,12 +2105,12 @@ configure_forward(const cfg_obj_t *confi + if (result != ISC_R_SUCCESS) { + char namebuf[DNS_NAME_FORMATSIZE]; + dns_name_format(origin, namebuf, sizeof(namebuf)); +- cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_WARNING, +- "could not set up forwarding for domain '%s': %s", ++ cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_NOTICE, ++ "setting up forwarding failed for domain '%s': %s", + namebuf, isc_result_totext(result)); + goto cleanup; + } +- ++ + result = ISC_R_SUCCESS; + + cleanup: +@@ -3586,6 +3588,20 @@ run_server(isc_task_t *task, isc_event_t + + CHECKFATAL(load_zones(server, ISC_FALSE), "loading zones"); + ++ server->dbus_mgr = 0L; ++ if( ns_g_dbus ) ++ if( dbus_mgr_create ++ ( ns_g_mctx, ns_g_taskmgr, ns_g_socketmgr, ns_g_timermgr, ++ &server->dbus_mgr ++ ) != ISC_R_SUCCESS ++ ) ++ { ++ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, ++ NS_LOGMODULE_SERVER, ISC_LOG_WARNING, ++ "dbus_mgr initialization failed. D-BUS service is disabled." ++ ); ++ } ++ + ns_os_started(); + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, + ISC_LOG_NOTICE, "running"); +@@ -3654,6 +3670,9 @@ shutdown_server(isc_task_t *task, isc_ev + + dns_db_detach(&server->in_roothints); + ++ if( server->dbus_mgr != 0L ) ++ dbus_mgr_shutdown(server->dbus_mgr); ++ + isc_task_endexclusive(server->task); + + isc_task_detach(&server->task); +--- bind-9.5.0a5/bin/named/Makefile.in.dbus 2007-06-19 11:04:17.000000000 +0200 ++++ bind-9.5.0a5/bin/named/Makefile.in 2007-06-19 11:04:17.000000000 +0200 +@@ -43,6 +43,9 @@ CINCLUDES = -I${srcdir}/include -I${srcd + ${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 @@ ISCCCDEPLIBS = ../../lib/isccc/libisccc. + 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 @@ OBJS = builtin.o client.o config.o cont + 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 +@@ -94,6 +99,7 @@ SRCS = builtin.c client.c config.c cont + 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 +@@ -122,9 +128,14 @@ config.o: config.c + -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@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS} + ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ +- ${OBJS} ${UOBJS} ${LIBS} ++ ${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS} + + lwresd@EXEEXT@: named@EXEEXT@ + rm -f lwresd@EXEEXT@ +--- bind-9.5.0a5/bin/named/named.8.dbus 2007-06-19 11:04:17.000000000 +0200 ++++ bind-9.5.0a5/bin/named/named.8 2007-06-19 11:20:15.000000000 +0200 +@@ -33,7 +33,7 @@ + named \- Internet domain name server + .SH "SYNOPSIS" + .HP 6 +-\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-m\ \fR\fB\fIflag\fR\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] ++\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-m\ \fR\fB\fIflag\fR\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] [\fB\-D\fR] + .SH "DESCRIPTION" + .PP + \fBnamed\fR +@@ -181,6 +181,13 @@ into the cache of the default view. + This option must not be used. It is only of interest to BIND 9 developers and may be removed or changed in a future release. + .RE + .RE ++.sp ++.TP ++\fB\-D\fR ++Enable dynamic management of the forwarding table with D-BUS ++messages. This option is required for Red Hat NetworkManager ++support. See doc/README.DBUS . ++.sp + .SH "SIGNALS" + .PP + In routine operation, signals should not be used to control the nameserver; diff --git a/bind-9.5.0-generate-xml.patch b/bind-9.5.0-generate-xml.patch new file mode 100644 index 0000000..8a34e37 --- /dev/null +++ b/bind-9.5.0-generate-xml.patch @@ -0,0 +1,11 @@ +--- bind-9.5.0a5/bin/named/Makefile.in.xml 2007-06-19 11:49:35.000000000 +0200 ++++ bind-9.5.0a5/bin/named/Makefile.in 2007-06-19 11:49:48.000000000 +0200 +@@ -154,7 +154,7 @@ bind9.xsl.h: bind9.xsl convertxsl.pl + ${PERL} ${srcdir}/convertxsl.pl < ${srcdir}/bind9.xsl > bind9.xsl.h + + depend: bind9.xsl.h +-server.@O@: bind9.xsl.h ++server.o: bind9.xsl.h + + installdirs: + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} diff --git a/bind-bsdcompat.patch b/bind-bsdcompat.patch deleted file mode 100644 index 01ae22b..0000000 --- a/bind-bsdcompat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- bind-9.4.0/lib/isc/unix/socket.c.bsdcompat 2006-06-06 02:56:09.000000000 +0200 -+++ bind-9.4.0/lib/isc/unix/socket.c 2007-03-06 12:53:12.000000000 +0100 -@@ -1492,7 +1492,7 @@ - return (ISC_R_UNEXPECTED); - } - --#ifdef SO_BSDCOMPAT -+#if 0 - if (type != isc_sockettype_unix && - setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT, - (void *)&on, sizeof(on)) < 0) { diff --git a/bind.spec b/bind.spec index 9cd4d25..0ddea33 100644 --- a/bind.spec +++ b/bind.spec @@ -15,8 +15,8 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server. Name: bind License: BSD-like -Version: 9.4.1 -Release: 7%{?dist} +Version: 9.5.0a5 +Release: 1%{?dist} Epoch: 31 Url: http://www.isc.org/products/BIND/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -46,8 +46,6 @@ Source28: config.tar # Common patches Patch0: bind-9.2.0rc3-varrun.patch Patch1: bind-9.3.3rc2-rndckey.patch -Patch2: bind-9.3.1beta2-openssl-suffix.patch -Patch4: bind-bsdcompat.patch Patch5: bind-nonexec.patch Patch6: bind-9.2.2-nsl.patch Patch10: bind-9.3.2b1-PIE.patch @@ -57,12 +55,11 @@ Patch16: bind-9.3.2-redhat_doc.patch Patch32: bind-9.3.2-prctl_set_dumpable.patch Patch52: bind-9.3.3-edns.patch Patch63: bind-9.4.0-dnssec-directory.patch -Patch66: bind-9.4.0-zone-freeze.patch +Patch69: bind-9.5.0-generate-xml.patch # SDB patches Patch11: bind-9.3.2b2-sdbsrc.patch Patch12: bind-9.3.1rc1-sdb.patch -Patch61: bind-9.3.4-sdb-sqlite-src.patch Patch62: bind-9.4.0-sdb-sqlite-bld.patch Patch68: bind-9.4.1-ldap-api.patch @@ -70,10 +67,9 @@ Patch68: bind-9.4.1-ldap-api.patch Patch17: bind-9.3.2b1-fix_sdb_ldap.patch # D-BUS patches -Patch15: bind-9.3.3rc2-dbus.patch +Patch15: bind-9.5.0-dbus.patch Patch22: bind-9.3.1-sdb_dbus.patch Patch23: bind-9.3.1-dbus_archdep_libdir.patch -Patch67: bind-9.4.0-dbus-race-condition.patch # IDN paches Patch64: bind-9.4.0-idnkit-autotools.patch @@ -197,19 +193,17 @@ to the standard in-memory RBT (Red Black Tree) zone database. %endif %prep -%setup -q -n %{name}-%{version}%{?prever} +%setup -q -n %{name}-%{version} # Common patches %patch -p1 -b .varrun %patch1 -p1 -b .key -%patch2 -p1 -b .openssl_suffix -%patch4 -p1 -b .bsdcompat %patch5 -p1 -b .nonexec %patch6 -p1 -b .nsl %patch10 -p1 -b .PIE +%patch69 -p1 -b .generate-xml %if %{SDB} %patch11 -p1 -b .sdbsrc -%patch61 -p1 -b .sdb-sqlite-src # BUILD 'Simplified Database Backend' (SDB) version of named: named_sdb cp -rfp bin/named bin/named_sdb # SDB ldap @@ -251,7 +245,6 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools # # this must follow all dbus patches: # -%patch67 -p1 -b .race-condition 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} @@ -271,7 +264,6 @@ pushd contrib/idn %patch64 -p0 -b .autotools popd %patch65 -p1 -b .idn -%patch66 -p1 -b .freeze :; @@ -405,7 +397,7 @@ find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; touch ${RPM_BUILD_ROOT}/etc/named.conf # configuration files: tar -C ${RPM_BUILD_ROOT} -xf %{SOURCE28} -for f in /etc/named.conf /var/named/{named.ca,named.localhost,named.loopback,named.empty}; do +for f in /etc/named.conf /var/named/{named.ca,named.localhost,named.loopback,named.loopback.ipv6,named.empty}; do touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/$f; done install -m 644 %{SOURCE5} ./rfc1912.txt @@ -417,7 +409,7 @@ install -m 754 bind-chroot-admin ${RPM_BUILD_ROOT}/%{_sbindir} mkdir -p sample/etc sample/var/named/{data,slaves} cp -fp %{SOURCE25} sample/etc/named.conf cp -fp ${RPM_BUILD_ROOT}/etc/named.rfc1912.zones sample/etc/named.rfc1912.zones -cp -fp ${RPM_BUILD_ROOT}/var/named/{named.ca,named.localhost,named.loopback,named.empty} sample/var/named +cp -fp ${RPM_BUILD_ROOT}/var/named/{named.ca,named.localhost,named.loopback,named.loopback.ipv6,named.empty} sample/var/named for f in my.internal.zone.db slaves/my.slave.internal.zone.db slaves/my.ddns.internal.zone.db my.external.zone.db; do echo '@ in soa localhost. root 1 3H 15M 1W 1D ns localhost.' > sample/var/named/$f; @@ -571,6 +563,8 @@ rm -rf ${RPM_BUILD_ROOT} %ghost %config %{chroot_prefix}/var/named/named.localhost %config %verify(not link) /var/named/named.loopback %ghost %config %{chroot_prefix}/var/named/named.loopback +%config %verify(not link) /var/named/named.loopback.ipv6 +%ghost %config %{chroot_prefix}/var/named/named.loopback.ipv6 %config %verify(not link) /var/named/named.empty %ghost %config %{chroot_prefix}/var/named/named.empty %defattr(0644,root,root,0755) @@ -710,6 +704,9 @@ rm -rf ${RPM_BUILD_ROOT} %endif %changelog +* Tue Jun 19 2007 Adam Tkac 31:9.5.0a5-1.fc8 +- updated to latest upstream + * Mon Jun 13 2007 Adam Tkac 31:9.4.1-7.fc8 - marked caching-nameserver as obsolete (#244604) - fixed typo in initscript (causes that named doesn't detect NetworkManager diff --git a/sources b/sources index 607ce30..54793ee 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -09b54d35036cb0423b2e618f21766285 bind-9.4.1.tar.gz +beb3f6e7e8e1f804d1fb79dd11319e1e bind-9.5.0a5.tar.gz dd2b4f4b795a0a989b0a01f93db3a57b bind-chroot.tar.bz2 +c6e0f999e5d387aa2564f1d02ccba6db config.tar 13fef79f99fcefebb51d84b08805de51 libbind-man.tar.gz -ba44f6cbd6d54dcb4d357a44276ba294 config.tar