The branch, master has been updated
       via  5845cc9 s4-dns: return the correct TTL
       via  49e0aef s4-dns: support Samba command line options to the 
dlz_bind.so module
       via  c60ce75 s4-dns: added flags support for dlz_bind9
      from  9f6f1b0 s4-dns: a dlz module for bind9

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5845cc94a99bcb2115c6edbd1711444e640c40d4
Author: Andrew Tridgell <[email protected]>
Date:   Mon Dec 6 17:18:30 2010 +1100

    s4-dns: return the correct TTL
    
    I've now patched the bind9 sdlz layer to cope with multiple TTLS on a
    name/type pair
    
    Autobuild-User: Andrew Tridgell <[email protected]>
    Autobuild-Date: Mon Dec  6 08:12:11 CET 2010 on sn-devel-104

commit 49e0aef3cb74b96ee710d5c705aa48512d81cddc
Author: Andrew Tridgell <[email protected]>
Date:   Mon Dec 6 16:57:12 2010 +1100

    s4-dns: support Samba command line options to the dlz_bind.so module
    
    this allows setting of Samba command line options in named.conf

commit c60ce7503cd3ce445612c8f8b5387b2d8cc98ba8
Author: Andrew Tridgell <[email protected]>
Date:   Mon Dec 6 16:56:18 2010 +1100

    s4-dns: added flags support for dlz_bind9
    
    this will allow us to set the THREADSAFE flag if we make this
    threadsafe. For now we don't set that flag, and let bind9 do the
    locking for us.

-----------------------------------------------------------------------

Summary of changes:
 source4/dns_server/dlz_bind9.c   |   45 ++++++++++++++++++++++++++++++++------
 source4/dns_server/dlz_bind9.h   |    3 ++
 source4/dns_server/wscript_build |    2 +-
 3 files changed, 42 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 0260a79..2631272 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -26,6 +26,7 @@
 #include "dsdb/common/util.h"
 #include "auth/session.h"
 #include "gen_ndr/ndr_dnsp.h"
+#include "lib/cmdline/popt_common.h"
 #include "dlz_bind9.h"
 
 struct dlz_bind9_data {
@@ -44,7 +45,7 @@ struct dlz_bind9_data {
 /*
   return the version of the API
  */
-_PUBLIC_ int dlz_version(void)
+_PUBLIC_ int dlz_version(unsigned int *flags)
 {
        return DLZ_DLOPEN_VERSION;
 }
@@ -179,9 +180,7 @@ static isc_result_t b9_putrr(struct dlz_bind9_data *state,
                }
        }
 
-       /* FIXME: why does dlz insist on all TTL values being the same
-          for the same name? */
-       result = state->putrr(handle, type, /* rec->dwTtlSeconds */ 900, data);
+       result = state->putrr(handle, type, rec->dwTtlSeconds, data);
        if (result != ISC_R_SUCCESS) {
                state->log(ISC_LOG_ERROR, "Failed to put rr");
        }
@@ -210,9 +209,7 @@ static isc_result_t b9_putnamedrr(struct dlz_bind9_data 
*state,
                return ISC_R_NOMEMORY;
        }
 
-       /* FIXME: why does dlz insist on all TTL values being the same
-          for the same name? */
-       result = state->putnamedrr(handle, name, type, /* rec->dwTtlSeconds */ 
900, data);
+       result = state->putnamedrr(handle, name, type, rec->dwTtlSeconds, data);
        if (result != ISC_R_SUCCESS) {
                state->log(ISC_LOG_ERROR, "Failed to put named rr '%s'", name);
        }
@@ -222,6 +219,35 @@ static isc_result_t b9_putnamedrr(struct dlz_bind9_data 
*state,
 
 
 /*
+   parse options
+ */
+static isc_result_t parse_options(struct dlz_bind9_data *state,
+                                 unsigned int argc, char *argv[])
+{
+       int opt;
+       poptContext pc;
+       struct poptOption long_options[] = {
+               POPT_COMMON_SAMBA
+               { NULL }
+       };
+
+       pc = poptGetContext("dlz_bind9", argc, (const char **)argv, 
long_options,
+                           POPT_CONTEXT_KEEP_FIRST);
+
+       while ((opt = poptGetNextOpt(pc)) != -1) {
+               switch (opt) {
+               default:
+                       state->log(ISC_LOG_ERROR, "Invalid option %s: %s",
+                                  poptBadOption(pc, 0), poptStrerror(opt));
+                       return ISC_R_FAILURE;
+               }
+       }
+
+       return ISC_R_SUCCESS;
+}
+
+
+/*
   called to initialise the driver
  */
 _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
@@ -251,6 +277,11 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
        }
        va_end(ap);
 
+       result = parse_options(state, argc, argv);
+       if (result != ISC_R_SUCCESS) {
+               goto failed;
+       }
+
        state->lp = loadparm_init_global(true);
        if (state->lp == NULL) {
                result = ISC_R_NOMEMORY;
diff --git a/source4/dns_server/dlz_bind9.h b/source4/dns_server/dlz_bind9.h
index 8cf0680..34f9605 100644
--- a/source4/dns_server/dlz_bind9.h
+++ b/source4/dns_server/dlz_bind9.h
@@ -29,6 +29,9 @@ typedef uint32_t dns_ttl_t;
 
 #define DLZ_DLOPEN_VERSION 1
 
+/* return this in flags to dlz_version() if thread safe */
+#define DNS_SDLZFLAG_THREADSAFE                0x00000001U
+
 /* result codes */
 #define ISC_R_SUCCESS                  0
 #define ISC_R_NOMEMORY                 1
diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
index a543b12..884d0c1 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -14,4 +14,4 @@ bld.SAMBA_LIBRARY('dlz_bind9',
                   source='dlz_bind9.c',
                   private_library=True,
                   link_name='modules/bind9/dlz_bind9.so',
-                  deps='samba-hostconfig ldbsamba samba-util')
+                  deps='samba-hostconfig ldbsamba samba-util popt POPT_SAMBA')


-- 
Samba Shared Repository

Reply via email to