summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpcclient/cmd_samr.c19
-rw-r--r--source3/utils/net_rpc.c11
-rw-r--r--source3/winbindd/winbindd_rpc.c12
3 files changed, 24 insertions, 18 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);
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 8530767d38..612ae1cb2e 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1164,7 +1164,7 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
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");
@@ -1203,11 +1203,14 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
&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) {
@@ -1217,7 +1220,7 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
}
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,
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 98e4077a4d..8e196e50ec 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -510,7 +510,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
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;
@@ -557,8 +557,10 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
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);
@@ -572,9 +574,9 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
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;
}