summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-29 13:24:54 -0800
committerJeremy Allison <jra@samba.org>2007-11-29 13:24:54 -0800
commitd2cf97aeba14a4d336fb57b01f19bd5a08dcb003 (patch)
tree659f15d8011a1a110850c01e11078eae86d8bdad /source3/rpc_client
parent42c87fe6e6036a56b178183b034275321949050d (diff)
downloadsamba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.tar.gz
samba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.tar.bz2
samba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.zip
Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx should last. Jeremy. (This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index c93e26ccbc..05ef2ad151 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1975,7 +1975,7 @@ static NTSTATUS rpc_finish_spnego_ntlmssp_bind(struct rpc_pipe_client *cli,
/* Initialize the returning data struct. */
prs_mem_free(rbuf);
- prs_init(rbuf, 0, cli->cli->mem_ctx, UNMARSHALL);
+ prs_init(rbuf, 0, cli->mem_ctx, UNMARSHALL);
nt_status = rpc_api_pipe(cli, &rpc_out, rbuf, RPC_ALTCONTRESP);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -2048,7 +2048,7 @@ static NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
return NT_STATUS_INVALID_PARAMETER;
}
- prs_init(&rpc_out, 0, cli->cli->mem_ctx, MARSHALL);
+ prs_init(&rpc_out, 0, cli->mem_ctx, MARSHALL);
rpc_call_id = get_rpc_call_id();
@@ -2064,7 +2064,7 @@ static NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
}
/* Initialize the incoming data struct. */
- prs_init(&rbuf, 0, cli->cli->mem_ctx, UNMARSHALL);
+ prs_init(&rbuf, 0, cli->mem_ctx, UNMARSHALL);
/* send data on \PIPE\. receive a response */
status = rpc_api_pipe(cli, &rpc_out, &rbuf, RPC_BINDACK);
@@ -2745,7 +2745,7 @@ struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
}
}
- result->auth.a_u.kerberos_auth = TALLOC_ZERO_P(cli->mem_ctx, struct kerberos_auth_struct);
+ result->auth.a_u.kerberos_auth = TALLOC_ZERO_P(result->mem_ctx, struct kerberos_auth_struct);
if (!result->auth.a_u.kerberos_auth) {
cli_rpc_pipe_close(result);
*perr = NT_STATUS_NO_MEMORY;
@@ -2769,30 +2769,3 @@ struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
return NULL;
#endif
}
-
-#if 0 /* Moved to libsmb/clientgen.c */
-/****************************************************************************
- External interface.
- Close an open named pipe over SMB. Free any authentication data.
- ****************************************************************************/
-
- void cli_rpc_pipe_close(struct rpc_pipe_client *cli)
-{
- if (!cli_close(cli->cli, cli->fnum)) {
- DEBUG(0,("cli_rpc_pipe_close: cli_close failed on pipe %s "
- "to machine %s. Error was %s\n",
- cli->pipe_name),
- cli->cli->desthost,
- cli_errstr(cli->cli)));
- }
-
- if (cli->auth.cli_auth_data_free_func) {
- (*cli->auth.cli_auth_data_free_func)(&cli->auth);
- }
- DEBUG(10,("cli_rpc_pipe_close: closed pipe %s to machine %s\n",
- cli->pipe_name, cli->cli->desthost ));
-
- DLIST_REMOVE(cli->cli->pipe_list, cli);
- talloc_destroy(cli->mem_ctx);
-}
-#endif