The branch, v3-6-test has been updated
       via  f2a4eec s3-net: Fix bug #7690: retry DNS updates when connection to 
one nameserver has failed.
       via  061b1e1 lib/addns: move DNS client library to the main directory.
      from  4a40f71 s4-smbtorture: check driver_version equality as well.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit f2a4eeca185d40bc4f94522c82215349f1d95c73
Author: Günther Deschner <g...@samba.org>
Date:   Thu Jan 6 16:23:54 2011 +0100

    s3-net: Fix bug #7690: retry DNS updates when connection to one nameserver 
has failed.
    
    Initial patch from Patrik Martinsson <patrik.martins...@smhi.se>.
    
    Guenther
    
    Autobuild-User: Günther Deschner <g...@samba.org>
    Autobuild-Date: Thu Jan  6 17:29:11 CET 2011 on sn-devel-104
    (cherry picked from commit fa1fd85eea549d2944974ddbc67e21ef9231c49b)

commit 061b1e1dcc94f119a594944f70cf7c4aa148335b
Author: Günther Deschner <g...@samba.org>
Date:   Thu Jan 6 14:53:04 2011 +0100

    lib/addns: move DNS client library to the main directory.
    
    Guenther
    (cherry picked from commit 7ee75c95481f0d13598577361d18e96cb8394b9c)

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

Summary of changes:
 {source3/libaddns => lib/addns}/addns.h       |    0
 {source3/libaddns => lib/addns}/dns.h         |    0
 {source3/libaddns => lib/addns}/dnserr.h      |    0
 {source3/libaddns => lib/addns}/dnsgss.c      |    0
 {source3/libaddns => lib/addns}/dnsmarshall.c |    0
 {source3/libaddns => lib/addns}/dnsrecord.c   |    0
 {source3/libaddns => lib/addns}/dnssock.c     |    0
 {source3/libaddns => lib/addns}/dnsutils.c    |    0
 {source3/libaddns => lib/addns}/error.c       |    0
 {source3/libaddns => lib/addns}/wscript_build |    0
 source3/Makefile.in                           |    6 ++--
 source3/configure.in                          |    2 +-
 source3/utils/net_ads.c                       |   27 +++++++++++++++++++-----
 source3/wscript_build                         |    2 +-
 14 files changed, 26 insertions(+), 11 deletions(-)
 rename {source3/libaddns => lib/addns}/addns.h (100%)
 rename {source3/libaddns => lib/addns}/dns.h (100%)
 rename {source3/libaddns => lib/addns}/dnserr.h (100%)
 rename {source3/libaddns => lib/addns}/dnsgss.c (100%)
 rename {source3/libaddns => lib/addns}/dnsmarshall.c (100%)
 rename {source3/libaddns => lib/addns}/dnsrecord.c (100%)
 rename {source3/libaddns => lib/addns}/dnssock.c (100%)
 rename {source3/libaddns => lib/addns}/dnsutils.c (100%)
 rename {source3/libaddns => lib/addns}/error.c (100%)
 rename {source3/libaddns => lib/addns}/wscript_build (100%)


Changeset truncated at 500 lines:

diff --git a/source3/libaddns/addns.h b/lib/addns/addns.h
similarity index 100%
rename from source3/libaddns/addns.h
rename to lib/addns/addns.h
diff --git a/source3/libaddns/dns.h b/lib/addns/dns.h
similarity index 100%
rename from source3/libaddns/dns.h
rename to lib/addns/dns.h
diff --git a/source3/libaddns/dnserr.h b/lib/addns/dnserr.h
similarity index 100%
rename from source3/libaddns/dnserr.h
rename to lib/addns/dnserr.h
diff --git a/source3/libaddns/dnsgss.c b/lib/addns/dnsgss.c
similarity index 100%
rename from source3/libaddns/dnsgss.c
rename to lib/addns/dnsgss.c
diff --git a/source3/libaddns/dnsmarshall.c b/lib/addns/dnsmarshall.c
similarity index 100%
rename from source3/libaddns/dnsmarshall.c
rename to lib/addns/dnsmarshall.c
diff --git a/source3/libaddns/dnsrecord.c b/lib/addns/dnsrecord.c
similarity index 100%
rename from source3/libaddns/dnsrecord.c
rename to lib/addns/dnsrecord.c
diff --git a/source3/libaddns/dnssock.c b/lib/addns/dnssock.c
similarity index 100%
rename from source3/libaddns/dnssock.c
rename to lib/addns/dnssock.c
diff --git a/source3/libaddns/dnsutils.c b/lib/addns/dnsutils.c
similarity index 100%
rename from source3/libaddns/dnsutils.c
rename to lib/addns/dnsutils.c
diff --git a/source3/libaddns/error.c b/lib/addns/error.c
similarity index 100%
rename from source3/libaddns/error.c
rename to lib/addns/error.c
diff --git a/source3/libaddns/wscript_build b/lib/addns/wscript_build
similarity index 100%
rename from source3/libaddns/wscript_build
rename to lib/addns/wscript_build
diff --git a/source3/Makefile.in b/source3/Makefile.in
index cfcadce..376a2f1 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -492,8 +492,8 @@ PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)
 
 KRBCLIENT_OBJ = libads/kerberos.o libads/ads_status.o
 
