]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Store copies of the syntax ids in rpc_pipe_client
authorVolker Lendecke <vl@samba.org>
Sun, 20 Jul 2008 08:21:14 +0000 (10:21 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 20 Jul 2008 15:06:21 +0000 (17:06 +0200)
source/include/client.h
source/rpc_client/cli_pipe.c

index c5882e34b6ebc364ce2681b6d507f69193719ca4..9276948dac529a524613f830b26803600f36e14c 100644 (file)
@@ -76,8 +76,8 @@ struct rpc_pipe_client {
                } sock;
        } trans ;
 
-       const struct ndr_syntax_id *abstract_syntax;
-       const struct ndr_syntax_id *transfer_syntax;
+       struct ndr_syntax_id abstract_syntax;
+       struct ndr_syntax_id transfer_syntax;
 
        char *desthost;
        char *srv_name_slash;
index cfb3091feb0cc62d8939e5cbd8588ac7095fcfc7..af4c28195d26635c617c848cd285ef3f7a90e4ef 100644 (file)
@@ -2217,8 +2217,8 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
 
        /* Marshall the outgoing data. */
        status = create_rpc_bind_req(cli, &rpc_out, rpc_call_id,
-                               cli->abstract_syntax,
-                               cli->transfer_syntax,
+                               &cli->abstract_syntax,
+                               &cli->transfer_syntax,
                                cli->auth->auth_type,
                                cli->auth->auth_level);
 
@@ -2255,7 +2255,7 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                return NT_STATUS_BUFFER_TOO_SMALL;
        }
 
-       if(!check_bind_response(&hdr_ba, cli->transfer_syntax)) {
+       if(!check_bind_response(&hdr_ba, &cli->transfer_syntax)) {
                DEBUG(2,("rpc_pipe_bind: check_bind_response failed.\n"));
                prs_mem_free(&rbuf);
                return NT_STATUS_BUFFER_TOO_SMALL;
@@ -2288,7 +2288,7 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                        /* Need to send alter context request and reply. */
                        status = rpc_finish_spnego_ntlmssp_bind(
                                cli, &hdr, &rbuf, rpc_call_id,
-                               cli->abstract_syntax, cli->transfer_syntax,
+                               &cli->abstract_syntax, &cli->transfer_syntax,
                                cli->auth->auth_type, cli->auth->auth_level);
                        if (!NT_STATUS_IS_OK(status)) {
                                prs_mem_free(&rbuf);
@@ -2337,7 +2337,8 @@ unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
 
 bool rpccli_is_pipe_idx(struct rpc_pipe_client *cli, int pipe_idx)
 {
-       return (cli->abstract_syntax == pipe_names[pipe_idx].abstr_syntax);
+       return ndr_syntax_id_equal(&cli->abstract_syntax,
+                                  pipe_names[pipe_idx].abstr_syntax);
 }
 
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16])
@@ -2616,8 +2617,8 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host,
 
        result->transport_type = NCACN_IP_TCP;
 
-       result->abstract_syntax = abstract_syntax;
-       result->transfer_syntax = &ndr_transfer_syntax;
+       result->abstract_syntax = *abstract_syntax;
+       result->transfer_syntax = ndr_transfer_syntax;
 
        result->desthost = talloc_strdup(result, host);
        result->srv_name_slash = talloc_asprintf_strupper_m(
@@ -2824,8 +2825,8 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
 
        result->transport_type = NCACN_UNIX_STREAM;
 
-       result->abstract_syntax = abstract_syntax;
-       result->transfer_syntax = &ndr_transfer_syntax;
+       result->abstract_syntax = *abstract_syntax;
+       result->transfer_syntax = ndr_transfer_syntax;
 
        result->desthost = get_myname(result);
        result->srv_name_slash = talloc_asprintf_strupper_m(
@@ -2914,8 +2915,8 @@ static struct rpc_pipe_client *rpc_pipe_open_np(struct cli_state *cli, int pipe_
        result->trans.np.pipe_name = cli_get_pipe_name(pipe_idx);
 
        result->trans.np.cli = cli;
-       result->abstract_syntax = pipe_names[pipe_idx].abstr_syntax;
-       result->transfer_syntax = &ndr_transfer_syntax;
+       result->abstract_syntax = *pipe_names[pipe_idx].abstr_syntax;
+       result->transfer_syntax = ndr_transfer_syntax;
        result->desthost = talloc_strdup(result, cli->desthost);
        result->srv_name_slash = talloc_asprintf_strupper_m(
                result, "\\\\%s", result->desthost);