diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-08-21 17:50:04 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-08-21 17:51:52 +1000 |
commit | e71ce2f9e3c6ae404d9ca8ec4e9a8b689d9dddb4 (patch) | |
tree | 11f16ab51513e8c0c5b99c0144e925c8987080d1 /source4 | |
parent | c49145b1ab18bd859ce925b08e9698d9218f6de8 (diff) | |
download | samba-e71ce2f9e3c6ae404d9ca8ec4e9a8b689d9dddb4.tar.gz samba-e71ce2f9e3c6ae404d9ca8ec4e9a8b689d9dddb4.tar.bz2 samba-e71ce2f9e3c6ae404d9ca8ec4e9a8b689d9dddb4.zip |
s4:ldb Python requires that a 'compare' handler return -1, 0 or 1
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/pyldb.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |