diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-12-29 01:51:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:30:22 -0500 |
commit | 81b971beae3c37120eebdf4020d8824dd8a027d1 (patch) | |
tree | 0b64f60b213bdeb9a6091bd732c783d727f68157 /source4/dsdb/samdb | |
parent | 7d7d01cf4e9bbb43d9579f09751b00118a0c577b (diff) | |
download | samba-81b971beae3c37120eebdf4020d8824dd8a027d1.tar.gz samba-81b971beae3c37120eebdf4020d8824dd8a027d1.tar.bz2 samba-81b971beae3c37120eebdf4020d8824dd8a027d1.zip |
r20398: Revert this patch, which caused failures in the samba3sam.js build farm test.
The interaction of the samldb.c module and this function is complex...
Andrew Bartlett
(This used to be commit bf7ab75875f722cc8499d24d455a94dd83b986ad)
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/samdb.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index e5eafb9188..405f15c83e 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -626,38 +626,32 @@ uint16_t samdb_result_acct_flags(struct ldb_message *msg, const char *attr) /* Find an attribute, with a particular value */ + +/* The current callers of this function expect a very specific + * behaviour: In particular, objectClass subclass equivilance is not + * wanted. This means that we should not lookup the schema for the + * comparison function */ struct ldb_message_element *samdb_find_attribute(struct ldb_context *ldb, const struct ldb_message *msg, const char *name, const char *value) { int i; struct ldb_message_element *el = ldb_msg_find_element(msg, name); - const struct ldb_schema_attribute *a; struct ldb_val v; - TALLOC_CTX *tmp_ctx = talloc_new(ldb); - if (!tmp_ctx) { - return NULL; - } - v.data = discard_const_p(uint8_t, value); v.length = strlen(value); if (!el) { - talloc_free(tmp_ctx); return NULL; } - a = ldb_schema_attribute_by_name(ldb, name); - for (i=0;i<el->num_values;i++) { - if (a->syntax->comparison_fn(ldb, tmp_ctx, &el->values[i], &v) == 0) { - talloc_free(tmp_ctx); + if (strcasecmp(value, (char *)el->values[i].data) == 0) { return el; } } - talloc_free(tmp_ctx); return NULL; } |