]> git.ipfire.org Git - thirdparty/samba.git/commit
ldb:dn: make ldb_dn_compare() self-consistent
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 7 Apr 2024 03:04:43 +0000 (15:04 +1200)
committerJule Anger <janger@samba.org>
Mon, 10 Jun 2024 13:25:17 +0000 (13:25 +0000)
commitaa255148bbb848b23b6fce107a3e1658e238496c
treeecd5d4ee4a52c27c9d200a325cbfbb9f5f672552
parent867dce05d217ccf45e9bc74fdd2b2dae7d710fb3
ldb:dn: make ldb_dn_compare() self-consistent

We were returning -1 in all these cases:

   ldb_dn_compare(dn, NULL);
   ldb_dn_compare(NULL, dn);
   ldb_dn_compare(NULL, NULL);

which would give strange results in sort, where this is often used.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5fe488d515a8bb719bdeafb8b64d8479732b5ac8)
lib/ldb/common/ldb_dn.c