summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-20 11:04:31 +0200
committerVolker Lendecke <vl@samba.org>2008-07-20 17:37:14 +0200
commit99526d391dc274eb87cfd0b393363d8ceafccda9 (patch)
treeb9b53237183aa5f6961425600c7faf06bdf0656f /source3/rpc_client
parent52ff49600e6421828784a9e9aefbd1e94a290ed0 (diff)
downloadsamba-99526d391dc274eb87cfd0b393363d8ceafccda9.tar.gz
samba-99526d391dc274eb87cfd0b393363d8ceafccda9.tar.bz2
samba-99526d391dc274eb87cfd0b393363d8ceafccda9.zip
Refactoring: Change calling conventions for cli_rpc_pipe_open_schannel
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS (This used to be commit 1fcfca007f33a2c4e979abf30c2ea0db65bac718)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 5441ab8807..e9a9480e35 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3368,33 +3368,38 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
Fetch the session key ourselves using a temporary netlogon pipe.
****************************************************************************/
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli,
- int pipe_idx,
- enum pipe_auth_level auth_level,
- const char *domain,
- NTSTATUS *perr)
+NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
+ const struct ndr_syntax_id *interface,
+ enum pipe_auth_level auth_level,
+ const char *domain,
+ struct rpc_pipe_client **presult)
{
uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
struct rpc_pipe_client *netlogon_pipe = NULL;
struct rpc_pipe_client *result = NULL;
+ NTSTATUS status;
- *perr = get_schannel_session_key(cli, domain, &neg_flags,
- &netlogon_pipe);
- if (!NT_STATUS_IS_OK(*perr)) {
+ status = get_schannel_session_key(cli, domain, &neg_flags,
+ &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("cli_rpc_pipe_open_schannel: failed to get schannel session "
"key from server %s for domain %s.\n",
cli->desthost, domain ));
- return NULL;
+ return status;
}
- *perr = cli_rpc_pipe_open_schannel_with_key(
- cli, cli_get_iface(pipe_idx), auth_level,
- domain, netlogon_pipe->dc, &result);
+ status = cli_rpc_pipe_open_schannel_with_key(
+ cli, interface, auth_level, domain, netlogon_pipe->dc,
+ &result);
/* Now we've bound using the session key we can close the netlog pipe. */
TALLOC_FREE(netlogon_pipe);
- return result;
+ if (NT_STATUS_IS_OK(status)) {
+ *presult = result;
+ }
+
+ return NT_STATUS_OK;
}
/****************************************************************************