Ok - this is a *BIG* change - but it fixes the problems with static strings
authorJeremy Allison <jra@samba.org>
Thu, 27 Jul 2000 00:47:19 +0000 (00:47 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 27 Jul 2000 00:47:19 +0000 (00:47 +0000)
commit0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4
treeb9cfdae0a18239efb1bde5221e13a75a8508fd41
parentc267b23620677a11f702bfea4885a28e66a05b05
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.
26 files changed:
source/include/client.h
source/include/ntdomain.h
source/include/proto.h
source/include/rpc_misc.h
source/include/talloc.h
source/lib/cmd_interp.c
source/lib/msrpc-client.c
source/lib/talloc.c
source/libsmb/clientgen.c
source/printing/nt_printing.c
source/rpc_client/cli_lsarpc.c
source/rpc_client/cli_netlogon.c
source/rpc_client/cli_pipe.c
source/rpc_client/cli_reg.c
source/rpc_client/cli_samr.c
source/rpc_client/cli_srvsvc.c
source/rpc_client/cli_wkssvc.c
source/rpc_parse/parse_creds.c
source/rpc_parse/parse_misc.c
source/rpc_parse/parse_prs.c
source/rpc_parse/parse_spoolss.c
source/rpc_server/srv_pipe.c
source/rpc_server/srv_pipe_hnd.c
source/rpc_server/srv_spoolss_nt.c
source/smbd/nttrans.c
source/smbd/process.c