diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-15 14:02:07 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-05-21 21:05:13 +0200 |
commit | 7274dffa75c63620ee02ad6cc750876ef0885ceb (patch) | |
tree | 8172c311876fcadb1eeb4723cf08508d8126f902 /source4/rpc_server/dcerpc_server.c | |
parent | 5a408bbdc8c4233e80428866fde9300219c4474b (diff) | |
download | samba-7274dffa75c63620ee02ad6cc750876ef0885ceb.tar.gz |
s4:rpc_server: make use of dcesrv_auth_prepare_bind_ack() in dcesrv_bind()
It means we also need to call gensec_update_ev() and dcesrv_auth_complete()
directly in dcesrv_bind(). Doing that will make it easier to make dcesrv_bind()
async in the next commits.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/rpc_server/dcerpc_server.c')
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index c2b531fa7ab..2f322ceadb6 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -782,6 +782,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) uint16_t max_rep = 0; const char *ep_prefix = ""; const char *endpoint = NULL; + struct dcesrv_auth *auth = &call->conn->auth_state; struct dcerpc_ack_ctx *ack_ctx_list = NULL; struct dcerpc_ack_ctx *ack_features = NULL; size_t i; @@ -964,7 +965,6 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) * is being requested. */ if (!dcesrv_auth_bind(call)) { - struct dcesrv_auth *auth = &call->conn->auth_state; if (auth->auth_level == DCERPC_AUTH_LEVEL_NONE) { /* @@ -1019,7 +1019,21 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) pkt->u.bind_ack.ctx_list = ack_ctx_list; pkt->u.bind_ack.auth_info = data_blob_null; - status = dcesrv_auth_bind_ack(call, pkt); + status = dcesrv_auth_prepare_bind_ack(call, pkt); + if (!NT_STATUS_IS_OK(status)) { + return dcesrv_bind_nak(call, 0); + } + + if (auth->auth_finished) { + return dcesrv_auth_reply(call); + } + + status = gensec_update_ev(auth->gensec_security, + call, call->event_ctx, + call->in_auth_info.credentials, + &call->out_auth_info->credentials); + + status = dcesrv_auth_complete(call, status); if (!NT_STATUS_IS_OK(status)) { return dcesrv_bind_nak(call, 0); } |