summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/samdb/samdb.c1
-rw-r--r--source4/lib/ldb_wrap.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 70f0409c3d..b3ba63388d 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -133,7 +133,6 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
if (!ldb) {
return NULL;
}
- dsdb_make_schema_global(ldb);
return ldb;
}
diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c
index ecd7bf4554..134c2271fd 100644
--- a/source4/lib/ldb_wrap.c
+++ b/source4/lib/ldb_wrap.c
@@ -248,6 +248,11 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
DLIST_ADD(ldb_wrap_list, w);
+ /* make the resulting schema global */
+ if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) {
+ dsdb_make_schema_global(ldb);
+ }
+
DEBUG(3,("ldb_wrap open of %s\n", url));
talloc_set_destructor(w, ldb_wrap_destructor);