From db76e6531825e66d4859106b583d9f7be8ae0a3a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 17 Dec 2009 23:50:05 +1100 Subject: [PATCH] s4-dsdb: fixed the sort in dsdb_find_nc_root() --- source4/dsdb/common/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 8ba734c15999..61d065b85c43 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2781,6 +2781,11 @@ int dsdb_wellknown_dn(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, } +static int dsdb_dn_compare_ptrs(struct ldb_dn **dn1, struct ldb_dn **dn2) +{ + return ldb_dn_compare(*dn1, *dn2); +} + /* find a NC root given a DN within the NC */ @@ -2830,7 +2835,7 @@ int dsdb_find_nc_root(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, struct ldb } } - qsort(nc_dns, el->num_values, sizeof(nc_dns[0]), (comparison_fn_t)ldb_dn_compare); + qsort(nc_dns, el->num_values, sizeof(nc_dns[0]), (comparison_fn_t)dsdb_dn_compare_ptrs); for (i=0; inum_values; i++) { if (ldb_dn_compare_base(nc_dns[i], dn) == 0) { -- 2.34.1