mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s4:param/provision: pass schema_dn to provision_get_schema()
metze
This commit is contained in:
parent
75ae19422b
commit
28d573168c
@ -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);
|
||||
|
@ -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"));
|
||||
|
@ -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,
|
||||
|
@ -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_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user