2 Unix SMB/CIFS implementation.
4 type definitions for loadparm
6 Copyright (C) Karl Auer 1993-1998
8 Largely re-written by Andrew Tridgell, September 1994
10 Copyright (C) Simo Sorce 2001
11 Copyright (C) Alexander Bokovoy 2002
12 Copyright (C) Stefan (metze) Metzmacher 2002
13 Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003.
14 Copyright (C) James Myers 2003 <myersjj@samba.org>
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/>.
35 struct parmlist_entry
{
36 struct parmlist_entry
*prev
, *next
;
39 char **list
; /* For the source3 parametric options, to save the parsed list */
44 struct parmlist_entry
*entries
;
47 /* the following are used by loadparm for option lists */
49 P_BOOL
,P_BOOLREV
,P_CHAR
,P_INTEGER
,P_OCTAL
,P_LIST
,
50 P_STRING
,P_USTRING
,P_ENUM
,P_BYTES
,P_CMDLIST
54 P_LOCAL
,P_GLOBAL
,P_NONE
62 struct loadparm_service
;
63 struct loadparm_context
{
64 const char *szConfigFile
;
65 struct loadparm_global
*globals
;
66 struct loadparm_service
**services
;
67 struct loadparm_service
*sDefault
;
68 struct smb_iconv_handle
*iconv_handle
;
70 struct loadparm_service
*currentService
;
71 bool bInGlobalSection
;
72 struct file_lists
*file_lists
;
76 bool global
; /* Is this the global context, which may set
77 * global variables such as debug level etc? */
78 const struct loadparm_s3_helpers
*s3_fns
;
86 bool (*special
)(struct loadparm_context
*lpcfg_ctx
,
87 struct loadparm_service
*, const char *, char **);
88 const struct enum_list
*enum_list
;
99 extern struct parm_struct parm_table
[];
102 struct file_lists
*next
;
105 struct timespec modtime
;
108 #define DEFAULT_NAME_RESOLVE_ORDER "lmhosts wins host bcast"
109 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
110 #define FLAG_SYNONYM 0x2000 /* options that is a synonym of another option */
111 #define FLAG_CMDLINE 0x10000 /* option has been overridden */
112 #define FLAG_DEFAULT 0x20000 /* this option was a default */
114 /* This defines the section name in the configuration file that will
115 refer to the special "printers" service */
116 #ifndef PRINTERS_NAME
117 #define PRINTERS_NAME "printers"
120 /* This defines the section name in the configuration file that will
121 refer to the special "homes" service */
123 #define HOMES_NAME "homes"
126 /* This defines the section name in the configuration file that will contain */
127 /* global parameters - that is, parameters relating to the whole server, not */
128 /* just services. This name is then reserved, and may not be used as a */
129 /* a service name. It will default to "global" if not defined here. */
131 #define GLOBAL_NAME "global"
132 #define GLOBAL_NAME2 "globals"
135 /* The default workgroup - usually overridden in smb.conf */
136 #ifndef DEFAULT_WORKGROUP
137 #define DEFAULT_WORKGROUP "WORKGROUP"
140 /* types of configuration backends for loadparm */
141 #define CONFIG_BACKEND_FILE 0
142 #define CONFIG_BACKEND_REGISTRY 1
145 Do you want session setups at user level security with a invalid
146 password to be rejected or allowed in as guest? WinNT rejects them
147 but it can be a pain as it means "net view" needs to use a password
149 You have 3 choices in the setting of map_to_guest:
151 "NEVER_MAP_TO_GUEST" means session setups with an invalid password
152 are rejected. This is the default.
154 "MAP_TO_GUEST_ON_BAD_USER" means session setups with an invalid password
155 are rejected, unless the username does not exist, in which case it
156 is treated as a guest login
158 "MAP_TO_GUEST_ON_BAD_PASSWORD" means session setups with an invalid password
159 are treated as a guest login
161 Note that map_to_guest only has an effect in user or server
165 #define NEVER_MAP_TO_GUEST 0
166 #define MAP_TO_GUEST_ON_BAD_USER 1
167 #define MAP_TO_GUEST_ON_BAD_PASSWORD 2
168 #define MAP_TO_GUEST_ON_BAD_UID 3
171 * This should be under the HAVE_KRB5 flag but since they're used
172 * in lp_kerberos_method(), they need to be always available
173 * If you add any entries to KERBEROS_VERIFY defines, please modify USE.*KEYTAB macros
174 * so they remain accurate.
177 #define KERBEROS_VERIFY_SECRETS 0
178 #define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
179 #define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
180 #define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
182 #define KERBEROS_ETYPES_ALL 0
183 #define KERBEROS_ETYPES_STRONG 1
184 #define KERBEROS_ETYPES_LEGACY 2
186 /* ACL compatibility */
187 enum acl_compatibility
{ACL_COMPAT_AUTO
, ACL_COMPAT_WINNT
, ACL_COMPAT_WIN2K
};
190 enum printing_types
{PRINT_BSD
,PRINT_SYSV
,PRINT_AIX
,PRINT_HPUX
,
191 PRINT_QNX
,PRINT_PLP
,PRINT_LPRNG
,PRINT_SOFTQ
,
192 PRINT_CUPS
,PRINT_LPRNT
,PRINT_LPROS2
,PRINT_IPRINT
193 #if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
194 ,PRINT_TEST
,PRINT_VLP
195 #endif /* DEVELOPER */
198 #define SERVER_TCP_LOW_PORT 49152
199 #define SERVER_TCP_HIGH_PORT 65535
201 #define SERVER_TCP_PORT_MIN 1024
202 #define SERVER_TCP_PORT_MAX 65535
206 enum ldap_server_require_strong_auth
{
207 LDAP_SERVER_REQUIRE_STRONG_AUTH_NO
,
208 LDAP_SERVER_REQUIRE_STRONG_AUTH_ALLOW_SASL_OVER_TLS
,
209 LDAP_SERVER_REQUIRE_STRONG_AUTH_ALLOW_SASL_WITHOUT_TLS_CB
,
210 LDAP_SERVER_REQUIRE_STRONG_AUTH_YES
,
213 /* DNS update settings */
214 enum dns_update_settings
{DNS_UPDATE_OFF
, DNS_UPDATE_ON
, DNS_UPDATE_SIGNED
};
216 /* MDNS name sources */
217 enum mdns_name_values
{MDNS_NAME_NETBIOS
, MDNS_NAME_MDNS
};
219 /* LDAP SSL options */
220 enum ldap_ssl_types
{LDAP_SSL_OFF
, LDAP_SSL_START_TLS
};
222 /* LDAP PASSWD SYNC methods */
223 enum ldap_passwd_sync_types
{LDAP_PASSWD_SYNC_ON
, LDAP_PASSWD_SYNC_OFF
, LDAP_PASSWD_SYNC_ONLY
};
225 /* map readonly options */
226 enum mapreadonly_options
{MAP_READONLY_NO
, MAP_READONLY_YES
, MAP_READONLY_PERMISSIONS
};
229 enum case_handling
{CASE_LOWER
,CASE_UPPER
};
231 /* inherit owner options */
232 enum inheritowner_options
{
234 INHERIT_OWNER_WINDOWS_AND_UNIX
,
235 INHERIT_OWNER_UNIX_ONLY
238 /* mangled names options */
239 enum mangled_names_options
{MANGLED_NAMES_NO
, MANGLED_NAMES_YES
, MANGLED_NAMES_ILLEGAL
};
241 /* Spotlight backend options */
242 enum spotlight_backend_options
{
243 SPOTLIGHT_BACKEND_NOINDEX
,
244 SPOTLIGHT_BACKEND_TRACKER
,
245 SPOTLIGHT_BACKEND_ES
,
249 enum samba_weak_crypto
{
250 SAMBA_WEAK_CRYPTO_UNKNOWN
,
251 SAMBA_WEAK_CRYPTO_ALLOWED
,
252 SAMBA_WEAK_CRYPTO_DISALLOWED
,
255 /* Controlling the storage of the NT password has on the AD DC */
262 /* Controlling the storage of the NT password has on the AD DC */
263 enum acl_claims_evaluation
{
264 ACL_CLAIMS_EVALUATION_AD_DC_ONLY
,
265 ACL_CLAIMS_EVALUATION_NEVER
268 /* Controlling the protocol for netlogon ping */
269 enum client_netlogon_ping_protocol
{
270 CLIENT_NETLOGON_PING_CLDAP
,
271 CLIENT_NETLOGON_PING_LDAP
,
272 CLIENT_NETLOGON_PING_LDAPS
,
273 CLIENT_NETLOGON_PING_STARTTLS
277 * Default passwd chat script.
279 #ifndef DEFAULT_PASSWD_CHAT
280 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
283 /* Max number of jobs per print queue. */
284 #ifndef PRINT_MAX_JOBID
285 #define PRINT_MAX_JOBID 10000
288 /* the default guest account - allow override via CFLAGS */
289 #ifndef GUEST_ACCOUNT
290 #define GUEST_ACCOUNT "nobody"
294 #define DEFAULT_SMB2_MAX_READ (8*1024*1024)
295 #define DEFAULT_SMB2_MAX_WRITE (8*1024*1024)
296 #define DEFAULT_SMB2_MAX_TRANSACT (8*1024*1024)
297 #define DEFAULT_SMB2_MAX_CREDITS 8192
299 #define DEFAULT_SMB3_SIGNING_ALGORITHMS "AES-128-GMAC AES-128-CMAC HMAC-SHA256"
300 #define DEFAULT_SMB3_ENCRYPTION_ALGORITHMS "AES-128-GCM AES-128-CCM AES-256-GCM AES-256-CCM"
302 #define LOADPARM_EXTRA_LOCALS \
304 struct timespec usershare_last_mod; \
306 struct parmlist_entry *param_opt; \
307 struct bitmap *copymap; \
308 char dummy[3]; /* for alignment */
310 #include "lib/param/param_local.h"
312 #define LOADPARM_EXTRA_GLOBALS \
313 struct parmlist_entry *param_opt; \
317 enum samba_weak_crypto weak_crypto;
319 const char* server_role_str(uint32_t role
);
320 int lp_find_server_role(int server_role
, int security
, int domain_logons
, int domain_master
);
321 int lp_find_security(int server_role
, int security
);
322 bool lp_is_security_and_server_role_valid(int server_role
, int security
);
324 struct loadparm_global
* get_globals(void);
325 unsigned int * get_flags(void);
326 int getservicebyname(const char *, struct loadparm_service
*);
327 bool lp_include(struct loadparm_context
*, struct loadparm_service
*,
328 const char *, char **);
329 bool lp_do_section(const char *pszSectionName
, void *userdata
);
330 bool store_lp_set_cmdline(const char *pszParmName
, const char *pszParmValue
);
332 int num_parameters(void);
333 int32_t lpcfg_parse_enum_vals(const char *param_name
,
334 const char *param_value
);
336 struct loadparm_substitution
;
337 #ifdef LOADPARM_SUBSTITUTION_INTERNALS
338 struct loadparm_substitution
{
339 char *(*substituted_string_fn
)(
341 const struct loadparm_substitution
*lp_sub
,
342 const char *raw_value
,
346 #endif /* LOADPARM_SUBSTITUTION_INTERNALS */
348 const struct loadparm_substitution
*lpcfg_noop_substitution(void);
349 char *lpcfg_substituted_string(TALLOC_CTX
*mem_ctx
,
350 const struct loadparm_substitution
*lp_sub
,
351 const char *raw_value
);
353 #endif /* _LOADPARM_H */