From b9e72b402de412c23702715ead96c20e9b3248cc Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 7 Apr 2008 22:33:01 +0200 Subject: [PATCH] libsmbconf: add a "verbatim" parameter to smbconf_init_txt_simple(). Michael --- source/lib/smbconf/smbconf.h | 3 ++- source/lib/smbconf/smbconf_txt_simple.c | 14 ++++++++++++-- source/utils/net_conf.c | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/lib/smbconf/smbconf.h b/source/lib/smbconf/smbconf.h index 72729b9df8a..15c2a3b7c9d 100644 --- a/source/lib/smbconf/smbconf.h +++ b/source/lib/smbconf/smbconf.h @@ -40,7 +40,8 @@ WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx, WERROR smbconf_init_txt_simple(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx, - const char *path); + const char *path + bool verbatim); /* * the smbconf API functions diff --git a/source/lib/smbconf/smbconf_txt_simple.c b/source/lib/smbconf/smbconf_txt_simple.c index 8c831f9f81c..9a3bc784eb4 100644 --- a/source/lib/smbconf/smbconf_txt_simple.c +++ b/source/lib/smbconf/smbconf_txt_simple.c @@ -40,6 +40,7 @@ struct txt_cache { struct txt_private_data { struct txt_cache *cache; uint64_t csn; + bool verbatim; }; /********************************************************************** @@ -514,7 +515,16 @@ static struct smbconf_ops smbconf_ops_txt = { */ WERROR smbconf_init_txt_simple(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx, - const char *path) + const char *path, + bool verbatim) { - return smbconf_init(mem_ctx, conf_ctx, path, &smbconf_ops_txt); + WERROR werr; + + werr = smbconf_init(mem_ctx, conf_ctx, path, &smbconf_ops_txt); + if (!W_ERROR_IS_OK(werr)) { + return werr; + } + + pd(*conf_ctx)->verbatim = verbatim; + return WERR_OK; } diff --git a/source/utils/net_conf.c b/source/utils/net_conf.c index 1e4ab9b3f29..e2d88c019d3 100644 --- a/source/utils/net_conf.c +++ b/source/utils/net_conf.c @@ -243,7 +243,7 @@ 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); + werr = smbconf_init_txt_simple(mem_ctx, &txt_ctx, filename, true); if (!W_ERROR_IS_OK(werr)) { goto done; }