From: Andrew Bartlett Date: Wed, 7 Jan 2009 05:29:23 +0000 (+1100) Subject: Raise a python exception when the ldb search fails X-Git-Tag: samba-4.0.0alpha6~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59d5a963d137ec10686b98e575b16c45848ea3ab;p=thirdparty%2Fsamba.git Raise a python exception when the ldb search fails This fixes a regression found by ldap.py in the new hand-written python bindings. Andrew Bartlett --- diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 0bc644716d1..521fa498aa5 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -848,6 +848,12 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar talloc_free(req); + if (ret != LDB_SUCCESS) { + talloc_free(res); + PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb_ctx); + return NULL; + } + return PyLdbResult_FromResult(res); }