diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-11-14 08:52:51 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-15 09:46:27 +0100 |
commit | 28d573168cb869a7c4cf85ad094eba3805676cbd (patch) | |
tree | 72dcc1afe34380a90059cf8424913414c46c3377 | |
parent | 75ae19422b2b405cabe269c29afb61a1b50636d1 (diff) | |
download | samba-28d573168cb869a7c4cf85ad094eba3805676cbd.tar.gz samba-28d573168cb869a7c4cf85ad094eba3805676cbd.tar.bz2 samba-28d573168cb869a7c4cf85ad094eba3805676cbd.zip |
s4:param/provision: pass schema_dn to provision_get_schema()
metze
-rw-r--r-- | source4/dsdb/schema/tests/schema_syntax.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_vampire.c | 4 | ||||
-rw-r--r-- | source4/param/provision.c | 9 | ||||
-rw-r--r-- | source4/param/provision.h | 4 |
4 files changed, 15 insertions, 4 deletions
diff --git a/source4/dsdb/schema/tests/schema_syntax.c b/source4/dsdb/schema/tests/schema_syntax.c index fed7063577..9127d08120 100644 --- a/source4/dsdb/schema/tests/schema_syntax.c +++ b/source4/dsdb/schema/tests/schema_syntax.c @@ -205,7 +205,7 @@ static bool torture_dsdb_syntax_tcase_setup(struct torture_context *tctx, void * priv = talloc_zero(tctx, struct torture_dsdb_syntax); torture_assert(tctx, priv, "No memory"); - priv->ldb = provision_get_schema(priv, tctx->lp_ctx, NULL); + priv->ldb = provision_get_schema(priv, tctx->lp_ctx, NULL, NULL); torture_assert(tctx, priv->ldb, "Failed to load schema from disk"); priv->schema = dsdb_get_schema(priv->ldb, NULL); diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index a11c9cbfbe..7b4715b3ec 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -308,7 +308,9 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s NT_STATUS_HAVE_NO_MEMORY(tmp_dns_name); s_dsa->other_info->dns_name = tmp_dns_name; - schema_ldb = provision_get_schema(s, s->lp_ctx, &s->prefixmap_blob); + schema_ldb = provision_get_schema(s, s->lp_ctx, + c->forest->schema_dn_str, + &s->prefixmap_blob); if (!schema_ldb) { DEBUG(0,("Failed to re-load from local provision using remote prefixMap. " "Will continue with local prefixMap\n")); diff --git a/source4/param/provision.c b/source4/param/provision.c index 55540d4fc4..766babead4 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -330,7 +330,9 @@ failure: } -struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, +struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, + const char *schema_dn, DATA_BLOB *override_prefixmap) { PyObject *schema_mod, *schema_dict, *schema_fn, *py_result, *parameters; @@ -362,6 +364,11 @@ struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, struct loadparm_co parameters = PyDict_New(); + if (schema_dn) { + PyDict_SetItemString(parameters, "schemadn", + PyString_FromString(schema_dn)); + } + if (override_prefixmap) { PyDict_SetItemString(parameters, "override_prefixmap", PyString_FromStringAndSize((const char *)override_prefixmap->data, diff --git a/source4/param/provision.h b/source4/param/provision.h index 36758b9707..fc0287831c 100644 --- a/source4/param/provision.h +++ b/source4/param/provision.h @@ -63,7 +63,9 @@ NTSTATUS provision_store_self_join(TALLOC_CTX *mem_ctx, struct loadparm_context struct provision_store_self_join_settings *settings, const char **error_string); -struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, +struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, + const char *schema_dn, DATA_BLOB *override_prefixmap); #endif /* _PROVISION_H_ */ |