From 0e0d77519c27038b30fec92d542198e97be767d9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Apr 2015 14:48:42 +0200 Subject: [PATCH] s3:param: remove arg initialize_globals from lp_load_with_registry_shares() This is only ever called in client context, and only called once. So there is no point at all in requesting reinit_globals. Set it to false. Signed-off-by: Michael Adam Reviewed-by: Ira Cooper --- source3/include/proto.h | 3 +-- source3/param/loadparm.c | 5 ++--- source3/param/test_lp_load.c | 3 +-- source3/utils/sharesec.c | 2 +- source3/utils/testparm.c | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index e66ce5fea55..ce68640d9ff 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1064,8 +1064,7 @@ bool lp_load_global_no_reinit(const char *file_name); bool lp_load_no_reinit(const char *file_name); bool lp_load_client_no_reinit(const char *file_name); bool lp_load_with_registry_shares(const char *pszFname, - bool save_defaults, - bool initialize_globals); + bool save_defaults); int lp_numservices(void); void lp_dump(FILE *f, bool show_defaults, int maxtoprint); void lp_dump_one(FILE * f, bool show_defaults, int snum); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ca773a7032a..8e2a13b4517 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3905,14 +3905,13 @@ bool lp_load_client_no_reinit(const char *file_name) } bool lp_load_with_registry_shares(const char *pszFname, - bool save_defaults, - bool initialize_globals) + bool save_defaults) { return lp_load_ex(pszFname, false, /* global_only */ save_defaults, false, /* add_ipc */ - initialize_globals, + false, /* reinit_globals */ true, /* allow_include_registry */ true); /* load_all_shares*/ } diff --git a/source3/param/test_lp_load.c b/source3/param/test_lp_load.c index bd373b9e354..3bb0b892fdb 100644 --- a/source3/param/test_lp_load.c +++ b/source3/param/test_lp_load.c @@ -62,8 +62,7 @@ int main(int argc, const char **argv) for (i=0; i < count; i++) { printf("call lp_load() #%d: ", i+1); if (!lp_load_with_registry_shares(config_file, - True, /* save defaults */ - True)) /*init globals */ + True)) /* save defaults */ { printf("ERROR.\n"); ret = 1; diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 914cc4fe429..a2f36fb4944 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -599,7 +599,7 @@ int main(int argc, const char *argv[]) setlinebuf(stdout); - lp_load_with_registry_shares(get_dyn_CONFIGFILE(), False, True); + lp_load_with_registry_shares(get_dyn_CONFIGFILE(), False); /* check for initializing secrets.tdb first */ diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index 3cef0d6a62e..a92fc3a8d8c 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -491,7 +491,7 @@ static void do_per_share_checks(int s) fprintf(stderr,"Load smb config files from %s\n",config_file); - if (!lp_load_with_registry_shares(config_file, True, True)) { + if (!lp_load_with_registry_shares(config_file, True)) { fprintf(stderr,"Error loading services.\n"); ret = 1; goto done; -- 2.11.4.GIT