The branch, v3-5-test has been updated
       via  cf4773f source3/libaddns: don't depend on the order in 
resp->answers[]
       via  4bb99f4 source3/libaddns: remove pointless check for 
resp->num_additionals != 1
      from  05f151c lib/replace: replace all *printf function if we replace 
snprintf (bug #9390)

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


- Log -----------------------------------------------------------------
commit cf4773f929b2ac01bfe22e8113ccd3843c92bf56
Author: Stefan Metzmacher <me...@samba.org>
Date:   Fri Nov 9 08:59:36 2012 +0100

    source3/libaddns: don't depend on the order in resp->answers[]
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    (cherry picked from commit eecc1d294256210ee8c2f6ab79d21b835258a6d4)
    
    The last 2 patches address bug #9402 - lib/addns doesn't work samba4 with a
    bind9 server.

commit 4bb99f454cea8a0c37422f1e64cabe96543ca6e8
Author: Stefan Metzmacher <me...@samba.org>
Date:   Fri Nov 9 08:55:40 2012 +0100

    source3/libaddns: remove pointless check for resp->num_additionals != 1
    
    We never use resp->additionals, so there's no reason to check.
    
    This fixes dns updates against BIND9 (used in a Samba4 domain).
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    (cherry picked from commit b59c5db5f74f56c0536635a41ae51c389109ceb5)

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

Summary of changes:
 source3/libaddns/dnsgss.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libaddns/dnsgss.c b/source3/libaddns/dnsgss.c
index c903741..a8b2ea1 100644
--- a/source3/libaddns/dnsgss.c
+++ b/source3/libaddns/dnsgss.c
@@ -164,6 +164,8 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX 
*mem_ctx,
                        struct dns_request *resp;
                        struct dns_buffer *buf;
                        struct dns_tkey_record *tkey;
+                       struct dns_rrec *tkey_answer = NULL;
+                       uint16_t i;
 
                        err = dns_receive(mem_ctx, conn, &buf);
                        if (!ERR_DNS_IS_OK(err)) goto error;
@@ -174,10 +176,16 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX 
*mem_ctx,
                        /*
                         * TODO: Compare id and keyname
                         */
-                       
-                       if ((resp->num_additionals != 1) ||
-                           (resp->num_answers == 0) ||
-                           (resp->answers[0]->type != QTYPE_TKEY)) {
+
+                       for (i=0; i < resp->num_answers; i++) {
+                               if (resp->answers[i]->type != QTYPE_TKEY) {
+                                       continue;
+                               }
+
+                               tkey_answer = resp->answers[i];
+                       }
+
+                       if (tkey_answer == NULL) {
                                err = ERROR_DNS_INVALID_MESSAGE;
                                goto error;
                        }


-- 
Samba Shared Repository

Reply via email to