smbldap: Introduce "smbldap_get_paged_results"
authorVolker Lendecke <vl@samba.org>
Wed, 19 Apr 2017 11:39:25 +0000 (13:39 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 20 Apr 2017 08:13:25 +0000 (10:13 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/include/smbldap.h
source3/lib/smbldap.c
source3/passdb/pdb_ldap.c

index 8bae63a..3aca948 100644 (file)
@@ -69,6 +69,7 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx,
                      struct smbldap_state **smbldap_state);
 
 LDAP *smbldap_get_ldap(struct smbldap_state *state);
+bool smbldap_get_paged_results(struct smbldap_state *state);
 
 void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value);
 void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob);
index ba845af..932695d 100644 (file)
@@ -40,6 +40,10 @@ LDAP *smbldap_get_ldap(struct smbldap_state *state)
        return state->ldap_struct;
 }
 
+bool smbldap_get_paged_results(struct smbldap_state *state)
+{
+       return state->paged_results;
+}
 
 /*******************************************************************
  Search an attribute and return the first value found.
index d94a72d..7c5f8cf 100644 (file)
@@ -4399,7 +4399,7 @@ static bool ldapsam_search_firstpage(struct pdb_search *search)
 
        state->entries = NULL;
 
-       if (state->connection->paged_results) {
+       if (smbldap_get_paged_results(state->connection)) {
                rc = smbldap_search_paged(state->connection, state->base,
                                          state->scope, state->filter,
                                          state->attrs, state->attrsonly,
@@ -4444,7 +4444,7 @@ static bool ldapsam_search_nextpage(struct pdb_search *search)
                (struct ldap_search_state *)search->private_data;
        int rc;
 
-       if (!state->connection->paged_results) {
+       if (!smbldap_get_paged_results(state->connection)) {
                /* There is no next page when there are no paged results */
                return False;
        }
@@ -4529,8 +4529,9 @@ static void ldapsam_search_end(struct pdb_search *search)
        state->entries = NULL;
        state->current_entry = NULL;
 
-       if (!state->connection->paged_results)
+       if (!smbldap_get_paged_results(state->connection)) {
                return;
+       }
 
        /* Tell the LDAP server we're not interested in the rest anymore. */