diff options
author | Michael Adam <obnox@samba.org> | 2008-04-15 16:06:57 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-04-15 17:40:27 +0200 |
commit | 747d4a8f044adeb43dd251e2e6a44641c838785b (patch) | |
tree | 158d0a0af758796cab4c6d10cc4a1c48ffc89c79 /source3 | |
parent | 7624bab9631b004815decfeced58ee72ebe125cb (diff) | |
download | samba-747d4a8f044adeb43dd251e2e6a44641c838785b.tar.gz samba-747d4a8f044adeb43dd251e2e6a44641c838785b.tar.bz2 samba-747d4a8f044adeb43dd251e2e6a44641c838785b.zip |
libsmbconf: make sure to always list the NULL section first in text backend.
Michael
(This used to be commit b50fdf321dc8056caa2b057cbd7f83792dfbcd4d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/smbconf/smbconf_txt_simple.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source3/lib/smbconf/smbconf_txt_simple.c b/source3/lib/smbconf/smbconf_txt_simple.c index bd7693047c..d2dc24a117 100644 --- a/source3/lib/smbconf/smbconf_txt_simple.c +++ b/source3/lib/smbconf/smbconf_txt_simple.c @@ -307,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; } @@ -318,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; } |