summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-07-27 00:47:19 +0000
committerJeremy Allison <jra@samba.org>2000-07-27 00:47:19 +0000
commit5ec1642809d9de83da8c88c65d6595c6eb0270f5 (patch)
treef6f4f1e0b3678394fca8b7c37f71084a1b166671 /source3/rpc_client/cli_netlogon.c
parent134a4b86548db77cba292c50fbd6b91ecaa69f14 (diff)
downloadsamba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.tar.gz
samba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.tar.bz2
samba-5ec1642809d9de83da8c88c65d6595c6eb0270f5.zip
Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy. (This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4)
Diffstat (limited to 'source3/rpc_client/cli_netlogon.c')
-rw-r--r--source3/rpc_client/cli_netlogon.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 6437685ed8..63461c5023 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -64,8 +64,8 @@ BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level)
NET_Q_LOGON_CTRL2 q_l;
BOOL ok = False;
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_LOGON_CTRL2 */
@@ -125,8 +125,8 @@ BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
NET_Q_AUTH_2 q_a;
BOOL ok = False;
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_AUTH2 */
@@ -215,8 +215,8 @@ BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_
NET_Q_REQ_CHAL q_c;
BOOL valid_chal = False;
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_REQCHAL */
@@ -279,8 +279,8 @@ BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
gen_next_creds( cli, &new_clnt_cred);
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_SRV_PWSET */
@@ -350,8 +350,8 @@ BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
gen_next_creds( cli, &new_clnt_cred);
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_SAMLOGON */
@@ -439,8 +439,8 @@ BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
gen_next_creds( cli, &new_clnt_cred);
- prs_init(&buf , 1024, 4, False);
- prs_init(&rbuf, 0, 4, True );
+ prs_init(&buf , 1024, 4, cli->mem_ctx, False);
+ prs_init(&rbuf, 0, 4, cli->mem_ctx, True );
/* create and send a MSRPC command with api NET_SAMLOGOFF */