param: remove special cases for tls files
authorGarming Sam <garming@catalyst.net.nz>
Thu, 16 Jan 2014 00:13:11 +0000 (13:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Feb 2014 00:17:14 +0000 (13:17 +1300)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
docs-xml/smbdotconf/security/tlscafile.xml
docs-xml/smbdotconf/security/tlscertfile.xml
docs-xml/smbdotconf/security/tlscrlfile.xml
docs-xml/smbdotconf/security/tlsdhparamsfile.xml
docs-xml/smbdotconf/security/tlskeyfile.xml
lib/param/loadparm.c
lib/param/param_table.c
source3/param/loadparm.c

index 0a54e994b635f7e8ee5a868d889bb2bbb1e5f4d8..889dd23f3b10f7edc4ee5fbb1cf271d5aad6f7ec 100644 (file)
@@ -2,7 +2,8 @@
                  type="string"
                  context="G"
                  basic="1" advanced="1" developer="1"
-                 generated_function="0"
+                 function="_tls_cafile"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
         <para>This option can be set to a file (PEM format)
index 0365554c012f53ab7f1c974210bf96e7186f9ac7..df5fb5fbf648dec14391f3f035733f4c287bfc55 100644 (file)
@@ -2,7 +2,8 @@
                  type="string"
                  context="G"
                  basic="1" advanced="1" developer="1"
-                 generated_function="0"
+                 function="_tls_certfile"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
         <para>This option can be set to a file (PEM format)
index 659a3d5f5a70d28048f4a4fbb7f009c56bbcb331..4c9de355678e42023e1bb11e2cf8e2269f5bc922 100644 (file)
@@ -2,7 +2,8 @@
                  type="string"
                  context="G"
                  basic="1" advanced="1" developer="1"
-                 generated_function="0"
+                 function="_tls_crlfile"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
         <para>This option can be set to a file containing a certificate
index b248a346a0968252994a84be9bdf97f83f5febee..b965b1ebec483e7a4fcbd182a03993bb9729fbcf 100644 (file)
@@ -2,7 +2,8 @@
                  type="string"
                  context="G"
                  basic="1" advanced="1" developer="1"
-                 generated_function="0"
+                 function="_tls_dhpfile"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
         <para>This option can be set to a file with Diffie-Hellman parameters
index 6cf7bd79efc2cc5dfcfed3d3e947bf678a4fddc3..a1c7be3f38865fef596ef3fba89815a7b072c06c 100644 (file)
@@ -2,7 +2,8 @@
                  type="string"
                  context="G"
                  basic="1" advanced="1" developer="1"
-                 generated_function="0"
+                 function="_tls_keyfile"
+                 constant="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
         <para>This option can be set to a file (PEM format)
index f9092c6b8e442dd66188db236aef73c104071515..9795614affd8f9a48fe8d5851e3c7c02948a29e3 100644 (file)
@@ -87,12 +87,7 @@ static bool defaults_saved = false;
        char *szIdmapGID;                                               \
        char *szIdmapBackend;                                           \
        int winbindMaxDomainConnections;                                \
-       int ismb2_max_credits;                                          \
-       char *tls_keyfile;                                              \
-       char *tls_certfile;                                             \
-       char *tls_cafile;                                               \
-       char *tls_crlfile;                                              \
-       char *tls_dhpfile;
+       int ismb2_max_credits;
 
 #include "lib/param/param_global.h"
 
@@ -2710,27 +2705,27 @@ _PUBLIC_ void reload_charcnv(struct loadparm_context *lp_ctx)
 
 _PUBLIC_ char *lpcfg_tls_keyfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
-       return lpcfg_private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_keyfile);
+       return lpcfg_private_path(mem_ctx, lp_ctx, lpcfg__tls_keyfile(lp_ctx));
 }
 
 _PUBLIC_ char *lpcfg_tls_certfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
-       return lpcfg_private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_certfile);
+       return lpcfg_private_path(mem_ctx, lp_ctx, lpcfg__tls_certfile(lp_ctx));
 }
 
 _PUBLIC_ char *lpcfg_tls_cafile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
