diff options
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/pydsdb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index d3486a41ec..08d87b957c 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -40,12 +40,19 @@ typedef intargfunc ssizeargfunc; /* FIXME: These should be in a header file somewhere */ #define PyErr_LDB_OR_RAISE(py_ldb, ldb) \ -/* if (!PyLdb_Check(py_ldb)) { \ + if (!py_check_dcerpc_type(py_ldb, "ldb", "Ldb")) { \ PyErr_SetString(py_ldb_get_exception(), "Ldb connection object required"); \ return NULL; \ - } */\ + } \ ldb = pyldb_Ldb_AsLdbContext(py_ldb); +#define PyErr_LDB_DN_OR_RAISE(py_ldb_dn, dn) \ + if (!py_check_dcerpc_type(py_ldb_dn, "ldb", "Dn")) { \ + PyErr_SetString(py_ldb_get_exception(), "ldb Dn object required"); \ + return NULL; \ + } \ + dn = pyldb_Dn_AsDn(py_ldb_dn); + static PyObject *py_ldb_get_exception(void) { PyObject *mod = PyImport_ImportModule("ldb"); |