[PATCH] added missing '\n' to ldb_debug messages

Sumit Bose sbose at redhat.com
Thu Jul 9 09:23:15 MDT 2009


Hi,

this patch adds a few missing '\n' to ldb debug messages to make the
debug experience more consistent.

bye,
Sumit
-------------- next part --------------
>From 7cb1922590ccbc34061d102a58993d439a9781bc Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Thu, 9 Jul 2009 16:59:08 +0200
Subject: [PATCH] added missing '\n' to ldb_debug messages

---
 source4/lib/ldb/common/attrib_handlers.c |    2 +-
 source4/lib/ldb/common/ldb.c             |   14 +++++++-------
 source4/lib/ldb/common/ldb_debug.c       |    2 +-
 source4/lib/ldb/common/ldb_match.c       |    6 +++---
 source4/lib/ldb/common/ldb_modules.c     |    8 ++++----
 source4/lib/ldb/ldb_tdb/ldb_tdb.c        |    2 +-
 source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c   |    2 +-
 source4/lib/ldb/modules/rdn_name.c       |    2 +-
 8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/source4/lib/ldb/common/attrib_handlers.c b/source4/lib/ldb/common/attrib_handlers.c
index 9cb9ff8..3a8a7ef 100644
--- a/source4/lib/ldb/common/attrib_handlers.c
+++ b/source4/lib/ldb/common/attrib_handlers.c
@@ -62,7 +62,7 @@ int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
 
 	out->data = (uint8_t *)ldb_casefold(ldb, mem_ctx, (const char *)(in->data), in->length);
 	if (out->data == NULL) {
-		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_handler_fold: unable to casefold string [%s]", in->data);
+		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_handler_fold: unable to casefold string [%s]\n", in->data);
 		return -1;
 	}
 
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 64ad683..cd79f76 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -41,7 +41,7 @@ static int ldb_context_destructor(void *ptr)
 
 	if (ldb->transaction_active) {
 		ldb_debug(ldb, LDB_DEBUG_FATAL,
-			  "A transaction is still active in ldb context [%p]",
+			  "A transaction is still active in ldb context [%p]\n",
 			  ldb);
 	}
 
@@ -78,7 +78,7 @@ static void ldb_tevent_debug(void *context, enum tevent_debug_level level,
 
 	vasprintf(&s, fmt, ap);
 	if (!s) return;
-	ldb_debug(ldb, ldb_level, "tevent: %s", s);
+	ldb_debug(ldb, ldb_level, "tevent: %s\n", s);
 	free(s);
 }
 
@@ -300,7 +300,7 @@ int ldb_transaction_start(struct ldb_context *ldb)
 	int status;
 
 	ldb_debug(ldb, LDB_DEBUG_TRACE,
-		  "start ldb transaction (nesting: %d)",
+		  "start ldb transaction (nesting: %d)\n",
 		  ldb->transaction_active);
 
 	/* explicit transaction active, count nested requests */
@@ -340,7 +340,7 @@ int ldb_transaction_commit(struct ldb_context *ldb)
 	ldb->transaction_active--;
 
 	ldb_debug(ldb, LDB_DEBUG_TRACE,
-		  "commit ldb transaction (nesting: %d)",
+		  "commit ldb transaction (nesting: %d)\n",
 		  ldb->transaction_active);
 
 	/* commit only when all nested transactions are complete */
@@ -350,7 +350,7 @@ int ldb_transaction_commit(struct ldb_context *ldb)
 
 	if (ldb->transaction_active < 0) {
 		ldb_debug(ldb, LDB_DEBUG_FATAL,
-			  "commit called but no ldb transactions are active!");
+			  "commit called but no ldb transactions are active!\n");
 		ldb->transaction_active = 0;
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
@@ -383,7 +383,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
 	ldb->transaction_active--;
 
 	ldb_debug(ldb, LDB_DEBUG_TRACE,
-		  "cancel ldb transaction (nesting: %d)",
+		  "cancel ldb transaction (nesting: %d)\n",
 		  ldb->transaction_active);
 
 	/* really cancel only if all nested transactions are complete */
