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;
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);
uint32 flags = 0x000003e8; /* Unknown */
int i;
char **names;
- DOM_GID *user_gids;
+ struct samr_RidWithAttributeArray *rid_array = NULL;
if (argc < 1) {
d_printf("User must be specified\n");
&user_pol);
if (!NT_STATUS_IS_OK(result)) goto done;
- result = rpccli_samr_query_usergroups(pipe_hnd, mem_ctx, &user_pol,
- &num_rids, &user_gids);
+ result = rpccli_samr_GetGroupsForUser(pipe_hnd, mem_ctx,
+ &user_pol,
+ &rid_array);
if (!NT_STATUS_IS_OK(result)) goto done;
+ num_rids = rid_array->count;
+
/* Look up rids */
if (num_rids) {
}
for (i = 0; i < num_rids; i++)
- rids[i] = user_gids[i].g_rid;
+ rids[i] = rid_array->rids[i].rid;
result = rpccli_samr_lookup_rids(pipe_hnd, mem_ctx, &domain_pol,
num_rids, rids,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND dom_pol, user_pol;
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
- DOM_GID *user_groups;
+ struct samr_RidWithAttributeArray *rid_array = NULL;
unsigned int i;
uint32 user_rid;
struct rpc_pipe_client *cli;
return result;
/* Query user rids */
- result = rpccli_samr_query_usergroups(cli, mem_ctx, &user_pol,
- num_groups, &user_groups);
+ result = rpccli_samr_GetGroupsForUser(cli, mem_ctx,
+ &user_pol,
+ &rid_array);
+ *num_groups = rid_array->count;
rpccli_samr_Close(cli, mem_ctx, &user_pol);
for (i=0;i<(*num_groups);i++) {
sid_copy(&((*user_grpsids)[i]), &domain->sid);
sid_append_rid(&((*user_grpsids)[i]),
- user_groups[i].g_rid);
+ rid_array->rids[i].rid);
}
-
+
return NT_STATUS_OK;
}