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

View: New views
6 Messages — Rating Filter:   Alert me  

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

by Sumit Bose :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

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

bye,
Sumit

>From 7cb1922590ccbc34061d102a58993d439a9781bc Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@...>
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


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

by Andrew Bartlett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-07-09 at 17:23 +0200, Sumit Bose wrote:
> Hi,
>
> this patch adds a few missing '\n' to ldb debug messages to make the
> debug experience more consistent.

I would rather the reverse - that we never specify the \n.

The inclusion of \n in Samba's DEBUG() messages is a hack dating back
years, to do with the way Samba outputs multiple line messages.  I don't
think we need to infect ldb with that.

Instead, ldb_debug_stderr() should be patched to output a \n on the end
of the line, as the log format requires.  (This message can be
redirected, and may not go to a log, and so should not have the log
formatting oddity embeded in the code).

Andrew Bartlett

--
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.


signature.asc (196 bytes) Download Attachment

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

by Sumit Bose :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 10, 2009 at 11:52:24AM +1000, Andrew Bartlett wrote:

> On Thu, 2009-07-09 at 17:23 +0200, Sumit Bose wrote:
> > Hi,
> >
> > this patch adds a few missing '\n' to ldb debug messages to make the
> > debug experience more consistent.
>
> I would rather the reverse - that we never specify the \n.
>
> The inclusion of \n in Samba's DEBUG() messages is a hack dating back
> years, to do with the way Samba outputs multiple line messages.  I don't
> think we need to infect ldb with that.
>
> Instead, ldb_debug_stderr() should be patched to output a \n on the end
> of the line, as the log format requires.  (This message can be
> redirected, and may not go to a log, and so should not have the log
> formatting oddity embeded in the code).
>

I have talked with Simo on irc and got the impression that he preferred
having \n. In general I don't mind which way to go as long as it is only
one way.

If we agree on having no \n at all, I can send a new patch. Simo?

bye,
Sumit

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

by simo-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-07-10 at 08:54 +0200, Sumit Bose wrote:

> On Fri, Jul 10, 2009 at 11:52:24AM +1000, Andrew Bartlett wrote:
> > On Thu, 2009-07-09 at 17:23 +0200, Sumit Bose wrote:
> > > Hi,
> > >
> > > this patch adds a few missing '\n' to ldb debug messages to make the
> > > debug experience more consistent.
> >
> > I would rather the reverse - that we never specify the \n.
> >
> > The inclusion of \n in Samba's DEBUG() messages is a hack dating back
> > years, to do with the way Samba outputs multiple line messages.  I don't
> > think we need to infect ldb with that.
> >
> > Instead, ldb_debug_stderr() should be patched to output a \n on the end
> > of the line, as the log format requires.  (This message can be
> > redirected, and may not go to a log, and so should not have the log
> > formatting oddity embeded in the code).
> >
>
> I have talked with Simo on irc and got the impression that he preferred
> having \n. In general I don't mind which way to go as long as it is only
> one way.
>
> If we agree on having no \n at all, I can send a new patch. Simo?

Yes I am fine either way too, if Andrew feels strongly for no \n, that
ok with me.

Simo.

--
Simo Sorce
Samba Team GPL Compliance Officer <simo@...>
Principal Software Engineer at Red Hat, Inc. <simo@...>


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

by Sumit Bose :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 10, 2009 at 07:45:05AM -0400, simo wrote:

> On Fri, 2009-07-10 at 08:54 +0200, Sumit Bose wrote:
> > On Fri, Jul 10, 2009 at 11:52:24AM +1000, Andrew Bartlett wrote:
> > > On Thu, 2009-07-09 at 17:23 +0200, Sumit Bose wrote:
> > > > Hi,
> > > >
> > > > this patch adds a few missing '\n' to ldb debug messages to make the
> > > > debug experience more consistent.
> > >
> > > I would rather the reverse - that we never specify the \n.
> > >
> > > The inclusion of \n in Samba's DEBUG() messages is a hack dating back
> > > years, to do with the way Samba outputs multiple line messages.  I don't
> > > think we need to infect ldb with that.
> > >
> > > Instead, ldb_debug_stderr() should be patched to output a \n on the end
> > > of the line, as the log format requires.  (This message can be
> > > redirected, and may not go to a log, and so should not have the log
> > > formatting oddity embeded in the code).
> > >
> >
> > I have talked with Simo on irc and got the impression that he preferred
> > having \n. In general I don't mind which way to go as long as it is only
> > one way.
> >
> > If we agree on having no \n at all, I can send a new patch. Simo?
>
> Yes I am fine either way too, if Andrew feels strongly for no \n, that
> ok with me.
>
ok, this new patch removes all \n and adds one in ldb_debug_stderr().

bye,
Sumit

>From d6b946c2a4485d9101fac14002b356f507b2276a Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@...>
Date: Fri, 10 Jul 2009 22:44:27 +0200
Subject: [PATCH] remove all '\n' from ldb_debug

---
 source4/lib/ldb/common/ldb.c               |    2 +-
 source4/lib/ldb/common/ldb_debug.c         |    1 +
 source4/lib/ldb/common/ldb_ldif.c          |   12 ++++++------
 source4/lib/ldb/common/ldb_match.c         |    2 +-
 source4/lib/ldb/common/ldb_modules.c       |   24 ++++++++++++------------
 source4/lib/ldb/ldb_ildap/ldb_ildap.c      |    6 +++---
 source4/lib/ldb/ldb_ldap/ldb_ldap.c        |    6 +++---
 source4/lib/ldb/ldb_map/ldb_map.c          |   16 ++++++++--------
 source4/lib/ldb/ldb_map/ldb_map_inbound.c  |    8 ++++----
 source4/lib/ldb/ldb_map/ldb_map_outbound.c |    8 ++++----
 source4/lib/ldb/ldb_tdb/ldb_cache.c        |    6 +++---
 source4/lib/ldb/ldb_tdb/ldb_index.c        |    6 +++---
 source4/lib/ldb/ldb_tdb/ldb_pack.c         |    2 +-
 source4/lib/ldb/ldb_tdb/ldb_tdb.c          |    2 +-
 source4/lib/ldb/modules/asq.c              |    2 +-
 source4/lib/ldb/modules/operational.c      |    4 ++--
 source4/lib/ldb/modules/paged_results.c    |    2 +-
 source4/lib/ldb/modules/rdn_name.c         |    4 ++--
 source4/lib/ldb/modules/sort.c             |    2 +-
 19 files changed, 58 insertions(+), 57 deletions(-)

diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 64ad683..164e5a9 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -240,7 +240,7 @@ int ldb_connect(struct ldb_context *ldb, const char *url,
 
  if (ldb_load_modules(ldb, options) != LDB_SUCCESS) {
  ldb_debug(ldb, LDB_DEBUG_FATAL,
-  "Unable to load modules for %s: %s\n",
+  "Unable to load modules for %s: %s",
   url, ldb_errstring(ldb));
  return LDB_ERR_OTHER;
  }
diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c
index f8009eb..7680862 100644
--- a/source4/lib/ldb/common/ldb_debug.c
+++ b/source4/lib/ldb/common/ldb_debug.c
@@ -56,6 +56,7 @@ static void ldb_debug_stderr(void *context, enum ldb_debug_level level,
 {
  if (level <= LDB_DEBUG_WARNING) {
  vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
  }
 }
 
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index d64a9f1..d890ff8 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -296,7 +296,7 @@ int ldb_ldif_write(struct ldb_context *ldb,
  }
  }
  if (!ldb_changetypes[i].name) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Invalid ldif changetype %d\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Invalid ldif changetype %d",
   ldif->changetype);
  talloc_free(mem_ctx);
  return -1;
@@ -561,7 +561,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
 
  /* first line must be a dn */
  if (ldb_attr_cmp(attr, "dn") != 0) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: First line of ldif must be a dn not '%s'\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: First line of ldif must be a dn not '%s'",
   attr);
  goto failed;
  }
@@ -569,7 +569,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
  msg->dn = ldb_dn_from_ldb_val(msg, ldb, &value);
 
  if ( ! ldb_dn_validate(msg->dn)) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Unable to parse dn '%s'\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Unable to parse dn '%s'",
   (char *)value.data);
  goto failed;
  }
