summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/localgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/netapi/localgroup.c')
-rw-r--r--source3/lib/netapi/localgroup.c58
1 files changed, 21 insertions, 37 deletions
diff --git a/source3/lib/netapi/localgroup.c b/source3/lib/netapi/localgroup.c
index 811e7e8ab6..25a3427bc1 100644
--- a/source3/lib/netapi/localgroup.c
+++ b/source3/lib/netapi/localgroup.c
@@ -150,12 +150,9 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx,
ZERO_STRUCT(domain_handle);
ZERO_STRUCT(alias_handle);
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -279,12 +276,9 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx,
ZERO_STRUCT(domain_handle);
ZERO_STRUCT(alias_handle);
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -460,12 +454,9 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx,
ZERO_STRUCT(domain_handle);
ZERO_STRUCT(alias_handle);
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -640,12 +631,9 @@ WERROR NetLocalGroupSetInfo_r(struct libnetapi_ctx *ctx,
ZERO_STRUCT(domain_handle);
ZERO_STRUCT(alias_handle);
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -791,12 +779,9 @@ WERROR NetLocalGroupEnum_r(struct libnetapi_ctx *ctx,
ZERO_STRUCT(domain_handle);
ZERO_STRUCT(alias_handle);
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -1086,13 +1071,10 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
break;
}
- werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
-
if (r->in.level == 3) {
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_lsarpc.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_lsarpc.syntax_id,
+ &cli,
&lsa_pipe);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -1110,7 +1092,9 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
TALLOC_FREE(lsa_pipe);
}
- werr = libnetapi_open_pipe(ctx, cli, &ndr_table_samr.syntax_id,
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_samr.syntax_id,
+ &cli,
&pipe_cli);
if (!W_ERROR_IS_OK(werr)) {
goto done;