s3-secrets: only include secrets.h when needed.
[nivanova/samba-autobuild/.git] / source3 / winbindd / idmap_adex / likewise_cell.c
index 77eeee406b01dc03ec24ce67bcd6347c2cac9ed5..3e529b427a4e830ece3f391c8c9ecda82a0398f3 100644 (file)
@@ -19,7 +19,9 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
+#include "secrets.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
@@ -176,7 +178,7 @@ static struct likewise_cell *_lw_cell_list = NULL;
 /**********************************************************************
  *********************************************************************/
 
- void cell_set_domain_sid(struct likewise_cell *c, DOM_SID *sid)
+ void cell_set_domain_sid(struct likewise_cell *c, struct dom_sid *sid)
 {
        sid_copy(&c->domain_sid, sid);
 }
@@ -389,6 +391,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, talloc_tos(), e);
+
+                                       DEBUGADD(10,("   dn: %s\n", dn ? dn : "<NULL>"));
+                                       TALLOC_FREE(dn);
+                               }
+                       }
+
                        return status;
                }