summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-08 23:32:37 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:56 +0100
commitdd7e5ed88c48f4ee39e53be07c8839791e914e45 (patch)
treefca88a741257b2f5165f3762de6c44053888fc3e /source4/param
parent75ac6cd318ae58aacc77785ba93af50bfe354b63 (diff)
downloadsamba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.tar.gz
samba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.tar.bz2
samba-dd7e5ed88c48f4ee39e53be07c8839791e914e45.zip
r26352: Don't make lp_load create a new context.
(This used to be commit d0d5c1a823a6601292c061dba2b6f4bde2b9e3dd)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index b045269192..564dede3a5 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -88,7 +88,6 @@ struct loadparm_global
char *szServerString;
char *szAutoServices;
char *szPasswdChat;
- const char *szConfigFile;
char *szShareBackend;
char *szSAM_URL;
char *szSECRETS_URL;
@@ -356,8 +355,6 @@ static const struct enum_list enum_server_role[] = {
#define LOCAL_VAR(name) offsetof(struct loadparm_service, name)
static struct parm_struct parm_table[] = {
- {"config file", P_STRING, P_GLOBAL, GLOBAL_VAR(szConfigFile), NULL, NULL},
-
{"server role", P_ENUM, P_GLOBAL, GLOBAL_VAR(server_role), NULL, enum_server_role},
{"dos charset", P_STRING, P_GLOBAL, GLOBAL_VAR(dos_charset), NULL, NULL},
@@ -521,6 +518,7 @@ static struct parm_struct parm_table[] = {
/* local variables */
struct loadparm_context {
+ const char *szConfigFile;
struct loadparm_global *globals;
struct loadparm_service **services;
int iNumServices;
@@ -682,7 +680,6 @@ _PUBLIC_ FN_GLOBAL_BOOL(lp_disable_netbios, bDisableNetbios)
_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_support, bWINSsupport)
_PUBLIC_ FN_GLOBAL_BOOL(lp_wins_dns_proxy, bWINSdnsProxy)
_PUBLIC_ FN_GLOBAL_STRING(lp_wins_hook, szWINSHook)
-_PUBLIC_ FN_GLOBAL_STRING(lp_configfile, szConfigFile)
_PUBLIC_ FN_GLOBAL_BOOL(lp_local_master, bLocalMaster)
_PUBLIC_ FN_GLOBAL_BOOL(lp_readraw, bReadRaw)
_PUBLIC_ FN_GLOBAL_BOOL(lp_large_readwrite, bLargeReadwrite)
@@ -2399,35 +2396,30 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
return lp_ctx;
}
+const char *lp_configfile(struct loadparm_context *lp_ctx)
+{
+ return lp_ctx->szConfigFile;
+}
+
/**
* Load the services array from the services file.
*
* Return True on success, False on failure.
*/
-bool lp_load(TALLOC_CTX *mem_ctx, const char *filename, struct loadparm_context **ret_lp)
+bool lp_load(struct loadparm_context *lp_ctx, const char *filename)
{
char *n2;
bool bRetval;
- struct loadparm_context *lp_ctx;
-
- if (ret_lp != NULL)
- *ret_lp = NULL;
-
- lp_ctx = loadparm_init(mem_ctx);
- if (lp_ctx == NULL)
- return false;
-
- global_loadparm = lp_ctx;
filename = talloc_strdup(lp_ctx, filename);
- lp_ctx->globals->szConfigFile = filename;
+ lp_ctx->szConfigFile = filename;
lp_ctx->bInGlobalSection = true;
- n2 = standard_sub_basic(lp_ctx, lp_ctx->globals->szConfigFile);
+ n2 = standard_sub_basic(lp_ctx, lp_ctx->szConfigFile);
DEBUG(2, ("lp_load: refreshing parameters from %s\n", n2));
- add_to_file_list(lp_ctx, lp_ctx->globals->szConfigFile, n2);
+ add_to_file_list(lp_ctx, lp_ctx->szConfigFile, n2);
/* We get sections first, so have to start 'behind' to make up */
lp_ctx->currentService = NULL;
@@ -2452,9 +2444,6 @@ bool lp_load(TALLOC_CTX *mem_ctx, const char *filename, struct loadparm_context
reload_charcnv();
- if (ret_lp != NULL)
- *ret_lp = lp_ctx;
-
return bRetval;
}