From 8609e7993237e5ffe54830299212c128e082d9b9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Aug 2005 06:55:40 +0000 Subject: r9318: fix searches with scope ONE and SUB, the problem was that ldb_dn_compare_base() just looked at if both dn's mtach some how, and the following happens: basedn: CN=bar,DC=foo,DC=com dn: DC=foo,DC=com and dn: DC=foo,DC=com was return as result of a sub and base search and also the ONE search with basedn: DC=foo,DC=com returned this dn: CN=bla,CN=bar,DC=foo,DC=com metze (This used to be commit 2a107472c373e425013050e28b944c830f653a87) --- source4/lib/ldb/common/ldb_dn.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/ldb/common/ldb_dn.c') diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index edb5124d99..5dcb540fa1 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -415,6 +415,10 @@ int ldb_dn_compare_base(struct ldb_context *ldb, int ret; int n0, n1; + if (base->comp_num > dn->comp_num) { + return (dn->comp_num - base->comp_num); + } + /* if the number of components doesn't match they differ */ n0 = base->comp_num - 1; n1 = dn->comp_num - 1; -- cgit