summaryrefslogtreecommitdiff
path: root/source3/lib/smbconf/smbconf_txt_simple.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-15 20:52:17 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-15 20:52:17 +0200
commitd0b946e328c25b8e2bdfef58e11bc3badad97f1c (patch)
treeca63d963f6db36f935aa591500db9741db4d58b8 /source3/lib/smbconf/smbconf_txt_simple.c
parent28fd4f6fcb101fc0274c43611a59d22072fb7891 (diff)
parentb64be89a6ddd1b9c62df98801f34f4d9116a06bf (diff)
downloadsamba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.tar.gz
samba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.tar.bz2
samba-d0b946e328c25b8e2bdfef58e11bc3badad97f1c.zip
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into 3-2-nopipeindex
(This used to be commit 9028f9e065536594df901ae4aac900102f2d85f6)
Diffstat (limited to 'source3/lib/smbconf/smbconf_txt_simple.c')
-rw-r--r--source3/lib/smbconf/smbconf_txt_simple.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/source3/lib/smbconf/smbconf_txt_simple.c b/source3/lib/smbconf/smbconf_txt_simple.c
index 1ce9069020..d2dc24a117 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];
@@ -301,10 +307,21 @@ static WERROR smbconf_txt_get_share_names(struct smbconf_ctx *ctx,
goto done;
}
- /* make sure "global" is always listed first */
+ /* make sure "global" is always listed first,
+ * possibly after NULL section */
+
+ if (smbconf_share_exists(ctx, NULL)) {
+ werr = smbconf_add_string_to_array(tmp_ctx, &tmp_share_names,
+ 0, NULL);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+ added_count++;
+ }
+
if (smbconf_share_exists(ctx, GLOBAL_NAME)) {
werr = smbconf_add_string_to_array(tmp_ctx, &tmp_share_names,
- 0, GLOBAL_NAME);
+ added_count, GLOBAL_NAME);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
@@ -312,7 +329,9 @@ static WERROR smbconf_txt_get_share_names(struct smbconf_ctx *ctx,
}
for (count = 0; count < pd(ctx)->cache->num_shares; count++) {
- if (strequal(pd(ctx)->cache->share_names[count], GLOBAL_NAME)) {
+ if (strequal(pd(ctx)->cache->share_names[count], GLOBAL_NAME) ||
+ (pd(ctx)->cache->share_names[count] == NULL))
+ {
continue;
}