X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=source4%2Flib%2Fldb%2Fpyldb.c;h=925ea5232aaf833be2475266ac2eabe851d73e5e;hb=dbf121e7b5d85df724aea5675b61fc8f53e6e1d9;hp=b886a4b81c8af31053de064461ecd6f8dc1824ce;hpb=4f137b2457838bb63a3be05777bc32cdf2401836;p=kamenim%2Fsamba.git diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index b886a4b81c..925ea5232a 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -1035,9 +1035,11 @@ static PyObject *py_ldb_parse_ldif(PyLdbObject *self, PyObject *args) static PyObject *py_ldb_msg_diff(PyLdbObject *self, PyObject *args) { + int ldb_ret; PyObject *py_msg_old; PyObject *py_msg_new; struct ldb_message *diff; + struct ldb_context *ldb; PyObject *py_ret; if (!PyArg_ParseTuple(args, "OO", &py_msg_old, &py_msg_new)) @@ -1053,14 +1055,20 @@ static PyObject *py_ldb_msg_diff(PyLdbObject *self, PyObject *args) return NULL; } - diff = ldb_msg_diff(PyLdb_AsLdbContext(self), PyLdbMessage_AsMessage(py_msg_old), PyLdbMessage_AsMessage(py_msg_new)); - if (!diff) { + ldb = PyLdb_AsLdbContext(self); + ldb_ret = ldb_msg_diff_ex(ldb, + PyLdbMessage_AsMessage(py_msg_old), + PyLdbMessage_AsMessage(py_msg_new), + (TALLOC_CTX*)ldb, &diff); + if (ldb_ret != LDB_SUCCESS) { PyErr_SetString(PyExc_RuntimeError, "Failed to generate the Ldb Message diff"); return NULL; } py_ret = PyLdbMessage_FromMessage(diff); + talloc_unlink(ldb, diff); + return py_ret; }