summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-12 15:02:01 +0200
committerVolker Lendecke <vl@samba.org>2009-06-12 15:04:21 +0200
commit6e4c57ced543e7b572beb567526df21a4c880eef (patch)
tree875f96889ea721e43df5ab3c8fc6b0c7548d0d4a /source3/passdb
parentbaa6ebddcb45fd817a7ff9b7986afbe3fc4c4b6c (diff)
downloadsamba-6e4c57ced543e7b572beb567526df21a4c880eef.tar.gz
samba-6e4c57ced543e7b572beb567526df21a4c880eef.tar.bz2
samba-6e4c57ced543e7b572beb567526df21a4c880eef.zip
Activate tldap tracing in pdb_ads
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ads.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index 9494915d9d..0811082e84 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -1947,6 +1947,39 @@ static void free_private_data(void **vp)
return;
}
+/*
+ this is used to catch debug messages from events
+*/
+static void s3_tldap_debug(void *context, enum tldap_debug_level level,
+ const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
+
+static void s3_tldap_debug(void *context, enum tldap_debug_level level,
+ const char *fmt, va_list ap)
+{
+ int samba_level = -1;
+ char *s = NULL;
+ switch (level) {
+ case TLDAP_DEBUG_FATAL:
+ samba_level = 0;
+ break;
+ case TLDAP_DEBUG_ERROR:
+ samba_level = 1;
+ break;
+ case TLDAP_DEBUG_WARNING:
+ samba_level = 2;
+ break;
+ case TLDAP_DEBUG_TRACE:
+ samba_level = 10;
+ break;
+
+ };
+ if (vasprintf(&s, fmt, ap) == -1) {
+ return;
+ }
+ DEBUG(samba_level, ("tldap: %s", s));
+ free(s);
+}
+
static NTSTATUS pdb_ads_connect(struct pdb_ads_state *state,
const char *location)
{
@@ -1979,6 +2012,7 @@ static NTSTATUS pdb_ads_connect(struct pdb_ads_state *state,
status = NT_STATUS_NO_MEMORY;
goto done;
}
+ tldap_set_debug(state->ld, s3_tldap_debug, NULL);
rc = tldap_search_fmt(
state->ld, "", TLDAP_SCOPE_BASE,