summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/provision.c11
-rw-r--r--source4/param/provision.h8
2 files changed, 14 insertions, 5 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 5d1f01c59a..41b062883c 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -29,9 +29,10 @@
#include "scripting/python/modules.h"
NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
- struct provision_settings *settings)
+ struct provision_settings *settings,
+ struct provision_result *result)
{
- PyObject *provision_mod, *provision_dict, *provision_fn, *result, *parameters;
+ PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters;
DEBUG(0,("Provision for Become-DC test using python\n"));
@@ -115,15 +116,17 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
PyDict_SetItemString(parameters, "machinepass",
PyString_FromString(settings->machine_password));
- result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
+ py_result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
Py_DECREF(parameters);
- if (result == NULL) {
+ if (py_result == NULL) {
PyErr_Print();
PyErr_Clear();
return NT_STATUS_UNSUCCESSFUL;
}
+ result->domaindn = talloc_strdup(mem_ctx, PyString_AsString(PyObject_GetAttrString(py_result, "domaindn")));
+
return NT_STATUS_OK;
}
diff --git a/source4/param/provision.h b/source4/param/provision.h
index 323159d417..e739053d50 100644
--- a/source4/param/provision.h
+++ b/source4/param/provision.h
@@ -39,7 +39,13 @@ struct provision_settings {
const char *targetdir;
};
+/* FIXME: Rename this to hostconfig ? */
+struct provision_result {
+ const char *domaindn;
+};
+
NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
- struct provision_settings *settings);
+ struct provision_settings *settings,
+ struct provision_result *result);
#endif /* _PROVISION_H_ */