diff options
author | Günther Deschner <gd@samba.org> | 2008-02-05 02:45:51 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-05 10:13:08 +0100 |
commit | 0c6b6b461c0cad6943fe24fd76f9723b749dc15c (patch) | |
tree | 21e01afdf96cfddddaa0eac0e92a1a45c60173e3 /source3/rpcclient | |
parent | f3d5f695646ef498889405c3b49c6b220df9d004 (diff) | |
download | samba-0c6b6b461c0cad6943fe24fd76f9723b749dc15c.tar.gz samba-0c6b6b461c0cad6943fe24fd76f9723b749dc15c.tar.bz2 samba-0c6b6b461c0cad6943fe24fd76f9723b749dc15c.zip |
Use rpccli_samr_GetAliasMembership() in winbindd and rpcclient.
Guenther
(This used to be commit 5c167162856fd1e13a3e04423cfc0cc936ae26b0)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index e751c4d132..ccea73e5a1 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -696,11 +696,11 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; DOM_SID *sids; size_t num_sids; - uint32 num_aliases, *alias_rids; uint32 access_mask = MAXIMUM_ALLOWED_ACCESS; int i; fstring server; - DOM_SID2 *sid2; + struct lsa_SidArray sid_array; + struct samr_Ids alias_rids; if (argc < 3) { printf("Usage: %s builtin|domain sid1 sid2 ...\n", argv[0]); @@ -723,18 +723,22 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli, } if (num_sids) { - sid2 = TALLOC_ARRAY(mem_ctx, DOM_SID2, num_sids); - if (sid2 == NULL) + sid_array.sids = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_SidPtr, num_sids); + if (sid_array.sids == NULL) return NT_STATUS_NO_MEMORY; } else { - sid2 = NULL; + sid_array.sids = NULL; } for (i=0; i<num_sids; i++) { - sid_copy(&sid2[i].sid, &sids[i]); - sid2[i].num_auths = sid2[i].sid.num_auths; + sid_array.sids[i].sid = sid_dup_talloc(mem_ctx, &sids[i]); + if (!sid_array.sids[i].sid) { + return NT_STATUS_NO_MEMORY; + } } + sid_array.num_sids = num_sids; + slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost); strupper_m(server); @@ -763,15 +767,15 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli, if (!NT_STATUS_IS_OK(result)) goto done; - result = rpccli_samr_query_useraliases(cli, mem_ctx, &domain_pol, - num_sids, sid2, - &num_aliases, &alias_rids); - + result = rpccli_samr_GetAliasMembership(cli, mem_ctx, + &domain_pol, + &sid_array, + &alias_rids); if (!NT_STATUS_IS_OK(result)) goto done; - for (i = 0; i < num_aliases; i++) { - printf("\tgroup rid:[0x%x]\n", alias_rids[i]); + for (i = 0; i < alias_rids.count; i++) { + printf("\tgroup rid:[0x%x]\n", alias_rids.ids[i]); } rpccli_samr_Close(cli, mem_ctx, &domain_pol); |