svn commit: samba r2693 - in branches/SAMBA_4_0/source/ldap_server: .

metze at samba.org metze at samba.org
Mon Sep 27 15:11:42 GMT 2004


Author: metze
Date: 2004-09-27 15:11:42 +0000 (Mon, 27 Sep 2004)
New Revision: 2693

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ldap_server&rev=2693&nolog=1

Log:
- send a reply when no attributes there
- add some debug messages

metze

Modified:
   branches/SAMBA_4_0/source/ldap_server/ldap_simple_ldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/ldap_server/ldap_simple_ldb.c
===================================================================
--- branches/SAMBA_4_0/source/ldap_server/ldap_simple_ldb.c	2004-09-27 14:44:48 UTC (rev 2692)
+++ branches/SAMBA_4_0/source/ldap_server/ldap_simple_ldb.c	2004-09-27 15:11:42 UTC (rev 2693)
@@ -48,19 +48,23 @@
 	enum ldb_scope scope = LDB_SCOPE_DEFAULT;
 	const char **attrs = NULL;
 
-	DEBUG(0, ("sldb_Search: %s\n", r->filter));
+	DEBUG(10, ("sldb_Search: basedn: [%s]\n", r->basedn));
+	DEBUG(10, ("sldb_Search: filter: [%s]\n", r->filter));
 
 	samdb = samdb_connect(call);
 	ldb = samdb->ldb;
 
 	switch (r->scope) {
 		case LDAP_SEARCH_SCOPE_BASE:
+			DEBUG(10,("sldb_Search: scope: [BASE]\n"));
 			scope = LDB_SCOPE_BASE;
 			break;
 		case LDAP_SEARCH_SCOPE_SINGLE:
+			DEBUG(10,("sldb_Search: scope: [ONE]\n"));
 			scope = LDB_SCOPE_ONELEVEL;
 			break;
 		case LDAP_SEARCH_SCOPE_SUB:
+			DEBUG(10,("sldb_Search: scope: [SUB]\n"));
 			scope = LDB_SCOPE_SUBTREE;
 			break;
 	}
@@ -70,6 +74,7 @@
 		ALLOC_CHECK(attrs);
 
 		for (i=0; i < r->num_attributes; i++) {
+			DEBUG(10,("sldb_Search: attrs: [%s]\n",r->attributes[i]));
 			attrs[i] = r->attributes[i];
 		}
 		attrs[i] = NULL;
@@ -79,10 +84,13 @@
 	count = ldb_search(ldb, r->basedn, scope, r->filter, attrs, &res);
 
 	if (count > 0) {
+		DEBUG(10,("sldb_Search: results: [%d]\n",count));
 		result = 0;
 	} else if (count == 0) {
+		DEBUG(10,("sldb_Search: no results\n"));
 		result = 32;
 	} else if (count == -1) {
+		DEBUG(10,("sldb_Search: error\n"));
 		result = 1;
 	}
 
@@ -95,7 +103,7 @@
 		ent->num_attributes = 0;
 		ent->attributes = NULL;
 		if (res[i]->num_elements == 0) {
-			continue;
+			goto queue_reply;
 		}
 		ent->num_attributes = res[i]->num_elements;
 		ent->attributes = talloc_array_p(ent_r, struct ldap_attribute, ent->num_attributes);
@@ -117,7 +125,7 @@
 									res[i]->elements[j].values[y].data);
 			}
 		}
-
+queue_reply:
 		status = ldapsrv_queue_reply(call, ent_r);
 		if (!NT_STATUS_IS_OK(status)) {
 			return status;



More information about the samba-cvs mailing list