s4-ldb: show the OID of any unhandled critical controls
authorAndrew Tridgell <tridge@samba.org>
Wed, 16 Dec 2009 06:13:19 +0000 (17:13 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 16 Dec 2009 09:56:23 +0000 (20:56 +1100)
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 <abartlet@samba.org>

source4/lib/ldb/ldb_tdb/ldb_tdb.c

index 48409f2cba6b2f90f8176b1d00ed5c2d17966650..227a202a6ffe3ec554768b62a0e46cc534086d89 100644 (file)
@@ -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;