diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 53b4e51ff3..126ad37d9b 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -265,7 +265,8 @@ static int ldb_op_finish(struct ldb_context *ldb, int status) if (ldb->err_string == NULL) { /* no error string was setup by the backend */ ldb_set_errstring(ldb, - talloc_asprintf(ldb, "ldb error %d", status)); + talloc_asprintf(ldb, "%s (%d)", + ldb_strerror(status), status)); } ldb_transaction_cancel(ldb); return status; @@ -463,6 +464,13 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque return ldb_op_finish(ldb, ret); } + if (ldb->err_string == NULL) { + /* no error string was setup by the backend */ + ldb_set_errstring(ldb, + talloc_asprintf(ldb, "%s (%d)", + ldb_strerror(ret), ret)); + } + return ret; } |