From: Stefan Metzmacher Date: Mon, 15 May 2017 10:16:35 +0000 (+0200) Subject: s4:rpc_server: split out dcesrv_auth_prepare_bind_ack() X-Git-Tag: ldb-1.1.30~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f65625e4e7f96031f6e1450f487d5910ad70c822;p=thirdparty%2Fsamba.git s4:rpc_server: split out dcesrv_auth_prepare_bind_ack() Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index 5e3df0460c4..ae3cebc1e0a 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -305,10 +305,9 @@ NTSTATUS dcesrv_auth_complete(struct dcesrv_call_state *call, NTSTATUS status) add any auth information needed in a bind ack, and process the authentication information found in the bind. */ -NTSTATUS dcesrv_auth_bind_ack(struct dcesrv_call_state *call, struct ncacn_packet *pkt) +NTSTATUS dcesrv_auth_prepare_bind_ack(struct dcesrv_call_state *call, struct ncacn_packet *pkt) { struct dcesrv_connection *dce_conn = call->conn; - NTSTATUS status; dce_conn->allow_alter = true; dce_conn->allow_auth3 = true; @@ -335,6 +334,23 @@ NTSTATUS dcesrv_auth_bind_ack(struct dcesrv_call_state *call, struct ncacn_packe }; call->out_auth_info = &call->_out_auth_info; + return NT_STATUS_OK; +} + +NTSTATUS dcesrv_auth_bind_ack(struct dcesrv_call_state *call, struct ncacn_packet *pkt) +{ + struct dcesrv_connection *dce_conn = call->conn; + NTSTATUS status; + + status = dcesrv_auth_prepare_bind_ack(call, pkt); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (dce_conn->auth_state.auth_finished) { + return NT_STATUS_OK; + } + status = gensec_update_ev(dce_conn->auth_state.gensec_security, call, call->event_ctx, call->in_auth_info.credentials,