From fe3e1af901c970f738bee92baac5d7d4f5736e17 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 22 Mar 2010 16:03:33 +1100 Subject: s4:dsdb Rework schema loading and add schema reloading This commit reworks Samba4's schema loading code to detect when it needs to reload the schema. This is done by watching the @REPLCHANGED special DN. The reload happens by means of a callback, which is only set when the schema is loaded from the ldb - not when loaded from an LDIF file or DRS. We also rework the global schema handling - instead of storing the pointer to the global schema in each ldb, we store a flag indicating that the global schema should be returned at run time. This makes it much easier to switch to a new global schema. Andrew Bartlett --- source4/lib/ldb_wrap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c index d5178467b1..8bcfb58f61 100644 --- a/source4/lib/ldb_wrap.c +++ b/source4/lib/ldb_wrap.c @@ -250,7 +250,10 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, /* make the resulting schema global */ if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) { - dsdb_make_schema_global(ldb); + struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL); + if (schema) { + dsdb_make_schema_global(ldb, schema); + } } DEBUG(3,("ldb_wrap open of %s\n", url)); -- cgit