s3:param: remove arg save_defaults from lp_load_with_registry_shares()
authorMichael Adam <obnox@samba.org>
Tue, 21 Apr 2015 13:24:42 +0000 (15:24 +0200)
committerIra Cooper <ira@samba.org>
Wed, 22 Apr 2015 11:57:30 +0000 (13:57 +0200)
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 <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
source3/include/proto.h
source3/param/loadparm.c
source3/param/test_lp_load.c
source3/utils/sharesec.c
source3/utils/testparm.c

index ce68640d9ff3b28bdd566dd7074404e9c7652c22..4acad41a939c293b877f8b53a69f202c460af993 100644 (file)
@@ -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);
index 8e2a13b45179f6093e44ca656862f4e8c16dca69..b53cae29973c9b4cd36ee1b76246f63871defb80 100644 (file)
@@ -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 */
index 3bb0b892fdb843f840b51b9ba9a0ee9c513f8037..fb3b95dd762dc57b58dc4e2627b9f06f1704933e 100644 (file)
@@ -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;
index a2f36fb4944667143d5c57a82317cfa466ecf41a..132ca7ecc10dd21aaebebf4bd637619f9abf2c06 100644 (file)
@@ -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 */
 
index a92fc3a8d8c5d6a293388a632dbb46b6cf8b37f7..7850b4386ed59db3766367c926251ab0600a9242 100644 (file)
@@ -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;