diff options
author | Simo Sorce <idra@samba.org> | 2010-07-28 15:53:56 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-28 15:53:56 -0400 |
commit | 7c9c075987e7cdb2d5cb6311876f088f907e46f2 (patch) | |
tree | e8147c6c89ef5410e3c6cc950efe56ffc9e9e408 /source3/rpc_client | |
parent | d17abc69f690ccc845a0a1d6d291b6e21ce86b3d (diff) | |
download | samba-7c9c075987e7cdb2d5cb6311876f088f907e46f2.tar.gz samba-7c9c075987e7cdb2d5cb6311876f088f907e46f2.tar.bz2 samba-7c9c075987e7cdb2d5cb6311876f088f907e46f2.zip |
Do not refernece pipe_auth_data directly in dcerpc_gssapi.c
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index bbd869e19d..6c4525935c 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3353,27 +3353,65 @@ NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, return status; } - status = gse_init_client(result, DCERPC_AUTH_TYPE_KRB5, auth_level, + auth = talloc(result, struct pipe_auth_data); + if (auth == NULL) { + status = NT_STATUS_NO_MEMORY; + goto err_out; + } + auth->auth_type = DCERPC_AUTH_TYPE_KRB5; + auth->auth_level = auth_level; + + if (!username) { + username = ""; + } + auth->user_name = talloc_strdup(auth, username); + if (!auth->user_name) { + status = NT_STATUS_NO_MEMORY; + goto err_out; + } + + /* Fixme, should we fetch/set the Realm ? */ + auth->domain = talloc_strdup(auth, ""); + if (!auth->domain) { + status = NT_STATUS_NO_MEMORY; + goto err_out; + } + + status = gse_init_client(auth, auth->auth_type, auth->auth_level, NULL, server, "cifs", username, password, - GSS_C_DCE_STYLE, &auth); + GSS_C_DCE_STYLE, &auth->a_u.gssapi_state); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("gse_init_client returned %s\n", nt_errstr(status))); - TALLOC_FREE(result); - return status; + goto err_out; } status = rpc_pipe_bind(result, auth); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("cli_rpc_pipe_bind failed with error %s\n", nt_errstr(status))); - TALLOC_FREE(result); - return status; + goto err_out; } *presult = result; return NT_STATUS_OK; + +err_out: + TALLOC_FREE(result); + return status; +} + +NTSTATUS cli_rpc_pipe_open_spnego_krb5(struct cli_state *cli, + const struct ndr_syntax_id *interface, + enum dcerpc_transport_t transport, + enum dcerpc_AuthLevel auth_level, + const char *server, + const char *username, + const char *password, + struct rpc_pipe_client **presult) +{ + return NT_STATUS_NOT_IMPLEMENTED; } NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, |