summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-20 16:36:55 +0200
committerVolker Lendecke <vl@samba.org>2008-07-20 17:37:12 +0200
commit44bdc98823bd85597803f1ca8f5d0282f2d724b3 (patch)
tree74cbf0f7ea45e1f266b91d4fdff46297c72c6f24
parentb8fc15be950072846d23e3836d4d0289c10156f2 (diff)
downloadsamba-44bdc98823bd85597803f1ca8f5d0282f2d724b3.tar.gz
samba-44bdc98823bd85597803f1ca8f5d0282f2d724b3.tar.bz2
samba-44bdc98823bd85597803f1ca8f5d0282f2d724b3.zip
Refactoring: Make get_schannel_session_key_auth_ntlmssp return NTSTATUS
(This used to be commit ab3d80d476d8264030fa71d974324c6dcf6fe6e1)
-rw-r--r--source3/rpc_client/cli_pipe.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 6d15771d73..1825174803 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3292,32 +3292,32 @@ struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cl
version uses an ntlmssp auth bound netlogon pipe to get the key.
****************************************************************************/
-static struct rpc_pipe_client *get_schannel_session_key_auth_ntlmssp(struct cli_state *cli,
- const char *domain,
- const char *username,
- const char *password,
- uint32 *pneg_flags,
- NTSTATUS *perr)
+static NTSTATUS get_schannel_session_key_auth_ntlmssp(struct cli_state *cli,
+ const char *domain,
+ const char *username,
+ const char *password,
+ uint32 *pneg_flags,
+ struct rpc_pipe_client **presult)
{
struct rpc_pipe_client *netlogon_pipe = NULL;
+ NTSTATUS status;
- *perr = cli_rpc_pipe_open_spnego_ntlmssp(cli,
- &ndr_table_netlogon.syntax_id,
- PIPE_AUTH_LEVEL_PRIVACY,
- domain, username, password,
- &netlogon_pipe);
- if (!netlogon_pipe) {
- return NULL;
+ status = cli_rpc_pipe_open_spnego_ntlmssp(
+ cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
+ domain, username, password, &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
- *perr = get_schannel_session_key_common(netlogon_pipe, cli, domain,
- pneg_flags);
- if (!NT_STATUS_IS_OK(*perr)) {
+ status = get_schannel_session_key_common(netlogon_pipe, cli, domain,
+ pneg_flags);
+ if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(netlogon_pipe);
- return NULL;
+ return status;
}
- return netlogon_pipe;
+ *presult = netlogon_pipe;
+ return NT_STATUS_OK;
}
/****************************************************************************
@@ -3338,9 +3338,9 @@ struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state
struct rpc_pipe_client *netlogon_pipe = NULL;
struct rpc_pipe_client *result = NULL;
- netlogon_pipe = get_schannel_session_key_auth_ntlmssp(cli, domain, username,
- password, &neg_flags, perr);
- if (!netlogon_pipe) {
+ *perr = get_schannel_session_key_auth_ntlmssp(
+ cli, domain, username, password, &neg_flags, &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(*perr)) {
DEBUG(0,("cli_rpc_pipe_open_ntlmssp_auth_schannel: failed to get schannel session "
"key from server %s for domain %s.\n",
cli->desthost, domain ));