- 9.6.0b1 release

- don't build ODBC and Berkeley DB DLZ drivers
- end of bind-chroot-admin script, copy config files to chroot manually
- /proc doesn't have to be mounted to chroot
- temporary use libbind from 9.5 series, noone has been released for 9.6
    yet
- removed all deprecated stuff from CVS
This commit is contained in:
Adam Tkac 2008-11-10 16:36:47 +00:00
parent 5691aedf5b
commit e5a309e7ae
14 changed files with 62 additions and 1504 deletions

View File

@ -1,4 +1,5 @@
config-4.tar.bz2
libbind-man.tar.gz
bind-chroot.tar.bz2
bind-9.5.1b2.tar.gz
bind-9.6.0b1.tar.gz
libbind-9.5.1b2.tar.bz2

View File

@ -1,63 +0,0 @@
Written-by: Adam Tkac <atkac@redhat.com>
diff -up bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak bind-9.5.0a6/contrib/dbus/dbus_mgr.c
--- bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak 2007-05-10 07:47:02.000000000 +0200
+++ bind-9.5.0a6/contrib/dbus/dbus_mgr.c 2007-10-18 13:32:19.000000000 +0200
@@ -167,6 +167,9 @@ dbus_mgr_init_dbus(ns_dbus_mgr_t *);
static isc_result_t
dbus_mgr_record_initial_fwdtable(ns_dbus_mgr_t *);
+static
+dns_fwdtable_t *dbus_mgr_get_fwdtable(void);
+
static void
dbus_mgr_free_initial_fwdtable(ns_dbus_mgr_t *);
@@ -272,6 +275,8 @@ dbus_mgr_create
return ISC_R_SUCCESS;
cleanup_mgr:
+ if ( dbus_mgr_get_fwdtable() != NULL)
+ dbus_mgr_free_initial_fwdtable (mgr);
if( mgr->task != 0L )
isc_task_detach(&(mgr->task));
isc_mem_put(mctx, mgr, sizeof(*mgr));
@@ -623,7 +628,7 @@ static void dbus_mgr_record_initial_forw
dns_name_init(&(ifwdr->dn), NULL);
if( dns_name_dupwithoffsets(name, mgr->mctx, &(ifwdr->dn)) != ISC_R_SUCCESS )
- return;
+ goto namedup_err;
ISC_LIST_INIT(ifwdr->sa);
@@ -634,14 +639,27 @@ static void dbus_mgr_record_initial_forw
{
nsa = isc_mem_get(mgr->mctx, sizeof(isc_sockaddr_t));
if( nsa == 0L )
- return;
+ goto nsa_err;
*nsa = *sa;
ISC_LINK_INIT(nsa, link);
ISC_LIST_APPEND(ifwdr->sa, nsa, link);
}
ISC_LINK_INIT(ifwdr, link);
tsearch( ifwdr, &(mgr->ifwdt), dbus_mgr_ifwdr_comparator);
-}
+
+ return;
+
+nsa_err:
+ while ( (sa = ISC_LIST_HEAD (ifwdr->sa)) != NULL) {
+ ISC_LIST_UNLINK (ifwdr->sa, sa, link);
+ isc_mem_put (mgr->mctx, sa, sizeof (*sa));
+ }
+
+namedup_err:
+ isc_mem_put (mgr->mctx, ifwdr, sizeof (*ifwdr));
+
+ return;
+}
static isc_result_t
dbus_mgr_record_initial_fwdtable( ns_dbus_mgr_t *mgr )

View File

@ -1,29 +0,0 @@
Written-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Adam Tkac <atkac@redhat.com>
--- bind-9.5.0a6/contrib/dbus/dbus_service.c.va_end 2007-10-17 14:55:10.000000000 -0400
+++ bind-9.5.0a6/contrib/dbus/dbus_service.c 2007-10-17 14:56:20.000000000 -0400
@@ -200,6 +200,7 @@ dbus_svc_add_filter
}
}
}
+ va_end(va);
return( 1 );
}
@@ -424,6 +425,7 @@ dbus_svc_message_append_args(DBusConnect
if( !dbus_message_append_args_valist( msg, firstType, va ) )
{
if( cs->eh != 0L ) (*(cs->eh))("dbus_svc_send: dbus_message_append_args failed");
+ va_end(va);
return 0;
}
va_end(va);
@@ -488,6 +490,7 @@ dbus_svc_call
va_end(va);
return(0L);
}
+ va_end(va);
return reply;
}

View File

@ -1,13 +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@

View File

