s4:gensec_gssapi: We need to use the users realm in the target_principal
authorStefan Metzmacher <metze@samba.org>
Mon, 24 Oct 2016 09:26:12 +0000 (11:26 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 15 Nov 2016 10:00:26 +0000 (11:00 +0100)
This is important in order to let the kdc of the users realm start with
the trust referral routing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/auth/gensec/gensec_gssapi.c

index 59b870f21de56bd6c841159ed55aeb99a4f96ee5..18bb01146b97385a181b33548cad7db451de57e1 100644 (file)
@@ -339,7 +339,7 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi
        } else {
                gensec_gssapi_state->target_principal = talloc_asprintf(gensec_gssapi_state, "%s/%s@%s",
                                            gensec_get_target_service(gensec_security), 
-                                           hostname, lpcfg_realm(gensec_security->settings->lp_ctx));
+                                           hostname, cli_credentials_get_realm(creds));
 
                name_type = GSS_C_NT_USER_NAME;
        }