diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-02-06 13:37:12 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-02-16 15:18:41 +0100 |
commit | bd2a7aac2c131f9875d3f555784e4c869a159ca5 (patch) | |
tree | de17931721037e1602264628c2506b7c91f34328 /source3/rpc_client | |
parent | a389632e1c2cf809aae02659c203687b6f5654ff (diff) | |
download | samba-bd2a7aac2c131f9875d3f555784e4c869a159ca5.tar.gz samba-bd2a7aac2c131f9875d3f555784e4c869a159ca5.tar.bz2 samba-bd2a7aac2c131f9875d3f555784e4c869a159ca5.zip |
s3-librpc: make gensec result handling more generic
This prepares us for handling SPNEGO via gensec
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 7b3cc252f0..5733f40082 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1014,20 +1014,12 @@ static NTSTATUS create_generic_auth_rpc_bind_req(struct rpc_pipe_client *cli, { struct gensec_security *gensec_security; DATA_BLOB null_blob = data_blob_null; - NTSTATUS status; gensec_security = talloc_get_type_abort(cli->auth->auth_ctx, struct gensec_security); DEBUG(5, ("create_generic_auth_rpc_bind_req: Processing NTLMSSP Negotiate\n")); - status = gensec_update(gensec_security, mem_ctx, NULL, null_blob, auth_token); - - if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { - data_blob_free(auth_token); - return status; - } - - return NT_STATUS_OK; + return gensec_update(gensec_security, mem_ctx, NULL, null_blob, auth_token); } /******************************************************************* @@ -1143,7 +1135,9 @@ static NTSTATUS create_rpc_bind_req(TALLOC_CTX *mem_ctx, case DCERPC_AUTH_TYPE_NTLMSSP: case DCERPC_AUTH_TYPE_KRB5: ret = create_generic_auth_rpc_bind_req(cli, mem_ctx, &auth_token); - if (!NT_STATUS_IS_OK(ret)) { + + if (!NT_STATUS_IS_OK(ret) && + !NT_STATUS_EQUAL(ret, NT_STATUS_MORE_PROCESSING_REQUIRED)) { return ret; } break; @@ -1626,7 +1620,8 @@ struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx, &cli->transfer_syntax, &state->rpc_out); - if (!NT_STATUS_IS_OK(status)) { + if (!NT_STATUS_IS_OK(status) && + !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { goto post_status; } @@ -1743,6 +1738,11 @@ static void rpc_pipe_bind_step_one_done(struct tevent_req *subreq) status = rpc_bind_next_send(req, state, &auth_token); } else if (NT_STATUS_IS_OK(status)) { + if (auth_token.length == 0) { + /* Bind complete. */ + tevent_req_done(req); + return; + } status = rpc_bind_finish_send(req, state, &auth_token); } |