@@ -588,8 +588,8 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
  }
  }
  if (!ldb_changetypes[i].name) {
- ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Error: Bad ldif changetype '%s'\n",(char *)value.data);
+ ldb_debug(ldb, LDB_DEBUG_ERROR,
+  "Error: Bad ldif changetype '%s'",(char *)value.data);
  }
  flags = 0;
  continue;
@@ -638,7 +638,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
  }
  if (value.length == 0) {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Error: Attribute value cannot be empty for attribute '%s'\n", el->name);
+  "Error: Attribute value cannot be empty for attribute '%s'", el->name);
  goto failed;
  }
  if (value.data != el->values[el->num_values].data) {
diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c
index c622701..e6ee0de 100644
--- a/source4/lib/ldb/common/ldb_match.c
+++ b/source4/lib/ldb/common/ldb_match.c
@@ -335,7 +335,7 @@ static int ldb_match_extended(struct ldb_context *ldb,
  }
  }
  if (comp == NULL) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: unknown extended rule_id %s\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: unknown extended rule_id %s",
   tree->u.extended.rule_id);
  return -1;
  }
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index ae97ef4..05dffd0 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -84,13 +84,13 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
  /* spaces not admitted */
  modstr = ldb_modules_strdup_no_spaces(mem_ctx, string);
  if ( ! modstr) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_strdup_no_spaces()\n");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_strdup_no_spaces()");
  return NULL;
  }
 
  modules = talloc_realloc(mem_ctx, modules, char *, 2);
  if ( ! modules ) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()\n");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()");
  talloc_free(modstr);
  return NULL;
  }
@@ -106,7 +106,7 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
  i++;
  modules = talloc_realloc(mem_ctx, modules, char *, i + 2);
  if ( ! modules ) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()\n");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()");
  return NULL;
  }
 
@@ -239,7 +239,7 @@ int ldb_connect_backend(struct ldb_context *ldb,
 
  if (fn == NULL) {
  ldb_debug(ldb, LDB_DEBUG_FATAL,
-  "Unable to find backend for '%s'\n", url);
+  "Unable to find backend for '%s'", url);
  return LDB_ERR_OTHER;
  }
 
@@ -247,7 +247,7 @@ int ldb_connect_backend(struct ldb_context *ldb,
 
  if (ret != LDB_SUCCESS) {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Failed to connect to '%s'\n", url);
+  "Failed to connect to '%s'", url);
  return ret;
  }
  return ret;
@@ -304,18 +304,18 @@ static void *ldb_dso_load_symbol(struct ldb_context *ldb, const char *name,
  path = talloc_asprintf(ldb, "%s/%s.%s", ldb->modules_dir, name,
        SHLIBEXT);
 
- ldb_debug(ldb, LDB_DEBUG_TRACE, "trying to load %s from %s\n", name, path);
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "trying to load %s from %s", name, path);
 
  handle = dlopen(path, RTLD_NOW);
  if (handle == NULL) {
- ldb_debug(ldb, LDB_DEBUG_WARNING, "unable to load %s from %s: %s\n", name, path, dlerror());
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "unable to load %s from %s: %s", name, path, dlerror());
  return NULL;
  }
 
  sym = (int (*)(void))dlsym(handle, symbol);
 
  if (sym == NULL) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol `%s' found in %s: %s\n", symbol, path, dlerror());
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "no symbol `%s' found in %s: %s", symbol, path, dlerror());
  return NULL;
  }
 
@@ -351,7 +351,7 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str
  }
 
  if (ops == NULL) {
- ldb_debug(ldb, LDB_DEBUG_WARNING, "WARNING: Module [%s] not found\n",
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "WARNING: Module [%s] not found",
   module_list[i]);
  continue;
  }
@@ -382,7 +382,7 @@ int ldb_init_module_chain(struct ldb_context *ldb, struct ldb_module *module)
  if (module) {
  int ret = module->ops->init_context(module);
  if (ret != LDB_SUCCESS) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "module %s initialization failed\n", module->ops->name);
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "module %s initialization failed", module->ops->name);
  return ret;
  }
  }
