diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-01-07 16:29:23 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-01-07 17:09:26 +1100 |
commit | 59d5a963d137ec10686b98e575b16c45848ea3ab (patch) | |
tree | 5df459c1ab4bfa741969202af92fb501e13adc88 /source4/lib/ldb | |
parent | c81863e86861bbb00df23b92470631e60314d9d1 (diff) | |
download | samba-59d5a963d137ec10686b98e575b16c45848ea3ab.tar.gz samba-59d5a963d137ec10686b98e575b16c45848ea3ab.tar.bz2 samba-59d5a963d137ec10686b98e575b16c45848ea3ab.zip |
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
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/pyldb.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |