summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),