diff options
author | Volker Lendecke <vl@samba.org> | 2008-07-20 16:33:26 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-07-20 17:37:12 +0200 |
commit | b8fc15be950072846d23e3836d4d0289c10156f2 (patch) | |
tree | 23d17fd53297e37faafc025015f036585abcda3c /source3/rpc_client | |
parent | 1f854d1db709ea0eeac9f5469fda053bd38e72c4 (diff) | |
download | samba-b8fc15be950072846d23e3836d4d0289c10156f2.tar.gz samba-b8fc15be950072846d23e3836d4d0289c10156f2.tar.bz2 samba-b8fc15be950072846d23e3836d4d0289c10156f2.zip |
Refactoring: Make get_schannel_session_key return NTSTATUS
(This used to be commit a0793cc853d3bd43df2fc49df193a5fead6b01ab)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 0ba94ea292..6d15771d73 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3203,27 +3203,29 @@ static NTSTATUS get_schannel_session_key_common(struct rpc_pipe_client *netlogon ****************************************************************************/ -struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli, - const char *domain, - uint32 *pneg_flags, - NTSTATUS *perr) +NTSTATUS get_schannel_session_key(struct cli_state *cli, + const char *domain, + uint32 *pneg_flags, + struct rpc_pipe_client **presult) { struct rpc_pipe_client *netlogon_pipe = NULL; + NTSTATUS status; - *perr = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id, - &netlogon_pipe); - if (!NT_STATUS_IS_OK(*perr)) { - return NULL; + status = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id, + &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; } /**************************************************************************** @@ -3370,8 +3372,9 @@ struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli, struct rpc_pipe_client *netlogon_pipe = NULL; struct rpc_pipe_client *result = NULL; - netlogon_pipe = get_schannel_session_key(cli, domain, &neg_flags, perr); - if (!netlogon_pipe) { + *perr = get_schannel_session_key(cli, domain, &neg_flags, + &netlogon_pipe); + if (!NT_STATUS_IS_OK(*perr)) { DEBUG(0,("cli_rpc_pipe_open_schannel: failed to get schannel session " "key from server %s for domain %s.\n", cli->desthost, domain )); |