From b97b8f5dcbce006f005e53ca79df3330e62f117b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 15 Dec 2006 13:08:57 +0000 Subject: 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 --- source/lib/ldb/modules/operational.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/lib/ldb/modules/operational.c') diff --git a/source/lib/ldb/modules/operational.c b/source/lib/ldb/modules/operational.c index c327a96f90b..764ce76294e 100644 --- a/source/lib/ldb/modules/operational.c +++ b/source/lib/ldb/modules/operational.c @@ -291,11 +291,17 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req static int operational_init(struct ldb_module *ctx) { + int ret = 0; + /* setup some standard attribute handlers */ - ldb_set_attrib_handler_syntax(ctx->ldb, "whenCreated", LDB_SYNTAX_UTC_TIME); - ldb_set_attrib_handler_syntax(ctx->ldb, "whenChanged", LDB_SYNTAX_UTC_TIME); - ldb_set_attrib_handler_syntax(ctx->ldb, "subschemaSubentry", LDB_SYNTAX_DN); - ldb_set_attrib_handler_syntax(ctx->ldb, "structuralObjectClass", LDB_SYNTAX_OBJECTCLASS); + ret |= ldb_schema_attribute_add(ctx->ldb, "whenCreated", 0, LDB_SYNTAX_UTC_TIME); + ret |= ldb_schema_attribute_add(ctx->ldb, "whenChanged", 0, LDB_SYNTAX_UTC_TIME); + ret |= ldb_schema_attribute_add(ctx->ldb, "subschemaSubentry", 0, LDB_SYNTAX_DN); + ret |= ldb_schema_attribute_add(ctx->ldb, "structuralObjectClass", 0, LDB_SYNTAX_OBJECTCLASS); + + if (ret != 0) { + return ret; + } return ldb_next_init(ctx); } -- cgit v1.2.1