From 9bae4cd3d967f43c32796d03b1c2ee8ae5119e00 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 1 Oct 2010 19:05:30 -0700 Subject: s4-rpc: added target_principal binding handle option this allows you to specify a target SPN for a connection Pair-Programmed-With: Andrew Bartlett --- source4/librpc/rpc/dcerpc_auth.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/librpc/rpc/dcerpc_auth.c') diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c index bca7a8d186..95fdbf2374 100644 --- a/source4/librpc/rpc/dcerpc_auth.c +++ b/source4/librpc/rpc/dcerpc_auth.c @@ -292,6 +292,17 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx, } } + if (p->binding && p->binding->target_principal) { + c->status = gensec_set_target_principal(sec->generic_state, + p->binding->target_principal); + if (!NT_STATUS_IS_OK(c->status)) { + DEBUG(1, ("Failed to set GENSEC target principal to %s: %s\n", + p->binding->target_principal, nt_errstr(c->status))); + composite_error(c, c->status); + return c; + } + } + c->status = gensec_start_mech_by_authtype(sec->generic_state, auth_type, auth_level); if (!NT_STATUS_IS_OK(c->status)) { -- cgit