diff options
author | Volker Lendecke <vl@samba.org> | 2008-04-26 09:24:39 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-04-26 09:24:39 +0200 |
commit | ce475f86a2dae3db9c094105be1a3daedacfb40e (patch) | |
tree | 0b8ef9e76eb0bbb5146afa4deb355cbb974039a7 | |
parent | 1b707cfd762fdb622080921695f313f59ad817dd (diff) | |
download | samba-ce475f86a2dae3db9c094105be1a3daedacfb40e.tar.gz |
Fix bug 5419
This is a port of Steven Danneman's 3-2 fix that was pushed with fe9f48bfe
Thanks!
-rw-r--r-- | source/include/ads_protos.h | 2 | ||||
-rw-r--r-- | source/libads/ldap.c | 26 |
2 files changed, 26 insertions, 2 deletions
diff --git a/source/include/ads_protos.h b/source/include/ads_protos.h index b5f323774d3..3530aeb533b 100644 --- a/source/include/ads_protos.h +++ b/source/include/ads_protos.h @@ -83,6 +83,8 @@ ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res); LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res); +LDAPMessage *ads_first_message(ADS_STRUCT *ads, LDAPMessage *res); +LDAPMessage *ads_next_message(ADS_STRUCT *ads, LDAPMessage *res); void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res, BOOL(*fn)(char *, void **, void *), void *data_area); diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 5d498abb1c0..67c547011bb 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -788,8 +788,8 @@ static ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path, /* this relies on the way that ldap_add_result_entry() works internally. I hope that this works on all ldap libs, but I have only tested with openldap */ - for (msg = ads_first_entry(ads, res2); msg; msg = next) { - next = ads_next_entry(ads, msg); + for (msg = ads_first_message(ads, res2); msg; msg = next) { + next = ads_next_message(ads, msg); ldap_add_result_entry((LDAPMessage **)res, msg); } /* note that we do not free res2, as the memory is now @@ -1923,6 +1923,28 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) } /** + * pull the first message from a ADS result + * @param ads connection to ads server + * @param res Results of search + * @return first message from result + **/ + LDAPMessage *ads_first_message(ADS_STRUCT *ads, LDAPMessage *res) +{ + return ldap_first_message(ads->ld, res); +} + +/** + * pull the next message from a ADS result + * @param ads connection to ads server + * @param res Results of search + * @return next message from result + **/ + LDAPMessage *ads_next_message(ADS_STRUCT *ads, LDAPMessage *res) +{ + return ldap_next_message(ads->ld, res); +} + +/** * pull a single string from a ADS result * @param ads connection to ads server * @param mem_ctx TALLOC_CTX to use for allocating result string |