s4:partition LDB module - move the "data" check a bit higher
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 6 Mar 2011 14:56:06 +0000 (15:56 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 10 Mar 2011 10:12:05 +0000 (11:12 +0100)
It can be performed a bit earlier.

source4/dsdb/samdb/ldb_modules/partition.c

index 57b804321f47b2bafa6588437346bf578e9fdfb2..1760fd7510d68625f4e452540df5c33ff98b3294 100644 (file)
@@ -500,6 +500,11 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
                return ldb_oom(ldb_module_get_ctx(module));
        }
 
+       /* if we aren't initialised yet go further */
+       if (!data || !data->partitions) {
+               return ldb_next_request(module, req);
+       }
+
        /* Locate the options */
        domain_scope = (search_options
                && (search_options->search_options & LDB_SEARCH_OPTION_DOMAIN_SCOPE))
@@ -514,10 +519,6 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
                        & ~LDB_SEARCH_OPTION_PHANTOM_ROOT;
        }
 
-       if (!data || !data->partitions) {
-               return ldb_next_request(module, req);
-       }
-
        ac = partition_init_ctx(module, req);
        if (!ac) {
                return ldb_operr(ldb_module_get_ctx(module));