&total_size,
&returned_size,
&disp_info);
+
+ if (!NT_STATUS_IS_OK(result)) {
+ if (!NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) {
+ return result;
+ }
+ }
+
num_dom_users = disp_info.info1.count;
start_idx += disp_info.info1.count;
loop_count++;
talloc_destroy(mem_ctx2);
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
- return NT_STATUS_OK;
+ return status;
}
/* List all domain groups */
} while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES));
- return NT_STATUS_OK;
+ return result;
}
/* convert a single name to a sid in a domain */
if (!NT_STATUS_IS_OK(result))
return result;
- *num_names = rids->count;
- rid_mem = rids->rids;
-
- if (!*num_names) {
+ if (!rids || !rids->count) {
names = NULL;
name_types = NULL;
sid_mem = NULL;
return NT_STATUS_OK;
}
+ *num_names = rids->count;
+ rid_mem = rids->rids;
+
/* Step #2: Convert list of rids into list of usernames. Do this
in bunches of ~1000 to avoid crashing NT4. It looks like there
is a buffer overflow or something like that lurking around
* This call can take a long time
* allow the server to time out.
* 35 seconds should do it.
- * NB
- * only do this when the undelying transport is named pipe.
*/
- if (cli->transport->transport == NCACN_NP) {
- orig_timeout = rpccli_set_timeout(cli, 35000);
- }
+ orig_timeout = rpccli_set_timeout(cli, 35000);
status = lookup_names_fn(cli,
mem_ctx,
types);
/* And restore our original timeout. */
- if (cli->transport->transport == NCACN_NP) {
- rpccli_set_timeout(cli, orig_timeout);
- }
+ rpccli_set_timeout(cli, orig_timeout);
if (!NT_STATUS_IS_OK(status)) {
return status;