1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbldap: Introduce "smbldap_get_paged_results"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2017-04-19 13:39:25 +02:00
parent 46968fc60f
commit 84b7125b99
3 changed files with 9 additions and 3 deletions

View 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);

View 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.

View 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. */