summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-09-21 15:41:23 -0700
committerGünther Deschner <gd@samba.org>2010-09-21 16:13:58 -0700
commit2cf1f0586038d5460d42a9cd4c3bc5c8a936d6ad (patch)
treeaee1d80f9f9091e1ce08ba4e84d091120267dbc9
parent93c95824c754384f12891f1c8daf527e178a2bff (diff)
downloadsamba-2cf1f0586038d5460d42a9cd4c3bc5c8a936d6ad.tar.gz
samba-2cf1f0586038d5460d42a9cd4c3bc5c8a936d6ad.tar.xz
samba-2cf1f0586038d5460d42a9cd4c3bc5c8a936d6ad.zip
s3: Remove a global variable in bugfix for bug 7665
Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source3/lib/netapi/cm.c17
-rw-r--r--source3/lib/netapi/netapi_private.h1
2 files changed, 11 insertions, 7 deletions
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index bff274248bf..b94da641a88 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -37,16 +37,15 @@ struct client_pipe_connection {
struct rpc_pipe_client *pipe;
};
-static struct client_ipc_connection *ipc_connections = NULL;
-
/********************************************************************
********************************************************************/
-static struct client_ipc_connection *ipc_cm_find(const char *server_name)
+static struct client_ipc_connection *ipc_cm_find(
+ struct libnetapi_private_ctx *priv_ctx, const char *server_name)
{
struct client_ipc_connection *p;
- for (p = ipc_connections; p; p = p->next) {
+ for (p = priv_ctx->ipc_connections; p; p = p->next) {
if (strequal(p->cli->desthost, server_name)) {
return p;
}
@@ -62,6 +61,8 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
const char *server_name,
struct client_ipc_connection **pp)
{
+ struct libnetapi_private_ctx *priv_ctx =
+ (struct libnetapi_private_ctx *)ctx->private_data;
struct user_auth_info *auth_info = NULL;
struct cli_state *cli_ipc = NULL;
struct client_ipc_connection *p;
@@ -70,7 +71,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
return WERR_INVALID_PARAM;
}
- p = ipc_cm_find(server_name);
+ p = ipc_cm_find(priv_ctx, server_name);
if (p) {
*pp = p;
return WERR_OK;
@@ -124,7 +125,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
}
p->cli = cli_ipc;
- DLIST_ADD(ipc_connections, p);
+ DLIST_ADD(priv_ctx->ipc_connections, p);
*pp = p;
@@ -136,9 +137,11 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx)
{
+ struct libnetapi_private_ctx *priv_ctx =
+ (struct libnetapi_private_ctx *)ctx->private_data;
struct client_ipc_connection *p;
- for (p = ipc_connections; p; p = p->next) {
+ for (p = priv_ctx->ipc_connections; p; p = p->next) {
cli_shutdown(p->cli);
}
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index effe2eb9a07..d0f7756d162 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -43,6 +43,7 @@ struct libnetapi_private_ctx {
struct policy_handle builtin_handle;
} samr;
+ struct client_ipc_connection *ipc_connections;
};
NET_API_STATUS libnetapi_get_password(struct libnetapi_ctx *ctx, char **password);