summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/cm.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-12 17:59:23 +0200
committerGünther Deschner <gd@samba.org>2008-08-14 12:22:11 +0200
commitfcd10d26a407bef323cb8beda39a21aeb1e5b144 (patch)
tree9936d445ecf19e6c28fa3e222858697a86ef4e92 /source3/lib/netapi/cm.c
parent87b9c9ade21a68d4428ff4aadd32f02f86e78a40 (diff)
downloadsamba-fcd10d26a407bef323cb8beda39a21aeb1e5b144.tar.gz
samba-fcd10d26a407bef323cb8beda39a21aeb1e5b144.tar.bz2
samba-fcd10d26a407bef323cb8beda39a21aeb1e5b144.zip
netapi: make libnetapi_open_ipc_connection static.
Guenther (cherry picked from commit 0259914f8ff04514a8395d8e1af61aadd50c5efb) (This used to be commit 7edc671cc1007ae216e7efdbcdb9cfa1e547dca5)
Diffstat (limited to 'source3/lib/netapi/cm.c')
-rw-r--r--source3/lib/netapi/cm.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index 8ea31e54f9..a5c85bfe6b 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -25,9 +25,9 @@
/********************************************************************
********************************************************************/
-WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
- const char *server_name,
- struct cli_state **cli)
+static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
+ const char *server_name,
+ struct cli_state **cli)
{
struct cli_state *cli_ipc = NULL;
@@ -161,17 +161,25 @@ static NTSTATUS pipe_cm_open(TALLOC_CTX *ctx,
********************************************************************/
WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
- struct cli_state *cli,
+ const char *server_name,
const struct ndr_syntax_id *interface,
+ struct cli_state **pcli,
struct rpc_pipe_client **presult)
{
struct rpc_pipe_client *result = NULL;
NTSTATUS status;
+ WERROR werr;
+ struct cli_state *cli = NULL;
- if (!cli || !presult) {
+ if (!presult) {
return WERR_INVALID_PARAM;
}
+ werr = libnetapi_open_ipc_connection(ctx, server_name, &cli);
+ if (!W_ERROR_IS_OK(werr)) {
+ return werr;
+ }
+
status = pipe_cm_open(ctx, cli, interface, &result);
if (!NT_STATUS_IS_OK(status)) {
libnetapi_set_error_string(ctx, "failed to open PIPE %s: %s",
@@ -182,6 +190,8 @@ WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
}
*presult = result;
+ *pcli = cli;
+
return WERR_OK;
}