@@ -428,7 +428,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
  if (ret == LDB_ERR_NO_SUCH_OBJECT) {
  ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db");
  } else if (ret != LDB_SUCCESS) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "ldb error (%s) occurred searching for modules, bailing out\n", ldb_errstring(ldb));
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldb error (%s) occurred searching for modules, bailing out", ldb_errstring(ldb));
  talloc_free(mem_ctx);
  return ret;
  } else {
@@ -436,7 +436,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
  if (res->count == 0) {
  ldb_debug(ldb, LDB_DEBUG_TRACE, "no modules required by the db");
  } else if (res->count > 1) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "Too many records found (%d), bailing out\n", res->count);
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Too many records found (%d), bailing out", res->count);
  talloc_free(mem_ctx);
  return -1;
  } else {
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index 4447d0e..ffde048 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -790,7 +790,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
 
  status = ldap_connect(ildb->ldap, url);
  if (!NT_STATUS_IS_OK(status)) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to connect to ldap URL '%s' - %s\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to connect to ldap URL '%s' - %s",
   url, ldap_errstr(ildb->ldap, module, status));
  goto failed;
  }
@@ -810,14 +810,14 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
  const char *password = cli_credentials_get_password(creds);
  status = ldap_bind_simple(ildb->ldap, bind_dn, password);
  if (!NT_STATUS_IS_OK(status)) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s",
   ldap_errstr(ildb->ldap, module, status));
  goto failed;
  }
  } else {
  status = ldap_bind_sasl(ildb->ldap, creds, lp_ctx);
  if (!NT_STATUS_IS_OK(status)) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s",
   ldap_errstr(ildb->ldap, module, status));
  goto failed;
  }
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index 43a01f7..52c1610 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -219,7 +219,7 @@ static int lldb_search(struct lldb_context *lldb_ac)
  }
 
  if (req->controls != NULL) {
- ldb_debug(ldb, LDB_DEBUG_WARNING, "Controls are not yet supported by ldb_ldap backend!\n");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "Controls are not yet supported by ldb_ldap backend!");
  }
 
  ldb_request_set_state(req, LDB_ASYNC_PENDING);
@@ -871,7 +871,7 @@ static int lldb_connect(struct ldb_context *ldb,
 
  ret = ldap_initialize(&lldb->ldap, url);
  if (ret != LDAP_SUCCESS) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_initialize failed for URL '%s' - %s\n",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_initialize failed for URL '%s' - %s",
   url, ldap_err2string(ret));
  goto failed;
  }
@@ -880,7 +880,7 @@ static int lldb_connect(struct ldb_context *ldb,
 
  ret = ldap_set_option(lldb->ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
  if (ret != LDAP_SUCCESS) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_set_option failed - %s\n",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_set_option failed - %s",
   ldap_err2string(ret));
  goto failed;
  }
diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c
index 5b4ea79..68e9d3f 100644
--- a/source4/lib/ldb/ldb_map/ldb_map.c
+++ b/source4/lib/ldb/ldb_map/ldb_map.c
@@ -242,7 +242,7 @@ int ldb_next_remote_request(struct ldb_module *module, struct ldb_request *reque
 
  default:
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
-  "Invalid remote request!\n");
+  "Invalid remote request!");
  return LDB_ERR_OPERATIONS_ERROR;
  }
 
@@ -503,14 +503,14 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
  case MAP_GENERATE:
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "MAP_IGNORE/MAP_GENERATE attribute '%s' "
-  "used in DN!\n", ldb_dn_get_component_name(dn, i));
+  "used in DN!", ldb_dn_get_component_name(dn, i));
  goto failed;
 
  case MAP_CONVERT:
  if (map->u.convert.convert_local == NULL) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "'convert_local' not set for attribute '%s' "
-  "used in DN!\n", ldb_dn_get_component_name(dn, i));
+  "used in DN!", ldb_dn_get_component_name(dn, i));
  goto failed;
  }
  /* fall through */
@@ -578,14 +578,14 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
  case MAP_GENERATE:
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "MAP_IGNORE/MAP_GENERATE attribute '%s' "
-  "used in DN!\n", ldb_dn_get_component_name(dn, i));
+  "used in DN!", ldb_dn_get_component_name(dn, i));
  goto failed;
 
  case MAP_CONVERT:
  if (map->u.convert.convert_remote == NULL) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "'convert_remote' not set for attribute '%s' "
