s3: Fix EnumDomainAliases when no aliases are in LDAP
authorVolker Lendecke <vl@samba.org>
Thu, 10 Jun 2010 13:40:14 +0000 (15:40 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 10 Jun 2010 13:28:26 +0000 (15:28 +0200)
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

index b81d1e6b927feb94bfa3bebe40f34df1593d0cdc..d2b4f4fbbad5c1ed51219b8266bf7e7e0510385d 100644 (file)
@@ -4441,12 +4441,6 @@ static bool ldapsam_search_firstpage(struct pdb_search *search)
         }
         state->current_entry = ldap_first_entry(ld, state->entries);
 
         }
         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;
 }
 
        return True;
 }
 
@@ -4489,6 +4483,10 @@ static bool ldapsam_search_next_entry(struct pdb_search *search,
        bool result;
 
  retry:
        bool result;
 
  retry:
+       if (state->current_entry == NULL) {
+               return false;
+       }
+
        if ((state->entries == NULL) && (state->pagedresults_cookie == NULL))
                return False;
 
        if ((state->entries == NULL) && (state->pagedresults_cookie == NULL))
                return False;