summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-10 05:23:17 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-10 05:23:17 +0200
commitad8e3e41923e20d401294eccd4da028e0f40c904 (patch)
tree6b39cb15e1b82a7d7a090e9e7c3904fd36916088 /source4/param
parent12840597c856a6521ee088a5c96e8ffdd1716252 (diff)
downloadsamba-ad8e3e41923e20d401294eccd4da028e0f40c904.tar.gz
samba-ad8e3e41923e20d401294eccd4da028e0f40c904.tar.bz2
samba-ad8e3e41923e20d401294eccd4da028e0f40c904.zip
Add infrastructure for returning ProvisionResult in C provision code.
(This used to be commit 98c3d34eb233be284e8c8994cca337be25c72968)
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_ */