[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2008-g72fc4ff

Günther Deschner gd at samba.org
Fri Feb 8 11:10:38 GMT 2008


The branch, v3-2-test has been updated
       via  72fc4ffa38285b3358c6e264e9007162ae3782f1 (commit)
      from  fe3a02d44c4051ef84a182bdeb4130548d98db38 (commit)

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


- Log -----------------------------------------------------------------
commit 72fc4ffa38285b3358c6e264e9007162ae3782f1
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 8 12:05:29 2008 +0100

    Use rpccli_samr_LookupRids() in net and rpcclient.
    
    Guenther

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

Summary of changes:
 source/rpcclient/cmd_samr.c |   20 ++++++++++++++------
 source/utils/net_rpc.c      |   34 +++++++++++++++++++++-------------
 2 files changed, 35 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpcclient/cmd_samr.c b/source/rpcclient/cmd_samr.c
index 0082d5c..f36e633 100644
--- a/source/rpcclient/cmd_samr.c
+++ b/source/rpcclient/cmd_samr.c
@@ -1847,8 +1847,10 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
 {
 	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
 	POLICY_HND connect_pol, domain_pol;
-	uint32 num_rids, num_names, *rids, *name_types;
-	char **names;
+	uint32_t num_rids, num_names, *rids;
+	struct lsa_Strings names;
+	struct samr_Ids types;
+
 	int i;
 
 	if (argc < 3) {
@@ -1896,8 +1898,12 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
 	for (i = 0; i < argc - 2; i++)
                 sscanf(argv[i + 2], "%i", &rids[i]);
 
-	result = rpccli_samr_lookup_rids(cli, mem_ctx, &domain_pol, num_rids, rids,
-				      &num_names, &names, &name_types);
+	result = rpccli_samr_LookupRids(cli, mem_ctx,
+					&domain_pol,
+					num_rids,
+					rids,
+					&names,
+					&types);
 
 	if (!NT_STATUS_IS_OK(result) &&
 	    !NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED))
@@ -1905,8 +1911,10 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
 
 	/* Display results */
 
-	for (i = 0; i < num_names; i++)
-		printf("rid 0x%x: %s (%d)\n", rids[i], names[i], name_types[i]);
+	for (i = 0; i < num_names; i++) {
+		printf("rid 0x%x: %s (%d)\n",
+			rids[i], names.names[i].string, types.ids[i]);
+	}
 
 	rpccli_samr_Close(cli, mem_ctx, &domain_pol);
 	rpccli_samr_Close(cli, mem_ctx, &connect_pol);
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index 26d63a8..33a1dad 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -1167,8 +1167,9 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
 	uint32 *rids, num_rids, *name_types, num_names;
 	uint32 flags = 0x000003e8; /* Unknown */
 	int i;
-	char **names;
 	struct samr_RidWithAttributeArray *rid_array = NULL;
+	struct lsa_Strings names;
+	struct samr_Ids types;
 
 	if (argc < 1) {
 		d_printf("User must be specified\n");
@@ -1226,9 +1227,12 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
 		for (i = 0; i < num_rids; i++)
 			rids[i] = rid_array->rids[i].rid;
 
-		result = rpccli_samr_lookup_rids(pipe_hnd, mem_ctx, &domain_pol,
-				      	      num_rids, rids,
-				      	      &num_names, &names, &name_types);
+		result = rpccli_samr_LookupRids(pipe_hnd, mem_ctx,
+						&domain_pol,
+						num_rids,
+						rids,
+						&names,
+						&types);
 
 		if (!NT_STATUS_IS_OK(result)) {
 			goto done;
@@ -1237,7 +1241,7 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
 		/* Display results */
 
 		for (i = 0; i < num_names; i++)
-			printf("%s\n", names[i]);
+			printf("%s\n", names.names[i].string);
 	}
  done:
 	return result;
@@ -2826,11 +2830,10 @@ static NTSTATUS rpc_list_group_members(struct rpc_pipe_client *pipe_hnd,
 	NTSTATUS result;
 	POLICY_HND group_pol;
 	uint32 num_members, *group_rids;
-	uint32 num_names;
-	char **names;
-	uint32 *name_types;
 	int i;
 	struct samr_RidTypeArray *rids = NULL;
+	struct lsa_Strings names;
+	struct samr_Ids types;
 
 	fstring sid_str;
 	sid_to_fstring(sid_str, domain_sid);
@@ -2860,9 +2863,12 @@ static NTSTATUS rpc_list_group_members(struct rpc_pipe_client *pipe_hnd,
 		if (num_members < this_time)
 			this_time = num_members;
 
-		result = rpccli_samr_lookup_rids(pipe_hnd, mem_ctx, domain_pol,
-					      this_time, group_rids,
-					      &num_names, &names, &name_types);
+		result = rpccli_samr_LookupRids(pipe_hnd, mem_ctx,
+						domain_pol,
+						this_time,
+						group_rids,
+						&names,
+						&types);
 
 		if (!NT_STATUS_IS_OK(result))
 			return result;
@@ -2874,10 +2880,12 @@ static NTSTATUS rpc_list_group_members(struct rpc_pipe_client *pipe_hnd,
 
 			if (opt_long_list_entries) {
 				printf("%s-%d %s\\%s %d\n", sid_str,
-				       group_rids[i], domain_name, names[i],
+				       group_rids[i], domain_name,
+				       names.names[i].string,
 				       SID_NAME_USER);
 			} else {
-				printf("%s\\%s\n", domain_name, names[i]);
+				printf("%s\\%s\n", domain_name,
+					names.names[i].string);
 			}
 		}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list