[PATCH] ldb: Add new line to ldb debug messages
Lukas Slebodnik
lslebodn at redhat.com
Thu Feb 18 18:23:59 UTC 2016
ehlo,
There are two common ways of logging messages in ldb
ldb_debug_add + ldb_debug_end
and
ldb_debug
The new line was added to message on every place with first way
but only on some places with second way.
Attached patch makes it consistent.
LS
-------------- next part --------------
>From 2132bde7e3dfc104b9668bc2a29f7af404f571f7 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Thu, 18 Feb 2016 17:51:13 +0100
Subject: [PATCH] ldb: Add new line to ldb debug messages
There are two common ways of logging messages in ldb
ldb_debug_add + ldb_debug_end
and
ldb_debug
The new line was added to message on every place with first way
but only on some places with second way.
This patch makes it consistent.
Signed-off-by: Lukas Slebodnik <lslebodn at redhat.com>
---
lib/ldb/common/ldb.c | 30 +++++++++++++--------------
lib/ldb/common/ldb_ldif.c | 42 +++++++++++++++++++-------------------
lib/ldb/common/ldb_match.c | 8 ++++----
lib/ldb/common/ldb_modules.c | 36 ++++++++++++++++----------------
lib/ldb/common/ldb_pack.c | 2 +-
lib/ldb/ldb_ldap/ldb_ldap.c | 6 +++---
lib/ldb/ldb_map/ldb_map.c | 16 +++++++--------
lib/ldb/ldb_map/ldb_map_inbound.c | 8 ++++----
lib/ldb/ldb_map/ldb_map_outbound.c | 8 ++++----
lib/ldb/ldb_tdb/ldb_cache.c | 6 +++---
lib/ldb/ldb_tdb/ldb_index.c | 4 ++--
lib/ldb/ldb_tdb/ldb_search.c | 2 +-
lib/ldb/ldb_tdb/ldb_tdb.c | 6 +++---
lib/ldb/ldb_tdb/ldb_tdb_wrap.c | 2 +-
lib/ldb/modules/asq.c | 2 +-
lib/ldb/modules/paged_results.c | 2 +-
lib/ldb/modules/sort.c | 2 +-
17 files changed, 91 insertions(+), 91 deletions(-)
diff --git a/lib/ldb/common/ldb.c b/lib/ldb/common/ldb.c
index 0f0f5ab99b69b805cd0535399ca9d7c4c34abc11..6016e6e0cf4dd1ede0a2455cd1bbce070f006859 100644
--- a/lib/ldb/common/ldb.c
+++ b/lib/ldb/common/ldb.c
@@ -42,7 +42,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] on %s",
+ "A transaction is still active in ldb context [%p] on %s\n",
ldb, (const char *)ldb_get_opaque(ldb, "ldb_url"));
}
@@ -265,7 +265,7 @@ int ldb_connect(struct ldb_context *ldb, const char *url,
ret = ldb_load_modules(ldb, options);
if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_FATAL,
- "Unable to load modules for %s: %s",
+ "Unable to load modules for %s: %s\n",
url, ldb_errstring(ldb));
return ret;
}
@@ -294,7 +294,7 @@ void ldb_asprintf_errstring(struct ldb_context *ldb, const char *format, ...)
va_end(ap);
if (ldb->flags & LDB_FLG_ENABLE_TRACING) {
- ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_asprintf/set_errstring: %s",
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_asprintf/set_errstring: %s\n",
ldb->err_string);
}
}
@@ -327,7 +327,7 @@ int ldb_error_at(struct ldb_context *ldb, int ecode,
module = ldb->modules; \
while (module && module->ops->op == NULL) module = module->next; \
if ((ldb->flags & LDB_FLG_ENABLE_TRACING) && module) { \
- ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_trace_request: (%s)->" #op, \
+ ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_trace_request: (%s)->" #op "\n", \
module->ops->name); \
} \
} while (0)
@@ -350,7 +350,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 */
@@ -377,12 +377,12 @@ int ldb_transaction_start(struct ldb_context *ldb)
status);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "start ldb transaction error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "start ldb transaction error: %s\n",
ldb_errstring(module->ldb));
}
} else {
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "start ldb transaction success");
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "start ldb transaction success\n");
}
}
return status;
@@ -409,7 +409,7 @@ int ldb_transaction_prepare_commit(struct ldb_context *ldb)
if (ldb->transaction_active < 0) {
ldb_debug(ldb, LDB_DEBUG_FATAL,
- "prepare commit called but no ldb transactions are active!");
+ "prepare commit called but no ldb transactions are active!\n");
ldb->transaction_active = 0;
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -435,7 +435,7 @@ int ldb_transaction_prepare_commit(struct ldb_context *ldb)
status);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "prepare commit transaction error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "prepare commit transaction error: %s\n",
ldb_errstring(module->ldb));
}
}
@@ -460,7 +460,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 */
@@ -470,7 +470,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;
}
@@ -488,7 +488,7 @@ int ldb_transaction_commit(struct ldb_context *ldb)
status);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "commit ldb transaction error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "commit ldb transaction error: %s\n",
ldb_errstring(module->ldb));
}
/* cancel the transaction */
@@ -510,7 +510,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 */
@@ -520,7 +520,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
if (ldb->transaction_active < 0) {
ldb_debug(ldb, LDB_DEBUG_FATAL,
- "cancel called but no ldb transactions are active!");
+ "cancel called but no ldb transactions are active!\n");
ldb->transaction_active = 0;
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -537,7 +537,7 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
status);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "cancel ldb transaction error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "cancel ldb transaction error: %s\n",
ldb_errstring(module->ldb));
}
}
diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index 0aeda94beac64a568d4345ee5d824b44c7f14385..4f558bc85d04f459eff7cf01be72a3fcdd503fbf 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -300,7 +300,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
}
}
if (!ldb_changetypes[i].name) {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Invalid ldif changetype %d",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Invalid ldif changetype %d\n",
ldif->changetype);
talloc_free(mem_ctx);
return -1;
@@ -314,7 +314,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb,
if (msg->elements[i].name == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: Invalid element name (NULL) at position %d", i);
+ "Error: Invalid element name (NULL) at position %d\n", i);
talloc_free(mem_ctx);
return -1;
}
@@ -590,27 +590,27 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
if (tmp_ctx == NULL) {
ldb_debug(ldb, LDB_DEBUG_FATAL,
- "Error: talloc_new() failed");
+ "Error: talloc_new() failed\n");
goto err_op;
}
if (ldif->changetype != LDB_CHANGETYPE_MODRDN) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: invalid changetype '%d'",
+ "Error: invalid changetype '%d'\n",
ldif->changetype);
goto err_other;
}
if (msg->num_elements < 2) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: num_elements[%u] < 2",
+ "Error: num_elements[%u] < 2\n",
msg->num_elements);
goto err_other;
}
if (msg->num_elements > 3) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: num_elements[%u] > 3",
+ "Error: num_elements[%u] > 3\n",
msg->num_elements);
goto err_other;
}
@@ -620,23 +620,23 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
if (msg->num_elements < (i + 1)) { \
if (needed) { \
ldb_debug(ldb, LDB_DEBUG_ERROR, \
- "Error: num_elements[%u] < (%u + 1)", \
+ "Error: num_elements[%u] < (%u + 1)\n", \
msg->num_elements, i); \
goto err_other; \
} \
} else if (ldb_attr_cmp(msg->elements[i].name, _name) != 0) { \
ldb_debug(ldb, LDB_DEBUG_ERROR, \
- "Error: elements[%u].name[%s] != [%s]", \
+ "Error: elements[%u].name[%s] != [%s]\n", \
i, msg->elements[i].name, _name); \
goto err_other; \
} else if (msg->elements[i].flags != 0) { \
ldb_debug(ldb, LDB_DEBUG_ERROR, \
- "Error: elements[%u].flags[0x%X} != [0x0]", \
+ "Error: elements[%u].flags[0x%X} != [0x0]\n", \
i, msg->elements[i].flags); \
goto err_other; \
} else if (msg->elements[i].num_values != 1) { \
ldb_debug(ldb, LDB_DEBUG_ERROR, \
- "Error: elements[%u].num_values[%u] != 1", \
+ "Error: elements[%u].num_values[%u] != 1\n", \
i, msg->elements[i].num_values); \
goto err_other; \
} else { \
@@ -653,7 +653,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
olddn = ldb_dn_copy(tmp_ctx, msg->dn);
if (olddn == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: failed to copy olddn '%s'",
+ "Error: failed to copy olddn '%s'\n",
ldb_dn_get_linearized(msg->dn));
goto err_op;
}
@@ -661,7 +661,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
newrdn = ldb_dn_from_ldb_val(tmp_ctx, ldb, newrdn_val);
if (!ldb_dn_validate(newrdn)) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: Unable to parse dn '%s'",
+ "Error: Unable to parse dn '%s'\n",
(char *)newrdn_val->data);
goto err_dn;
}
@@ -676,7 +676,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
deleteoldrdn = true;
} else {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: deleteoldrdn value invalid '%s' not '0'/'1'",
+ "Error: deleteoldrdn value invalid '%s' not '0'/'1'\n",
(char *)deleteoldrdn_val->data);
goto err_attr;
}
@@ -685,7 +685,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
newsuperior = ldb_dn_from_ldb_val(tmp_ctx, ldb, newsuperior_val);
if (!ldb_dn_validate(newsuperior)) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: Unable to parse dn '%s'",
+ "Error: Unable to parse dn '%s'\n",
(char *)newsuperior_val->data);
goto err_dn;
}
@@ -693,7 +693,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
newsuperior = ldb_dn_get_parent(tmp_ctx, msg->dn);
if (newsuperior == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: Unable to get parent dn '%s'",
+ "Error: Unable to get parent dn '%s'\n",
ldb_dn_get_linearized(msg->dn));
goto err_dn;
}
@@ -702,7 +702,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
newdn = ldb_dn_copy(tmp_ctx, newrdn);
if (newdn == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: failed to copy newrdn '%s'",
+ "Error: failed to copy newrdn '%s'\n",
ldb_dn_get_linearized(newrdn));
goto err_op;
}
@@ -710,7 +710,7 @@ int ldb_ldif_parse_modrdn(struct ldb_context *ldb,
ok = ldb_dn_add_base(newdn, newsuperior);
if (!ok) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: failed to base '%s' to newdn '%s'",
+ "Error: failed to base '%s' to newdn '%s'\n",
ldb_dn_get_linearized(newsuperior),
ldb_dn_get_linearized(newdn));
goto err_op;
@@ -795,7 +795,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'",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: First line of ldif must be a dn not '%s'\n",
attr);
goto failed;
}
@@ -803,7 +803,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'",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Error: Unable to parse dn '%s'\n",
(char *)value.data);
goto failed;
}
@@ -823,7 +823,7 @@ 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'",(char *)value.data);
+ "Error: Bad ldif changetype '%s'\n",(char *)value.data);
}
flags = 0;
continue;
@@ -872,7 +872,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'", el->name);
+ "Error: Attribute value cannot be empty for attribute '%s'\n", el->name);
goto failed;
}
if (value.data != el->values[el->num_values].data) {
diff --git a/lib/ldb/common/ldb_match.c b/lib/ldb/common/ldb_match.c
index e83ad637dffd509d38cf62e3f280dd3c16cee3e5..25b696013285c64dae6d6aadbf4066df2435d711 100644
--- a/lib/ldb/common/ldb_match.c
+++ b/lib/ldb/common/ldb_match.c
@@ -490,21 +490,21 @@ static int ldb_match_extended(struct ldb_context *ldb,
* an extended match means and how to handle it. For now print
* only a warning to have s3 winbind and other tools working
* against us. - Matthias */
- ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb: dnAttributes extended match not supported yet");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb: dnAttributes extended match not supported yet\n");
}
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 LDB_ERR_INAPPROPRIATE_MATCHING;
}
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 LDB_ERR_INAPPROPRIATE_MATCHING;
}
rule = ldb_find_extended_match_rule(ldb, tree->u.extended.rule_id);
if (rule == NULL) {
*matched = false;
- ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: unknown extended rule_id %s",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb: unknown extended rule_id %s\n",
tree->u.extended.rule_id);
return LDB_SUCCESS;
}
diff --git a/lib/ldb/common/ldb_modules.c b/lib/ldb/common/ldb_modules.c
index 21059668b57f8f971bac9311d0b70889ab1ee1cd..a35686f42240d4b2f9a60ef6d108a76e193fd5af 100644
--- a/lib/ldb/common/ldb_modules.c
+++ b/lib/ldb/common/ldb_modules.c
@@ -73,13 +73,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()");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_strdup_no_spaces()\n");
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()");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()\n");
talloc_free(modstr);
return NULL;
}
@@ -101,7 +101,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()");
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Out of Memory in ldb_modules_list_from_string()\n");
return NULL;
}
@@ -210,7 +210,7 @@ int ldb_module_connect_backend(struct ldb_context *ldb,
if (be == NULL) {
ldb_debug(ldb, LDB_DEBUG_FATAL,
- "Unable to find backend for '%s' - do you need to set LDB_MODULES_PATH?", url);
+ "Unable to find backend for '%s' - do you need to set LDB_MODULES_PATH?\n", url);
return LDB_ERR_OTHER;
}
@@ -218,7 +218,7 @@ int ldb_module_connect_backend(struct ldb_context *ldb,
if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Failed to connect to '%s' with backend '%s': %s", url, be->ops->name, ldb_errstring(ldb));
+ "Failed to connect to '%s' with backend '%s': %s\n", url, be->ops->name, ldb_errstring(ldb));
return ret;
}
return ret;
@@ -314,7 +314,7 @@ int ldb_module_load_list(struct ldb_context *ldb, const char **module_list,
ops = ldb_find_module_ops(module_list[i]);
if (ops == NULL) {
- ldb_debug(ldb, LDB_DEBUG_FATAL, "WARNING: Module [%s] not found - do you need to set LDB_MODULES_PATH?",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "WARNING: Module [%s] not found - do you need to set LDB_MODULES_PATH?\n",
module_list[i]);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -348,7 +348,7 @@ int ldb_module_init_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 : %s",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "module %s initialization failed : %s\n",
module->ops->name, ldb_strerror(ret));
return ret;
}
@@ -392,23 +392,23 @@ 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", ldb_errstring(ldb));
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldb error (%s) occurred searching for modules, bailing out\n", ldb_errstring(ldb));
talloc_free(mem_ctx);
return ret;
} 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 (%u), bailing out", res->count);
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "Too many records found (%u), bailing out\n", res->count);
talloc_free(mem_ctx);
return LDB_ERR_OPERATIONS_ERROR;
} 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);
@@ -425,7 +425,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_module_init_chain(ldb, ldb->modules);
@@ -442,7 +442,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
module = module->next; \
while (module && module->ops->op == NULL) module = module->next; \
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) { \
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_trace_next_request: (%s)->" #op, \
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_trace_next_request: (%s)->" #op "\n", \
module->ops->name); \
} \
} while (0)
@@ -616,7 +616,7 @@ int ldb_next_start_trans(struct ldb_module *module)
ldb_asprintf_errstring(module->ldb, "start_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_start_trans error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_start_trans error: %s\n",
ldb_errstring(module->ldb));
}
return ret;
@@ -635,7 +635,7 @@ int ldb_next_end_trans(struct ldb_module *module)
ldb_asprintf_errstring(module->ldb, "end_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_end_trans error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_end_trans error: %s\n",
ldb_errstring(module->ldb));
}
return ret;
@@ -659,7 +659,7 @@ int ldb_next_prepare_commit(struct ldb_module *module)
ldb_asprintf_errstring(module->ldb, "prepare_commit error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_prepare_commit error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_prepare_commit error: %s\n",
ldb_errstring(module->ldb));
}
return ret;
@@ -678,7 +678,7 @@ int ldb_next_del_trans(struct ldb_module *module)
ldb_asprintf_errstring(module->ldb, "del_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_del_trans error: %s",
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_del_trans error: %s\n",
ldb_errstring(module->ldb));
}
return ret;
diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c
index 7970b9d3ecb8325b4a46f1da46236810009cbb50..c209dff62201f8e29fca1bf016f0e136a41c489f 100644
--- a/lib/ldb/common/ldb_pack.c
+++ b/lib/ldb/common/ldb_pack.c
@@ -452,7 +452,7 @@ int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
if (remaining != 0) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Error: %zu bytes unread in ldb_unpack_data_only_attr_list",
+ "Error: %zu bytes unread in ldb_unpack_data_only_attr_list\n",
remaining);
}
diff --git a/lib/ldb/ldb_ldap/ldb_ldap.c b/lib/ldb/ldb_ldap/ldb_ldap.c
index 29f89388c5fd2c9ca764872f2f1ce1afa0865404..f7b470ac8693f0feecbb429cbc5d429bbd763709 100644
--- a/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -222,7 +222,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!");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "Controls are not yet supported by ldb_ldap backend!\n");
}
ldb_request_set_state(req, LDB_ASYNC_PENDING);
@@ -939,7 +939,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",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_initialize failed for URL '%s' - %s\n",
url, ldap_err2string(ret));
goto failed;
}
@@ -948,7 +948,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",
+ ldb_debug(ldb, LDB_DEBUG_FATAL, "ldap_set_option failed - %s\n",
ldap_err2string(ret));
goto failed;
}
diff --git a/lib/ldb/ldb_map/ldb_map.c b/lib/ldb/ldb_map/ldb_map.c
index 66b00592921e994164d33462a3d995d92f94eda6..5a760fd5e354cfd11e6610fc6bbfde890efaf9d8 100644
--- a/lib/ldb/ldb_map/ldb_map.c
+++ b/lib/ldb/ldb_map/ldb_map.c
@@ -250,7 +250,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!");
+ "Invalid remote request!\n");
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -513,14 +513,14 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
case LDB_MAP_GENERATE:
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"LDB_MAP_IGNORE/LDB_MAP_GENERATE attribute '%s' "
- "used in DN!", ldb_dn_get_component_name(dn, i));
+ "used in DN!\n", ldb_dn_get_component_name(dn, i));
goto failed;
case LDB_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!", ldb_dn_get_component_name(dn, i));
+ "used in DN!\n", ldb_dn_get_component_name(dn, i));
goto failed;
}
/* fall through */
@@ -589,14 +589,14 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
case LDB_MAP_GENERATE:
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"LDB_MAP_IGNORE/LDB_MAP_GENERATE attribute '%s' "
- "used in DN!", ldb_dn_get_component_name(dn, i));
+ "used in DN!\n", ldb_dn_get_component_name(dn, i));
goto failed;
case LDB_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!", ldb_dn_get_component_name(dn, i));
+ "used in DN!\n", ldb_dn_get_component_name(dn, i));
goto failed;
}
/* fall through */
@@ -1021,7 +1021,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!", MAP_DN_NAME);
+ "Failed to construct '%s' DN!\n", MAP_DN_NAME);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -1032,13 +1032,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'!", MAP_DN_NAME, name);
+ "No results for '%s=%s'!\n", 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'!", MAP_DN_NAME, name);
+ "Too many results for '%s=%s'!\n", MAP_DN_NAME, name);
talloc_free(res);
return LDB_ERR_CONSTRAINT_VIOLATION;
}
diff --git a/lib/ldb/ldb_map/ldb_map_inbound.c b/lib/ldb/ldb_map/ldb_map_inbound.c
index 461e68113ab20a9b0ee73ee0158abb45577111ad..e8f5a08ee7d24bfbcc49e572f85dd06c2ff621c5 100644
--- a/lib/ldb/ldb_map/ldb_map_inbound.c
+++ b/lib/ldb/ldb_map/ldb_map_inbound.c
@@ -75,7 +75,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, enum ldb_request_type
/* Unknown attribute: ignore */
if (map == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
- "Not mapping attribute '%s': no mapping found",
+ "Not mapping attribute '%s': no mapping found\n",
old->name);
goto local;
}
@@ -95,7 +95,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, enum ldb_request_type
if (map->u.convert.convert_local == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Not mapping attribute '%s': "
- "'convert_local' not set",
+ "'convert_local' not set\n",
map->local_name);
goto local;
}
@@ -109,7 +109,7 @@ static int ldb_msg_el_partition(struct ldb_module *module, enum ldb_request_type
if (map->u.generate.generate_remote == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Not mapping attribute '%s': "
- "'generate_remote' not set",
+ "'generate_remote' not set\n",
map->local_name);
goto local;
}
@@ -177,7 +177,7 @@ static int ldb_msg_partition(struct ldb_module *module, enum ldb_request_type op
/* 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'",
+ "Skipping attribute '%s'\n",
msg->elements[i].name);
continue;
}
diff --git a/lib/ldb/ldb_map/ldb_map_outbound.c b/lib/ldb/ldb_map/ldb_map_outbound.c
index e755b7e4427ef34b65f14afc4c3db224f78f6c0a..85eab2ccee38040c6b1afed94e867448e47349de 100644
--- a/lib/ldb/ldb_map/ldb_map_outbound.c
+++ b/lib/ldb/ldb_map/ldb_map_outbound.c
@@ -326,7 +326,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",
+ "'convert_remote' not set\n",
attr_name);
return LDB_SUCCESS;
}
@@ -346,7 +346,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",
+ "'generate_local' not set\n",
attr_name);
return LDB_SUCCESS;
}
@@ -927,7 +927,7 @@ static int map_subtree_collect_remote(struct ldb_module *module, void *mem_ctx,
if (map->type == LDB_MAP_GENERATE) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Skipping attribute '%s': "
- "'convert_operator' not set",
+ "'convert_operator' not set\n",
tree->u.equality.attr);
*new = NULL;
return 0;
@@ -1094,7 +1094,7 @@ int map_return_entry(struct map_context *ac, struct ldb_reply *ares)
if (!matched) {
ldb_debug(ldb, LDB_DEBUG_TRACE, "ldb_map: "
"Skipping record '%s': "
- "doesn't match original search",
+ "doesn't match original search\n",
ldb_dn_get_linearized(ares->message->dn));
return LDB_SUCCESS;
}
diff --git a/lib/ldb/ldb_tdb/ldb_cache.c b/lib/ldb/ldb_tdb/ldb_cache.c
index 6467af1d00cf7e7381703f3d386acace02a9fe45..807a7ab5615e04f1dd03d785927949893b0eb1c0 100644
--- a/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/lib/ldb/ldb_tdb/ldb_cache.c
@@ -142,7 +142,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'", msg->elements[i].name);
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid @ATTRIBUTES element for '%s'\n", msg->elements[i].name);
goto failed;
}
switch (flags & ~LTDB_FLAG_HIDDEN) {
@@ -157,7 +157,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",
+ "Invalid flag combination 0x%x for '%s' in @ATTRIBUTES\n",
flags, msg->elements[i].name);
goto failed;
}
@@ -165,7 +165,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",
+ "Invalid attribute syntax '%s' for '%s' in @ATTRIBUTES\n",
syntax, msg->elements[i].name);
goto failed;
}
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index cf21092426185e82a072e0fe95a35834df02c4e8..3294a6808eddc76b8929da279c750b26d57eea99 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -1540,7 +1540,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",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid DN in re_index: %s\n",
ldb_dn_get_linearized(msg->dn));
talloc_free(msg);
return 0;
@@ -1560,7 +1560,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
ret = ltdb_index_onelevel(module, msg, 1);
if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Adding special ONE LEVEL index failed (%s)!",
+ "Adding special ONE LEVEL index failed (%s)!\n",
ldb_dn_get_linearized(msg->dn));
talloc_free(msg);
return -1;
diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c
index 62a36c7c252d46d40fc783416627f840a13b3bc8..332699824ffa02d8011f1dc4cea80c5890d43c4d 100644
--- a/lib/ldb/ldb_tdb/ldb_search.c
+++ b/lib/ldb/ldb_tdb/ldb_search.c
@@ -621,7 +621,7 @@ int ltdb_search(struct ltdb_context *ctx)
/* useful for debugging when slow performance
* is caused by unindexed searches */
char *expression = ldb_filter_from_tree(ctx, ctx->tree);
- ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb FULL SEARCH: %s SCOPE: %s DN: %s",
+ ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb FULL SEARCH: %s SCOPE: %s DN: %s\n",
expression,
req->op.search.scope==LDB_SCOPE_BASE?"base":
req->op.search.scope==LDB_SCOPE_ONELEVEL?"one":
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 8d1fd3600142e77854c1b01c380bab27a26271ff..e01aee3a42dda3daf8ac31059e823ad0b351a7cf 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -233,7 +233,7 @@ static int ltdb_modified(struct ldb_module *module, struct ldb_dn *dn)
{
if (ltdb->warn_reindex) {
ldb_debug(ldb_module_get_ctx(module),
- LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s",
+ LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s\n",
tdb_name(ltdb->tdb), ldb_dn_get_linearized(dn));
}
ret = ltdb_reindex(module);
@@ -1534,7 +1534,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 LDB_ERR_OPERATIONS_ERROR;
}
path = url+6;
@@ -1574,7 +1574,7 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
ldb_asprintf_errstring(ldb,
"Unable to open tdb '%s': %s", path, strerror(errno));
ldb_debug(ldb, LDB_DEBUG_ERROR,
- "Unable to open tdb '%s': %s", path, strerror(errno));
+ "Unable to open tdb '%s': %s\n", path, strerror(errno));
talloc_free(ltdb);
if (errno == EACCES || errno == EPERM) {
return LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS;
diff --git a/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index eb168098a75a021620a553b1ee360bc7572c3fc1..33205b7b26978ebfab8f67945d9efba676f666fe 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -57,7 +57,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/lib/ldb/modules/asq.c b/lib/ldb/modules/asq.c
index 7482de826f0cf088d17d3e63ce30f6b1818e479e..81b9ae2821ce8fbc2b27b4192e6d76687f7c08c9 100644
--- a/lib/ldb/modules/asq.c
+++ b/lib/ldb/modules/asq.c
@@ -397,7 +397,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!");
+ ldb_debug(ldb, LDB_DEBUG_WARNING, "asq: Unable to register control with rootdse!\n");
}
return ldb_next_init(module);
diff --git a/lib/ldb/modules/paged_results.c b/lib/ldb/modules/paged_results.c
index 2d6c62fd54b6a03f583a303830e7d500b1656624..7bd4246a59c8cc6513fb5e3a9910671353dbc5f1 100644
--- a/lib/ldb/modules/paged_results.c
+++ b/lib/ldb/modules/paged_results.c
@@ -419,7 +419,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!");
+ "Unable to register control with rootdse!\n");
}
return ldb_next_init(module);
diff --git a/lib/ldb/modules/sort.c b/lib/ldb/modules/sort.c
index 1b762f7e51b56370e4bdf7159f5eb0392b69a4b1..c1226292068f972aa9d5190657a45013a999d603 100644
--- a/lib/ldb/modules/sort.c
+++ b/lib/ldb/modules/sort.c
@@ -341,7 +341,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!");
+ "Unable to register control with rootdse!\n");
}
return ldb_next_init(module);
--
2.5.0
More information about the samba-technical
mailing list