summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-27 09:07:19 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-27 03:34:22 +0200
commitc4eeda91b0237e17cd837c8c965d381f2b3e01d6 (patch)
treeff723c84303e8aae2ee66d9b688e40e0335d11b4
parent081a010f8cadd5a739f432a3f9c6cdcddd0239a8 (diff)
downloadsamba-c4eeda91b0237e17cd837c8c965d381f2b3e01d6.tar.gz
samba-c4eeda91b0237e17cd837c8c965d381f2b3e01d6.tar.bz2
samba-c4eeda91b0237e17cd837c8c965d381f2b3e01d6.zip
lib/param: Merge in source3 parameters into parmeter table
This finishes the series to remove the various warnings from smb.conf loading when a source3 parameter is used. Based on an earlier patch Pair-Programmed-With: Andrew Tridgell <tridge@samba.org> Andrew Bartlett
-rw-r--r--lib/param/loadparm.c63
1 files changed, 48 insertions, 15 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 9ecd7cc3aa..53c166fb7d 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -134,33 +134,47 @@ static bool handle_logfile(struct loadparm_context *lp_ctx, int unused,
#include "lib/param/param_table.c"
+/* Note: We do not initialise the defaults union - it is not allowed in ANSI C
+ *
+ * The FLAG_HIDE is explicit. Parameters set this way do NOT appear in any edit
+ * screen in SWAT. This is used to exclude parameters as well as to squash all
+ * parameters that have been duplicated by pseudonyms.
+ *
+ * NOTE: To display a parameter in BASIC view set FLAG_BASIC
+ * Any parameter that does NOT have FLAG_ADVANCED will not disply at all
+ * Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in
+ * respective views.
+ *
+ * NOTE2: Handling of duplicated (synonym) parameters:
+ * Only the first occurance of a parameter should be enabled by FLAG_BASIC
+ * and/or FLAG_ADVANCED. All duplicates following the first mention should be
+ * set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred
+ * name first, and all synonyms must follow it with the FLAG_HIDE attribute.
+ */
+
#define GLOBAL_VAR(name) offsetof(struct loadparm_global, name)
#define LOCAL_VAR(name) offsetof(struct loadparm_service, name)
-static struct parm_struct parm_table[] = {
- {
- .label = "server role",
- .type = P_ENUM,
- .p_class = P_GLOBAL,
- .offset = GLOBAL_VAR(server_role),
- .special = NULL,
- .enum_list = enum_server_role
- },
+
+ {N_("Base Options"), P_SEP, P_SEPARATOR},
+
{
.label = "dos charset",
.type = P_STRING,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(dos_charset),
- .special = NULL,
- .enum_list = NULL
+ .special = handle_dos_charset,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED
},
{
.label = "unix charset",
.type = P_STRING,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(unix_charset),
- .special = NULL,
- .enum_list = NULL
+ .special = handle_charset,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED
},
{
.label = "comment",
@@ -221,8 +235,9 @@ static struct parm_struct parm_table[] = {
.type = P_LIST,
.p_class = P_GLOBAL,
.offset = GLOBAL_VAR(szNetbiosAliases),
- .special = NULL,
- .enum_list = NULL
+ .special = handle_netbios_aliases,
+ .enum_list = NULL,
+ .flags = FLAG_ADVANCED,
},
{
.label = "netbios scope",
@@ -260,6 +275,24 @@ static struct parm_struct parm_table[] = {
.enum_list = NULL,
.flags = FLAG_ADVANCED | FLAG_WIZARD,
},
+ {
+ .label = "config backend",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(ConfigBackend),
+ .special = NULL,
+ .enum_list = enum_config_backend,
+ .flags = FLAG_HIDE|FLAG_ADVANCED|FLAG_META,
+ },
+ {
+ .label = "server role",
+ .type = P_ENUM,
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(server_role),
+ .special = NULL,
+ .enum_list = enum_server_role,
+ .flags = FLAG_BASIC | FLAG_ADVANCED,
+ },
{N_("Security Options"), P_SEP, P_SEPARATOR},