Only ask for 512 names at a time.
authorVolker Lendecke <vlendec@samba.org>
Thu, 27 Nov 2003 17:31:18 +0000 (17:31 +0000)
committerVolker Lendecke <vlendec@samba.org>
Thu, 27 Nov 2003 17:31:18 +0000 (17:31 +0000)
Volker

source/utils/net_rpc.c

index af575d95853c7d62a821797ea2c336237e2791fd..2453355ee3d9c3957051847ae45c65f4cc1a77f0 100644 (file)
@@ -1125,16 +1125,27 @@ rpc_group_members_internals(const DOM_SID *domain_sid, struct cli_state *cli,
        if (!NT_STATUS_IS_OK(result))
                goto done;
 
-       result = cli_samr_lookup_rids(cli, mem_ctx, &domain_pol, 1000,
-                                     num_members, group_rids,
-                                     &num_names, &names, &name_types);
+       do {
+               int this_time = 512;
 
-       if (!NT_STATUS_IS_OK(result))
-               goto done;
+               if (num_members < this_time)
+                       this_time = num_members;
 
-       for (i = 0; i < num_members; i++) {
-               printf("%s\n", names[i]);
-       }
+               result = cli_samr_lookup_rids(cli, mem_ctx, &domain_pol, 1000,
+                                             this_time, group_rids,
+                                             &num_names, &names, &name_types);
+
+               if (!NT_STATUS_IS_OK(result))
+                       goto done;
+
+               for (i = 0; i < this_time; i++) {
+                       printf("%s\n", names[i]);
+               }
+
+               num_members -= this_time;
+               group_rids += 512;
+
+       } while (num_members > 0);
 
  done:
        return result;