summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-20 16:27:45 +0200
committerVolker Lendecke <vl@samba.org>2008-07-20 17:37:12 +0200
commit1f854d1db709ea0eeac9f5469fda053bd38e72c4 (patch)
tree96e4bdb3ae127c1a7f7288f0214e26061b8e2038 /source3
parente0be03d8d5006f92ed479b84cd30ebfe510fa68a (diff)
downloadsamba-1f854d1db709ea0eeac9f5469fda053bd38e72c4.tar.gz
samba-1f854d1db709ea0eeac9f5469fda053bd38e72c4.tar.bz2
samba-1f854d1db709ea0eeac9f5469fda053bd38e72c4.zip
Refactoring: Make get_schannel_session_key_common return NTSTATUS
(This used to be commit 513e69507676fc2227424362d24d8ea9615ea758)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index b93e8181e9..0ba94ea292 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3150,15 +3150,15 @@ NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
/****************************************************************************
Get a the schannel session key out of an already opened netlogon pipe.
****************************************************************************/
-static bool get_schannel_session_key_common(struct rpc_pipe_client *netlogon_pipe,
- struct cli_state *cli,
- const char *domain,
- uint32 *pneg_flags,
- NTSTATUS *perr)
+static NTSTATUS get_schannel_session_key_common(struct rpc_pipe_client *netlogon_pipe,
+ struct cli_state *cli,
+ const char *domain,
+ uint32 *pneg_flags)
{
uint32 sec_chan_type = 0;
unsigned char machine_pwd[16];
const char *machine_account;
+ NTSTATUS status;
/* Get the machine account credentials from secrets.tdb. */
if (!get_trust_pw_hash(domain, machine_pwd, &machine_account,
@@ -3167,11 +3167,10 @@ static bool get_schannel_session_key_common(struct rpc_pipe_client *netlogon_pip
DEBUG(0, ("get_schannel_session_key: could not fetch "
"trust account password for domain '%s'\n",
domain));
- *perr = NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
- return false;
+ return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
}
- *perr = rpccli_netlogon_setup_creds(netlogon_pipe,
+ status = rpccli_netlogon_setup_creds(netlogon_pipe,
cli->desthost, /* server name */
domain, /* domain */
global_myname(), /* client name */
@@ -3180,21 +3179,22 @@ static bool get_schannel_session_key_common(struct rpc_pipe_client *netlogon_pip
sec_chan_type,
pneg_flags);
- if (!NT_STATUS_IS_OK(*perr)) {
- DEBUG(3,("get_schannel_session_key_common: rpccli_netlogon_setup_creds "
- "failed with result %s to server %s, domain %s, machine account %s.\n",
- nt_errstr(*perr), cli->desthost, domain, machine_account ));
- return false;
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(3, ("get_schannel_session_key_common: "
+ "rpccli_netlogon_setup_creds failed with result %s "
+ "to server %s, domain %s, machine account %s.\n",
+ nt_errstr(status), cli->desthost, domain,
+ machine_account ));
+ return status;
}
if (((*pneg_flags) & NETLOGON_NEG_SCHANNEL) == 0) {
DEBUG(3, ("get_schannel_session_key: Server %s did not offer schannel\n",
cli->desthost));
- *perr = NT_STATUS_INVALID_NETWORK_RESPONSE;
- return false;
+ return NT_STATUS_INVALID_NETWORK_RESPONSE;
}
- return true;
+ return NT_STATUS_OK;;
}
/****************************************************************************
@@ -3216,9 +3216,9 @@ struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli,
return NULL;
}
- if (!get_schannel_session_key_common(netlogon_pipe, cli, domain,
- pneg_flags, perr))
- {
+ *perr = get_schannel_session_key_common(netlogon_pipe, cli, domain,
+ pneg_flags);
+ if (!NT_STATUS_IS_OK(*perr)) {
TALLOC_FREE(netlogon_pipe);
return NULL;
}
@@ -3308,9 +3308,9 @@ static struct rpc_pipe_client *get_schannel_session_key_auth_ntlmssp(struct cli_
return NULL;
}
- if (!get_schannel_session_key_common(netlogon_pipe, cli, domain,
- pneg_flags, perr))
- {
+ *perr = get_schannel_session_key_common(netlogon_pipe, cli, domain,
+ pneg_flags);
+ if (!NT_STATUS_IS_OK(*perr)) {
TALLOC_FREE(netlogon_pipe);
return NULL;
}