From f66cc827096c53d4d16b8c850c83a3b5664e9725 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 10 Jun 2010 15:40:14 +0200 Subject: [PATCH] s3: Fix EnumDomainAliases when no aliases are in LDAP We used to return NT_STATUS_ACCESS_DENIED, now we just return 0 entries, just like W2k8 does. usrmgr.exe was pretty unhappy with the NT_STATUS_ACCESS_DENIED --- source3/passdb/pdb_ldap.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index b81d1e6..d2b4f4f 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -4441,12 +4441,6 @@ static bool ldapsam_search_firstpage(struct pdb_search *search) } state->current_entry = ldap_first_entry(ld, state->entries); - if (state->current_entry == NULL) { - ldap_msgfree(state->entries); - state->entries = NULL; - return false; - } - return True; } @@ -4489,6 +4483,10 @@ static bool ldapsam_search_next_entry(struct pdb_search *search, bool result; retry: + if (state->current_entry == NULL) { + return false; + } + if ((state->entries == NULL) && (state->pagedresults_cookie == NULL)) return False; -- 1.6.4.2