summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-04-25 19:45:52 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-10 09:18:54 +0200
commite9c8e3fb92143525f846523e446e2213e5b55d9d (patch)
tree5a3750a3b592396974bfe1a41dde4c108af25f41 /source3
parent90e28c1825b2c48714d7b34fdb57d3878116d07e (diff)
downloadsamba-e9c8e3fb92143525f846523e446e2213e5b55d9d.tar.gz
samba-e9c8e3fb92143525f846523e446e2213e5b55d9d.tar.bz2
samba-e9c8e3fb92143525f846523e446e2213e5b55d9d.zip
s3:rpc_client: use netlogon_creds_copy before rpc_pipe_bind
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 477853494a..8775c3b03d 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3019,6 +3019,18 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
return status;
}
+ /*
+ * The credentials on a new netlogon pipe are the ones we are passed
+ * in - copy them over
+ *
+ * This may get overwritten... in rpc_pipe_bind()...
+ */
+ rpccli->dc = netlogon_creds_copy(rpccli, *pdc);
+ if (rpccli->dc == NULL) {
+ TALLOC_FREE(rpccli);
+ return NT_STATUS_NO_MEMORY;
+ }
+
status = rpc_pipe_bind(rpccli, rpcauth);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("cli_rpc_pipe_open_schannel_with_key: "
@@ -3028,18 +3040,6 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
return status;
}
- /*
- * The credentials on a new netlogon pipe are the ones we are passed
- * in - copy them over
- */
- if (rpccli->dc == NULL) {
- rpccli->dc = netlogon_creds_copy(rpccli, *pdc);
- if (rpccli->dc == NULL) {
- TALLOC_FREE(rpccli);
- return NT_STATUS_NO_MEMORY;
- }
- }
-
DEBUG(10,("cli_rpc_pipe_open_schannel_with_key: opened pipe %s to machine %s "
"for domain %s and bound using schannel.\n",
get_pipe_name_from_syntax(talloc_tos(), &table->syntax_id),