diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_conf.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 630d01d0a0..1e4ab9b3f2 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -131,7 +131,13 @@ static WERROR import_process_service(struct smbconf_ctx *conf_ctx, if (opt_testmode) { d_printf("[%s]\n", servicename); } else { - werr = smbconf_delete_share(conf_ctx, servicename); + if (smbconf_share_exists(conf_ctx, servicename)) { + werr = smbconf_delete_share(conf_ctx, servicename); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + } + werr = smbconf_create_share(conf_ctx, servicename); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -280,6 +286,10 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx, if (!W_ERROR_IS_OK(werr)) { goto done; } + werr = smbconf_drop(conf_ctx); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } for (sidx = 0; sidx < num_shares; sidx++) { werr = import_process_service(conf_ctx, share_names[sidx], |