summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_match.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-03 12:29:21 +0000
committerAndrew Tridgell <tridge@samba.org>2004-04-03 12:29:21 +0000
commitee44733f94864fb0a1ae15d48e3335c0705a82ae (patch)
tree8f9691975aab7a6ce3736e64283e66a69db3c194 /source4/lib/ldb/ldb_tdb/ldb_match.c
parentf1c3fa060efcecde404d0bfb55c359ef7fe36ed8 (diff)
downloadsamba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.tar.gz
samba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.tar.bz2
samba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.zip
added the rest of the ldb_modify() code, which required a fairly large
change in the ldb API. The API is now much closer to LDAP. (This used to be commit e9e85c464411c561c5073d262a2e3533fec175ca)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_match.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_match.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_match.c b/source4/lib/ldb/ldb_tdb/ldb_match.c
index 89d204f56a..6f29726ee7 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_match.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_match.c
@@ -39,7 +39,7 @@
see if two ldb_val structures contain the same data
return 1 for a match, 0 for a mis-match
*/
-static int ldb_val_equal(struct ldb_val *v1, struct ldb_val *v2)
+int ldb_val_equal(const struct ldb_val *v1, const struct ldb_val *v2)
{
if (v1->length != v2->length) return 0;
@@ -108,7 +108,7 @@ static int match_leaf(struct ldb_context *ldb,
const char *base,
enum ldb_scope scope)
{
- int i;
+ int i, j;
if (!scope_match(msg->dn, base, scope)) {
return 0;
@@ -122,10 +122,16 @@ static int match_leaf(struct ldb_context *ldb,
}
for (i=0;i<msg->num_elements;i++) {
- if (strcmp(msg->elements[i].name, tree->u.simple.attr) == 0 &&
- (strcmp(tree->u.simple.value.data, "*") == 0 ||
- ldb_val_equal(&msg->elements[i].value, &tree->u.simple.value))) {
- return 1;
+ if (strcmp(msg->elements[i].name, tree->u.simple.attr) == 0) {
+ if (strcmp(tree->u.simple.value.data, "*") == 0) {
+ return 1;
+ }
+ for (j=0;j<msg->elements[i].num_values;j++) {
+ if (ldb_val_equal(&msg->elements[i].values[j],
+ &tree->u.simple.value)) {
+ return 1;
+ }
+ }
}
}