libsmbconf: add a "verbatim" parameter to smbconf_init_txt_simple().
authorMichael Adam <obnox@samba.org>
Mon, 7 Apr 2008 20:33:01 +0000 (22:33 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 23:28:56 +0000 (01:28 +0200)
Michael
(This used to be commit b9e72b402de412c23702715ead96c20e9b3248cc)

source3/lib/smbconf/smbconf.h
source3/lib/smbconf/smbconf_txt_simple.c
source3/utils/net_conf.c

index 72729b9df8a2c86e3b47eb36ee5acb4edf9a3833..15c2a3b7c9d4a5734a82427fa8e54b352f8e6a67 100644 (file)
@@ -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
index 8c831f9f81ca586d1e60c3eb440fb537d68dc42c..9a3bc784eb41186c90dd9b5b0a599a1074abd810 100644 (file)
@@ -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;
 }
index 1e4ab9b3f29ac4540159543379db7917a9bbd879..e2d88c019d3e375497897c8d6497dc6db8f36841 100644 (file)
@@ -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;
        }