r16056: Fix errors found by trying to use our kpasswd server and the Apple client.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 6 Jun 2006 04:50:14 +0000 (04:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:08:54 +0000 (14:08 -0500)
Andrew Bartlett

source/auth/gensec/gensec_krb5.c
source/heimdal/lib/hdb/keytab.c
source/kdc/hdb-ldb.c

index 918950302e0b1e384e875f86e2b23410ee718f7b..a63d7c4b1b3e8b1ccd43340428be18d9efc64550 100644 (file)
@@ -151,7 +151,7 @@ static NTSTATUS gensec_krb5_start(struct gensec_security *gensec_security)
                }
        }
 
-       peer_addr = gensec_get_my_addr(gensec_security);
+       peer_addr = gensec_get_peer_addr(gensec_security);
        if (peer_addr && peer_addr->sockaddr) {
                ret = krb5_sockaddr2address(gensec_krb5_state->smb_krb5_context->krb5_context, 
                                            peer_addr->sockaddr, &peer_krb5_addr);
index b4fa5f84c929631e39c5727a23f1815bf408a4ba..c87b8eca2c7af0546c0bc4671a4534060d8fd28b 100644 (file)
@@ -218,7 +218,7 @@ hdb_get_entry(krb5_context context,
        (*db->hdb_destroy)(context, db);
        return ret;
     }
-    ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT, &ent);
+    ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT|HDB_F_GET_CLIENT|HDB_F_GET_SERVER, &ent);
 
 
     /* Shutdown the hdb on error */
index 57e6d52a7c5a64d5c1d6d708290ff0233adb1bca..860051c25746821aed765fe94995b1d25f5ff854 100644 (file)
@@ -611,13 +611,10 @@ static krb5_error_code LDB_fetch_client(krb5_context context, HDB *db,
                                              &msg, &realm_ref_msg);
        free(principal_string);
        if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER)) {
-               talloc_free(mem_ctx);
                return HDB_ERR_NOENTRY;
        } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_MEMORY)) {
-               talloc_free(mem_ctx);
                return ENOMEM;
        } else if (!NT_STATUS_IS_OK(nt_status)) {
-               talloc_free(mem_ctx);
                return EINVAL;
        }
        
@@ -788,7 +785,7 @@ static krb5_error_code LDB_fetch(krb5_context context, HDB *db,
                                 unsigned flags,
                                 hdb_entry_ex *entry_ex)
 {
-       krb5_error_code ret;
+       krb5_error_code ret = HDB_ERR_NOENTRY;
 
        TALLOC_CTX *mem_ctx = talloc_named(db, 0, "LDB_fetch context");