summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-09-20 17:41:10 +0200
committerAndrew Tridgell <tridge@samba.org>2011-10-11 08:42:07 +0200
commit21d053d120cbc665ed8c0afe82598220a608f2af (patch)
tree34ed5a576303aaad9b926d77a68d3dd1687f0257 /lib/ldb
parent96a9f823edd9c9387d6708fa8c3a4dc5de75127d (diff)
downloadsamba-21d053d120cbc665ed8c0afe82598220a608f2af.tar.gz
samba-21d053d120cbc665ed8c0afe82598220a608f2af.tar.bz2
samba-21d053d120cbc665ed8c0afe82598220a608f2af.zip
ldb:pyldb.c - py_ldb_* modification calls - error string shouldn't be set here
As discussed with Jelmer, we shouldn't be setting a generic LDB error string only for the Python bindings alone. This should be done in "ldb_request" and "ldb_wait" - the common place for all possible LDB access mechanisms. Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/pyldb.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index dbdfe777e0..673cee268d 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -995,17 +995,13 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args, PyObject *kwar
ret = ldb_request(ldb_ctx, req);
if (ret == LDB_SUCCESS) {
- ret = ldb_wait(req->handle, LDB_WAIT_ALL);
+ ret = ldb_wait(req->handle, LDB_WAIT_ALL);
}
if (ret == LDB_SUCCESS) {
ret = ldb_transaction_commit(ldb_ctx);
} else {
ldb_transaction_cancel(ldb_ctx);
- if (ldb_ctx->err_string == NULL) {
- /* no error string was setup by the backend */
- ldb_asprintf_errstring(ldb_ctx, "%s (%d)", ldb_strerror(ret), ret);
- }
}
talloc_free(mem_ctx);
@@ -1152,10 +1148,6 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args, PyObject *kwargs)
ret = ldb_transaction_commit(ldb_ctx);
} else {
ldb_transaction_cancel(ldb_ctx);
- if (ldb_ctx->err_string == NULL) {
- /* no error string was setup by the backend */
- ldb_asprintf_errstring(ldb_ctx, "%s (%d)", ldb_strerror(ret), ret);
- }
}
talloc_free(mem_ctx);
@@ -1227,10 +1219,6 @@ static PyObject *py_ldb_delete(PyLdbObject *self, PyObject *args, PyObject *kwar
ret = ldb_transaction_commit(ldb_ctx);
} else {
ldb_transaction_cancel(ldb_ctx);
- if (ldb_ctx->err_string == NULL) {
- /* no error string was setup by the backend */
- ldb_asprintf_errstring(ldb_ctx, "%s (%d)", ldb_strerror(ret), ret);
- }
}
talloc_free(mem_ctx);
@@ -1310,10 +1298,6 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args, PyObject *kwar
ret = ldb_transaction_commit(ldb_ctx);
} else {
ldb_transaction_cancel(ldb_ctx);
- if (ldb_ctx->err_string == NULL) {
- /* no error string was setup by the backend */
- ldb_asprintf_errstring(ldb_ctx, "%s (%d)", ldb_strerror(ret), ret);
- }
}
talloc_free(mem_ctx);