[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3721-g4a4e90a

Günther Deschner gd at samba.org
Thu Aug 14 10:18:49 GMT 2008


The branch, v3-3-test has been updated
       via  4a4e90a3872d34791de43c3849c60e2f4e713d47 (commit)
       via  93210f04c3b1e4fe977a395531ddc0387a65dab5 (commit)
       via  eee28804b7efc3089ce3528f13de6c930cf00adb (commit)
       via  0259914f8ff04514a8395d8e1af61aadd50c5efb (commit)
       via  aa70e588803e3767796dc958b139f4ee464d8626 (commit)
       via  bded298e022028d6237e25e1c785509bc983be9d (commit)
       via  dcf6d879a14a70ce5795eb8dcfbfe2fc5a8ad859 (commit)
      from  60718a203c1d90dbdcdcb2eaf6b37f6135fb411b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 4a4e90a3872d34791de43c3849c60e2f4e713d47
Author: Günther Deschner <gd at samba.org>
Date:   Wed Aug 13 13:59:08 2008 +0200

    netapi: add some remaining documentation fixes.
    
    Guenther

commit 93210f04c3b1e4fe977a395531ddc0387a65dab5
Author: Günther Deschner <gd at samba.org>
Date:   Tue Aug 12 19:47:37 2008 +0200

    netapi: add doxygen documentation for NetUserModalsGet and NetUserModalsSet.
    
    Guenther

commit eee28804b7efc3089ce3528f13de6c930cf00adb
Author: Günther Deschner <gd at samba.org>
Date:   Tue Aug 12 19:39:38 2008 +0200

    netapi: add doxygen documentation for NetLocalGroup{Add,Del,Set,Get}Members.
    
    Guenther

commit 0259914f8ff04514a8395d8e1af61aadd50c5efb
Author: Günther Deschner <gd at samba.org>
Date:   Tue Aug 12 17:59:23 2008 +0200

    netapi: make libnetapi_open_ipc_connection static.
    
    Guenther

commit aa70e588803e3767796dc958b139f4ee464d8626
Author: Günther Deschner <gd at samba.org>
Date:   Tue Aug 12 15:25:06 2008 +0200

    netapi: make non-implemented local calls default to remote "localhost" calls.
    
    Guenther

commit bded298e022028d6237e25e1c785509bc983be9d
Author: Günther Deschner <gd at samba.org>
Date:   Tue Aug 12 12:49:19 2008 +0200

    netapi: add NetLocalGroupGetMembers example code.
    
    Guenther

commit dcf6d879a14a70ce5795eb8dcfbfe2fc5a8ad859
Author: Günther Deschner <gd at samba.org>
Date:   Mon Aug 11 20:39:14 2008 +0200

    netapi: let libnetapi_samr_lookup_and_open_alias return NTSTATUS.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/lib/netapi/cm.c                             |   20 ++-
 source/lib/netapi/examples/Makefile.in             |    6 +
 .../localgroup_getmembers.c}                       |   88 ++++---
 source/lib/netapi/getdc.c                          |   31 +--
 source/lib/netapi/group.c                          |   79 +++----
 source/lib/netapi/joindomain.c                     |   36 +--
 source/lib/netapi/localgroup.c                     |  238 +++++++++-----------
 source/lib/netapi/netapi.h                         |  111 +++++++++-
 source/lib/netapi/netapi_private.h                 |   13 +-
 source/lib/netapi/serverinfo.c                     |   29 +--
 source/lib/netapi/user.c                           |   99 +++------
 11 files changed, 390 insertions(+), 360 deletions(-)
 copy source/lib/netapi/examples/{group/group_enum.c => localgroup/localgroup_getmembers.c} (57%)


Changeset truncated at 500 lines:

diff --git a/source/lib/netapi/cm.c b/source/lib/netapi/cm.c
index 8ea31e5..a5c85bf 100644
--- a/source/lib/netapi/cm.c
+++ b/source/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;
 }
 
diff --git a/source/lib/netapi/examples/Makefile.in b/source/lib/netapi/examples/Makefile.in
index 158df4f..0b7553c 100644
--- a/source/lib/netapi/examples/Makefile.in
+++ b/source/lib/netapi/examples/Makefile.in
@@ -47,6 +47,7 @@ PROGS = bin/getdc at EXEEXT@ \
 	bin/localgroup_addmembers at EXEEXT@ \
 	bin/localgroup_delmembers at EXEEXT@ \
 	bin/localgroup_setmembers at EXEEXT@ \
+	bin/localgroup_getmembers at EXEEXT@ \
 	bin/remote_tod at EXEEXT@
 
 all: $(PROGS)
