/***************************************************************************
Handle the include operation.
***************************************************************************/
+static bool bNoIncludes = false;
static bool handle_include(int snum, const char *pszParmValue, char **ptr)
{
char *fname;
+ if (bNoIncludes) {
+ return true;
+ }
+
if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) {
if (bInGlobalSection) {
return process_registry_globals();
False on failure.
***************************************************************************/
-bool lp_load(const char *pszFname,
- bool global_only,
- bool save_defaults,
- bool add_ipc,
- bool initialize_globals)
+bool lp_load_ex(const char *pszFname,
+ bool global_only,
+ bool save_defaults,
+ bool add_ipc,
+ bool initialize_globals,
+ bool no_includes)
{
char *n2 = NULL;
bool bRetval;
bRetval = False;
- DEBUG(3, ("lp_load: refreshing parameters\n"));
+ DEBUG(3, ("lp_load_ex: refreshing parameters\n"));
bInGlobalSection = True;
bGlobalOnly = global_only;
+ bNoIncludes = no_includes;
init_globals(! initialize_globals);
debug_init();
current_user_info.domain,
pszFname);
if (!n2) {
- smb_panic("lp_load: out of memory");
+ smb_panic("lp_load_ex: out of memory");
}
add_to_file_list(pszFname, n2);
*/
config_backend = CONFIG_BACKEND_REGISTRY;
/* start over */
- DEBUG(1, ("lp_load: changing to config backend "
+ DEBUG(1, ("lp_load_ex: changing to config backend "
"registry\n"));
init_globals(false);
lp_kill_all_services();
- return lp_load(pszFname, global_only, save_defaults,
- add_ipc, initialize_globals);
+ return lp_load_ex(pszFname, global_only, save_defaults,
+ add_ipc, initialize_globals, no_includes);
}
} else if (lp_config_backend_is_registry()) {
bRetval = process_registry_globals();
init_iconv();
+ bNoIncludes = false;
+
return (bRetval);
}
+bool lp_load(const char *pszFname,
+ bool global_only,
+ bool save_defaults,
+ bool add_ipc,
+ bool initialize_globals)
+{
+ return lp_load_ex(pszFname,
+ global_only,
+ save_defaults,
+ add_ipc,
+ initialize_globals,
+ false);
+}
+
+bool lp_load_initial_only(const char *pszFname)
+{
+ return lp_load_ex(pszFname,
+ true,
+ false,
+ false,
+ true,
+ true);
+}
+
/***************************************************************************
Reset the max number of services.
***************************************************************************/