diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-06-10 21:33:45 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-06-15 10:51:34 +1000 |
commit | 7c60ac97bf72aa08df39aa9695607270e39931c5 (patch) | |
tree | 1d15467d8a5b584b1eb3a8c4715bb404a68a639b /source4/param | |
parent | 9e28ceda96a0c76752af851db4ccba86c010ed67 (diff) | |
download | samba-7c60ac97bf72aa08df39aa9695607270e39931c5.tar.gz samba-7c60ac97bf72aa08df39aa9695607270e39931c5.tar.bz2 samba-7c60ac97bf72aa08df39aa9695607270e39931c5.zip |
s4:provision Allow a specific prefix map to be loaded into a new schema provision
This allows the prefixMap from a DRS server to be used when loading
the schema from the local files. This helps us then import other
schema with this map in place.
Andrew Bartlett
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/provision.c | 8 | ||||
-rw-r--r-- | source4/param/provision.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c index 28869e0a72..81c4fb16a5 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -339,7 +339,8 @@ 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, + DATA_BLOB *override_prefixmap) { const char *setupdir; PyObject *schema_mod, *schema_dict, *schema_fn, *py_result, *parameters; @@ -376,6 +377,11 @@ struct ldb_context *provision_get_schema(TALLOC_CTX *mem_ctx, struct loadparm_co setupdir = lp_setupdir(lp_ctx); PyDict_SetItemString(parameters, "setup_dir", PyString_FromString(setupdir)); + if (override_prefixmap) { + PyDict_SetItemString(parameters, "override_prefixmap", + PyString_FromStringAndSize((const char *)override_prefixmap->data, + override_prefixmap->length)); + } py_result = PyEval_CallObjectWithKeywords(schema_fn, NULL, parameters); diff --git a/source4/param/provision.h b/source4/param/provision.h index 516a9dea5f..36758b9707 100644 --- a/source4/param/provision.h +++ b/source4/param/provision.h @@ -63,6 +63,7 @@ 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, + DATA_BLOB *override_prefixmap); #endif /* _PROVISION_H_ */ |