loadarm: fix testparm with "config backend = registry".
authorMichael Adam <obnox@samba.org>
Mon, 26 May 2008 09:58:11 +0000 (11:58 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 10 Jul 2008 21:34:05 +0000 (23:34 +0200)
Set the iServiceIndex to "-1" for starup with either config
backend (originally only for text backend). Otherwise,
process_registry_shares() will fail.

Currently, the only user of lp_load_with_registry_shares() is testparm.

Michael
(cherry picked from commit 5e2b925367241c41793b2eb7a628e9fc9f3ac8ff)

source/param/loadparm.c

index 959cc92e7c782a4436d1f38990146c67920691d1..45a559f6ff60d61603ef7bfe9fb8e750061b7982 100644 (file)
@@ -8758,6 +8758,9 @@ bool lp_load_ex(const char *pszFname,
                lp_save_defaults();
        }
 
+       /* We get sections first, so have to start 'behind' to make up */
+       iServiceIndex = -1;
+
        if (Globals.param_opt != NULL) {
                data = Globals.param_opt;
                while (data) {
@@ -8781,8 +8784,6 @@ bool lp_load_ex(const char *pszFname,
 
                add_to_file_list(pszFname, n2);
 
-               /* We get sections first, so have to start 'behind' to make up */
-               iServiceIndex = -1;
                bRetval = pm_process(n2, do_section, do_parameter, NULL);
                SAFE_FREE(n2);