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;
}
}
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;
}