summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_match.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-06-06 22:04:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:55 -0500
commitefddd37af84b9db429237a491cb74a2c12c505cb (patch)
tree84a29b84eaa6788ec96cccb0882ea9b747163503 /source4/lib/ldb/common/ldb_match.c
parent4f422081a79704827b13571540143b8b57e6b74c (diff)
downloadsamba-efddd37af84b9db429237a491cb74a2c12c505cb.tar.gz
samba-efddd37af84b9db429237a491cb74a2c12c505cb.tar.bz2
samba-efddd37af84b9db429237a491cb74a2c12c505cb.zip
r16066: The OSX AD plugin uses objectCategory searches a lot, and uses them
both fully qualified and in the 'short' form. Now we test and support this query format. Andrew Bartlett (This used to be commit 9ddcfacbcedc5eea2730d4bf902c0fcd02bcfa11)
Diffstat (limited to 'source4/lib/ldb/common/ldb_match.c')
-rw-r--r--source4/lib/ldb/common/ldb_match.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c
index 810191c5ec..f3ecbe0381 100644
--- a/source4/lib/ldb/common/ldb_match.c
+++ b/source4/lib/ldb/common/ldb_match.c
@@ -207,8 +207,11 @@ static int ldb_wildcard_compare(struct ldb_context *ldb,
chunk = tree->u.substring.chunks[c];
if(h->canonicalise_fn(ldb, ldb, chunk, &cnk) != 0) goto failed;
- /* FIXME: case of embedded nulls */
- if (strncmp((char *)val.data, (char *)cnk.data, cnk.length) != 0) goto failed;
+ /* This deals with wildcard prefix searches on binary attributes (eg objectGUID) */
+ if (cnk.length > val.length) {
+ goto failed;
+ }
+ if (memcmp((char *)val.data, (char *)cnk.data, cnk.length) != 0) goto failed;
val.length -= cnk.length;
val.data += cnk.length;
c++;