-  "used in DN!\n", ldb_dn_get_component_name(dn, i));
+  "used in DN!", ldb_dn_get_component_name(dn, i));
  goto failed;
  }
  /* fall through */
@@ -1007,7 +1007,7 @@ static int map_init_dns(struct ldb_module *module, struct ldb_map_context *data,
  dn = ldb_dn_new_fmt(data, ldb, "%s=%s", MAP_DN_NAME, name);
  if ( ! ldb_dn_validate(dn)) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
-  "Failed to construct '%s' DN!\n", MAP_DN_NAME);
+  "Failed to construct '%s' DN!", MAP_DN_NAME);
  return LDB_ERR_OPERATIONS_ERROR;
  }
 
@@ -1018,13 +1018,13 @@ static int map_init_dns(struct ldb_module *module, struct ldb_map_context *data,
  }
  if (res->count == 0) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
-  "No results for '%s=%s'!\n", MAP_DN_NAME, name);
+  "No results for '%s=%s'!", MAP_DN_NAME, name);
  talloc_free(res);
  return LDB_ERR_CONSTRAINT_VIOLATION;
  }
  if (res->count > 1) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
-  "Too many results for '%s=%s'!\n", MAP_DN_NAME, name);
+  "Too many results for '%s=%s'!", MAP_DN_NAME, name);
  talloc_free(res);
  return LDB_ERR_CONSTRAINT_VIOLATION;
  }
diff --git a/source4/lib/ldb/ldb_map/ldb_map_inbound.c b/source4/lib/ldb/ldb_map/ldb_map_inbound.c
index 455740c..8903741 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_inbound.c
+++ b/source4/lib/ldb/ldb_map/ldb_map_inbound.c
@@ -73,7 +73,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, struct ldb_message *l
  /* Unknown attribute: ignore */
  if (map == NULL) {
  ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
-  "Not mapping attribute '%s': no mapping found\n",
+  "Not mapping attribute '%s': no mapping found",
   old->name);
  goto local;
  }
@@ -86,7 +86,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, struct ldb_message *l
  if (map->u.convert.convert_local == NULL) {
  ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
   "Not mapping attribute '%s': "
-  "'convert_local' not set\n",
+  "'convert_local' not set",
   map->local_name);
  goto local;
  }
@@ -100,7 +100,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, struct ldb_message *l
  if (map->u.generate.generate_remote == NULL) {
  ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
   "Not mapping attribute '%s': "
-  "'generate_remote' not set\n",
+  "'generate_remote' not set",
   map->local_name);
  goto local;
  }
@@ -167,7 +167,7 @@ static int ldb_msg_partition(struct ldb_module *module, struct ldb_message *loca
  /* Skip 'IS_MAPPED' */
  if (ldb_attr_cmp(msg->elements[i].name, IS_MAPPED) == 0) {
  ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
-  "Skipping attribute '%s'\n",
+  "Skipping attribute '%s'",
   msg->elements[i].name);
  continue;
  }
diff --git a/source4/lib/ldb/ldb_map/ldb_map_outbound.c b/source4/lib/ldb/ldb_map/ldb_map_outbound.c
index ffcefad..4487d7e 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_outbound.c
+++ b/source4/lib/ldb/ldb_map/ldb_map_outbound.c
@@ -304,7 +304,7 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
  if (map->u.convert.convert_remote == NULL) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "Skipping attribute '%s': "
-  "'convert_remote' not set\n",
+  "'convert_remote' not set",
   attr_name);
  return LDB_SUCCESS;
  }
@@ -323,7 +323,7 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
  if (map->u.generate.generate_local == NULL) {
  ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
   "Skipping attribute '%s': "
-  "'generate_local' not set\n",
+  "'generate_local' not set",
   attr_name);
  return LDB_SUCCESS;
  }