@ -1,726 +0,0 @@
--- 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 <named/dbus_mgr.h>
+
/*
* 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;

View File

@ -0,0 +1,12 @@
diff -up bind-9.6.0b1/configure.in.libbind bind-9.6.0b1/configure.in
--- bind-9.6.0b1/configure.in.libbind 2008-11-10 15:43:33.000000000 +0100
+++ bind-9.6.0b1/configure.in 2008-11-10 15:43:51.000000000 +0100
@@ -23,6 +23,8 @@ AC_REVISION($Revision: 1.456 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.59)
+AC_CONFIG_SUBDIRS(lib/bind)
+
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST

View File

@ -1,328 +0,0 @@
#!/bin/bash
#
# Script to control the bind-chroot ISC BIND named(8) server runtime environment.
#
# Usage:
# [ -e | --enable ] [ -d | --disable ] | [ -s --sync ]
#
# -e | --enable: enable the bind-chroot environment
# -d | --disable: disable the bind-chroot environment
# -s | --sync: sync files between the bind chroot and / environments,
# so they are correct for the current state of the bind-chroot
# (enabled / disabled)
# $BIND_CHROOT_PREFIX, default /var/named/chroot, is the location of the chroot.
# $BIND_DIR, default /var/named, is the default un-chrooted bind directory.
#
# Copyright(C) 2006 Jason Vas Dias <jvdias@redhat.com>, Red Hat, Inc.
#
# This software is provided under the terms of the GNU
# General Public License (GPL), as published at:
# http://www.gnu.org/licenses/gpl.html .
#
#
BIND_CHROOT_PREFIX=${BIND_CHROOT_PREFIX:-@BIND_CHROOT_PREFIX@}
BIND_DIR=${BIND_DIR:-@BIND_DIR@}
function usage()
{
echo 'Usage:
-e | --enable: enable the bind-chroot environment
-d | --disable: disable the bind-chroot environment
-s | --sync: sync files between the bind chroot and / environments,
so they are correct for the current state of the bind-chroot
(enabled / disabled)
$BIND_CHROOT_PREFIX, default /var/named/chroot, is the location of the chroot.
$BIND_DIR, default /var/named, is the default un-chrooted bind directory.
';
}
function rootdir()
{
. /etc/sysconfig/named
if [ -n "$ROOTDIR" ]; then
BIND_CHROOT_PREFIX="$ROOTDIR";
BIND_CHROOT_PREFIX=`echo $BIND_CHROOT_PREFIX | sed 's#//*#/#g;s#/$##'`;
if [ -L "$BIND_CHROOT_PREFIX" ]; then
BIND_CHROOT_PREFIX=`/usr/bin/readlink "$BIND_CHROOT_PREFIX"`;
fi
ENABLED=0;
else
ENABLED=1;
fi;
}
function selinux_enabled()
{
if [ -x /usr/sbin/selinuxenabled ]; then
/usr/sbin/selinuxenabled;
return $?;
fi;
return 1;
}
function check_dirs()
{
if [ -z "$BIND_CHROOT_PREFIX" ]; then
usage;
exit 1;
fi;
BIND_DIR=`echo $BIND_DIR | sed 's#//*#/#g;s#/$##'`;
if [ -L "$BIND_DIR" ]; then
BIND_DIR=`/usr/bin/readlink "$BIND_DIR"`;
fi
BIND_CHROOT_PREFIX=`echo $BIND_CHROOT_PREFIX | sed 's#//*#/#g;s#/$##'`;
if [ -L "$BIND_CHROOT_PREFIX" ]; then
BIND_CHROOT_PREFIX=`/usr/bin/readlink "$BIND_CHROOT_PREFIX"`;
fi
if [ -e /etc/sysconfig/named ]; then
/bin/chown root:named /etc/sysconfig/named;
/bin/chmod 0640 /etc/sysconfig/named;
fi
/bin/mkdir -p ${BIND_DIR}/{slaves,data,dynamic};
/bin/chown --preserve-root root:named ${BIND_DIR};
/bin/chown --preserve-root named:named ${BIND_DIR}/{slaves,data,dynamic};
/bin/chmod --preserve-root 750 ${BIND_DIR}
/bin/chmod --preserve-root 770 ${BIND_DIR}/{slaves,data,dynamic};
mkdir -p ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run/named,named/{slaves,data,dynamic}}};
/bin/chown --preserve-root root:named ${BIND_CHROOT_PREFIX}/{etc,dev,var/{run,named/}};
/bin/chown --preserve-root root:named ${BIND_CHROOT_PREFIX}/var;
/bin/chmod --preserve-root 750 ${BIND_CHROOT_PREFIX}/{,etc,dev,var,var/{run,named/}};
/bin/chown --preserve-root named:named ${BIND_CHROOT_PREFIX}/var/{run/named,named/{data,slaves,dynamic}};
/bin/chmod --preserve-root 770 ${BIND_CHROOT_PREFIX}/var/{run/named,named/{slaves,data,dynamic}};
[ ! -e "${BIND_CHROOT_PREFIX}/dev/random" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/random" c 1 8
[ ! -e "${BIND_CHROOT_PREFIX}/dev/zero" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/zero" c 1 5
[ ! -e "${BIND_CHROOT_PREFIX}/dev/null" ] && /bin/mknod "${BIND_CHROOT_PREFIX}/dev/null" c 1 3
[ ! -e "${BIND_CHROOT_PREFIX}/etc/localtime" ] && [ -e /etc/localtime ] && /bin/cp -fp /etc/localtime "${BIND_CHROOT_PREFIX}/etc/localtime";
/bin/chown --preserve-root root:named "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
/bin/chmod --preserve-root 660 "${BIND_CHROOT_PREFIX}"/dev/{random,null,zero};
if selinux_enabled && [ -x /sbin/restorecon ]; then
for dev in random zero null; do
/sbin/restorecon ${BIND_CHROOT_PREFIX}/dev/$dev;
done
fi;
}
check_dirs;
function replace_with_link()
{ # replaces $dst second arg file with link to $src first arg file
if [ $# -lt 2 ]; then
return 1;
fi;
src=$1
dst=$2
if [ -z "$src" ] || [ -z "$dst" ] || [ "$src" = "$dst" ]; then
return 1;
fi
if [ ! -e "$src" ]; then
if [ ! -e "$dst" ]; then
return 1;
else
if [ -L "$dst" ]; then
dstlnk=`/usr/bin/readlink "$dst"`;
if [ ! -e "$dstlnk" ] ; then
return 1;
fi
rm -f "$dst";
/bin/cp -fp "$dstlnk" "$dst";
fi;
/bin/mv "$dst" "$src";
fi
fi
if [ -e "$dst" ]; then
if [ ! -L "$dst" ]; then
if [ ! -s "$dst" ] || /usr/bin/cmp "$dst" "$src" > /dev/null 2>&1; then
/bin/rm -f "$dst";
else
if [ "$src" -nt "$dst" ] || [ ! "$dst" -nt "$src" ] ; then
/bin/mv "$dst" "$dst".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
else # [ "$dst" -nt "$src" ]
/bin/mv "$src" "$src".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
/bin/mv "$dst" "$src";
fi;
fi;
else
dstlnk=`/usr/bin/readlink "$dst"`
if [ "$dstlnk" != $src ]; then
/bin/rm -f $dst;
if ! /usr/bin/cmp "$dstlnk" "$src" > /dev/null 2>&1; then
if [ "$dstlnk" != "$dst" ] && [ -s $dstlnk ]; then
if [ "$dstlnk" -nt "$src" ] || [ ! "$dstlnk" -nt "$src" ] ; then
/bin/cp -fp "$dstlnk" "$dst".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
else
/bin/mv "$src" "$src".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
/bin/cp -fp "$dstlnk" "$src";
fi;
fi;
fi;
else
return 0;
fi;
fi;
fi;
/bin/ln -sf "$src" "$dst";
return $?;
}
function replace_with_file()
{
if [ $# -lt 2 ]; then
return 1;
fi;
src=$1;
dst=$2;
if [ -z "$src" ] || [ -z "$dst" ] || [ "$src" = "$dst" ]; then
return 1;
fi
if [ ! -e "$src" ]; then
if [ -e "$dst" ]; then
/bin/rm -f $dst;
fi;
return 1;
fi;
if [ -e "$dst" ]; then
if [ ! -L "$dst" ]; then
/bin/mv "$dst" "$dst".`/bin/date +'%Y-%m-%d_%H-%M-%S.%N'`;
else
/bin/rm -f "$dst";
fi;
fi;
/bin/mv -f "$src" "$dst";
}
function enable_bind_chroot()
{
rootdir;
if /bin/egrep -q '^ROOTDIR=' /etc/sysconfig/named; then
/bin/sed -i -e 's#^ROOTDIR=.*$#ROOTDIR='${BIND_CHROOT_PREFIX}'#' /etc/sysconfig/named ;
else
echo 'ROOTDIR='${BIND_CHROOT_PREFIX} >> /etc/sysconfig/named;
fi;
}
function disable_bind_chroot()
{
/bin/sed -i -e '/^ROOTDIR=/d' /etc/sysconfig/named;
}
function sync_files()
{
rootdir;
shopt -q nullglob;
ng=$?
shopt -s nullglob;
pfx=''
changed=`/bin/mktemp /tmp/XXXXXX`;
rm -f $changed
if [ $ENABLED -eq 0 ] ; then # chroot is enabled
/usr/bin/find /{etc/{named.*,rndc.*},${BIND_DIR#/}{/*,/data/*,/slaves/*,/dynamic/*}} /var/log/named.log -maxdepth 0 -type f |
while read f;
do
replace_with_link ${BIND_CHROOT_PREFIX}$f $f;
[ ! -e $changed ] && touch $changed;
done;
/usr/bin/find /etc/{named.*,rndc.*}.rpmsave ${BIND_DIR}/*.rpmsave -maxdepth 0 -type l 2>/dev/null |
while read f;
do
/bin/rm -f $f >/dev/null 2>&1;
done
pfx=${BIND_CHROOT_PREFIX}
else # chroot is disabled
/usr/bin/find /var/named/chroot/{etc/{named.*,rndc.*},var/{named{/*,/data/*,/slaves/*,/dynamic/*},log/named.log}} -maxdepth 0 |
while read f;
do
if [ ! -d "$f" ]; then
replace_with_file $f ${f#$BIND_CHROOT_PREFIX};
[ ! -e $changed ] && touch $changed;
fi;
done
fi;
if [ ! -e ${pfx}/etc/rndc.key ]; then
echo 'key "rndckey" {
algorithm hmac-md5;
secret "'`/usr/sbin/dns-keygen`'";
};' > /etc/rndc.key;
elif /bin/egrep -q '@KEY@' /etc/rndc.key; then
/bin/sed -i -e 's^@KEY@^'`/usr/sbin/dns-keygen`'^' /etc/rndc.key ;
fi
chown -h root:named /var/named/* >/dev/null 2>&1;
chown -h root:named ${BIND_CHROOT_PREFIX}/var/named/* >/dev/null 2>&1;
chown -h root:named /etc/{named,rndc}.* >/dev/null 2>&1;
chown -h root:named ${BIND_CHROOT_PREFIX}/etc/{named,rndc}.* >/dev/null 2>&1;
chown -h named:named /var/log/named.log >/dev/null 2>&1;
chown -h named:named ${BIND_CHROOT_PREFIX}/var/log/named.log >/dev/null 2>&1;
chmod 750 ${pfx}/var/named >/dev/null 2>&1;
chmod 640 ${pfx}/var/named/* >/dev/null 2>&1;
chmod 750 ${pfx}/var/named/*/. >/dev/null 2>&1;
chmod 660 ${pfx}/var/log/named.log >/dev/null 2>&1;
chown -h named:named /var/named/{data{,/*},slaves{,/*},dynamic{,/*}} >/dev/null 2>&1;
chown -h named:named ${BIND_CHROOT_PREFIX}/var/named/{data{,/*},slaves{,/*},dynamic{,/*}} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data,slaves,dynamic} >/dev/null 2>&1;
chmod 660 ${pfx}/var/named/{data/*,slaves/*,dynamic/*} >/dev/null 2>&1;
chmod 770 ${pfx}/var/named/{data/*/.,slaves/*/.,dynamic/*/.} >/dev/null 2>&1;
if [ -e $changed ]; then
if selinux_enabled && [ -x /sbin/restorecon ]; then
/sbin/restorecon -R ${BIND_CHROOT_PREFIX}/{dev,etc,var} >/dev/null 2>&1;
/sbin/restorecon /etc/named.* >/dev/null 2>&1;
/sbin/restorecon /etc/rndc.key >/dev/null 2>&1;
/sbin/restorecon /etc/rndc.conf >/dev/null 2>&1;
for all in `ls /var/named`; do
if [ "x$all" != "xchroot" ]; then
restorecon -R /var/named/"$all" > /dev/null 2>&1;
fi
done
fi;
/sbin/service named try-restart
rm -f $changed;
fi;
if [ $ng -eq 1 ]; then
shopt -u nullglob;
fi;
}
function clean_root()
{
if [ $ENABLED -eq 0 ] ; then # chroot is disabled, clean it up
if [ -n "${BIND_CHROOT_PREFIX}" -a "x${BIND_CHROOT_PREFIX}" != "x/" ]; then
rm -r ${BIND_CHROOT_PREFIX}/dev >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/etc >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run/named >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/run >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/slaves >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/data >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named/dynamic >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/named >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var/tmp >/dev/null 2>&1 || :;
rmdir ${BIND_CHROOT_PREFIX}/var >/dev/null 2>&1 || :;
fi;
fi;
}
case $1 in
-e|--enable)
enable_bind_chroot;
sync_files;
exit $?;
;;
-d|--disable)
disable_bind_chroot;
sync_files;
/bin/umount ${BIND_CHROOT_PREFIX}/proc >/dev/null 2>&1 || :;
/bin/umount ${BIND_CHROOT_PREFIX}/var/run/dbus >/dev/null 2>&1 || :;
clean_root;
exit $?;
;;
-s|--sync)
sync_files;
exit $?;
;;
-q)
;;
*)
usage;
exit 1;
esac