-       return lpcfg_private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_cafile);
+       return lpcfg_private_path(mem_ctx, lp_ctx, lpcfg__tls_cafile(lp_ctx));
 }
 
 _PUBLIC_ char *lpcfg_tls_crlfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
-       return lpcfg_private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_crlfile);
+       return lpcfg_private_path(mem_ctx, lp_ctx, lpcfg__tls_crlfile(lp_ctx));
 }
 
 _PUBLIC_ char *lpcfg_tls_dhpfile(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
 {
-       return lpcfg_private_path(mem_ctx, lp_ctx, lp_ctx->globals->tls_dhpfile);
+       return lpcfg_private_path(mem_ctx, lp_ctx, lpcfg__tls_dhpfile(lp_ctx));
 }
 
 struct gensec_settings *lpcfg_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
index d108833aba1891849b3c5c36995882fbe2881f7c..ad929ec16b2437076a53e1d2808141c0c39f4b62 100644 (file)
@@ -4349,7 +4349,7 @@ static struct parm_struct parm_table[] = {
                .label          = "tls keyfile",
                .type           = P_STRING,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(tls_keyfile),
+               .offset         = GLOBAL_VAR(_tls_keyfile),
                .special        = NULL,
                .enum_list      = NULL
        },
@@ -4357,7 +4357,7 @@ static struct parm_struct parm_table[] = {
                .label          = "tls certfile",
                .type           = P_STRING,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(tls_certfile),
+               .offset         = GLOBAL_VAR(_tls_certfile),
                .special        = NULL,
                .enum_list      = NULL
        },
@@ -4365,7 +4365,7 @@ static struct parm_struct parm_table[] = {
                .label          = "tls cafile",
                .type           = P_STRING,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(tls_cafile),
+               .offset         = GLOBAL_VAR(_tls_cafile),
                .special        = NULL,
                .enum_list      = NULL
        },
@@ -4373,7 +4373,7 @@ static struct parm_struct parm_table[] = {
                .label          = "tls crlfile",
                .type           = P_STRING,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(tls_crlfile),
+               .offset         = GLOBAL_VAR(_tls_crlfile),
                .special        = NULL,
                .enum_list      = NULL
        },
@@ -4381,7 +4381,7 @@ static struct parm_struct parm_table[] = {
                .label          = "tls dh params file",
                .type           = P_STRING,
                .p_class        = P_GLOBAL,
-               .offset         = GLOBAL_VAR(tls_dhpfile),
+               .offset         = GLOBAL_VAR(_tls_dhpfile),
                .special        = NULL,
                .enum_list      = NULL
        },
index be18f10921fc4f6f2cc4f821a443b0db7277b2c7..c780f4e72cabaaabb260bff99f65cfbb8c453edf 100644 (file)
@@ -123,12 +123,7 @@ static bool defaults_saved = false;
        char *szIdmapGID;                                               \
        char *szIdmapBackend;                                           \
        int winbindMaxDomainConnections;                                \
-       int ismb2_max_credits;                                          \
-       char *tls_keyfile;                                              \
-       char *tls_certfile;                                             \
-       char *tls_cafile;                                               \
-       char *tls_crlfile;                                              \
-       char *tls_dhpfile;
+       int ismb2_max_credits;
 
 #include "lib/param/param_global.h"
 
@@ -1036,9 +1031,9 @@ static void init_globals(bool reinit_globals)
 
        Globals.tls_enabled = true;
 
-       string_set(&Globals.tls_keyfile, "tls/key.pem");
-       string_set(&Globals.tls_certfile, "tls/cert.pem");
-       string_set(&Globals.tls_cafile, "tls/ca.pem");
+       string_set(&Globals._tls_keyfile, "tls/key.pem");
+       string_set(&Globals._tls_certfile, "tls/cert.pem");
+       string_set(&Globals._tls_cafile, "tls/ca.pem");
 
        string_set(&Globals.share_backend, "classic");