diff options
author | Michael Adam <obnox@samba.org> | 2008-03-27 00:32:00 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-03-27 00:32:09 +0100 |
commit | 65b4a93c4ac381a669777c7d06611255e5e48263 (patch) | |
tree | 30ebdb66f8a1bc493d3e264daf85f5ce4c6b47ab /source3/utils | |
parent | 3d8727343bc360ba42495892b233f430efd1be31 (diff) | |
download | samba-65b4a93c4ac381a669777c7d06611255e5e48263.tar.gz samba-65b4a93c4ac381a669777c7d06611255e5e48263.tar.bz2 samba-65b4a93c4ac381a669777c7d06611255e5e48263.zip |
net_conf: fix non-testmode import function.
Michael
(This used to be commit cd17cc745a35db8ee158f59a5fff1f0f26cf9c6e)
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], |