diff options
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/schema_data.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/schema_data.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_data.c b/source4/dsdb/samdb/ldb_modules/schema_data.c index 25f2dcec8b..655b4892af 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_data.c +++ b/source4/dsdb/samdb/ldb_modules/schema_data.c @@ -417,12 +417,17 @@ static int schema_data_search(struct ldb_module *module, struct ldb_request *req int ret; struct schema_data_search_data *search_context; struct ldb_request *down_req; - struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL); + const struct dsdb_schema *schema; + if (!ldb_module_get_private(module)) { + /* If there is no module data, there is little we can do */ + return ldb_next_request(module, req); + } - if (!schema || !ldb_module_get_private(module)) { - /* If there is no schema, there is little we can do */ + /* The schema manipulation does not apply to special DNs */ + if (ldb_dn_is_special(req->op.search.base)) { return ldb_next_request(module, req); } + for (i=0; i < ARRAY_SIZE(generated_attrs); i++) { if (ldb_attr_in_list(req->op.search.attrs, generated_attrs[i].attr)) { break; @@ -434,6 +439,12 @@ static int schema_data_search(struct ldb_module *module, struct ldb_request *req return ldb_next_request(module, req); } + schema = dsdb_get_schema(ldb, NULL); + if (!schema || !ldb_module_get_private(module)) { + /* If there is no schema, there is little we can do */ + return ldb_next_request(module, req); + } + search_context = talloc(req, struct schema_data_search_data); if (!search_context) { ldb_oom(ldb); |