diff options
author | Michael Adam <obnox@samba.org> | 2013-05-21 16:50:49 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-05-28 20:01:12 +0200 |
commit | 89edff08db367417f3032563df3ea1b546553c83 (patch) | |
tree | fff913df68bf4cf545ccb6947f11b12242c42be8 /source3 | |
parent | caf83bcb76f52b0628f6d59e95396d16b5e3c66e (diff) | |
download | samba-89edff08db367417f3032563df3ea1b546553c83.tar.gz samba-89edff08db367417f3032563df3ea1b546553c83.tar.bz2 samba-89edff08db367417f3032563df3ea1b546553c83.zip |
net: use smbconf_create_set_share() in "net conf import"
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue May 28 20:01:12 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_conf.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c index 60588c0eed..e43cd12164 100644 --- a/source3/utils/net_conf.c +++ b/source3/utils/net_conf.c @@ -179,13 +179,10 @@ static sbcErr import_process_service(struct net_context *c, struct smbconf_ctx *conf_ctx, struct smbconf_service *service) { - uint32_t idx; sbcErr err = SBC_ERR_OK; - uint32_t num_includes = 0; - char **includes = NULL; - TALLOC_CTX *mem_ctx = talloc_stackframe(); if (c->opt_testmode) { + uint32_t idx; const char *indent = ""; if (service->name != NULL) { d_printf("[%s]\n", service->name); @@ -206,52 +203,10 @@ static sbcErr import_process_service(struct net_context *c, goto done; } } - err = smbconf_create_share(conf_ctx, service->name); - if (!SBC_ERROR_IS_OK(err)) { - goto done; - } - for (idx = 0; idx < service->num_params; idx ++) { - if (strequal(service->param_names[idx], "include")) { - includes = talloc_realloc(mem_ctx, - includes, - char *, - num_includes+1); - if (includes == NULL) { - err = SBC_ERR_NOMEM; - goto done; - } - includes[num_includes] = talloc_strdup(includes, - service->param_values[idx]); - if (includes[num_includes] == NULL) { - err = SBC_ERR_NOMEM; - goto done; - } - num_includes++; - } else { - err = smbconf_set_parameter(conf_ctx, - service->name, - service->param_names[idx], - service->param_values[idx]); - if (!SBC_ERROR_IS_OK(err)) { - d_fprintf(stderr, - _("Error in section [%s], parameter \"%s\": %s\n"), - service->name, service->param_names[idx], - sbcErrorString(err)); - goto done; - } - } - } + err = smbconf_create_set_share(conf_ctx, service); - err = smbconf_set_includes(conf_ctx, service->name, num_includes, - (const char **)includes); - if (!SBC_ERROR_IS_OK(err)) { - goto done; - } - - err = SBC_ERR_OK; done: - TALLOC_FREE(mem_ctx); return err; } |