From 59d5a963d137ec10686b98e575b16c45848ea3ab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Jan 2009 16:29:23 +1100 Subject: 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 --- source4/lib/ldb/pyldb.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4') diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 0bc644716d..521fa498aa 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); } -- cgit