The branch, v3-0-test has been updated
       via  ce475f86a2dae3db9c094105be1a3daedacfb40e (commit)
      from  1b707cfd762fdb622080921695f313f59ad817dd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit ce475f86a2dae3db9c094105be1a3daedacfb40e
Author: Volker Lendecke <[EMAIL PROTECTED]>
Date:   Sat Apr 26 09:24:39 2008 +0200

    Fix bug 5419
    
    This is a port of Steven Danneman's 3-2 fix that was pushed with fe9f48bfe
    
    Thanks!

-----------------------------------------------------------------------

Summary of changes:
 source/include/ads_protos.h |    2 ++
 source/libads/ldap.c        |   26 ++++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/ads_protos.h b/source/include/ads_protos.h
index b5f3237..3530aeb 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 5d498ab..67c5470 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


-- 
Samba Shared Repository

Reply via email to