2 Unix SMB/CIFS implementation.
3 Parameter loading functions
4 Copyright (C) Karl Auer 1993-1998
6 Largely re-written by Andrew Tridgell, September 1994
8 Copyright (C) Simo Sorce 2001
9 Copyright (C) Alexander Bokovoy 2002
10 Copyright (C) Stefan (metze) Metzmacher 2002
11 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
12 Copyright (C) Michael Adam 2008
13 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
14 Copyright (C) Andrew Bartlett 2011
16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
26 You should have received a copy of the GNU General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>.
31 #include "lib/param/param.h"
32 #include "lib/param/loadparm.h"
33 #include "lib/param/param_global.h"
34 #include "libcli/smb/smb_constants.h"
35 #include "libds/common/roles.h"
41 static const struct enum_list enum_protocol[] = {
42 {PROTOCOL_DEFAULT, "default"}, /* the caller decides what this means */
43 {PROTOCOL_SMB2_10, "SMB2"}, /* for now keep PROTOCOL_SMB2_10 */
44 {PROTOCOL_SMB3_11, "SMB3"}, /* for now keep PROTOCOL_SMB3_11 */
45 {PROTOCOL_SMB3_11, "SMB3_11"},
46 {PROTOCOL_SMB3_10, "SMB3_10"},
47 {PROTOCOL_SMB3_02, "SMB3_02"},
48 {PROTOCOL_SMB3_00, "SMB3_00"},
49 {PROTOCOL_SMB2_24, "SMB2_24"},
50 {PROTOCOL_SMB2_22, "SMB2_22"},
51 {PROTOCOL_SMB2_10, "SMB2_10"},
52 {PROTOCOL_SMB2_02, "SMB2_02"},
53 {PROTOCOL_NT1, "NT1"},
54 {PROTOCOL_LANMAN2, "LANMAN2"},
55 {PROTOCOL_LANMAN1, "LANMAN1"},
56 {PROTOCOL_CORE, "CORE"},
57 {PROTOCOL_COREPLUS, "COREPLUS"},
58 {PROTOCOL_COREPLUS, "CORE+"},
62 static const struct enum_list enum_security[] = {
65 {SEC_DOMAIN, "DOMAIN"},
70 static const struct enum_list enum_bool_auto[] = {
81 static const struct enum_list enum_csc_policy[] = {
82 {CSC_POLICY_MANUAL, "manual"},
83 {CSC_POLICY_DOCUMENTS, "documents"},
84 {CSC_POLICY_PROGRAMS, "programs"},
85 {CSC_POLICY_DISABLE, "disable"},
89 /* Server role options */
90 static const struct enum_list enum_server_role[] = {
92 {ROLE_STANDALONE, "standalone server"},
93 {ROLE_STANDALONE, "standalone"},
94 {ROLE_DOMAIN_MEMBER, "member server"},
95 {ROLE_DOMAIN_MEMBER, "member"},
96 {ROLE_DOMAIN_PDC, "classic primary domain controller"},
97 {ROLE_DOMAIN_BDC, "classic backup domain controller"},
98 {ROLE_ACTIVE_DIRECTORY_DC, "active directory domain controller"},
99 {ROLE_ACTIVE_DIRECTORY_DC, "domain controller"},
100 {ROLE_ACTIVE_DIRECTORY_DC, "dc"},
104 /* SMB signing types. */
105 static const struct enum_list enum_smb_signing_vals[] = {
106 {SMB_SIGNING_DEFAULT, "default"},
107 {SMB_SIGNING_OFF, "No"},
108 {SMB_SIGNING_OFF, "False"},
109 {SMB_SIGNING_OFF, "0"},
110 {SMB_SIGNING_OFF, "Off"},
111 {SMB_SIGNING_OFF, "disabled"},
112 {SMB_SIGNING_IF_REQUIRED, "if_required"},
113 {SMB_SIGNING_IF_REQUIRED, "Yes"},
114 {SMB_SIGNING_IF_REQUIRED, "True"},
115 {SMB_SIGNING_IF_REQUIRED, "1"},
116 {SMB_SIGNING_IF_REQUIRED, "On"},
117 {SMB_SIGNING_IF_REQUIRED, "enabled"},
118 {SMB_SIGNING_IF_REQUIRED, "auto"},
119 {SMB_SIGNING_DESIRED, "desired"},
120 {SMB_SIGNING_REQUIRED, "required"},
121 {SMB_SIGNING_REQUIRED, "mandatory"},
122 {SMB_SIGNING_REQUIRED, "force"},
123 {SMB_SIGNING_REQUIRED, "forced"},
124 {SMB_SIGNING_REQUIRED, "enforced"},
128 /* DNS update options. */
129 static const struct enum_list enum_dns_update_settings[] = {
130 {DNS_UPDATE_OFF, "disabled"},
131 {DNS_UPDATE_OFF, "No"},
132 {DNS_UPDATE_OFF, "False"},
133 {DNS_UPDATE_OFF, "0"},
134 {DNS_UPDATE_OFF, "Off"},
135 {DNS_UPDATE_ON, "nonsecure and secure"},
136 {DNS_UPDATE_ON, "nonsecure"},
137 {DNS_UPDATE_SIGNED, "secure only"},
138 {DNS_UPDATE_SIGNED, "secure"},
139 {DNS_UPDATE_SIGNED, "signed"},
144 Do you want session setups at user level security with a invalid
145 password to be rejected or allowed in as guest? WinNT rejects them
146 but it can be a pain as it means "net view" needs to use a password
148 You have 3 choices in the setting of map_to_guest:
150 "Never" means session setups with an invalid password
151 are rejected. This is the default.
153 "Bad User" means session setups with an invalid password
154 are rejected, unless the username does not exist, in which case it
155 is treated as a guest login
157 "Bad Password" means session setups with an invalid password
158 are treated as a guest login
160 Note that map_to_guest only has an effect in user or server
164 static const struct enum_list enum_map_to_guest[] = {
165 {NEVER_MAP_TO_GUEST, "Never"},
166 {MAP_TO_GUEST_ON_BAD_USER, "Bad User"},
167 {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"},
168 {MAP_TO_GUEST_ON_BAD_UID, "Bad Uid"},
172 /* Config backend options */
174 static const struct enum_list enum_config_backend[] = {
175 {CONFIG_BACKEND_FILE, "file"},
176 {CONFIG_BACKEND_REGISTRY, "registry"},
180 static const struct enum_list enum_smbd_profiling_level[] = {
181 {0, "off"}, {1, "count"}, {2, "on"}, {-1, NULL}
185 /* ADS kerberos ticket verification options */
187 static const struct enum_list enum_kerberos_method[] = {
188 {KERBEROS_VERIFY_SECRETS, "default"},
189 {KERBEROS_VERIFY_SECRETS, "secrets only"},
190 {KERBEROS_VERIFY_SYSTEM_KEYTAB, "system keytab"},
191 {KERBEROS_VERIFY_DEDICATED_KEYTAB, "dedicated keytab"},
192 {KERBEROS_VERIFY_SECRETS_AND_KEYTAB, "secrets and keytab"},
196 static const struct enum_list enum_printing[] = {
197 {PRINT_SYSV, "sysv"},
199 {PRINT_HPUX, "hpux"},
203 {PRINT_LPRNG, "lprng"},
205 {PRINT_CUPS, "cups"},
208 {PRINT_IPRINT, "iprint"},
211 {PRINT_LPROS2, "os2"},
212 #if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
213 {PRINT_TEST, "test"},
215 #endif /* DEVELOPER */
219 static const struct enum_list enum_ldap_sasl_wrapping[] = {
221 {ADS_AUTH_SASL_SIGN, "sign"},
222 {ADS_AUTH_SASL_SEAL, "seal"},
226 static const struct enum_list enum_ldap_ssl[] = {
227 {LDAP_SSL_OFF, "no"},
228 {LDAP_SSL_OFF, "off"},
229 {LDAP_SSL_START_TLS, "start tls"},
230 {LDAP_SSL_START_TLS, "start_tls"},
234 /* LDAP Dereferencing Alias types */
235 #define SAMBA_LDAP_DEREF_NEVER 0
236 #define SAMBA_LDAP_DEREF_SEARCHING 1
237 #define SAMBA_LDAP_DEREF_FINDING 2
238 #define SAMBA_LDAP_DEREF_ALWAYS 3
240 static const struct enum_list enum_ldap_deref[] = {
241 {SAMBA_LDAP_DEREF_NEVER, "never"},
242 {SAMBA_LDAP_DEREF_SEARCHING, "searching"},
243 {SAMBA_LDAP_DEREF_FINDING, "finding"},
244 {SAMBA_LDAP_DEREF_ALWAYS, "always"},
248 static const struct enum_list enum_ldap_passwd_sync[] = {
249 {LDAP_PASSWD_SYNC_OFF, "no"},
250 {LDAP_PASSWD_SYNC_OFF, "off"},
251 {LDAP_PASSWD_SYNC_ON, "yes"},
252 {LDAP_PASSWD_SYNC_ON, "on"},
253 {LDAP_PASSWD_SYNC_ONLY, "only"},
257 static const struct enum_list enum_map_readonly[] = {
258 {MAP_READONLY_NO, "no"},
259 {MAP_READONLY_NO, "false"},
260 {MAP_READONLY_NO, "0"},
261 {MAP_READONLY_YES, "yes"},
262 {MAP_READONLY_YES, "true"},
263 {MAP_READONLY_YES, "1"},
264 {MAP_READONLY_PERMISSIONS, "permissions"},
265 {MAP_READONLY_PERMISSIONS, "perms"},
269 static const struct enum_list enum_case[] = {
270 {CASE_LOWER, "lower"},
271 {CASE_UPPER, "upper"},
276 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
278 * NOTE: Handling of duplicated (synonym) parameters:
279 * Parameters that are synonymous are stored in the same variable.
280 * All but the default spelling carry the flag FLAG_SYNONYM.
283 #define GLOBAL_VAR(name) offsetof(struct loadparm_global, name)
284 #define LOCAL_VAR(name) offsetof(struct loadparm_service, name)
286 #include "lib/param/param_table_gen.c"
288 int num_parameters(void)
290 return (sizeof(parm_table) / sizeof(struct parm_struct));