From c32b4b61610338f12093f3ad552c27b4f972e8fd Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 15 Nov 2001 06:55:56 +0000 Subject: Caching user, group and domain sam handles was a stupid idea. Now we just keep a record of the open pipes. (This used to be commit 77c287e9460eed7bde7004c7e6c8cb0099c6ba6f) --- source3/nsswitch/winbindd_group.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source3/nsswitch/winbindd_group.c') diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 335f1d6514..3bee95b845 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -473,20 +473,30 @@ static BOOL get_sam_group_entries(struct getent_state *ent) do { struct acct_info *sam_grp_entries = NULL; + uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED; CLI_POLICY_HND *hnd; + POLICY_HND dom_pol; num_entries = 0; - if (!(hnd = cm_get_sam_dom_handle(ent->domain->name, - &ent->domain->sid))) + if (!(hnd = cm_get_sam_handle(ent->domain->name))) + break; + + status = cli_samr_open_domain(hnd->cli, mem_ctx, + &hnd->pol, des_access, + &ent->domain->sid, &dom_pol); + + if (!NT_STATUS_IS_OK(status)) break; status = cli_samr_enum_dom_groups( - hnd->cli, mem_ctx, &hnd->pol, + hnd->cli, mem_ctx, &dom_pol, &ent->grp_query_start_ndx, 0x8000, /* buffer size? */ (struct acct_info **) &sam_grp_entries, &num_entries); + cli_samr_close(hnd->cli, mem_ctx, &dom_pol); + /* Copy entries into return buffer */ if (num_entries) { -- cgit