summaryrefslogtreecommitdiffstats
path: root/source/rpc_client
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2005-12-14 04:00:58 +0000
committerDerrell Lipman <derrell@samba.org>2005-12-14 04:00:58 +0000
commit2fa58d4c218401afa894dd9ed8d93edd8710cd6a (patch)
treecc418c07846dede32cd3753c83ae86a607f11548 /source/rpc_client
parent5a6cef8dccef985c4e48d58919a17d92a3b61dd7 (diff)
downloadsamba-2fa58d4c218401afa894dd9ed8d93edd8710cd6a.tar.gz
samba-2fa58d4c218401afa894dd9ed8d93edd8710cd6a.tar.xz
samba-2fa58d4c218401afa894dd9ed8d93edd8710cd6a.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.
Diffstat (limited to 'source/rpc_client')
-rw-r--r--source/rpc_client/cli_pipe.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c
index 7965aee8074..41266838a87 100644
--- a/source/rpc_client/cli_pipe.c
+++ b/source/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)