diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-01-31 12:47:42 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-01-31 12:47:42 +0000 |
commit | 0815cd63bd878d72c154caf5e121352b2af10a53 (patch) | |
tree | 89abd01f19e69cdd2e51b226a1ee840a7ec37179 /source3/nsswitch | |
parent | 12b7f600a0549c8a5136951697952fbffc55a2ca (diff) | |
download | samba-0815cd63bd878d72c154caf5e121352b2af10a53.tar.gz samba-0815cd63bd878d72c154caf5e121352b2af10a53.tar.bz2 samba-0815cd63bd878d72c154caf5e121352b2af10a53.zip |
reduced memory usage in winbindd with a rpc backend by using a
separate talloc context for each partial fetch
(This used to be commit 9c8a2fe4df21c29c90dc8493dade2b12314234c3)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_rpc.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c index 2057a85fa3..5e766cd9eb 100644 --- a/source3/nsswitch/winbindd_rpc.c +++ b/source3/nsswitch/winbindd_rpc.c @@ -36,8 +36,6 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, POLICY_HND dom_pol; BOOL got_dom_pol = False; uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED; - SAM_DISPINFO_CTR ctr; - SAM_DISPINFO_1 info1; int i; *num_entries = 0; @@ -58,16 +56,21 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, got_dom_pol = True; - ctr.sam.info1 = &info1; - i = 0; do { + SAM_DISPINFO_CTR ctr; + SAM_DISPINFO_1 info1; uint32 count = 0, start=i; int j; - + TALLOC_CTX *ctx2; + + ctr.sam.info1 = &info1; + ctx2 = talloc_init_named("winbindd dispinfo"); + if (!ctx2) return NT_STATUS_NO_MEMORY; + /* Query display info level 1 */ - result = cli_samr_query_dispinfo(hnd->cli, mem_ctx, + result = cli_samr_query_dispinfo(hnd->cli, ctx2, &dom_pol, &start, 1, &count, 0xFFFF, &ctr); @@ -96,6 +99,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, something like that. */ (*info)[i].group_rid = DOMAIN_GROUP_RID_USERS; } + + talloc_destroy(ctx2); } while (NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)); done: |