summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-04 18:30:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:47 -0500
commit76036d37b42d0c77e57b288af410b931c51fea81 (patch)
treef9d91c33b4abba69d3862c7b0f1d3d8762b17eee /source4
parent18a0ece2cc3ffb8590a499446970f75d954f18cf (diff)
downloadsamba-76036d37b42d0c77e57b288af410b931c51fea81.tar.gz
samba-76036d37b42d0c77e57b288af410b931c51fea81.tar.bz2
samba-76036d37b42d0c77e57b288af410b931c51fea81.zip
r13349: In the end I could not use ldb_caseless_cmp
in attrib_handler.c functions remove it again Simo (This used to be commit 513ff499071e6cb5e608a82430718021f72997bd)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/db_wrap.c2
-rw-r--r--source4/lib/ldb/common/ldb_utf8.c20
-rw-r--r--source4/lib/ldb/include/ldb.h17
-rw-r--r--source4/lib/ldb/include/ldb_private.h1
-rw-r--r--source4/lib/ldb/tools/cmdline.c2
5 files changed, 3 insertions, 39 deletions
diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c
index 8524f0da10..5f4251bb92 100644
--- a/source4/lib/db_wrap.c
+++ b/source4/lib/db_wrap.c
@@ -133,7 +133,7 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
ldb_set_debug(ldb, ldb_wrap_debug, NULL);
- ldb_set_utf8_fns(ldb, NULL, wrap_caseless_cmp, wrap_casefold);
+ ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
return ldb;
}
diff --git a/source4/lib/ldb/common/ldb_utf8.c b/source4/lib/ldb/common/ldb_utf8.c
index 743e976e84..1951e6edca 100644
--- a/source4/lib/ldb/common/ldb_utf8.c
+++ b/source4/lib/ldb/common/ldb_utf8.c
@@ -42,13 +42,10 @@
*/
void ldb_set_utf8_fns(struct ldb_context *ldb,
void *context,
- int (*cmp)(void *, const char *, const char *),
char *(*casefold)(void *, void *, const char *))
{
if (context)
ldb->utf8_fns.context = context;
- if (cmp)
- ldb->utf8_fns.caseless_cmp = cmp;
if (casefold)
ldb->utf8_fns.casefold = casefold;
}
@@ -71,19 +68,9 @@ char *ldb_casefold_default(void *context, void *mem_ctx, const char *s)
return ret;
}
-/*
- a caseless compare, optimised for 7 bit
- NOTE: doesn't handle UTF8
-*/
-
-int ldb_caseless_cmp_default(void *context, const char *s1, const char *s2)
-{
- return strcasecmp(s1,s2);
-}
-
void ldb_set_utf8_default(struct ldb_context *ldb)
{
- ldb_set_utf8_fns(ldb, NULL, ldb_caseless_cmp_default, ldb_casefold_default);
+ ldb_set_utf8_fns(ldb, NULL, ldb_casefold_default);
}
char *ldb_casefold(struct ldb_context *ldb, void *mem_ctx, const char *s)
@@ -91,11 +78,6 @@ char *ldb_casefold(struct ldb_context *ldb, void *mem_ctx, const char *s)
return ldb->utf8_fns.casefold(ldb->utf8_fns.context, mem_ctx, s);
}
-int ldb_caseless_cmp(struct ldb_context *ldb, const char *s1, const char *s2)
-{
- return ldb->utf8_fns.caseless_cmp(ldb->utf8_fns.context, s1, s2);
-}
-
/*
check the attribute name is valid according to rfc2251
returns 1 if the name is ok
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 4e457b028f..44f2f5840c 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -214,7 +214,6 @@ struct ldb_debug_ops {
*/
struct ldb_utf8_fns {
void *context;
- int (*caseless_cmp)(void *context, const char *s1, const char *s2);
char *(*casefold)(void *context, void *mem_ctx, const char *s);
};
@@ -749,21 +748,6 @@ void ldb_set_utf8_default(struct ldb_context *ldb);
char *ldb_casefold(struct ldb_context *ldb, void *mem_ctx, const char *s);
/**
- Compare two strings, without regard to case.
-
- \param ldb the ldb context
- \param s1 the first string to compare
- \param s2 the second string to compare
-
- \return 0 if the strings are the same, non-zero if there are any
- differences except for case.
-
- \note The default function is not yet UTF8 aware. Provide your own
- set of functions through ldb_set_utf8_fns()
-*/
-int ldb_caseless_cmp(struct ldb_context *ldb, const char *s1, const char *s2);
-
-/**
Check the attribute name is valid according to rfc2251
\param s tthe string to check
@@ -1118,7 +1102,6 @@ int ldb_set_debug(struct ldb_context *ldb,
*/
void ldb_set_utf8_fns(struct ldb_context *ldb,
void *context,
- int (*cmp)(void *, const char *, const char *),
char *(*casefold)(void *, void *, const char *));
/**
diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h
index fffda77ff8..90632744ed 100644
--- a/source4/lib/ldb/include/ldb_private.h
+++ b/source4/lib/ldb/include/ldb_private.h
@@ -197,5 +197,4 @@ int check_critical_controls(struct ldb_control **controls);
/* The following definitions come from lib/ldb/common/ldb_utf8.c */
char *ldb_casefold_default(void *context, void *mem_ctx, const char *s);
-int ldb_caseless_cmp_default(void *context, const char *s1, const char *s2);
#endif
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c
index 1926df4c86..8937f9d4f6 100644
--- a/source4/lib/ldb/tools/cmdline.c
+++ b/source4/lib/ldb/tools/cmdline.c
@@ -205,7 +205,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const
if (ldb_set_opaque(ldb, "credentials", cmdline_credentials)) {
goto failed;
}
- ldb_set_utf8_fns(ldb, NULL, wrap_caseless_cmp, wrap_casefold);
+ ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
#endif
if (ldb_connect(ldb, ret->url, flags, ret->options) != 0) {
fprintf(stderr, "Failed to connect to %s - %s\n",