summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-06 16:19:20 +0100
committerGünther Deschner <gd@samba.org>2008-02-07 14:25:18 +0100
commit1c788bc36561842d08c3f62b5d3145dbe74db620 (patch)
tree4614b83777642886d54f4dc96ac6d45d19051f2d /source3/rpcclient
parentcce7e93d842833e7f44254d80de59cc35e8f2af7 (diff)
downloadsamba-1c788bc36561842d08c3f62b5d3145dbe74db620.tar.gz
samba-1c788bc36561842d08c3f62b5d3145dbe74db620.tar.bz2
samba-1c788bc36561842d08c3f62b5d3145dbe74db620.zip
Use rpccli_samr_GetGroupsForUser() all over the place.
Guenther (This used to be commit d1c669920e88e7fecd13101c4ddfe45354c5ecdb)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_samr.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 43f53cb263..c77d13d88e 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -605,13 +605,12 @@ static NTSTATUS cmd_samr_query_usergroups(struct rpc_pipe_client *cli,
domain_pol,
user_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- uint32 num_groups,
- user_rid;
+ uint32 user_rid;
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
- DOM_GID *user_gids;
int i;
fstring server;
-
+ struct samr_RidWithAttributeArray *rid_array = NULL;
+
if ((argc < 2) || (argc > 3)) {
printf("Usage: %s rid [access mask]\n", argv[0]);
return NT_STATUS_OK;
@@ -648,15 +647,17 @@ static NTSTATUS cmd_samr_query_usergroups(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
- result = rpccli_samr_query_usergroups(cli, mem_ctx, &user_pol,
- &num_groups, &user_gids);
+ result = rpccli_samr_GetGroupsForUser(cli, mem_ctx,
+ &user_pol,
+ &rid_array);
if (!NT_STATUS_IS_OK(result))
goto done;
- for (i = 0; i < num_groups; i++) {
- printf("\tgroup rid:[0x%x] attr:[0x%x]\n",
- user_gids[i].g_rid, user_gids[i].attr);
+ for (i = 0; i < rid_array->count; i++) {
+ printf("\tgroup rid:[0x%x] attr:[0x%x]\n",
+ rid_array->rids[i].rid,
+ rid_array->rids[i].attributes);
}
rpccli_samr_Close(cli, mem_ctx, &user_pol);