svn commit: samba r20398 - in branches/SAMBA_4_0/source/dsdb/samdb:
.
abartlet at samba.org
abartlet at samba.org
Fri Dec 29 01:51:46 GMT 2006
Author: abartlet
Date: 2006-12-29 01:51:45 +0000 (Fri, 29 Dec 2006)
New Revision: 20398
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20398
Log:
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
Modified:
branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.c 2006-12-29 00:36:57 UTC (rev 20397)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.c 2006-12-29 01:51:45 UTC (rev 20398)
@@ -626,38 +626,32 @@
/* 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;
}
More information about the samba-cvs
mailing list