diff options
author | Luke Leighton <lkcl@samba.org> | 1999-10-28 20:34:28 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-10-28 20:34:28 +0000 |
commit | 326b011b2df0dc83aa59fda9ab7dd8bcc0909a2e (patch) | |
tree | 7b5cda9cfd60f3a6d7770e9c43f9ed9923b96ce2 /source3/rpcclient | |
parent | c7c77cbfd75052c73723b1b6783f254d2ff49e65 (diff) | |
download | samba-326b011b2df0dc83aa59fda9ab7dd8bcc0909a2e.tar.gz samba-326b011b2df0dc83aa59fda9ab7dd8bcc0909a2e.tar.bz2 samba-326b011b2df0dc83aa59fda9ab7dd8bcc0909a2e.zip |
restructuring sam enum dom groups code to do multiple calls to
sam_enum_dom_groups. enum dom aliases is still left to do (dom users
already done).
(This used to be commit 8d181924cedb7a2d34a0b40cee600494665fe923)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index c1c09948e7..f0ce84e3ef 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -1397,7 +1397,7 @@ int msrpc_sam_enum_users(struct client_info *info, uint16 acb_mask = 0; uint16 unk_1 = 0x0; uint32 ace_perms = 0x304; /* access control permissions */ - uint32 status = STATUS_MORE_ENTRIES; + uint32 status; POLICY_HND sam_pol; POLICY_HND pol_dom; POLICY_HND pol_blt; @@ -1450,13 +1450,14 @@ int msrpc_sam_enum_users(struct client_info *info, if (res1) { /* read some users */ - while (status == STATUS_MORE_ENTRIES) + do { status = samr_enum_dom_users(smb_cli, fnum, &pol_dom, - &start_idx, acb_mask, unk_1, 0x10000, + &start_idx, acb_mask, unk_1, 0x100000, sam, num_sam_entries); - } + + } while (status == STATUS_MORE_ENTRIES); if ((*num_sam_entries) == 0) { @@ -2137,9 +2138,9 @@ uint32 msrpc_sam_enum_groups(struct client_info *info, DOM_SID sid1; BOOL res = True; uint32 ace_perms = 0x02000000; /* access control permissions. */ - uint32 group_idx; POLICY_HND sam_pol; POLICY_HND pol_dom; + uint32 status; sid_copy(&sid1, &info->dom.level5_sid); @@ -2175,19 +2176,25 @@ uint32 msrpc_sam_enum_groups(struct client_info *info, (*sam) = NULL; - /* read some groups */ - res = res ? samr_enum_dom_groups(smb_cli, fnum, - &pol_dom, - 0x0, 0x100000, - sam, num_sam_entries) : False; - - if (res && (*num_sam_entries) == 0) - { - report(out_hnd, "No groups\n"); - } - if (res) { + uint32 group_idx; + uint32 start_idx = 0; + /* read some groups */ + do + { + status = samr_enum_dom_groups(smb_cli, fnum, + &pol_dom, + &start_idx, 0x100000, + sam, num_sam_entries); + + } while (status == STATUS_MORE_ENTRIES); + + if ((*num_sam_entries) == 0) + { + report(out_hnd, "No groups\n"); + } + for (group_idx = 0; group_idx < (*num_sam_entries); group_idx++) { uint32 group_rid = (*sam)[group_idx].rid; @@ -2236,8 +2243,8 @@ void cmd_sam_enum_groups(struct client_info *info) BOOL request_group_info = False; fstring tmp; int i; - struct acct_info *sam; - uint32 num_sam_entries; + struct acct_info *sam = NULL; + uint32 num_sam_entries = 0; for (i = 0; i < 3; i++) { |