From 0c0bbf2932edc55a897029f34faee105e5b694aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Apr 2010 12:01:16 +1000 Subject: s4-provision: set "setup_dir" to the right path This needs to cope with both running from the build tree or running from the install tree. We use the provision.smb.conf.dc as a sentinal to detect if we are in the build tree. Pair-Programmed-With: Andrew Bartlett --- source4/param/provision.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/param/provision.c b/source4/param/provision.c index 91260c6326..68c87239c1 100644 --- a/source4/param/provision.c +++ b/source4/param/provision.c @@ -35,6 +35,7 @@ #include "scripting/python/modules.h" #include "lib/ldb/pyldb.h" #include "param/pyparam.h" +#include "dynconfig/dynconfig.h" static PyObject *provision_module(void) { @@ -138,8 +139,13 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, if (settings->targetdir != NULL) PyDict_SetItemString(parameters, "targetdir", PyString_FromString(settings->targetdir)); - PyDict_SetItemString(parameters, "setup_dir", - PyString_FromString("setup")); + if (file_exist("setup/provision.smb.conf.dc")) { + PyDict_SetItemString(parameters, "setup_dir", + PyString_FromString("setup")); + } else { + PyDict_SetItemString(parameters, "setup_dir", + PyString_FromString(dyn_SETUPDIR)); + } PyDict_SetItemString(parameters, "hostname", PyString_FromString(settings->netbios_name)); PyDict_SetItemString(parameters, "domain", -- cgit