libsmbconf: default to the NULL section when a parameter is encountered w/o section
authorMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 12:37:15 +0000 (14:37 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 15 Apr 2008 15:40:27 +0000 (17:40 +0200)
Michael
(This used to be commit e1b98f1cbce72d12085d86da834f0949ecbfbf67)

source3/lib/smbconf/smbconf_txt_simple.c

index 1ce9069020f1ca71ea5b96aa8133d0617c3665f7..bd7693047c9aa0b23ed2c9469707d60ebd07d91f 100644 (file)
@@ -121,8 +121,14 @@ static bool smbconf_txt_do_parameter(const char *param_name,
        struct txt_cache *cache = tpd->cache;
 
        if (cache->num_shares == 0) {
-               /* not in any share ... */
-               return false;
+               /*
+                * not in any share yet,
+                * initialize the "empty" section (NULL):
+                * parameters without a previous [section] are stored here.
+                */
+               if (!smbconf_txt_do_section(NULL, private_data)) {
+                       return false;
+               }
        }
 
        param_names  = cache->param_names[cache->current_share];