summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-03-04 13:58:07 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-03-04 13:58:07 +1100
commit44c94b6c66b00807d58233550cf8915566cb97d0 (patch)
tree7f8dabe39351a22ea59239107e8fd0d1675c1601 /source4
parent243d4e8a0846f9b873573ec504fb2f811be7d25c (diff)
downloadsamba-44c94b6c66b00807d58233550cf8915566cb97d0.tar.gz
samba-44c94b6c66b00807d58233550cf8915566cb97d0.tar.bz2
samba-44c94b6c66b00807d58233550cf8915566cb97d0.zip
Allow 'net vampire' to work without an existing smb.conf
Now the provision can generate one based on the detected settings from the target domain. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/param/provision.c8
-rw-r--r--source4/param/util.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 7a06f77d96..c8bff59deb 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -34,6 +34,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
struct provision_settings *settings,
struct provision_result *result)
{
+ char *configfile;
PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters;
DEBUG(0,("Provision for Become-DC test using python\n"));
@@ -76,8 +77,11 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
settings->targetdir));
parameters = PyDict_New();
- PyDict_SetItemString(parameters, "smbconf",
- PyString_FromString(lp_configfile(lp_ctx)));
+ configfile = lp_configfile(lp_ctx);
+ if (configfile != NULL) {
+ PyDict_SetItemString(parameters, "smbconf",
+ PyString_FromString(configfile));
+ }
PyDict_SetItemString(parameters, "rootdn",
PyString_FromString(settings->root_dn_str));
diff --git a/source4/param/util.c b/source4/param/util.c
index 92728d505a..3881107cbc 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -107,7 +107,7 @@ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
char *fname, *config_dir, *p;
config_dir = talloc_strdup(mem_ctx, lp_configfile(lp_ctx));
if (config_dir == NULL) {
- return NULL;
+ config_dir = talloc_strdup(mem_ctx, lp_default_path());
}
p = strrchr(config_dir, '/');
if (p == NULL) {