@@ -106,6 +107,7 @@ LOCALGROUPENUM_OBJ = localgroup/localgroup_enum.o $(CMDLINE_OBJ)
 LOCALGROUPADDMEMBERS_OBJ = localgroup/localgroup_addmembers.o $(CMDLINE_OBJ)
 LOCALGROUPDELMEMBERS_OBJ = localgroup/localgroup_delmembers.o $(CMDLINE_OBJ)
 LOCALGROUPSETMEMBERS_OBJ = localgroup/localgroup_setmembers.o $(CMDLINE_OBJ)
+LOCALGROUPGETMEMBERS_OBJ = localgroup/localgroup_getmembers.o $(CMDLINE_OBJ)
 REMOTETOD_OBJ = server/remote_tod.o $(CMDLINE_OBJ)
 
 bin/getdc at EXEEXT@: $(BINARY_PREREQS) $(GETDC_OBJ)
@@ -228,6 +230,10 @@ bin/localgroup_setmembers at EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPSETMEMBERS_OBJ)
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(LOCALGROUPSETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
 
+bin/localgroup_getmembers at EXEEXT@: $(BINARY_PREREQS) $(LOCALGROUPGETMEMBERS_OBJ)
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(LOCALGROUPGETMEMBERS_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
+
 bin/remote_tod at EXEEXT@: $(BINARY_PREREQS) $(REMOTETOD_OBJ)
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(REMOTETOD_OBJ) $(LDFLAGS) $(DYNEXP) $(CMDLINE_LIBS)
diff --git a/source/lib/netapi/examples/group/group_enum.c b/source/lib/netapi/examples/localgroup/localgroup_getmembers.c
similarity index 57%
copy from source/lib/netapi/examples/group/group_enum.c
copy to source/lib/netapi/examples/localgroup/localgroup_getmembers.c
index fe2aee1..0589870 100644
--- a/source/lib/netapi/examples/group/group_enum.c
+++ b/source/lib/netapi/examples/localgroup/localgroup_getmembers.c
@@ -1,6 +1,6 @@
 /*
  *  Unix SMB/CIFS implementation.
- *  NetGroupEnum query
+ *  NetLocalGroupGetMembers query
  *  Copyright (C) Guenther Deschner 2008
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -32,18 +32,19 @@ int main(int argc, const char **argv)
 	NET_API_STATUS status;
 	struct libnetapi_ctx *ctx = NULL;
 	const char *hostname = NULL;
+	const char *groupname = NULL;
 	uint32_t level = 0;
 	uint8_t *buffer = NULL;
 	uint32_t entries_read = 0;
 	uint32_t total_entries = 0;
 	uint32_t resume_handle = 0;
-	int i;
 	char *sid_str = NULL;
+	int i;
 
-	struct GROUP_INFO_0 *info0 = NULL;
-	struct GROUP_INFO_1 *info1 = NULL;
-	struct GROUP_INFO_2 *info2 = NULL;
-	struct GROUP_INFO_3 *info3 = NULL;
+	struct LOCALGROUP_MEMBERS_INFO_0 *info0 = NULL;
+	struct LOCALGROUP_MEMBERS_INFO_1 *info1 = NULL;
+	struct LOCALGROUP_MEMBERS_INFO_2 *info2 = NULL;
+	struct LOCALGROUP_MEMBERS_INFO_3 *info3 = NULL;
 
 	poptContext pc;
 	int opt;
@@ -59,9 +60,9 @@ int main(int argc, const char **argv)
 		return status;
 	}
 
-	pc = poptGetContext("group_enum", argc, argv, long_options, 0);
+	pc = poptGetContext("localgroup_getmembers", argc, argv, long_options, 0);
 
-	poptSetOtherOptionHelp(pc, "hostname level");
+	poptSetOtherOptionHelp(pc, "hostname groupname level");
 	while((opt = poptGetNextOpt(pc)) != -1) {
 	}
 
@@ -70,35 +71,41 @@ int main(int argc, const char **argv)
 		goto out;
 	}
 	hostname = poptGetArg(pc);
+	if (!poptPeekArg(pc)) {
+		poptPrintHelp(pc, stderr, 0);
+		goto out;
+	}
+	groupname = poptGetArg(pc);
 
 	if (poptPeekArg(pc)) {
 		level = atoi(poptGetArg(pc));
 	}
 
-	/* NetGroupEnum */
+	/* NetLocalGroupGetMembers */
 
 	do {
-		status = NetGroupEnum(hostname,
-				      level,
-				      &buffer,
-				      (uint32_t)-1,
-				      &entries_read,
-				      &total_entries,
-				      &resume_handle);
+		status = NetLocalGroupGetMembers(hostname,
+						 groupname,
+						 level,
+						 &buffer,
+						 (uint32_t)-1,
+						 &entries_read,
+						 &total_entries,
+						 &resume_handle);
 		if (status == 0 || status == ERROR_MORE_DATA) {
 			printf("total entries: %d\n", total_entries);
 			switch (level) {
 				case 0:
-					info0 = (struct GROUP_INFO_0 *)buffer;
+					info0 = (struct LOCALGROUP_MEMBERS_INFO_0 *)buffer;
 					break;
 				case 1:
-					info1 = (struct GROUP_INFO_1 *)buffer;
+					info1 = (struct LOCALGROUP_MEMBERS_INFO_1 *)buffer;
 					break;
 				case 2:
-					info2 = (struct GROUP_INFO_2 *)buffer;
+					info2 = (struct LOCALGROUP_MEMBERS_INFO_2 *)buffer;
 					break;
 				case 3:
-					info3 = (struct GROUP_INFO_3 *)buffer;
+					info3 = (struct LOCALGROUP_MEMBERS_INFO_3 *)buffer;
 					break;
 				default:
 					break;
@@ -106,34 +113,39 @@ int main(int argc, const char **argv)
 			for (i=0; i<entries_read; i++) {
 				switch (level) {
 					case 0:
-						printf("#%d group: %s\n", i, info0->grpi0_name);
+						if (ConvertSidToStringSid(info0->lgrmi0_sid,
+									  &sid_str)) {
+							printf("#%d member sid: %s\n", i, sid_str);
+							free(sid_str);
+						}
 						info0++;
 						break;
 					case 1:
-						printf("#%d group: %s\n", i, info1->grpi1_name);
-						printf("#%d comment: %s\n", i, info1->grpi1_comment);
+						if (ConvertSidToStringSid(info1->lgrmi1_sid,
+									  &sid_str)) {
+							printf("#%d member sid: %s\n", i, sid_str);
+							free(sid_str);
+						}
+						printf("#%d sid type: %d\n", i, info1->lgrmi1_sidusage);
+						printf("#%d name: %s\n", i, info1->lgrmi1_name);
 						info1++;
 						break;
 					case 2:
-						printf("#%d group: %s\n", i, info2->grpi2_name);
-						printf("#%d comment: %s\n", i, info2->grpi2_comment);
-						printf("#%d rid: %d\n", i, info2->grpi2_group_id);
-						printf("#%d attributes: 0x%08x\n", i, info2->grpi2_attributes);
-						info2++;
-						break;
-					case 3:
-						printf("#%d group: %s\n", i, info3->grpi3_name);
-						printf("#%d comment: %s\n", i, info3->grpi3_comment);
-						if (ConvertSidToStringSid(info3->grpi3_group_sid,
+						if (ConvertSidToStringSid(info2->lgrmi2_sid,
 									  &sid_str)) {
-							printf("#%d group_sid: %s\n", i, sid_str);
+							printf("#%d member sid: %s\n", i, sid_str);
 							free(sid_str);
 						}
-						printf("#%d attributes: 0x%08x\n", i, info3->grpi3_attributes);
+						printf("#%d sid type: %d\n", i, info2->lgrmi2_sidusage);
+						printf("#%d full name: %s\n", i, info2->lgrmi2_domainandname);
+						info2++;
+						break;
+					case 3:
+						printf("#%d full name: %s\n", i, info3->lgrmi3_domainandname);
 						info3++;
 						break;
-
-
+					default:
+						break;
 				}
 			}
 			NetApiBufferFree(buffer);
@@ -141,7 +153,7 @@ int main(int argc, const char **argv)
 	} while (status == ERROR_MORE_DATA);
 
 	if (status != 0) {
-		printf("NetGroupEnum failed with: %s\n",
+		printf("NetLocalGroupGetMembers failed with: %s\n",
 			libnetapi_get_error_string(ctx, status));
 	}
 
diff --git a/source/lib/netapi/getdc.c b/source/lib/netapi/getdc.c
index 4636042..07a6544 100644
--- a/source/lib/netapi/getdc.c
+++ b/source/lib/netapi/getdc.c
@@ -31,7 +31,7 @@
 WERROR NetGetDCName_l(struct libnetapi_ctx *ctx,
 		      struct NetGetDCName *r)
 {
-	return WERR_NOT_SUPPORTED;
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGetDCName);
 }
 
 /********************************************************************
@@ -45,12 +45,9 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx,
 	NTSTATUS status;
 	WERROR werr;
 
-	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_netlogon.syntax_id,
+	werr = libnetapi_open_pipe(ctx, r->in.server_name,
+				   &ndr_table_netlogon.syntax_id,
+				   &cli,
 				   &pipe_cli);
 	if (!W_ERROR_IS_OK(werr)) {
 		goto done;
@@ -72,7 +69,7 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx,
 WERROR NetGetAnyDCName_l(struct libnetapi_ctx *ctx,
 			 struct NetGetAnyDCName *r)
 {
-	return WERR_NOT_SUPPORTED;
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGetAnyDCName);
 }
 
 /********************************************************************
@@ -86,12 +83,9 @@ WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx,
 	NTSTATUS status;
 	WERROR werr;
 
-	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_netlogon.syntax_id,
+	werr = libnetapi_open_pipe(ctx, r->in.server_name,
+				   &ndr_table_netlogon.syntax_id,
+				   &cli,
 				   &pipe_cli);
 	if (!W_ERROR_IS_OK(werr)) {
 		goto done;
@@ -146,12 +140,9 @@ WERROR DsGetDcName_r(struct libnetapi_ctx *ctx,
 	struct cli_state *cli = NULL;
 	struct rpc_pipe_client *pipe_cli = NULL;
 
-	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_netlogon.syntax_id,
+	werr = libnetapi_open_pipe(ctx, r->in.server_name,
+				   &ndr_table_netlogon.syntax_id,
+				   &cli,
 				   &pipe_cli);
 	if (!W_ERROR_IS_OK(werr)) {
 		goto done;
diff --git a/source/lib/netapi/group.c b/source/lib/netapi/group.c
index 30ff6af..f7c9366 100644
--- a/source/lib/netapi/group.c
+++ b/source/lib/netapi/group.c
@@ -71,12 +71,9 @@ WERROR NetGroupAdd_r(struct libnetapi_ctx *ctx,
 			goto done;
 	}
 
-	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;
@@ -220,7 +217,7 @@ WERROR NetGroupAdd_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupAdd_l(struct libnetapi_ctx *ctx,
 		     struct NetGroupAdd *r)
 {
-	return NetGroupAdd_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupAdd);
 }
 
 /****************************************************************
@@ -251,12 +248,9 @@ WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	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;
@@ -390,7 +384,7 @@ WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupDel_l(struct libnetapi_ctx *ctx,
 		     struct NetGroupDel *r)
 {
-	return NetGroupDel_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupDel);
 }
 
 /****************************************************************
@@ -425,12 +419,9 @@ WERROR NetGroupSetInfo_r(struct libnetapi_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	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;
@@ -578,7 +569,7 @@ WERROR NetGroupSetInfo_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupSetInfo_l(struct libnetapi_ctx *ctx,
 			 struct NetGroupSetInfo *r)
 {
-	return NetGroupSetInfo_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupSetInfo);
 }
 
 /****************************************************************
@@ -669,12 +660,9 @@ WERROR NetGroupGetInfo_r(struct libnetapi_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	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;
@@ -766,7 +754,7 @@ WERROR NetGroupGetInfo_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupGetInfo_l(struct libnetapi_ctx *ctx,
 			 struct NetGroupGetInfo *r)
 {
-	return NetGroupGetInfo_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupGetInfo);
 }
 
 /****************************************************************
@@ -794,12 +782,9 @@ WERROR NetGroupAddUser_r(struct libnetapi_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	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;
@@ -896,7 +881,7 @@ WERROR NetGroupAddUser_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupAddUser_l(struct libnetapi_ctx *ctx,
 			 struct NetGroupAddUser *r)
 {
-	return NetGroupAddUser_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupAddUser);
 }
 
 /****************************************************************
@@ -924,12 +909,9 @@ WERROR NetGroupDelUser_r(struct libnetapi_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	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;
@@ -1025,7 +1007,7 @@ WERROR NetGroupDelUser_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupDelUser_l(struct libnetapi_ctx *ctx,
 			 struct NetGroupDelUser *r)
 {
-	return NetGroupDelUser_r(ctx, r);
+	LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetGroupDelUser);
 }
 
 /****************************************************************
@@ -1211,12 +1193,9 @@ WERROR NetGroupEnum_r(struct libnetapi_ctx *ctx,
 			return WERR_UNKNOWN_LEVEL;
 	}
 
-	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;
@@ -1304,7 +1283,7 @@ WERROR NetGroupEnum_r(struct libnetapi_ctx *ctx,
 WERROR NetGroupEnum_l(struct libnetapi_ctx *ctx,
 		      struct NetGroupEnum *r)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list