svn commit: samba r24245 - in branches/SAMBA_4_0/source/lib: .

abartlet at samba.org abartlet at samba.org
Mon Aug 6 01:36:50 GMT 2007


Author: abartlet
Date: 2007-08-06 01:36:49 +0000 (Mon, 06 Aug 2007)
New Revision: 24245

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

Log:
Fix bug #4828 - we need to set the samba LDB debug handler early, so
we catch messages pushed out by modules during startup.

This also sets an explict mapping between ldb and Samba debug levels.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/db_wrap.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/db_wrap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/db_wrap.c	2007-08-05 11:34:57 UTC (rev 24244)
+++ branches/SAMBA_4_0/source/lib/db_wrap.c	2007-08-06 01:36:49 UTC (rev 24245)
@@ -47,13 +47,23 @@
 static void ldb_wrap_debug(void *context, enum ldb_debug_level level, 
 			   const char *fmt, va_list ap)
 {
+	int samba_level;
 	char *s = NULL;
-	if (DEBUGLEVEL < 4 && level > LDB_DEBUG_WARNING) {
-		return;
-	}
-	if (DEBUGLEVEL < 2 && level > LDB_DEBUG_ERROR) {
-		return;
-	}
+	switch (level) {
+	case LDB_DEBUG_FATAL:
+		samba_level = 0;
+		break;
+	case LDB_DEBUG_ERROR:
+		samba_level = 1;
+		break;
+	case LDB_DEBUG_WARNING:
+		samba_level = 2;
+		break;
+	case LDB_DEBUG_TRACE:
+		samba_level = 5;
+		break;
+		
+	};
 	vasprintf(&s, fmt, ap);
 	if (!s) return;
 	DEBUG(level, ("ldb: %s\n", s));
@@ -137,6 +147,10 @@
 		return NULL;
 	}
 
+	ldb_set_debug(ldb, ldb_wrap_debug, NULL);
+
+	ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
+
 	real_url = private_path(ldb, url);
 	if (real_url == NULL) {
 		talloc_free(ldb);
@@ -159,10 +173,6 @@
 		return NULL;
 	}
 
-	ldb_set_debug(ldb, ldb_wrap_debug, NULL);
-
-	ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
-
 	/* setup for leak detection */
 	ldb_set_opaque(ldb, "wrap_url", real_url);
 	startup_blocks = talloc(ldb, size_t);



More information about the samba-cvs mailing list