From 21d053d120cbc665ed8c0afe82598220a608f2af Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 20 Sep 2011 17:41:10 +0200 Subject: 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 --- lib/ldb/pyldb.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'lib/ldb') 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); -- cgit