diff options
author | Derrell Lipman <derrell@samba.org> | 2005-12-14 04:00:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:50 -0500 |
commit | 765daab643c2957297e71b26de515c05b04d244d (patch) | |
tree | b1c98893c1ecaab41c1c5fb0f97626dde60fa60a /source3/rpc_client | |
parent | 728e527d2c73b1db69f03bcf6015af6843315408 (diff) | |
download | samba-765daab643c2957297e71b26de515c05b04d244d.tar.gz samba-765daab643c2957297e71b26de515c05b04d244d.tar.bz2 samba-765daab643c2957297e71b26de515c05b04d244d.zip |
r12225: r11729@cabra: derrell | 2005-12-13 22:59:45 -0500
1. Fix a crash bug which should have reared its ugly head ages ago, but for
some reason, remained dormant until recently. The bug pertained to
libsmbclient doing a structure assignment of a cli after having opened a
pipe. The pipe open code makes a copy of the cli pointer that was passed
to it. If the cli is later copied (and that cli pointer that was saved
is no longer valid), the pipe code will cause a crash during shutdown or
when the copied cli is closed.
2. The 'type' field in enumerated shares was not being set correctly with
the new RPC-based mechanism for enumerating shares.
(This used to be commit 62a02b8f2a1fcb66881a9c9636e0b27e3049c5a1)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 7965aee807..41266838a8 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2150,6 +2150,15 @@ static NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli, /**************************************************************************** Open a named pipe over SMB to a remote server. + * + * CAVEAT CALLER OF THIS FUNCTION: + * The returned rpc_pipe_client saves a copy of the cli_state cli pointer, + * so be sure that this function is called AFTER any structure (vs pointer) + * assignment of the cli. In particular, libsmbclient does structure + * assignments of cli, which invalidates the data in the returned + * rpc_pipe_client if this function is called before the structure assignment + * of cli. + * ****************************************************************************/ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe_idx, NTSTATUS *perr) |