summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-09-21 11:59:06 +0200
committerAndrew Tridgell <tridge@samba.org>2011-10-11 08:42:07 +0200
commit96a9f823edd9c9387d6708fa8c3a4dc5de75127d (patch)
treefeebe2334fe385909eb2dadb88c556685faf1886 /source4
parent7599d59d1afd0814c14953a830ba4a618187e95e (diff)
downloadsamba-96a9f823edd9c9387d6708fa8c3a4dc5de75127d.tar.gz
samba-96a9f823edd9c9387d6708fa8c3a4dc5de75127d.tar.bz2
samba-96a9f823edd9c9387d6708fa8c3a4dc5de75127d.zip
s4:ldap_backend.c/"map_ldb_error" - handle errors similar to "PyErr_SetLdbError"
If the call was done using an error string ("add_err_string"), then use that one without an additional "ldb_strerror()" for the definitive LDAP output. Otherwise generate one using "ldb_strerror()". This omits redundancies in the error string generation (twice the same information by "ldb_strerror()"). Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/ldap_server/ldap_backend.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 57f81eaaaf..afeb3500d0 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -169,12 +169,8 @@ static int map_ldb_error(TALLOC_CTX *mem_ctx, int ldb_err,
}
*errstring = talloc_asprintf(mem_ctx, "%08X: %s", W_ERROR_V(err),
- ldb_strerror(ldb_err));
- if (add_err_string != NULL) {
- *errstring = talloc_asprintf(mem_ctx, "%s - %s", *errstring,
- add_err_string);
- }
-
+ add_err_string != NULL ? add_err_string : ldb_strerror(ldb_err));
+
/* result is 1:1 for now */
return ldb_err;
}