mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
net_conf: fix non-testmode import function.
Michael
This commit is contained in:
parent
ee46f0eca6
commit
cd17cc745a
@ -131,11 +131,17 @@ static WERROR import_process_service(struct smbconf_ctx *conf_ctx,
|
|||||||
if (opt_testmode) {
|
if (opt_testmode) {
|
||||||
d_printf("[%s]\n", servicename);
|
d_printf("[%s]\n", servicename);
|
||||||
} else {
|
} else {
|
||||||
|
if (smbconf_share_exists(conf_ctx, servicename)) {
|
||||||
werr = smbconf_delete_share(conf_ctx, servicename);
|
werr = smbconf_delete_share(conf_ctx, servicename);
|
||||||
if (!W_ERROR_IS_OK(werr)) {
|
if (!W_ERROR_IS_OK(werr)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
werr = smbconf_create_share(conf_ctx, servicename);
|
||||||
|
if (!W_ERROR_IS_OK(werr)) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (idx = 0; idx < num_params; idx ++) {
|
for (idx = 0; idx < num_params; idx ++) {
|
||||||
if (opt_testmode) {
|
if (opt_testmode) {
|
||||||
@ -280,6 +286,10 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
|
|||||||
if (!W_ERROR_IS_OK(werr)) {
|
if (!W_ERROR_IS_OK(werr)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
werr = smbconf_drop(conf_ctx);
|
||||||
|
if (!W_ERROR_IS_OK(werr)) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
for (sidx = 0; sidx < num_shares; sidx++) {
|
for (sidx = 0; sidx < num_shares; sidx++) {
|
||||||
werr = import_process_service(conf_ctx,
|
werr = import_process_service(conf_ctx,
|
||||||
share_names[sidx],
|
share_names[sidx],
|
||||||
|
Loading…
Reference in New Issue
Block a user