@@ -393,7 +393,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
 
 	if (ldb->transaction_active < 0) {
 		ldb_debug(ldb, LDB_DEBUG_FATAL,
-			  "commit called but no ldb transactions are active!");
+			  "commit called but no ldb transactions are active!\n");
 		ldb->transaction_active = 0;
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c
index f8009eb..cf6218d 100644
--- a/source4/lib/ldb/common/ldb_debug.c
+++ b/source4/lib/ldb/common/ldb_debug.c
@@ -96,7 +96,7 @@ void ldb_debug_set(struct ldb_context *ldb, enum ldb_debug_level level,
 	va_end(ap);
 	if (msg != NULL) {
 		ldb_set_errstring(ldb, msg);
-		ldb_debug(ldb, level, "%s", msg);
+		ldb_debug(ldb, level, "%s\n", msg);
 	}
 	talloc_free(msg);
 }
diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c
index c622701..39aa75e 100644
--- a/source4/lib/ldb/common/ldb_match.c
+++ b/source4/lib/ldb/common/ldb_match.c
@@ -316,15 +316,15 @@ static int ldb_match_extended(struct ldb_context *ldb,
 	struct ldb_message_element *el;
 
 	if (tree->u.extended.dnAttributes) {
-		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: dnAttributes extended match not supported yet");
+		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: dnAttributes extended match not supported yet\n");
 		return -1;
 	}
 	if (tree->u.extended.rule_id == NULL) {
-		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: no-rule extended matches not supported yet");
+		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: no-rule extended matches not supported yet\n");
 		return -1;
 	}
 	if (tree->u.extended.attr == NULL) {
-		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: no-attribute extended matches not supported yet");
+		ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: no-attribute extended matches not supported yet\n");
 		return -1;
 	}
 
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index ae97ef4..ede54e1 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -426,7 +426,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
 		ret = ldb_search(ldb, mods_dn, &res, mods_dn, LDB_SCOPE_BASE, attrs, "@LIST=*");
 		
 		if (ret == LDB_ERR_NO_SUCH_OBJECT) {
-			ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db");
+			ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db\n");
 		} else if (ret != LDB_SUCCESS) {
 			ldb_debug(ldb, LDB_DEBUG_FATAL, "ldb error (%s) occurred searching for modules, bailing out\n", ldb_errstring(ldb));
 			talloc_free(mem_ctx);
@@ -434,7 +434,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
 		} else {
 			const char *module_list;
 			if (res->count == 0) {
-				ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db");
+				ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db\n");
 			} else if (res->count > 1) {
 				ldb_debug(ldb, LDB_DEBUG_FATAL, "Too many records found (%d), bailing out\n", res->count);
 				talloc_free(mem_ctx);
@@ -442,7 +442,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
 			} else {
 				module_list = ldb_msg_find_attr_as_string(res->msgs[0], "@LIST", NULL);
 				if (!module_list) {
-					ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db");
+					ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db\n");
 				}
 				modules = ldb_modules_list_from_string(ldb, mem_ctx,
 							       module_list);
@@ -459,7 +459,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
 			return ret;
 		}
 	} else {
-		ldb_debug(ldb, LDB_DEBUG_TRACE, "No modules specified for this database");
+		ldb_debug(ldb, LDB_DEBUG_TRACE, "No modules specified for this database\n");
 	}
 
 	ret = ldb_init_module_chain(ldb, ldb->modules);
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 4a45276..bcf4764 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1238,7 +1238,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
 	if (strchr(url, ':')) {
 		if (strncmp(url, "tdb://", 6) != 0) {
 			ldb_debug(ldb, LDB_DEBUG_ERROR,
-				  "Invalid tdb URL '%s'", url);
+				  "Invalid tdb URL '%s'\n", url);
 			return -1;
 		}
 		path = url+6;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index 6ee8417..bf3e5ad 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -87,7 +87,7 @@ static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, con
 		ldb_level = LDB_DEBUG_FATAL;
 	}
 
-	ldb_debug(ldb, ldb_level, "ltdb: tdb(%s): %s", name, message);
+	ldb_debug(ldb, ldb_level, "ltdb: tdb(%s): %s\n", name, message);
 	talloc_free(message);
 }
 
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 880678d..a58ebc7 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -157,7 +157,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
 		}
 		if (i == attribute->num_values) {
 			ldb_debug_set(ldb, LDB_DEBUG_FATAL, 
-				      "RDN mismatch on %s: %s (%s)", 
+				      "RDN mismatch on %s: %s (%s)\n", 
 				      ldb_dn_get_linearized(msg->dn), rdn_name, rdn_val.data);
 			talloc_free(ac);
 			/* Match AD's error here */
-- 
1.6.2.5



More information about the samba-technical mailing list