]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dns: Use pyldb_Ldb_AsLdbContext() in PyErr_LDB_OR_RAISE()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Dec 2023 21:30:50 +0000 (10:30 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 3 Mar 2024 22:33:35 +0000 (22:33 +0000)
This prepares to move this macro into pyldb.h

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dns_server/pydns.c

index 6e99ebd6479be763de813f45016d78260eec132c..96151df97718785ed58f9fa7a3c4c50e8c19dd26 100644 (file)
 
 /* FIXME: These should be in a header file somewhere */
 #define PyErr_LDB_OR_RAISE(py_ldb, ldb) \
-       if (!py_check_dcerpc_type(py_ldb, "ldb", "Ldb")) { \
+       ldb = pyldb_Ldb_AsLdbContext(py_ldb); \
+       if (!ldb) { \
                PyErr_SetString(PyExc_TypeError, "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")) { \