diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/pydsdb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 793c49522b..ee02483acd 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -981,6 +981,11 @@ static PyObject *py_dsdb_get_wellknown_dn(PyObject *self, PyObject *args) PyErr_LDB_DN_OR_RAISE(py_nc_dn, nc_dn); ret = dsdb_wellknown_dn(ldb, ldb, nc_dn, wkguid, &wk_dn); + if (ret == LDB_ERR_NO_SUCH_OBJECT) { + PyErr_Format(PyExc_KeyError, "Failed to find well known DN for GUID %s", wkguid); + return NULL; + } + PyErr_LDB_ERROR_IS_ERR_RAISE(py_ldb_get_exception(), ret, ldb); py_wk_dn = pyldb_Dn_FromDn(wk_dn); |