idmap_adex: Add more debugging to the basic search function.
authorGerald (Jerry) Carter <jerry@samba.org>
Mon, 6 Oct 2008 16:47:57 +0000 (11:47 -0500)
committerGerald (Jerry) Carter <jerry@samba.org>
Mon, 6 Oct 2008 19:10:03 +0000 (14:10 -0500)
Log the dn of all located entries in order to verify search results.

source3/winbindd/idmap_adex/likewise_cell.c

index 77eeee406b01dc03ec24ce67bcd6347c2cac9ed5..7723b3e0153fb490363db30042b49a5bac243cfc 100644 (file)
@@ -389,6 +389,24 @@ done:
                status = ads_do_search(c->conn, search_base,
                                       scope, expr, attrs, msg);
                if (ADS_ERR_OK(status)) {
+                       if (DEBUGLEVEL >= 10) {
+                               LDAPMessage *e = NULL;
+
+                               int n = ads_count_replies(c->conn, *msg);
+
+                               DEBUG(10,("cell_do_search: Located %d entries\n", n));
+
+                               for (e=ads_first_entry(c->conn, *msg);
+                                    e!=NULL;
+                                    e = ads_next_entry(c->conn, e))
+                               {
+                                       char *dn = ads_get_dn(c->conn, e);
+
+                                       DEBUGADD(10,("   dn: %s\n", dn ? dn : "<NULL>"));
+                                       SAFE_FREE(dn);
+                               }
+                       }
+
                        return status;
                }