mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
r25398: Parse loadparm context to all lp_*() functions.
(This used to be commit 3fcc960839
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
e09226cb35
commit
37d53832a4
@ -68,7 +68,7 @@ static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
talloc_free(ctx);
|
||||
return -1;
|
||||
}
|
||||
cli_credentials_set_conf(creds);
|
||||
cli_credentials_set_conf(creds, global_loadparm);
|
||||
cli_credentials_set_anonymous(creds);
|
||||
|
||||
mprCreds = mprCredentials(creds);
|
||||
|
@ -111,7 +111,7 @@ static int ejs_typeof_native(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
static int ejs_libinclude(int eid, int argc, char **argv)
|
||||
{
|
||||
int i, j;
|
||||
const char **js_include = lp_js_include();
|
||||
const char **js_include = lp_js_include(global_loadparm);
|
||||
|
||||
if (js_include == NULL || js_include[0] == NULL) {
|
||||
ejsSetErrorMsg(eid, "js include path not set");
|
||||
|
@ -431,7 +431,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
|
||||
/* Set up credentials */
|
||||
|
||||
creds = cli_credentials_init(NULL);
|
||||
cli_credentials_set_conf(creds);
|
||||
cli_credentials_set_conf(creds, global_loadparm);
|
||||
cli_credentials_parse_string(creds, argv[1], CRED_SPECIFIED);
|
||||
|
||||
/* Do connect */
|
||||
@ -443,7 +443,7 @@ static int ejs_tree_connect(MprVarHandle eid, int argc, char **argv)
|
||||
io.in.service_type = "?????";
|
||||
io.in.credentials = creds;
|
||||
io.in.fallback_to_anonymous = False;
|
||||
io.in.workgroup = lp_workgroup();
|
||||
io.in.workgroup = lp_workgroup(global_loadparm);
|
||||
|
||||
result = smb_composite_connect(&io, mem_ctx, NULL);
|
||||
tree = io.out.tree;
|
||||
|
@ -211,7 +211,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv)
|
||||
*/
|
||||
static int ejs_lpReload(MprVarHandle eid, int argc, char **argv)
|
||||
{
|
||||
BOOL ret = lp_load();
|
||||
BOOL ret = lp_load(lp_configfile(global_loadparm));
|
||||
if (ret) {
|
||||
unload_interfaces();
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ static int ejs_credentials_init(MprVarHandle eid, int argc, struct MprVar **argv
|
||||
return -1;
|
||||
}
|
||||
|
||||
cli_credentials_set_conf(creds);
|
||||
cli_credentials_set_conf(creds, global_loadparm);
|
||||
|
||||
return ejs_credentials_obj(obj, creds);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "scripting/ejs/smbcalls.h"
|
||||
#include "auth/gensec/gensec.h"
|
||||
#include "ldb/include/ldb.h"
|
||||
#include "dynconfig.h"
|
||||
|
||||
static EjsId eid;
|
||||
|
||||
@ -52,7 +53,9 @@ int main(int argc, const char **argv)
|
||||
fault_setup(argv[0]);
|
||||
|
||||
if (getenv("SMB_CONF_PATH")) {
|
||||
lp_set_cmdline(global_loadparm, "config file", getenv("SMB_CONF_PATH"));
|
||||
lp_load(getenv("SMB_CONF_PATH"));
|
||||
} else {
|
||||
lp_load(dyn_CONFIGFILE);
|
||||
}
|
||||
|
||||
ldb_global_init();
|
||||
@ -60,7 +63,6 @@ int main(int argc, const char **argv)
|
||||
gensec_init();
|
||||
mprSetCtx(mem_ctx);
|
||||
|
||||
lp_load();
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "You must supply a script name\n");
|
||||
|
Reference in New Issue
Block a user