From: Douglas Bagnall Date: Thu, 11 Apr 2024 01:46:28 +0000 (+1200) Subject: ldb:attrib_handlers: use ldb_ascii_toupper() in first loop X-Git-Tag: tdb-1.4.11~1017 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dca6b2d25529288eaf7b31baf37ca4f6de4f4b9d;p=thirdparty%2Fsamba.git ldb:attrib_handlers: use ldb_ascii_toupper() in first loop In a dotless-I locale, we might meet an 'i' before we meet a byte with the high bit set, in which case we still want the ldb casefold comparison. Many ldb operations will do some case-folding before getting here, so hitting this might be quite rare even in those locales. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15637 Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/common/attrib_handlers.c b/lib/ldb/common/attrib_handlers.c index c01477331f0..6ae12c88eec 100644 --- a/lib/ldb/common/attrib_handlers.c +++ b/lib/ldb/common/attrib_handlers.c @@ -351,8 +351,9 @@ int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx, * never appear in multibyte sequences */ if (((unsigned char)s1[0]) & 0x80) goto utf8str; if (((unsigned char)s2[0]) & 0x80) goto utf8str; - if (toupper((unsigned char)*s1) != toupper((unsigned char)*s2)) + if (ldb_ascii_toupper(*s1) != ldb_ascii_toupper(*s2)) { break; + } if (*s1 == ' ') { while (n1 > 1 && s1[0] == s1[1]) { s1++; n1--; } while (n2 > 1 && s2[0] == s2[1]) { s2++; n2--; } diff --git a/selftest/knownfail.d/ldb.python.api.tr b/selftest/knownfail.d/ldb.python.api.tr deleted file mode 100644 index f327762e70b..00000000000 --- a/selftest/knownfail.d/ldb.python.api.tr +++ /dev/null @@ -1,2 +0,0 @@ -^ldb.python.api.tr.api.SearchTests.test_subtree_uniquer_elsewhere.none -^ldb.python.api.tr.api.SearchTestsLmdb.test_subtree_uniquer_elsewhere.none