From e71ce2f9e3c6ae404d9ca8ec4e9a8b689d9dddb4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Aug 2009 17:50:04 +1000 Subject: s4:ldb Python requires that a 'compare' handler return -1, 0 or 1 --- source4/lib/ldb/pyldb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 5825f88530..d55e0aae7c 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -211,7 +211,11 @@ static PyObject *py_ldb_dn_check_special(PyLdbDnObject *self, PyObject *args) static int py_ldb_dn_compare(PyLdbDnObject *dn1, PyLdbDnObject *dn2) { - return ldb_dn_compare(dn1->dn, dn2->dn); + int ret; + ret = ldb_dn_compare(dn1->dn, dn2->dn); + if (ret < 0) ret = -1; + if (ret > 0) ret = 1; + return ret; } static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self) -- cgit