mirror of
https://github.com/samba-team/samba.git
synced 2025-12-10 04:23:50 +03:00
r26352: Don't make lp_load create a new context.
(This used to be commit d0d5c1a823)
This commit is contained in:
committed by
Stefan Metzmacher
parent
75ac6cd318
commit
dd7e5ed88c
@@ -161,6 +161,14 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
v = lp.filename(); obtain filename
|
||||
*/
|
||||
static int ejs_lpFilename(MprVarHandle eid, int argc, char **argv)
|
||||
{
|
||||
mpr_ReturnString(eid, lp_configfile(global_loadparm));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
set a smb.conf parameter. Only sets in memory, not permanent
|
||||
@@ -188,8 +196,9 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv)
|
||||
static int ejs_lpReload(MprVarHandle eid, int argc, char **argv)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
ret = lp_load(talloc_autofree_context(), lp_configfile(global_loadparm), NULL);
|
||||
const char *filename = lp_configfile(global_loadparm);
|
||||
|
||||
ret = lp_load(global_loadparm, filename);
|
||||
if (ret) {
|
||||
unload_interfaces();
|
||||
}
|
||||
@@ -208,6 +217,7 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
mprSetStringCFunction(obj, "set", ejs_lpSet);
|
||||
mprSetStringCFunction(obj, "reload", ejs_lpReload);
|
||||
mprSetStringCFunction(obj, "services", ejs_lpServices);
|
||||
mprSetStringCFunction(obj, "filename", ejs_lpFilename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,12 @@ int main(int argc, const char **argv)
|
||||
|
||||
fault_setup(argv[0]);
|
||||
|
||||
global_loadparm = lp_ctx = loadparm_init(talloc_autofree_context());
|
||||
|
||||
if (getenv("SMB_CONF_PATH")) {
|
||||
lp_load(talloc_autofree_context(), getenv("SMB_CONF_PATH"), &lp_ctx);
|
||||
lp_load(lp_ctx, getenv("SMB_CONF_PATH"));
|
||||
} else {
|
||||
lp_load(talloc_autofree_context(), dyn_CONFIGFILE, &lp_ctx);
|
||||
lp_load(lp_ctx, dyn_CONFIGFILE);
|
||||
}
|
||||
|
||||
ldb_global_init();
|
||||
|
||||
@@ -386,7 +386,7 @@ function provision_default_paths(subobj)
|
||||
var dnsdomain = strlower(subobj.REALM);
|
||||
var lp = loadparm_init();
|
||||
var paths = new Object();
|
||||
paths.smbconf = lp.get("config file");
|
||||
paths.smbconf = lp.filename()
|
||||
paths.shareconf = lp.get("private dir") + "/" + "share.ldb";
|
||||
paths.samdb = lp.get("sam database");
|
||||
paths.secrets = lp.get("secrets database");
|
||||
|
||||
@@ -468,7 +468,6 @@ smbconf_keep = new Array(
|
||||
"wins support",
|
||||
"csc policy",
|
||||
"strict locking",
|
||||
"config file",
|
||||
"preload",
|
||||
"auto services",
|
||||
"lock dir",
|
||||
|
||||
Reference in New Issue
Block a user