@@ -900,7 +900,7 @@ static int map_subtree_collect_remote(struct ldb_module *module, void *mem_ctx,
  if (map->type == MAP_GENERATE) {
  ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
   "Skipping attribute '%s': "
-  "'convert_operator' not set\n",
+  "'convert_operator' not set",
   tree->u.equality.attr);
  *new = NULL;
  return 0;
@@ -1062,7 +1062,7 @@ int map_return_entry(struct map_context *ac, struct ldb_reply *ares)
    ac->req->op.search.scope)) {
  ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_map: "
   "Skipping record '%s': "
-  "doesn't match original search\n",
+  "doesn't match original search",
   ldb_dn_get_linearized(ares->message->dn));
  return LDB_SUCCESS;
  }
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c
index 042c1c9..2c39968 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c
@@ -141,7 +141,7 @@ static int ltdb_attributes_load(struct ldb_module *module)
  const struct ldb_schema_syntax *s;
 
  if (ltdb_attributes_flags(&msg->elements[i], &flags) != 0) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid @ATTRIBUTES element for '%s'\n", msg->elements[i].name);
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid @ATTRIBUTES element for '%s'", msg->elements[i].name);
  goto failed;
  }
  switch (flags & ~LTDB_FLAG_HIDDEN) {
@@ -156,7 +156,7 @@ static int ltdb_attributes_load(struct ldb_module *module)
  break;
  default:
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Invalid flag combination 0x%x for '%s' in @ATTRIBUTES\n",
+  "Invalid flag combination 0x%x for '%s' in @ATTRIBUTES",
   flags, msg->elements[i].name);
  goto failed;
  }
@@ -164,7 +164,7 @@ static int ltdb_attributes_load(struct ldb_module *module)
  s = ldb_standard_syntax_by_name(ldb, syntax);
  if (s == NULL) {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Invalid attribute syntax '%s' for '%s' in @ATTRIBUTES\n",
+  "Invalid attribute syntax '%s' for '%s' in @ATTRIBUTES",
   syntax, msg->elements[i].name);
  goto failed;
  }
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index fab60cb..1daa450 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -1409,7 +1409,7 @@ int ltdb_index_del_value(struct ldb_module *module, const char *dn,
  struct ldb_ldif ldif;
 
  ldb_debug(ldb, LDB_DEBUG_ERROR,
- "ERROR: dn %s not found in %s\n", dn,
+ "ERROR: dn %s not found in %s", dn,
  ldb_dn_get_linearized(dn_key));
  ldif.changetype = LDB_CHANGETYPE_NONE;
  ldif.msg = msg;
@@ -1587,7 +1587,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
  key2 = ltdb_key(module, msg->dn);
  if (key2.dptr == NULL) {
  /* probably a corrupt record ... darn */
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid DN in re_index: %s\n",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid DN in re_index: %s",
  ldb_dn_get_linearized(msg->dn));
  talloc_free(msg);
  return 0;
@@ -1609,7 +1609,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
  ret = ltdb_index_add0(module, dn, msg->elements, msg->num_elements);
  } else {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Adding special ONE LEVEL index failed (%s)!\n",
+ "Adding special ONE LEVEL index failed (%s)!",
  ldb_dn_get_linearized(msg->dn));
  }
 
diff --git a/source4/lib/ldb/ldb_tdb/ldb_pack.c b/source4/lib/ldb/ldb_tdb/ldb_pack.c
index 1995606..5640e70 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_pack.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_pack.c
@@ -280,7 +280,7 @@ int ltdb_unpack_data(struct ldb_module *module,
 
  if (remaining != 0) {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Error: %d bytes unread in ltdb_unpack_data\n", remaining);
+  "Error: %d bytes unread in ltdb_unpack_data", remaining);
  }
 
  return 0;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 4a45276..d4f7b45 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1276,7 +1276,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
    ldb_get_create_perms(ldb), ldb);
  if (!ltdb->tdb) {
  ldb_debug(ldb, LDB_DEBUG_ERROR,
-  "Unable to open tdb '%s'\n", path);
+  "Unable to open tdb '%s'", path);
  talloc_free(ltdb);
  return -1;
  }
diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c
index dd5afd8..271cf52 100644
--- a/source4/lib/ldb/modules/asq.c
+++ b/source4/lib/ldb/modules/asq.c
@@ -393,7 +393,7 @@ static int asq_init(struct ldb_module *module)
 
  ret = ldb_mod_register_control(module, LDB_CONTROL_ASQ_OID);
  if (ret != LDB_SUCCESS) {
- ldb_debug(ldb, LDB_DEBUG_WARNING, "asq: Unable to register control with rootdse!\n");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "asq: Unable to register control with rootdse!");
  }
 
  return ldb_next_init(module);
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index 43b223b..77b0014 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -169,8 +169,8 @@ static int operational_search_post_process(struct ldb_module *module,
  return 0;
 
 failed:
- ldb_debug_set(ldb, LDB_DEBUG_WARNING,
-      "operational_search_post_process failed for attribute '%s'\n",
+ ldb_debug_set(ldb, LDB_DEBUG_WARNING,
+      "operational_search_post_process failed for attribute '%s'",
       attrs[a]);
  return -1;
 }
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index f269230..b712f84 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -409,7 +409,7 @@ static int paged_request_init(struct ldb_module *module)
  if (ret != LDB_SUCCESS) {
  ldb_debug(ldb, LDB_DEBUG_WARNING,
  "paged_results:"
- "Unable to register control with rootdse!\n");
+ "Unable to register control with rootdse!");
  }
 
  return ldb_next_init(module);
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 880678d..e9f873f 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -98,7 +98,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
  int i, ret;
 
  ldb = ldb_module_get_ctx(module);
- ldb_debug(ldb, LDB_DEBUG_TRACE, "rdn_name_add_record\n");
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "rdn_name_add_record");
 
  /* do not manipulate our control entries */
  if (ldb_dn_is_special(req->op.add.message->dn)) {
@@ -288,7 +288,7 @@ static int rdn_name_rename(struct ldb_module *module, struct ldb_request *req)
  int ret;
 
  ldb = ldb_module_get_ctx(module);
- ldb_debug(ldb, LDB_DEBUG_TRACE, "rdn_name_rename\n");
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "rdn_name_rename");
 
  /* do not manipulate our control entries */
  if (ldb_dn_is_special(req->op.rename.newdn)) {
diff --git a/source4/lib/ldb/modules/sort.c b/source4/lib/ldb/modules/sort.c
index a95a861..b4ea017 100644
--- a/source4/lib/ldb/modules/sort.c
+++ b/source4/lib/ldb/modules/sort.c
@@ -339,7 +339,7 @@ static int server_sort_init(struct ldb_module *module)
  if (ret != LDB_SUCCESS) {
  ldb_debug(ldb, LDB_DEBUG_WARNING,
  "server_sort:"
- "Unable to register control with rootdse!\n");
+ "Unable to register control with rootdse!");
  }
 
  return ldb_next_init(module);
--
1.6.2.5


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

by simo-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-07-10 at 22:55 +0200, Sumit Bose wrote:

> On Fri, Jul 10, 2009 at 07:45:05AM -0400, simo wrote:
> > On Fri, 2009-07-10 at 08:54 +0200, Sumit Bose wrote:
> > > On Fri, Jul 10, 2009 at 11:52:24AM +1000, Andrew Bartlett wrote:
> > > > On Thu, 2009-07-09 at 17:23 +0200, Sumit Bose wrote:
> > > > > Hi,
> > > > >
> > > > > this patch adds a few missing '\n' to ldb debug messages to make the
> > > > > debug experience more consistent.
> > > >
> > > > I would rather the reverse - that we never specify the \n.
> > > >
> > > > The inclusion of \n in Samba's DEBUG() messages is a hack dating back
> > > > years, to do with the way Samba outputs multiple line messages.  I don't
> > > > think we need to infect ldb with that.
> > > >
> > > > Instead, ldb_debug_stderr() should be patched to output a \n on the end
> > > > of the line, as the log format requires.  (This message can be
> > > > redirected, and may not go to a log, and so should not have the log
> > > > formatting oddity embeded in the code).
> > > >
> > >
> > > I have talked with Simo on irc and got the impression that he preferred
> > > having \n. In general I don't mind which way to go as long as it is only
> > > one way.
> > >
> > > If we agree on having no \n at all, I can send a new patch. Simo?
> >
> > Yes I am fine either way too, if Andrew feels strongly for no \n, that
> > ok with me.
> >
>
> ok, this new patch removes all \n and adds one in ldb_debug_stderr().

Thanks!
Pushed to master.

Simo.

--
Simo Sorce
Samba Team GPL Compliance Officer <simo@...>
Principal Software Engineer at Red Hat, Inc. <simo@...>