From 34e8ec54ce46a620515836b0d584dc1f59522e37 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Apr 2008 14:37:15 +0200 Subject: libsmbconf: default to the NULL section when a parameter is encountered w/o section Michael (This used to be commit e1b98f1cbce72d12085d86da834f0949ecbfbf67) --- source3/lib/smbconf/smbconf_txt_simple.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/lib/smbconf/smbconf_txt_simple.c b/source3/lib/smbconf/smbconf_txt_simple.c index 1ce9069020..bd7693047c 100644 --- a/source3/lib/smbconf/smbconf_txt_simple.c +++ b/source3/lib/smbconf/smbconf_txt_simple.c @@ -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]; -- cgit