From 55f84c05bdb33f9c97bb71240e02a8f5a77b3355 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jul 2008 11:04:31 +0200 Subject: Refactoring: Change calling conventions for cli_rpc_pipe_open_krb5 Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS (This used to be commit f2656e5c2e700523ead7a62734d203ad0caaff0c) --- source3/rpc_client/cli_pipe.c | 47 ++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index e9a9480e35..b5a188ed76 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3408,45 +3408,46 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, NULL so long as the caller has a TGT. ****************************************************************************/ -struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli, - int pipe_idx, - enum pipe_auth_level auth_level, - const char *service_princ, - const char *username, - const char *password, - NTSTATUS *perr) +NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, + const struct ndr_syntax_id *interface, + enum pipe_auth_level auth_level, + const char *service_princ, + const char *username, + const char *password, + struct rpc_pipe_client **presult) { #ifdef HAVE_KRB5 struct rpc_pipe_client *result; struct cli_pipe_auth_data *auth; + NTSTATUS status; - *perr = cli_rpc_pipe_open(cli, pipe_names[pipe_idx].abstr_syntax, - &result); - if (!NT_STATUS_IS_OK(*perr)) { - return NULL; + status = cli_rpc_pipe_open(cli, interface, &result); + if (!NT_STATUS_IS_OK(status)) { + return status; } - *perr = rpccli_kerberos_bind_data(result, auth_level, service_princ, - username, password, &auth); - if (!NT_STATUS_IS_OK(*perr)) { + status = rpccli_kerberos_bind_data(result, auth_level, service_princ, + username, password, &auth); + if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("rpccli_kerberos_bind_data returned %s\n", - nt_errstr(*perr))); + nt_errstr(status))); TALLOC_FREE(result); - return NULL; + return status; } - *perr = rpc_pipe_bind(result, auth); - if (!NT_STATUS_IS_OK(*perr)) { - DEBUG(0, ("cli_rpc_pipe_open_krb5: cli_rpc_pipe_bind failed with error %s\n", - nt_errstr(*perr) )); + status = rpc_pipe_bind(result, auth); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("cli_rpc_pipe_open_krb5: cli_rpc_pipe_bind failed " + "with error %s\n", nt_errstr(status))); TALLOC_FREE(result); - return NULL; + return status; } - return result; + *presult = result; + return NT_STATUS_OK; #else DEBUG(0,("cli_rpc_pipe_open_krb5: kerberos not found at compile time.\n")); - return NULL; + return NT_STATUS_NOT_IMPLEMENTED; #endif } -- cgit