From 65b4a93c4ac381a669777c7d06611255e5e48263 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 27 Mar 2008 00:32:00 +0100 Subject: net_conf: fix non-testmode import function. Michael (This used to be commit cd17cc745a35db8ee158f59a5fff1f0f26cf9c6e) --- source3/utils/net_conf.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3') 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], -- cgit