From f1938123a613ac81f11b00ff5876a7cc71168cfb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Dec 2004 08:43:34 +0000 Subject: r4444: - initialise registry:HKEY_LOCAL_MACHINE to a reasonable default (where provision.pl suggests hklm.ldb be put) - fix the globals init not to wipe parametic values after initialising them (this bug prevented default values for parametric parameters) (This used to be commit 6a360c52c1723b4c3485a97ebcfeb907f840a051) --- source4/param/loadparm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source4/param') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 8e535c0900..405caf6fc4 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -933,6 +933,7 @@ static void init_globals(void) do_parameter("private dir", dyn_PRIVATE_DIR); do_parameter_var("sam database", "tdb://%s/sam.ldb", dyn_PRIVATE_DIR); do_parameter_var("spoolss database", "tdb://%s/spoolss.ldb", dyn_PRIVATE_DIR); + do_parameter_var("registry:HKEY_LOCAL_MACHINE", "ldb:/%s/hklm.ldb", dyn_PRIVATE_DIR); do_parameter("guest account", GUEST_ACCOUNT); /* using UTF8 by default allows us to support all chars */ @@ -1412,7 +1413,7 @@ static BOOL lp_bool(const char *s) const char *lp_parm_string(int lookup_service, const char *type, const char *option) { const char *value = get_parametrics(lookup_service, type, option); - + if (value) return lp_string(value); @@ -3025,13 +3026,6 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, bInGlobalSection = True; bGlobalOnly = global_only; - init_globals(); - - if (save_defaults) - { - lp_save_defaults(); - } - if (Globals.param_opt != NULL) { struct param_opt *next; for (data=Globals.param_opt; data; data=next) { @@ -3044,6 +3038,13 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, } } + init_globals(); + + if (save_defaults) + { + lp_save_defaults(); + } + /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter); -- cgit