mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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
This commit is contained in:
parent
243d4e8a08
commit
44c94b6c66
@ -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));
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user