134
bind.spec
View File

@ -2,13 +2,12 @@
# Red Hat BIND package .spec file
#
%define PREVER b2
%define PREVER b1
%define VERSION %{version}%{PREVER}
%{?!SDB: %define SDB 1}
%{?!LIBBIND: %define LIBBIND 1}
%{?!test: %define test 0}
%{?!WITH_DBUS: %define WITH_DBUS 0} # + dynamic forwarder table management with D-BUS
%{?!bind_uid: %define bind_uid 25}
%{?!bind_gid: %define bind_gid 25}
%{?!GSSTSIG: %define GSSTSIG 1}
@ -18,8 +17,8 @@
Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server
Name: bind
License: ISC
Version: 9.5.1
Release: 0.8.4.%{PREVER}%{?dist}
Version: 9.6.0
Release: 0.1.%{PREVER}%{?dist}
Epoch: 32
Url: http://www.isc.org/products/BIND/
Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -34,18 +33,19 @@ Source6: bind-chroot.tar.bz2
Source7: bind-9.3.1rc1-sdb_tools-Makefile.in
Source8: dnszone.schema
Source9: libbind-man.tar.gz
Source10: named-dbus.conf
Source11: named.service
Source12: README.sdb_pgsql
Source13: namedSetForwarders
Source14: namedGetForwarders
Source21: Copyright.caching-nameserver
Source22: bind-chroot-admin.in
Source24: libbind.pc
Source25: named.conf.sample
Source28: config-4.tar.bz2
Source30: ldap2zone.c
%if %{LIBBIND}
# XXX libbind is going to be a separate product in 9.6 series but it wasn't
# released yet. Use libbind from 9.5 series
Source31: libbind-9.5.1b2.tar.bz2
%endif
# Common patches
Patch0: bind-9.2.0rc3-varrun.patch
Patch1: bind-9.3.3rc2-rndckey.patch
@ -58,6 +58,9 @@ Patch72: bind-9.5-dlz-64bit.patch
Patch87: bind-9.5-parallel-build.patch
Patch95: bind-95-sdlz-include.patch
Patch96: bind-95-rh469440.patch
%if %{LIBBIND}
Patch97: bind-96-temporary-libbind.patch
%endif
# SDB patches
Patch11: bind-9.3.2b2-sdbsrc.patch
@ -67,12 +70,6 @@ Patch62: bind-9.5-sdb-sqlite-bld.patch
# needs inpection
Patch17: bind-9.3.2b1-fix_sdb_ldap.patch
# D-BUS patches
Patch15: bind-9.5.0-dbus.patch
Patch23: bind-9.5-dbus_archdep_libdir.patch
Patch81: bind-9.5-dbus-leak.patch
Patch82: bind-9.5-dbus-va_end.patch
# IDN paches
Patch73: bind-9.5-libidn.patch
Patch83: bind-9.5-libidn2.patch
@ -90,10 +87,6 @@ BuildRequires: openssl-devel, libtool, autoconf, pkgconfig, libcap-devel
BuildRequires: libidn-devel
%if %{SDB}
BuildRequires: openldap-devel, postgresql-devel, sqlite-devel, mysql-devel
BuildRequires: db4-devel unixODBC-devel
%endif
%if %{WITH_DBUS}
BuildRequires: dbus-devel
%endif
%if %{test}
BuildRequires: net-tools
@ -176,6 +169,14 @@ Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
%prep
%setup -q -n %{name}-%{VERSION}
%if %{LIBBIND}
# XXX temporary libbind workaround
pushd lib
tar xf %{SOURCE31}
popd
sed -i 's/SUBDIRS\(.*\)/SUBDIRS\1 lib\/bind/' Makefile.in
%endif
# Common patches
%patch0 -p1 -b .varrun
%patch1 -p1 -b .key
@ -208,23 +209,11 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools
%endif
%if %{LIBBIND}
%patch13 -p1 -b .fix_libbind_includedir
%endif
%if %{WITH_DBUS}
%patch15 -p1 -b .dbus
%patch23 -p1 -b .dbus_archdep_libdir
%patch81 -p1 -b .leak
%patch82 -p1 -b .va_end
%patch97 -p1 -b .temporary-libbind
%endif
%if %{SDB}
%patch17 -p1 -b .fix_sdb_ldap
%endif
%if %{WITH_DBUS}
#
# this must follow all dbus patches:
#
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
%endif
%if %{SDB}
%patch62 -p1 -b .sdb-sqlite-bld
%endif
@ -251,8 +240,8 @@ done
%build
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
export CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
export STD_CDEFINES="$CPPFLAGS"
export CPPFLAGS="$CPPFLAGS -DLDAP_DEPRECATED -D_GNU_SOURCE"
export STD_CFLAGS="$CPPFLAGS"
sed -i -e \
's/RELEASEVER=\(.*\)/RELEASEVER=\1-RedHat-%{version}-%{release}/' \
@ -260,13 +249,6 @@ version
libtoolize -c -f; aclocal --force; autoheader -f; autoconf -f
%if %{WITH_DBUS}
%ifarch s390x x86_64 ppc64 sparc64
# every 64-bit arch EXCEPT ia64 has dbus architecture dependant
# includes in /usr/lib64/dbus-1.0/include
export DBUS_ARCHDEP_LIBDIR=lib64
%endif
%endif
if pkg-config openssl ; then
export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
export CPPFLAGS="$CPPFLAGS `pkg-config --cflags-only-I openssl`"
@ -280,17 +262,11 @@ fi
--with-pic \
--disable-static \
--disable-openssl-version-check \
--enable-getifaddrs=glibc \
%if %{LIBBIND}
--enable-libbind \
%endif
%if %{SDB}
--with-dlz-ldap=yes \
--with-dlz-postgres=yes \
--with-dlz-mysql=yes \
--with-dlz-filesystem=yes \
--with-dlz-odbc=yes \
--with-dlz-bdb=yes \
%endif
%if %{GSSTSIG}
--with-gssapi=yes \
@ -346,13 +322,10 @@ mkdir -p ${RPM_BUILD_ROOT}/%{chroot_prefix}
tar --no-same-owner -jxvf %{SOURCE6} --directory ${RPM_BUILD_ROOT}/%{chroot_prefix}
# these are required to prevent them being erased during upgrade of previous
# versions that included them (bug #130121):
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/named.conf
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/named.rfc1912.zones
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/rndc.key
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/null
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/random
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/dev/zero
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/var/log/named.log
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/etc/localtime
#end chroot
make DESTDIR=${RPM_BUILD_ROOT} install
@ -373,14 +346,6 @@ gunzip < %{SOURCE9} | (cd ${RPM_BUILD_ROOT}/usr/share; tar -xpf -)
mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}/pkgconfig
install -m 644 %{SOURCE24} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libbind.pc
%endif
%if %{WITH_DBUS}
mkdir -p ${RPM_BUILD_ROOT}/etc/dbus-1/system.d
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/dbus-1/services
cp -fp %{SOURCE10} ${RPM_BUILD_ROOT}/etc/dbus-1/system.d/named.conf
cp -fp %{SOURCE11} ${RPM_BUILD_ROOT}%{_datadir}/dbus-1/services/named.service
cp -fp %{SOURCE13} ${RPM_BUILD_ROOT}%{_sbindir}/namedSetForwarders
cp -fp %{SOURCE14} ${RPM_BUILD_ROOT}%{_sbindir}/namedGetForwarders
%endif
# Files required to run test-suite outside of build tree:
cp -fp config.h ${RPM_BUILD_ROOT}/%{_includedir}/bind9
@ -398,17 +363,10 @@ touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/named.log
# configuration files:
tar -C ${RPM_BUILD_ROOT} -xjf %{SOURCE28}
for f in /etc/named.conf /var/named/{named.ca,named.localhost,named.loopback,named.empty}; do
touch ${RPM_BUILD_ROOT}/%{chroot_prefix}/$f;
done
install -m 644 %{SOURCE5} ./rfc1912.txt
install -m 644 %{SOURCE21} ./Copyright
# bind-chroot-admin script:
sed -e 's^@BIND_CHROOT_PREFIX@^'%{chroot_prefix}'^;s^@BIND_DIR@^'%{bind_dir}'^' < %{SOURCE22} > bind-chroot-admin;
install -m 755 bind-chroot-admin ${RPM_BUILD_ROOT}/%{_sbindir}
# sample bind configuration files for %doc:
mkdir -p sample/etc sample/var/named/{data,slaves}
install -m 644 %{SOURCE25} sample/etc/named.conf
@ -438,7 +396,6 @@ if [ "$1" -eq 1 ]; then
# rndc.key has to have correct perms and ownership, CVE-2007-6283
[ -e /etc/rndc.key ] && chown root:named /etc/rndc.key
[ -e /etc/rndc.key ] && chmod 0640 /etc/rndc.key
[ -x /usr/sbin/bind-chroot-admin ] && /usr/sbin/bind-chroot-admin --sync;
fi
:;
@ -477,7 +434,14 @@ fi
%post chroot
if [ "$1" -gt 0 ]; then
/usr/sbin/bind-chroot-admin --enable > /dev/null 2>&1;
[ -e %{chroot_prefix}/dev/random ] || \
/bin/mknod %{chroot_prefix}/dev/random c 1 8
[ -e %{chroot_prefix}/dev/zero ] || \
/bin/mknod %{chroot_prefix}/dev/zero c 1 5
[ -e %{chroot_prefix}/dev/zero ] || \
/bin/mknod %{chroot_prefix}/dev/null c 1 3
rm -f %{chroot_prefix}/etc/localtime
cp /etc/localtime %{chroot_prefix}/etc/localtime
fi;
:;
@ -489,7 +453,8 @@ fi;
%preun chroot
if [ "$1" -eq 0 ]; then
/usr/sbin/bind-chroot-admin --disable > /dev/null 2>&1;
rm -f %{chroot_prefix}/dev/{random,zero,null}
rm -f %{chroot_prefix}/etc/localtime
fi
:;
@ -549,13 +514,6 @@ rm -rf ${RPM_BUILD_ROOT}
%doc sample/
%doc Copyright
%doc rfc1912.txt
%if %{WITH_DBUS}
%doc contrib/dbus/README.DBUS
%config %{_sysconfdir}/dbus-1/system.d/named.conf
%config %{_datadir}/dbus-1/services/named.service
%{_sbindir}/namedGetForwarders
%{_sbindir}/namedSetForwarders
%endif
%if %{SDB}
%files sdb
@ -607,20 +565,14 @@ rm -rf ${RPM_BUILD_ROOT}
%endif
%files chroot
%defattr(0640,root,named,0750)
%dir %{chroot_prefix}
%dir %{chroot_prefix}/dev
%dir %{chroot_prefix}/etc
%ghost %config(noreplace) %{chroot_prefix}/etc/named.conf
%ghost %config(noreplace) %{chroot_prefix}/etc/named.rfc1912.zones
%ghost %config(noreplace) %{chroot_prefix}/etc/rndc.key
%dir %{chroot_prefix}/var
%dir %{chroot_prefix}/var/run
%dir %{chroot_prefix}/var/named
%ghost %config %{chroot_prefix}/var/named/named.ca
%ghost %config %{chroot_prefix}/var/named/named.localhost
%ghost %config %{chroot_prefix}/var/named/named.loopback
%ghost %config %{chroot_prefix}/var/named/named.empty
%dir %{chroot_prefix}/var/run
%dir %{chroot_prefix}/var/named
%defattr(0660,named,named,0770)
%dir %{chroot_prefix}/var/named/slaves
%dir %{chroot_prefix}/var/named/data
@ -628,14 +580,20 @@ rm -rf ${RPM_BUILD_ROOT}
%dir %{chroot_prefix}/var/run/named
%dir %{chroot_prefix}/var/tmp
%dir %{chroot_prefix}/var/log
%ghost %{chroot_prefix}/var/log/named.log
%defattr(-,root,root,-)
%ghost %{chroot_prefix}/dev/null
%ghost %{chroot_prefix}/dev/random
%ghost %{chroot_prefix}/dev/zero
%defattr(-,root,root,-)
%{_sbindir}/bind-chroot-admin
%ghost %{chroot_prefix}/etc/localtime
%changelog
* Mon Nov 10 2008 Adam Tkac <atkac redhat com> 32:9.6.0-0.1.b1
- 9.6.0b1 release
- don't build ODBC and Berkeley DB DLZ drivers
- end of bind-chroot-admin script, copy config files to chroot manually
- /proc doesn't have to be mounted to chroot
- temporary use libbind from 9.5 series, noone has been released for 9.6 yet
* Mon Nov 03 2008 Adam Tkac <atkac redhat com> 32:9.5.1-0.8.4.b2
- dig/host: use only IPv4 addresses when -4 option is specified (#469440)

View File

@ -1,20 +0,0 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<servicedir>/usr/share/dbus-1/services</servicedir>
<policy user="named">
<allow own="com.redhat.named"/>
<allow send_interface="com.redhat.named"/>
<allow send_destination="com.redhat.named"/>
</policy>
<policy user="root">
<allow send_interface="com.redhat.named"/>
<allow send_destination="com.redhat.named"/>
</policy>
<policy context="default">
<deny own="com.redhat.named"/>
<deny send_destination="com.redhat.named"/>
<deny send_interface="com.redhat.named"/>
</policy>
</busconfig>

View File

@ -84,17 +84,6 @@ start()
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
ckcf_options="$ckcf_options -t ${ROOTDIR}";
[ -s /etc/localtime ] && cp -fp /etc/localtime ${ROOTDIR}/etc/localtime;
[ -d ${ROOTDIR}/proc ] || mkdir -p ${ROOTDIR}/proc;
if ! egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
mount --bind -n /proc ${ROOTDIR}/proc >/dev/null 2>&1;
fi
if [ ! -z $dbusEnabled ]; then
if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
mkdir -p ${ROOTDIR}/var/run/dbus
[ -d /var/run/dbus ] || mkdir -p /var/run/dbus;
mount --bind -n /var/run/dbus ${ROOTDIR}/var/run/dbus > /dev/null 2>&1;
fi;
fi;
fi
RETVAL=0
@ -160,17 +149,6 @@ stop() {
rm -f /var/run/{named,named-sdb}.pid
fi;
# unmount mounted filesystems/directories
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
if egrep -q '^/proc[[:space:]]+'${ROOTDIR}'/proc' /proc/mounts; then
umount ${ROOTDIR}/proc >/dev/null 2>&1
fi
if [ ! -z $dbusEnabled ]; then
if egrep -q '^/[^[:space:]]+[[:space:]]+'${ROOTDIR}'/var/run/dbus' /proc/mounts; then
umount ${ROOTDIR}/var/run/dbus > /dev/null 2>&1
fi;
fi;
fi;
if [ $RETVAL -eq 0 ]; then
success
else

View File

@ -1,3 +0,0 @@
[D-BUS Service]
Name=com.redhat.named
Exec=/usr/sbin/named

View File

@ -1,158 +0,0 @@
#!/bin/sh
#
# This script uses the named D-BUS support, which must be enabled in
# the running named with the named '-D' option, to get and print the
# list of forwarding zones in the running server.
#
# It accepts an optional <zone> first argument which is the DNS name
# of the zone whose forwarders (if any) will be retrieved.
#
# If no zone argument is specified, all forwarding zones will be listed.
#
# Usage: namedGetForwarders [-n -r] [ <zone> ]
# -n : output forward zone statements for named.conf
# -r : output in resolv.conf format
# : no -r or -n: just list the forwarders
#
# This script is based on perl script of Jason Vas Dias <jvdias@redhat.com>.
#
# Copyright(C) Baris Cicek <baris@nerd.com.tr> Nerd Software. 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
# the Free Software Foundation at
# http://www.fsf.org/licensing/licenses/gpl.txt
# and included in this software distribution as the "LICENSE" file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
declare -a zones;
declare -a servers;
declare -a ports;
declare -a only;
output_format='plain';
zonecnt=0;
function push () {
local array
array=( `echo $1` );
array[${#array[*]}]=$2;
echo ${array[@]};
}
function concat () {
local string
while [ $# -gt 0 ]; do
string=${string}$1;
shift;
done
echo $string;
}
if [ $# -ge 0 ]; then
if [ "$1" == "-r" ]; then
output_format='resolv';
shift;
elif [ "$1" == "-n" ]; then
output_format='named';
shift;
fi
zone="";
for arg in $*; do
zone=$(push "$zone" " string:'$arg'");
done
fi
DNS=`/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=20000 --dest=com.redhat.named /com/redhat/named com.redhat.named.text.GetForwarders $zone`;
if [ $? -ne 0 ]; then
echo -e "dbus-send failed: $? $!";
exit 1;
fi
IFS=$'\n'
for line in $DNS; do
match_ip=$( echo "$line" | awk --re-interval '{ match ($0, /([[:digit:]]{1,3})\.([[:digit:]]{1,3})\.([[:digit:]]{1,3})\.([[:digit:]]{1,3})/, a); printf "%s.%s.%s.%s", substr($0, a[1, "start"], a[1, "length"]), substr($0, a[2, "start"], a[2, "length"]), substr($0, a[3, "start"], a[3, "length"]), substr($0, a[4, "start"], a[4, "length"]);}' );
match_port=$( echo "$line" | awk '{ match ($0, /\"([[:digit:]]+)\"$/, a); printf "%s", substr($0, a[1, "start"], a[1,"length"]);}' );
match_string=$( echo "$line" | awk '{ match ($0, /string.+\"([^\"]+)\"$/, a); printf "%s", substr($0, a[1, "start"], a[1,"length"]);}' );
if [ "$match_ip" != "" ] && [ "$match_ip" != "..." ]; then
servers[$zonecnt]=$(push "${servers[$zonecnt]}" "$match_ip");
elif [ "$match_port" != "" ]; then
ports[$zonecnt]=$(push "${ports[$zonecnt]}" "$match_port");
elif [ "$match_string" == "only" ]; then
only[$zonecnt]="1";
elif [ "$match_string" != "" ] && [ "$match_string" != "first" ]; then
zonecnt=$((zonecnt + 1));
zones[$zonecnt]="$match_string";
fi
done
if [ "$output_format" == "resolv" ]; then
# resolv.conf style:
search_line='search';
nameserver_lines='';
for index in $(seq 1 $zonecnt); do
if [ "` echo ${zones[$index]} | awk ' /\.in-addr\.arpa$/ { print $0 }'`" == '' ]; then
search_line=$(push "$search_line" "${zones[$index]}");
fi
IFS=$' ';
for ns in ${servers[$index]}; do
nameserver_lines=$(concat "$nameserver_lines" "\nnameserver " "$ns");
done
done
echo -n $search_line;
echo -e $nameserver_lines;
elif [ "$output_format" == "named" ]; then
# named.conf style:
zone_lines='';
for index in $(seq 1 $zonecnt); do
zone_line=$(concat 'zone "' "${zones[$index]}" '." IN { type forward; forwarders { ');
srvcnt=1;
IFS=$' ';
for ns in ${servers[$index]}; do
srvport=$(eval "echo ${ports[$index]} | awk '{ print \$${srvcnt} }'");
if [ "$srvport" != "53" ]; then
zone_line=$(concat "$zone_line" " $ns port $srvport;");
else
zone_line=$(concat "$zone_line" " $ns;");
fi
srvcnt=$((srvcnt+1));
done
zone_line=$(concat "$zone_line" " };");
if [ "${only[$index]}" == '1' ]; then
zone_line=$(concat "$zone_line" " forward only;");
fi
zone_line=$(concat "$zone_line" " };");
zone_lines=$(concat "$zone_lines" "$zone_line\n");
done
echo -e ${zone_lines%\\n};
elif [ "$output_format" == "plain" ]; then
# just list:
output='';
for index in $(seq 1 $zonecnt); do
output=$(concat "$output" "${zones[$index]}" "\n");
if [ "${only[$index]}" == "1" ]; then
output=$(concat "$output" "\t" "forward only" "\n");
fi
srvcnt=1;
IFS=$' ';
for ns in ${servers[$index]}; do
srvport=$(eval "echo ${ports[$index]} | awk '{ print \$${srvcnt} }'");
if [ "$srvport" != "53" ]; then
output=$(concat "$output" "\t" "$ns:$srvport" "\n");
else
output=$(concat "$output" "\t" "$ns" "\n");
fi
srvcnt=$((srvcnt+1));
done
done
echo -e ${output%\\n};
fi

View File

@ -1,52 +0,0 @@
#!/bin/bash
#
# This script uses the named D-BUS support, which must be enabled in
# the running named with the named '-D' option, to set the forwarding zones
# in the running server.
#
# One zone argument is required, followed by any number of server IP (v4 or v6)
# addresses. If the server IP address list is empty, any forwarders for the zone
# will be removed.
#
# Usage:
# SetForwarders [ -t <'first' | 'only'> ] <zone> [ <server IP> [...<server IP>] ]
#
# Copyright(C) Jason Vas Dias<jvdias@redhat.com> Red Hat Inc. 2005
#
# 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
# the Free Software Foundation at
# http://www.fsf.org/licensing/licenses/gpl.txt
# and included in this software distribution as the "LICENSE" file.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
usage() { echo "Usage: SetForwarders [ -t <'first' | 'only'> ] <zone> [ <server> [...<server>] ]"; }
type=''
if [ $# -eq 0 ]; then
usage;
exit 1;
elif [ "$1" = "-t" ]; then
if [ $# -lt 2 ]; then
echo '-t option requires an argument.'
exit 1;
fi;
type=$2;
shift 2;
fi;
if [ $# -lt 1 ]; then
echo '<zone> first argument required.'
exit 1;
fi;
zone='string:'"$1";
shift;
servers='';
if [ $# -gt 0 ]; then
for svr in $*; do
servers="$servers string:$svr";
done
fi;
dbus-send --system --type=method_call --print-reply --reply-timeout=20000 --dest=com.redhat.named /com/redhat/named com.redhat.named.text.SetForwarders $zone $type $servers;

View File

@ -1,4 +1,5 @@
de68e10e91e05ab100be879b5bcaa6cb config-4.tar.bz2
13fef79f99fcefebb51d84b08805de51 libbind-man.tar.gz
4faa4395b955e5f8a3d50f308b9fabc8 bind-chroot.tar.bz2
7c2ca5b5c49b6259498a3822142afd34 bind-9.5.1b2.tar.gz
29d868ead2c985f522e2edf6c5152310 bind-9.6.0b1.tar.gz
3d1dad3630ec3510c8ab0ac2217a3317 libbind-9.5.1b2.tar.bz2