s3-build: only link in lsa client code where needed.
[nivanova/samba-autobuild/.git] / source3 / rpc_client / cli_pipe.c
index a8766dad94d3657646d5ce577e3db191e5bf774a..d57bc0af60cc101d6a166faddda9e3c43cc3d9ac 100644 (file)
@@ -827,7 +827,7 @@ static void rpc_api_pipe_got_pdu(struct tevent_req *subreq)
                return;
        }
 
-       status = dcerpc_pull_ncacn_packet(state,
+       status = dcerpc_pull_ncacn_packet(state->pkt,
                                          &state->incoming_frag,
                                          state->pkt,
                                          !state->endianess);
@@ -2383,7 +2383,7 @@ NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx, const char *domain,
        result->a_u.schannel_auth->state = SCHANNEL_STATE_START;
        result->a_u.schannel_auth->seq_num = 0;
        result->a_u.schannel_auth->initiator = true;
-       result->a_u.schannel_auth->creds = creds;
+       result->a_u.schannel_auth->creds = netlogon_creds_copy(result, creds);
 
        *presult = result;
        return NT_STATUS_OK;
@@ -3048,9 +3048,13 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
 
        /*
         * The credentials on a new netlogon pipe are the ones we are passed
-        * in - reference them in
+        * in - copy them over
         */
-       result->dc = talloc_move(result, pdc);
+       result->dc = netlogon_creds_copy(result, *pdc);
+       if (result->dc == NULL) {
+               TALLOC_FREE(result);
+               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",
@@ -3395,7 +3399,7 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
 {
        struct pipe_auth_data *a = cli->auth;
        DATA_BLOB sk = data_blob_null;
-       bool make_dup;
+       bool make_dup = false;
 
        if (!session_key || !cli) {
                return NT_STATUS_INVALID_PARAMETER;