diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-03-22 16:03:33 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-03-22 20:24:41 +1100 |
commit | fe3e1af901c970f738bee92baac5d7d4f5736e17 (patch) | |
tree | 88666ac36e3d7041b24592600f361c412aaa5c3f /source4/lib/ldb_wrap.c | |
parent | d0b54476fc9f855d1e482597538a7ec60e04f331 (diff) | |
download | samba-fe3e1af901c970f738bee92baac5d7d4f5736e17.tar.gz samba-fe3e1af901c970f738bee92baac5d7d4f5736e17.tar.xz samba-fe3e1af901c970f738bee92baac5d7d4f5736e17.zip |
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
Diffstat (limited to 'source4/lib/ldb_wrap.c')
-rw-r--r-- | source4/lib/ldb_wrap.c | 5 |
1 files changed, 4 insertions, 1 deletions
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)); |