diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-08-22 17:36:56 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-08-22 17:36:56 +1000 |
commit | cc43037f19056ed24d7fffa54456d597c63ad105 (patch) | |
tree | e2ae68e4cd85eab35e9a55fa44726e1cb78895b0 /source4/lib/util | |
parent | a83bb07016032bd29e36c8de5a3205bbe318167e (diff) | |
download | samba-cc43037f19056ed24d7fffa54456d597c63ad105.tar.gz samba-cc43037f19056ed24d7fffa54456d597c63ad105.tar.bz2 samba-cc43037f19056ed24d7fffa54456d597c63ad105.zip |
fixed a problem with length limited ldap values
The core ldb code for string matching assumed NULL terminated strings,
whereas the anr module used data_blob_const() to effectively truncate
a ldb_val by changing its length. The ldb code is supposed to be based
around length limited blobs, not NULL terminated strings, so the
correct fix was to change the string comparison functions to be length
limited
(This used to be commit 26c6aa5a80ffaf06fc33f30a6533f8f16ef538bc)
Diffstat (limited to 'source4/lib/util')
-rw-r--r-- | source4/lib/util/util_ldb.c | 4 | ||||
-rw-r--r-- | source4/lib/util/util_ldb.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/util/util_ldb.c b/source4/lib/util/util_ldb.c index 0a7433696e..fab729c036 100644 --- a/source4/lib/util/util_ldb.c +++ b/source4/lib/util/util_ldb.c @@ -125,9 +125,9 @@ int gendb_add_ldif(struct ldb_context *ldb, const char *ldif_string) return ret; } -char *wrap_casefold(void *context, void *mem_ctx, const char *s) +char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n) { - return strupper_talloc(mem_ctx, s); + return strupper_talloc_n(mem_ctx, s, n); } diff --git a/source4/lib/util/util_ldb.h b/source4/lib/util/util_ldb.h index 030ba7ebee..43f98ae1a9 100644 --- a/source4/lib/util/util_ldb.h +++ b/source4/lib/util/util_ldb.h @@ -22,6 +22,6 @@ int gendb_search_dn(struct ldb_context *ldb, struct ldb_message ***res, const char * const *attrs); int gendb_add_ldif(struct ldb_context *ldb, const char *ldif_string); -char *wrap_casefold(void *context, void *mem_ctx, const char *s); +char *wrap_casefold(void *context, void *mem_ctx, const char *s, size_t n); #endif /* __LIB_UTIL_UTIL_LDB_H__ */ |