-LIBADDNS_OBJ0 = libaddns/dnsrecord.o libaddns/dnsutils.o  libaddns/dnssock.o \
-              libaddns/dnsgss.o libaddns/dnsmarshall.o libaddns/error.o
+LIBADDNS_OBJ0 = ../lib/addns/dnsrecord.o ../lib/addns/dnsutils.o  
../lib/addns/dnssock.o \
+              ../lib/addns/dnsgss.o ../lib/addns/dnsmarshall.o 
../lib/addns/error.o
 LIBADDNS_OBJ = $(LIBADDNS_OBJ0) $(SOCKET_WRAPPER_OBJ)
 
 GPEXT_OBJ = ../libgpo/gpext/gpext.o @GPEXT_STATIC@
@@ -2246,7 +2246,7 @@ 
LIBADDNS_SHARED_TARGET_SONAME=$(LIBADDNS_SHARED_TARGET).$(LIBADDNS_SOVER)
 libaddns_static_targ...@libaddns_static_target@
 libadd...@libaddns_static@ @LIBADDNS_SHARED@
 #LIBADDNS_SYMS=$(srcdir)/exports/libadd...@symsext@
-LIBADDNS_HEADERS=$(srcdir)/libaddns/addns.h
+LIBADDNS_HEADERS=$(srcdir)/../lib/addns/addns.h
 
 $(LIBADDNS_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBADDNS_OBJ) 
$(LIBTALLOC)
        @echo Linking shared library $@
diff --git a/source3/configure.in b/source3/configure.in
index ac43308..f565fdb 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -37,7 +37,7 @@ LIBS="${LIBS} ${TEVENT_LIBS}"
 SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include  -I. -I${srcdir-.}"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/libaddns"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/addns"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
 SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
 
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 48df564..ac14184 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1132,7 +1132,7 @@ static NTSTATUS net_update_dns_internal(TALLOC_CTX *ctx, 
ADS_STRUCT *ads,
                                        int num_addrs)
 {
        struct dns_rr_ns *nameservers = NULL;
-       int ns_count = 0;
+       int ns_count = 0, i;
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
        DNS_ERROR dns_err;
        fstring dns_server;
@@ -1197,16 +1197,31 @@ static NTSTATUS net_update_dns_internal(TALLOC_CTX 
*ctx, ADS_STRUCT *ads,
 
        }
 
-       /* Now perform the dns update - we'll try non-secure and if we fail,
-          we'll follow it up with a secure update */
+       for (i=0; i < ns_count; i++) {
 
-       fstrcpy( dns_server, nameservers[0].hostname );
+               /* Now perform the dns update - we'll try non-secure and if we 
fail,
+                  we'll follow it up with a secure update */
+
+               fstrcpy( dns_server, nameservers[i].hostname );
+
+               dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, 
addrs, num_addrs);
+               if (ERR_DNS_IS_OK(dns_err)) {
+                       status = NT_STATUS_OK;
+                       goto done;
+               }
+
+               if (ERR_DNS_EQUAL(dns_err, ERROR_DNS_INVALID_NAME_SERVER) ||
+                   ERR_DNS_EQUAL(dns_err, ERROR_DNS_CONNECTION_FAILED) ||
+                   ERR_DNS_EQUAL(dns_err, ERROR_DNS_SOCKET_ERROR)) {
+                       DEBUG(1,("retrying DNS update with next nameserver 
after receiving %s\n",
+                               dns_errstr(dns_err)));
+                       continue;
+               }
 
-       dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, 
num_addrs);
-       if (!ERR_DNS_IS_OK(dns_err)) {
                d_printf(_("DNS Update for %s failed: %s\n"),
                        machine_name, dns_errstr(dns_err));
                status = NT_STATUS_UNSUCCESSFUL;
+               goto done;
        }
 
 done:
diff --git a/source3/wscript_build b/source3/wscript_build
index af7c6cb..5fa5296 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1493,6 +1493,7 @@ bld.RECURSE('../lib/tsocket')
 bld.RECURSE('../lib/iniparser/src')
 bld.RECURSE('../lib/crypto')
 bld.RECURSE('../lib/async_req')
+bld.RECURSE('../lib/addns')
 bld.RECURSE('../libcli/auth')
 bld.RECURSE('../libcli/drsuapi')
 bld.RECURSE('../libcli/samsync')
@@ -1507,7 +1508,6 @@ bld.RECURSE('winbindd')
 bld.RECURSE('libgpo/gpext')
 bld.RECURSE('pam_smbpass')
 bld.RECURSE('rpc_server')
-bld.RECURSE('libaddns')
 
 bld.ENFORCE_GROUP_ORDERING()
 bld.CHECK_PROJECT_RULES()


-- 
Samba Shared Repository

Reply via email to