mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
net_conf: fix non-testmode import function.
Michael
This commit is contained in:
parent
ee46f0eca6
commit
cd17cc745a
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user