diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-15 13:08:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:19 -0500 |
commit | c69717755abeaf8bf93e76255d0912e3a24b7cb0 (patch) | |
tree | 979dfa0ee6680bd67b47661ae78965b52577a698 /source4/lib/ldb/ldb_tdb/ldb_cache.c | |
parent | 1a1027b8244a2f41676b2bd5999015c769fb4fb4 (diff) | |
download | samba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.tar.gz samba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.tar.bz2 samba-c69717755abeaf8bf93e76255d0912e3a24b7cb0.zip |
r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointer
to a ldb_schema_syntax struct.
the default attribute handler is now registered dynamicly as "*"
attribute, instead of having its own code path.
ldb_schema_attribute's can be added to the ldb_schema given a
ldb_schema_syntax struct or the syntax name
we may also need to introduce a ldb_schema_matching_rule,
and add a pointer to a default ldb_schema_matching_rule
in the ldb_schema_syntax.
metze
(This used to be commit b97b8f5dcbce006f005e53ca79df3330e62f117b)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_cache.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_cache.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c index d64340b5d0..dbd5222ce5 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_cache.c +++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c @@ -71,7 +71,7 @@ static void ltdb_attributes_unload(struct ldb_module *module) msg = ltdb->cache->attributes; for (i=0;i<msg->num_elements;i++) { - ldb_remove_attrib_handler(module->ldb, msg->elements[i].name); + ldb_schema_attribute_remove(module->ldb, msg->elements[i].name); } talloc_free(ltdb->cache->attributes); @@ -126,7 +126,6 @@ static int ltdb_attributes_load(struct ldb_module *module) unsigned flags; const char *syntax; const struct ldb_schema_syntax *s; - struct ldb_attrib_handler h; if (ltdb_attributes_flags(&msg->elements[i], &flags) != 0) { ldb_debug(module->ldb, LDB_DEBUG_ERROR, "Invalid @ATTRIBUTES element for '%s'\n", msg->elements[i].name); @@ -156,14 +155,9 @@ static int ltdb_attributes_load(struct ldb_module *module) syntax, msg->elements[i].name); goto failed; } - h.attr = msg->elements[i].name; - h.flags |= LDB_ATTR_FLAG_ALLOCATED; - h.ldif_read_fn = s->ldif_read_fn; - h.ldif_write_fn = s->ldif_write_fn; - h.canonicalise_fn = s->canonicalise_fn; - h.comparison_fn = s->comparison_fn; - - if (ldb_set_attrib_handlers(module->ldb, &h, 1) != 0) { + + flags |= LDB_ATTR_FLAG_ALLOCATED; + if (ldb_schema_attribute_add_with_syntax(module->ldb, msg->elements[i].name, flags, s) != 0) { goto failed; } } |