From 99557563141a3776b05bebba0436c56e72f9e20f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 16 Dec 2009 17:13:19 +1100 Subject: s4-ldb: show the OID of any unhandled critical controls It isn't very useful just saying that a control is not supported, without saying which one is the problem Pair-Programmed-With: Andrew Bartlett --- source4/lib/ldb/ldb_tdb/ldb_tdb.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 48409f2cba..227a202a6f 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -1237,13 +1237,18 @@ static int ltdb_handle_request(struct ldb_module *module, struct ltdb_context *ac; struct tevent_timer *te; struct timeval tv; - - if (check_critical_controls(req->controls)) { - return LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION; - } + int i; ldb = ldb_module_get_ctx(module); + for (i = 0; req->controls && req->controls[i]; i++) { + if (req->controls[i]->critical) { + ldb_asprintf_errstring(ldb, "Unsupported critical extension %s", + req->controls[i]->oid); + return LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION; + } + } + if (req->starttime == 0 || req->timeout == 0) { ldb_set_errstring(ldb, "Invalid timeout settings"); return LDB_ERR_TIME_LIMIT_EXCEEDED; -- cgit