summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c18
-rw-r--r--source4/param/param.h2
-rw-r--r--source4/param/param.i9
-rw-r--r--source4/param/param_wrap.c9
4 files changed, 33 insertions, 5 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 6b8db0e7f5..d660141efc 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -228,8 +228,6 @@ struct loadparm_service
};
-struct loadparm_context *global_loadparm = NULL;
-
#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
@@ -2431,7 +2429,10 @@ const char *lp_configfile(struct loadparm_context *lp_ctx)
bool lp_load_default(struct loadparm_context *lp_ctx)
{
- return lp_load(lp_ctx, dyn_CONFIGFILE);
+ if (getenv("SMB_CONF_PATH"))
+ return lp_load(lp_ctx, getenv("SMB_CONF_PATH"));
+ else
+ return lp_load(lp_ctx, dyn_CONFIGFILE);
}
/**
@@ -2477,6 +2478,16 @@ bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
reload_charcnv(lp_ctx);
+ /* FIXME: ntstatus_check_dos_mapping = lp_nt_status_support(lp_ctx); */
+
+ /* FIXME: This is a bit of a hack, but we can't use a global, since
+ * not everything that uses lp also uses the socket library */
+ if (lp_parm_bool(lp_ctx, NULL, "socket", "testnonblock", false)) {
+ setenv("SOCKET_TESTNONBLOCK", "1", 1);
+ } else {
+ unsetenv("SOCKET_TESTNONBLOCK");
+ }
+
/* FIXME: Check locale in environment for this: */
if (strcmp(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)) != 0)
d_set_iconv(smb_iconv_open(lp_display_charset(lp_ctx), lp_unix_charset(lp_ctx)));
@@ -2679,6 +2690,7 @@ struct gensec_settings *lp_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_
struct gensec_settings *settings = talloc(mem_ctx, struct gensec_settings);
if (settings == NULL)
return NULL;
+ SMB_ASSERT(lp_ctx != NULL);
settings->lp_ctx = talloc_reference(settings, lp_ctx);
settings->iconv_convenience = lp_iconv_convenience(lp_ctx);
settings->target_hostname = lp_parm_string(lp_ctx, NULL, "gensec", "target_hostname");
diff --git a/source4/param/param.h b/source4/param/param.h
index 80bb5ff128..ba0dbfd0fa 100644
--- a/source4/param/param.h
+++ b/source4/param/param.h
@@ -71,8 +71,6 @@ struct gensec_settings;
void reload_charcnv(struct loadparm_context *lp_ctx);
-extern _DEPRECATED_ struct loadparm_context *global_loadparm;
-
struct loadparm_service *lp_default_service(struct loadparm_context *lp_ctx);
struct parm_struct *lp_parm_table(void);
int lp_server_role(struct loadparm_context *);
diff --git a/source4/param/param.i b/source4/param/param.i
index 6158c92f80..c085ca2f05 100644
--- a/source4/param/param.i
+++ b/source4/param/param.i
@@ -344,4 +344,13 @@ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
return lp_ctx;
}
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx)
+{
+ struct loadparm_context *ret;
+ ret = loadparm_init(mem_ctx);
+ if (!lp_load_default(ret))
+ return NULL;
+ return ret;
+}
+
%}
diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c
index 23b3c17623..8f4f529532 100644
--- a/source4/param/param_wrap.c
+++ b/source4/param/param_wrap.c
@@ -2814,6 +2814,15 @@ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
return lp_ctx;
}
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx)
+{
+ struct loadparm_context *ret;
+ ret = loadparm_init(mem_ctx);
+ if (!lp_load_default(ret))
+ return NULL;
+ return ret;
+}
+
#ifdef __cplusplus
extern "C" {