From: Garming Sam Date: Fri, 10 Mar 2017 04:29:53 +0000 (+1300) Subject: replmd: Ensure that binary blobs in links are ordered in the database X-Git-Tag: tdb-1.3.13~495 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1809d67e4dd57e950453f69ebdfcfe0588f67168;p=thirdparty%2Fsamba.git replmd: Ensure that binary blobs in links are ordered in the database This is required if we are to search them with a binsearch. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 4da182f1e71..9edcc33b08a 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1949,7 +1949,12 @@ static int ndr_guid_compare(struct GUID *guid1, struct GUID *guid2) static int parsed_dn_compare(struct parsed_dn *pdn1, struct parsed_dn *pdn2) { - return ndr_guid_compare(&pdn1->guid, &pdn2->guid); + int ret = ndr_guid_compare(&pdn1->guid, &pdn2->guid); + if (ret == 0) { + return data_blob_cmp(&pdn1->dsdb_dn->extra_part, + &pdn2->dsdb_dn->extra_part); + } + return ret; } static int la_guid_compare_with_trusted_dn(struct compare_ctx *ctx,