summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-13 17:16:54 +0200
committerMichael Adam <obnox@samba.org>2008-04-13 20:04:44 +0200
commitd2d82394a488471e54bd4931f892dc1640f9d80e (patch)
tree5f4b1f57470a4d4aebdb1f821d4a2fb62e304550
parent4eab3d3cf0d0fc111d0566089d902750be634759 (diff)
downloadsamba-d2d82394a488471e54bd4931f892dc1640f9d80e.tar.gz
samba-d2d82394a488471e54bd4931f892dc1640f9d80e.tar.bz2
samba-d2d82394a488471e54bd4931f892dc1640f9d80e.zip
net conf: use the new smbconf_init() dispatcher instead of explicit backend init.
Michael (This used to be commit 281c9287a34533045b62302bb33ced3d216421ac)
-rw-r--r--source3/utils/net_conf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 245a91fa3e..88cc15e0eb 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -266,6 +266,7 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
int ret = -1;
const char *filename = NULL;
const char *servicename = NULL;
+ char *conf_source = NULL;
TALLOC_CTX *mem_ctx;
struct smbconf_ctx *txt_ctx;
WERROR werr;
@@ -291,7 +292,13 @@ static int net_conf_import(struct smbconf_ctx *conf_ctx,
DEBUG(3,("net_conf_import: reading configuration from file %s.\n",
filename));
- werr = smbconf_init_txt_simple(mem_ctx, &txt_ctx, filename);
+ conf_source = talloc_asprintf(mem_ctx, "file:%s", filename);
+ if (conf_source == NULL) {
+ d_printf("error: out of memory!\n");
+ goto done;
+ }
+
+ werr = smbconf_init(mem_ctx, &txt_ctx, conf_source);
if (!W_ERROR_IS_OK(werr)) {
d_printf("error loading file '%s': %s\n", filename,
dos_errstr(werr));
@@ -969,7 +976,7 @@ static int net_conf_wrap_function(int (*fn)(struct smbconf_ctx *,
struct smbconf_ctx *conf_ctx;
int ret = -1;
- werr = smbconf_init_reg(mem_ctx, &conf_ctx, NULL);
+ werr = smbconf_init(mem_ctx, &conf_ctx, "registry:");
if (!W_ERROR_IS_OK(werr)) {
return -1;