From 40c9cc150ad99c468207f1762b0a2eaba9f03925 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Apr 2015 15:24:42 +0200 Subject: [PATCH] s3:param: remove arg save_defaults from lp_load_with_registry_shares() This is only used in command line contexts, especially for testparm which relies on safe defaults. The only changed use is in sharesec, but it does not harm to also safe the defaults there. 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 | 4 +--- source3/utils/sharesec.c | 2 +- source3/utils/testparm.c | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index ce68640d9ff..4acad41a939 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1063,8 +1063,7 @@ bool lp_load_client(const char *file_name); 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 lp_load_with_registry_shares(const char *pszFname); 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 8e2a13b4517..b53cae29973 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3904,12 +3904,11 @@ bool lp_load_client_no_reinit(const char *file_name) return lp_load_global_no_reinit(file_name); } -bool lp_load_with_registry_shares(const char *pszFname, - bool save_defaults) +bool lp_load_with_registry_shares(const char *pszFname) { return lp_load_ex(pszFname, false, /* global_only */ - save_defaults, + true, /* save_defaults */ false, /* add_ipc */ false, /* reinit_globals */ true, /* allow_include_registry */ diff --git a/source3/param/test_lp_load.c b/source3/param/test_lp_load.c index 3bb0b892fdb..fb3b95dd762 100644 --- a/source3/param/test_lp_load.c +++ b/source3/param/test_lp_load.c @@ -61,9 +61,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 */ - { + if (!lp_load_with_registry_shares(config_file)) { printf("ERROR.\n"); ret = 1; goto done; diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index a2f36fb4944..132ca7ecc10 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); + lp_load_with_registry_shares(get_dyn_CONFIGFILE()); /* check for initializing secrets.tdb first */ diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index a92fc3a8d8c..7850b4386ed 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)) { + if (!lp_load_with_registry_shares(config_file)) { fprintf(stderr,"Error loading services.\n"); ret = 1; goto done; -- 2.47.3