svn commit: samba r18620 - in branches: SAMBA_3_0/source/libads SAMBA_3_0_23/source/libads

gd at samba.org gd at samba.org
Mon Sep 18 19:26:09 GMT 2006


Author: gd
Date: 2006-09-18 19:26:09 +0000 (Mon, 18 Sep 2006)
New Revision: 18620

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18620

Log:
Fallback to non-paging LDAP searches in ads_do_search_retry_internal()
for anonymous bound connections.

When doing anonymous bind you can never use paged LDAP control for
RootDSE searches on AD. 

Guenther

Modified:
   branches/SAMBA_3_0/source/libads/ldap_utils.c
   branches/SAMBA_3_0_23/source/libads/ldap_utils.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap_utils.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap_utils.c	2006-09-18 19:18:29 UTC (rev 18619)
+++ branches/SAMBA_3_0/source/libads/ldap_utils.c	2006-09-18 19:26:09 UTC (rev 18620)
@@ -50,7 +50,15 @@
 	}
 
 	*res = NULL;
-	status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+
+	/* when binding anonymously, we cannot use the paged search LDAP
+	 * control - Guenther */
+
+	if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
+		status = ads_do_search(ads, bp, scope, expr, attrs, res);
+	} else {
+		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+	}
 	if (ADS_ERR_OK(status)) {
 		DEBUG(5,("Search for %s gave %d replies\n",
 			 expr, ads_count_replies(ads, *res)));
@@ -83,7 +91,16 @@
 		}
 
 		*res = NULL;
-		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+
+		/* when binding anonymously, we cannot use the paged search LDAP
+		 * control - Guenther */
+
+		if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
+			status = ads_do_search(ads, bp, scope, expr, attrs, res);
+		} else {
+			status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+		}
+
 		if (ADS_ERR_OK(status)) {
 			DEBUG(5,("Search for filter: %s, base: %s gave %d replies\n",
 				 expr, bp, ads_count_replies(ads, *res)));

Modified: branches/SAMBA_3_0_23/source/libads/ldap_utils.c
===================================================================
--- branches/SAMBA_3_0_23/source/libads/ldap_utils.c	2006-09-18 19:18:29 UTC (rev 18619)
+++ branches/SAMBA_3_0_23/source/libads/ldap_utils.c	2006-09-18 19:26:09 UTC (rev 18620)
@@ -49,7 +49,15 @@
 	}
 
 	*res = NULL;
-	status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+
+	/* when binding anonymously, we cannot use the paged search LDAP
+	 * control - Guenther */
+
+	if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
+		status = ads_do_search(ads, bp, scope, expr, attrs, res);
+	} else {
+		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+	}
 	if (ADS_ERR_OK(status)) {
 		DEBUG(5,("Search for %s gave %d replies\n",
 			 expr, ads_count_replies(ads, *res)));
@@ -82,7 +90,16 @@
 		}
 
 		*res = NULL;
-		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+
+		/* when binding anonymously, we cannot use the paged search LDAP
+		 * control - Guenther */
+
+		if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
+			status = ads_do_search(ads, bp, scope, expr, attrs, res);
+		} else {
+			status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
+		}
+
 		if (ADS_ERR_OK(status)) {
 			DEBUG(5,("Search for filter: %s, base: %s gave %d replies\n",
 				 expr, bp, ads_count_replies(ads, *res)));



More information about the samba-cvs mailing list