1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

ldb-samba: add ldb_comparison_fold_utf8, wrapping strncasecmp_ldb

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2024-05-10 15:42:46 +12:00 committed by Andrew Bartlett
parent f9797950fd
commit 0becc8a90c
2 changed files with 13 additions and 0 deletions

View File

@ -125,6 +125,14 @@ char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n)
return strupper_talloc_n(mem_ctx, s, n);
}
int ldb_comparison_fold_utf8(void *ignored,
const struct ldb_val *v1,
const struct ldb_val *v2)
{
return strncasecmp_ldb((const char *)v1->data, v1->length,
(const char *)v2->data, v2->length);
}
struct ldb_context *samba_ldb_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,

View File

@ -30,9 +30,14 @@ struct ldb_dn;
struct cli_credentials;
struct loadparm_context;
struct tevent_context;
struct ldb_val;
char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n);
int ldb_comparison_fold_utf8(void *ignored,
const struct ldb_val *v1,
const struct ldb_val *v2);
struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct loadparm_context *lp_ctx,