From 3721bca79dc6ff409085a2fc40cbd060d25191d4 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 5 Feb 2006 20:48:27 +0000 Subject: r13354: Add tests to check that controls work properly Fix asq module, add a second_stage_init to register with rootdse Fix asq control ldap parsing routines (this was nasty to find out) (This used to be commit 933a80397d137f7d5b79c82a068d62bb6928ef47) --- source4/lib/ldb/modules/asq.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source4/lib/ldb/modules') diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c index 5d4a5a3970..7e6bbdf29e 100644 --- a/source4/lib/ldb/modules/asq.c +++ b/source4/lib/ldb/modules/asq.c @@ -197,9 +197,29 @@ static int asq(struct ldb_module *module, struct ldb_request *req) } } +static int asq_init_2(struct ldb_module *module) +{ + struct ldb_request request; + int ret; + + request.operation = LDB_REQ_REGISTER; + request.op.reg.oid = LDB_CONTROL_ASQ_OID; + request.controls = NULL; + + ret = ldb_request(module->ldb, &request); + if (ret != LDB_SUCCESS) { + ldb_debug(module->ldb, LDB_DEBUG_ERROR, "asq: Unable to register control with rootdse!\n"); + return LDB_ERR_OTHER; + } + + return ldb_next_second_stage_init(module); +} + + static const struct ldb_module_ops asq_ops = { .name = "asq", - .request = asq + .request = asq, + .second_stage_init = asq_init_2 }; struct ldb_module *asq_module_init(struct ldb_context *ldb, const char *options[]) -- cgit