Fix from "Ken Cross" <kcross@nssolutions.com> for enumerating
[tprouty/samba.git] / source / nsswitch / winbindd_rpc.c
index ddd2fc4946c29c0224b054820dccae8856bc5fcd..edeacdec6d84d030e533fcd9609059a9cee3129d 100644 (file)
@@ -131,6 +131,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
        CLI_POLICY_HND *hnd;
        POLICY_HND dom_pol;
        NTSTATUS status;
+       uint32 start = 0;
 
        *num_entries = 0;
        *info = NULL;
@@ -149,11 +150,12 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
 
        do {
                struct acct_info *info2 = NULL;
-               uint32 count = 0, start = *num_entries;
+               uint32 count = 0;
                TALLOC_CTX *mem_ctx2;
 
                mem_ctx2 = talloc_init("enum_dom_groups[rpc]");
 
+               /* start is updated by this call. */
                status = cli_samr_enum_dom_groups(hnd->cli, mem_ctx2, &dom_pol,
                                                  &start,
                                                  0xFFFF, /* buffer size? */