s3-smbd provide struct smbd_server_connection * to conn_snum_used
[nivanova/samba-autobuild/.git] / source3 / param / loadparm.c
1 /* 
2    Unix SMB/CIFS implementation.
3    Parameter loading functions
4    Copyright (C) Karl Auer 1993-1998
5
6    Largely re-written by Andrew Tridgell, September 1994
7
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
14    This program is free software; you can redistribute it and/or modify
15    it under the terms of the GNU General Public License as published by
16    the Free Software Foundation; either version 3 of the License, or
17    (at your option) any later version.
18
19    This program is distributed in the hope that it will be useful,
20    but WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22    GNU General Public License for more details.
23
24    You should have received a copy of the GNU General Public License
25    along with this program.  If not, see <http://www.gnu.org/licenses/>.
26 */
27
28 /*
29  *  Load parameters.
30  *
31  *  This module provides suitable callback functions for the params
32  *  module. It builds the internal table of service details which is
33  *  then used by the rest of the server.
34  *
35  * To add a parameter:
36  *
37  * 1) add it to the global or service structure definition
38  * 2) add it to the parm_table
39  * 3) add it to the list of available functions (eg: using FN_GLOBAL_STRING())
40  * 4) If it's a global then initialise it in init_globals. If a local
41  *    (ie. service) parameter then initialise it in the sDefault structure
42  *  
43  *
44  * Notes:
45  *   The configuration file is processed sequentially for speed. It is NOT
46  *   accessed randomly as happens in 'real' Windows. For this reason, there
47  *   is a fair bit of sequence-dependent code here - ie., code which assumes
48  *   that certain things happen before others. In particular, the code which
49  *   happens at the boundary between sections is delicately poised, so be
50  *   careful!
51  *
52  */
53
54 #include "includes.h"
55 #include "system/filesys.h"
56 #include "util_tdb.h"
57 #include "printing.h"
58 #include "lib/smbconf/smbconf.h"
59 #include "lib/smbconf/smbconf_init.h"
60
61 #include "ads.h"
62 #include "../librpc/gen_ndr/svcctl.h"
63 #include "intl.h"
64 #include "smb_signing.h"
65 #include "dbwrap.h"
66 #include "smbldap.h"
67
68 #ifdef HAVE_SYS_SYSCTL_H
69 #include <sys/sysctl.h>
70 #endif
71
72 #ifdef HAVE_HTTPCONNECTENCRYPT
73 #include <cups/http.h>
74 #endif
75
76 bool bLoaded = False;
77
78 extern userdom_struct current_user_info;
79
80 #ifndef GLOBAL_NAME
81 #define GLOBAL_NAME "global"
82 #endif
83
84 #ifndef PRINTERS_NAME
85 #define PRINTERS_NAME "printers"
86 #endif
87
88 #ifndef HOMES_NAME
89 #define HOMES_NAME "homes"
90 #endif
91
92 /* the special value for the include parameter
93  * to be interpreted not as a file name but to
94  * trigger loading of the global smb.conf options
95  * from registry. */
96 #ifndef INCLUDE_REGISTRY_NAME
97 #define INCLUDE_REGISTRY_NAME "registry"
98 #endif
99
100 static bool in_client = False;          /* Not in the client by default */
101 static struct smbconf_csn conf_last_csn;
102
103 #define CONFIG_BACKEND_FILE 0
104 #define CONFIG_BACKEND_REGISTRY 1
105
106 static int config_backend = CONFIG_BACKEND_FILE;
107
108 /* some helpful bits */
109 #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid)
110 #define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid)
111
112 #define USERSHARE_VALID 1
113 #define USERSHARE_PENDING_DELETE 2
114
115 static bool defaults_saved = False;
116
117 struct param_opt_struct {
118         struct param_opt_struct *prev, *next;
119         char *key;
120         char *value;
121         char **list;
122         unsigned flags;
123 };
124
125 /*
126  * This structure describes global (ie., server-wide) parameters.
127  */
128 struct global {
129         int ConfigBackend;
130         char *smb_ports;
131         char *dos_charset;
132         char *unix_charset;
133         char *display_charset;
134         char *szPrintcapname;
135         char *szAddPortCommand;
136         char *szEnumPortsCommand;
137         char *szAddPrinterCommand;
138         char *szDeletePrinterCommand;
139         char *szOs2DriverMap;
140         char *szLockDir;
141         char *szStateDir;
142         char *szCacheDir;
143         char *szPidDir;
144         char *szRootdir;
145         char *szDefaultService;
146         char *szGetQuota;
147         char *szSetQuota;
148         char *szMsgCommand;
149         char *szServerString;
150         char *szAutoServices;
151         char *szPasswdProgram;
152         char *szPasswdChat;
153         char *szLogFile;
154         char *szConfigFile;
155         char *szSMBPasswdFile;
156         char *szPrivateDir;
157         char *szPassdbBackend;
158         char **szPreloadModules;
159         char *szPasswordServer;
160         char *szSocketOptions;
161         char *szRealm;
162         char *szAfsUsernameMap;
163         int iAfsTokenLifetime;
164         char *szLogNtTokenCommand;
165         char *szUsernameMap;
166         char *szLogonScript;
167         char *szLogonPath;
168         char *szLogonDrive;
169         char *szLogonHome;
170         char **szWINSservers;
171         char **szInterfaces;
172         char *szRemoteAnnounce;
173         char *szRemoteBrowseSync;
174         char *szSocketAddress;
175         bool bNmbdBindExplicitBroadcast;
176         char *szNISHomeMapName;
177         char *szAnnounceVersion;        /* This is initialised in init_globals */
178         char *szWorkgroup;
179         char *szNetbiosName;
180         char **szNetbiosAliases;
181         char *szNetbiosScope;
182         char *szNameResolveOrder;
183         char *szPanicAction;
184         char *szAddUserScript;
185         char *szRenameUserScript;
186         char *szDelUserScript;
187         char *szAddGroupScript;
188         char *szDelGroupScript;
189         char *szAddUserToGroupScript;
190         char *szDelUserFromGroupScript;
191         char *szSetPrimaryGroupScript;
192         char *szAddMachineScript;
193         char *szShutdownScript;
194         char *szAbortShutdownScript;
195         char *szUsernameMapScript;
196         int iUsernameMapCacheTime;
197         char *szCheckPasswordScript;
198         char *szWINSHook;
199         char *szUtmpDir;
200         char *szWtmpDir;
201         bool bUtmp;
202         char *szIdmapUID;
203         char *szIdmapGID;
204         bool bPassdbExpandExplicit;
205         int AlgorithmicRidBase;
206         char *szTemplateHomedir;
207         char *szTemplateShell;
208         char *szWinbindSeparator;
209         bool bWinbindEnumUsers;
210         bool bWinbindEnumGroups;
211         bool bWinbindUseDefaultDomain;
212         bool bWinbindTrustedDomainsOnly;
213         bool bWinbindNestedGroups;
214         int  winbind_expand_groups;
215         bool bWinbindRefreshTickets;
216         bool bWinbindOfflineLogon;
217         bool bWinbindNormalizeNames;
218         bool bWinbindRpcOnly;
219         bool bCreateKrb5Conf;
220         int winbindMaxDomainConnections;
221         char *szIdmapBackend;
222         bool bIdmapReadOnly;
223         char *szAddShareCommand;
224         char *szChangeShareCommand;
225         char *szDeleteShareCommand;
226         char **szEventLogs;
227         char *szGuestaccount;
228         char *szManglingMethod;
229         char **szServicesList;
230         char *szUsersharePath;
231         char *szUsershareTemplateShare;
232         char **szUsersharePrefixAllowList;
233         char **szUsersharePrefixDenyList;
234         int mangle_prefix;
235         int max_log_size;
236         char *szLogLevel;
237         int max_xmit;
238         int max_mux;
239         int max_open_files;
240         int open_files_db_hash_size;
241         int pwordlevel;
242         int unamelevel;
243         int deadtime;
244         bool getwd_cache;
245         int maxprotocol;
246         int minprotocol;
247         int security;
248         char **AuthMethods;
249         bool paranoid_server_security;
250         int maxdisksize;
251         int lpqcachetime;
252         int iMaxSmbdProcesses;
253         bool bDisableSpoolss;
254         int syslog;
255         int os_level;
256         bool enhanced_browsing;
257         int max_ttl;
258         int max_wins_ttl;
259         int min_wins_ttl;
260         int lm_announce;
261         int lm_interval;
262         int announce_as;        /* This is initialised in init_globals */
263         int machine_password_timeout;
264         int map_to_guest;
265         int oplock_break_wait_time;
266         int winbind_cache_time;
267         int winbind_reconnect_delay;
268         int winbind_max_clients;
269         char **szWinbindNssInfo;
270         int iLockSpinTime;
271         char *szLdapMachineSuffix;
272         char *szLdapUserSuffix;
273         char *szLdapIdmapSuffix;
274         char *szLdapGroupSuffix;
275         int ldap_ssl;
276         bool ldap_ssl_ads;
277         int ldap_deref;
278         int ldap_follow_referral;
279         char *szLdapSuffix;
280         char *szLdapAdminDn;
281         int ldap_debug_level;
282         int ldap_debug_threshold;
283         int iAclCompat;
284         char *szCupsServer;
285         int CupsEncrypt;
286         char *szIPrintServer;
287         char *ctdbdSocket;
288         char **szClusterAddresses;
289         bool clustering;
290         int ctdb_timeout;
291         int ctdb_locktime_warn_threshold;
292         int ldap_passwd_sync;
293         int ldap_replication_sleep;
294         int ldap_timeout; /* This is initialised in init_globals */
295         int ldap_connection_timeout;
296         int ldap_page_size;
297         bool ldap_delete_dn;
298         bool bMsAddPrinterWizard;
299         bool bDNSproxy;
300         bool bWINSsupport;
301         bool bWINSproxy;
302         bool bLocalMaster;
303         int  iPreferredMaster;
304         int iDomainMaster;
305         bool bDomainLogons;
306         char **szInitLogonDelayedHosts;
307         int InitLogonDelay;
308         bool bEncryptPasswords;
309         bool bUpdateEncrypt;
310         int  clientSchannel;
311         int  serverSchannel;
312         bool bNullPasswords;
313         bool bObeyPamRestrictions;
314         bool bLoadPrinters;
315         int PrintcapCacheTime;
316         bool bLargeReadwrite;
317         bool bReadRaw;
318         bool bWriteRaw;
319         bool bSyslogOnly;
320         bool bBrowseList;
321         bool bNISHomeMap;
322         bool bTimeServer;
323         bool bBindInterfacesOnly;
324         bool bPamPasswordChange;
325         bool bUnixPasswdSync;
326         bool bPasswdChatDebug;
327         int iPasswdChatTimeout;
328         bool bTimestampLogs;
329         bool bNTSmbSupport;
330         bool bNTPipeSupport;
331         bool bNTStatusSupport;
332         bool bStatCache;
333         int iMaxStatCacheSize;
334         bool bKernelOplocks;
335         bool bAllowTrustedDomains;
336         bool bLanmanAuth;
337         bool bNTLMAuth;
338         bool bUseSpnego;
339         bool bClientLanManAuth;
340         bool bClientNTLMv2Auth;
341         bool bClientPlaintextAuth;
342         bool bClientUseSpnego;
343         bool client_use_spnego_principal;
344         bool send_spnego_principal;
345         bool bDebugPrefixTimestamp;
346         bool bDebugHiresTimestamp;
347         bool bDebugPid;
348         bool bDebugUid;
349         bool bDebugClass;
350         bool bEnableCoreFiles;
351         bool bHostMSDfs;
352         bool bUseMmap;
353         bool bHostnameLookups;
354         bool bUnixExtensions;
355         bool bDisableNetbios;
356         char * szDedicatedKeytabFile;
357         int  iKerberosMethod;
358         bool bDeferSharingViolations;
359         bool bEnablePrivileges;
360         bool bASUSupport;
361         bool bUsershareOwnerOnly;
362         bool bUsershareAllowGuests;
363         bool bRegistryShares;
364         int restrict_anonymous;
365         int name_cache_timeout;
366         int client_signing;
367         int server_signing;
368         int client_ldap_sasl_wrapping;
369         int iUsershareMaxShares;
370         int iIdmapCacheTime;
371         int iIdmapNegativeCacheTime;
372         bool bResetOnZeroVC;
373         bool bLogWriteableFilesOnExit;
374         int iKeepalive;
375         int iminreceivefile;
376         struct param_opt_struct *param_opt;
377         int cups_connection_timeout;
378         char *szSMBPerfcountModule;
379         bool bMapUntrustedToDomain;
380         bool bAsyncSMBEchoHandler;
381         bool bMulticastDnsRegister;
382         int ismb2_max_read;
383         int ismb2_max_write;
384         int ismb2_max_trans;
385         int ismb2_max_credits;
386         char *ncalrpc_dir;
387 };
388
389 static struct global Globals;
390
391 /*
392  * This structure describes a single service.
393  */
394 struct service {
395         bool valid;
396         bool autoloaded;
397         int usershare;
398         struct timespec usershare_last_mod;
399         char *szService;
400         char *szPath;
401         char *szUsername;
402         char **szInvalidUsers;
403         char **szValidUsers;
404         char **szAdminUsers;
405         char *szCopy;
406         char *szInclude;
407         char *szPreExec;
408         char *szPostExec;
409         char *szRootPreExec;
410         char *szRootPostExec;
411         char *szCupsOptions;
412         char *szPrintcommand;
413         char *szLpqcommand;
414         char *szLprmcommand;
415         char *szLppausecommand;
416         char *szLpresumecommand;
417         char *szQueuepausecommand;
418         char *szQueueresumecommand;
419         char *szPrintername;
420         char *szPrintjobUsername;
421         char *szDontdescend;
422         char **szHostsallow;
423         char **szHostsdeny;
424         char *szMagicScript;
425         char *szMagicOutput;
426         char *szVetoFiles;
427         char *szHideFiles;
428         char *szVetoOplockFiles;
429         char *comment;
430         char *force_user;
431         char *force_group;
432         char **readlist;
433         char **writelist;
434         char **printer_admin;
435         char *volume;
436         char *fstype;
437         char **szVfsObjects;
438         char *szMSDfsProxy;
439         char *szAioWriteBehind;
440         char *szDfree;
441         int iMinPrintSpace;
442         int iMaxPrintJobs;
443         int iMaxReportedPrintJobs;
444         int iWriteCacheSize;
445         int iCreate_mask;
446         int iCreate_force_mode;
447         int iSecurity_mask;
448         int iSecurity_force_mode;
449         int iDir_mask;
450         int iDir_force_mode;
451         int iDir_Security_mask;
452         int iDir_Security_force_mode;
453         int iMaxConnections;
454         int iDefaultCase;
455         int iPrinting;
456         int iOplockContentionLimit;
457         int iCSCPolicy;
458         int iBlock_size;
459         int iDfreeCacheTime;
460         bool bPreexecClose;
461         bool bRootpreexecClose;
462         int  iCaseSensitive;
463         bool bCasePreserve;
464         bool bShortCasePreserve;
465         bool bHideDotFiles;
466         bool bHideSpecialFiles;
467         bool bHideUnReadable;
468         bool bHideUnWriteableFiles;
469         bool bBrowseable;
470         bool bAccessBasedShareEnum;
471         bool bAvailable;
472         bool bRead_only;
473         bool bNo_set_dir;
474         bool bGuest_only;
475         bool bAdministrative_share;
476         bool bGuest_ok;
477         bool bPrint_ok;
478         bool bPrintNotifyBackchannel;
479         bool bMap_system;
480         bool bMap_hidden;
481         bool bMap_archive;
482         bool bStoreDosAttributes;
483         bool bDmapiSupport;
484         bool bLocking;
485         int iStrictLocking;
486         bool bPosixLocking;
487         bool bShareModes;
488         bool bOpLocks;
489         bool bLevel2OpLocks;
490         bool bOnlyUser;
491         bool bMangledNames;
492         bool bWidelinks;
493         bool bSymlinks;
494         bool bSyncAlways;
495         bool bStrictAllocate;
496         bool bStrictSync;
497         char magic_char;
498         struct bitmap *copymap;
499         bool bDeleteReadonly;
500         bool bFakeOplocks;
501         bool bDeleteVetoFiles;
502         bool bDosFilemode;
503         bool bDosFiletimes;
504         bool bDosFiletimeResolution;
505         bool bFakeDirCreateTimes;
506         bool bBlockingLocks;
507         bool bInheritPerms;
508         bool bInheritACLS;
509         bool bInheritOwner;
510         bool bMSDfsRoot;
511         bool bUseClientDriver;
512         bool bDefaultDevmode;
513         bool bForcePrintername;
514         bool bNTAclSupport;
515         bool bForceUnknownAclUser;
516         bool bUseSendfile;
517         bool bProfileAcls;
518         bool bMap_acl_inherit;
519         bool bAfs_Share;
520         bool bEASupport;
521         bool bAclCheckPermissions;
522         bool bAclMapFullControl;
523         bool bAclGroupControl;
524         bool bChangeNotify;
525         bool bKernelChangeNotify;
526         int iallocation_roundup_size;
527         int iAioReadSize;
528         int iAioWriteSize;
529         int iMap_readonly;
530         int iDirectoryNameCacheSize;
531         int ismb_encrypt;
532         struct param_opt_struct *param_opt;
533
534         char dummy[3];          /* for alignment */
535 };
536
537
538 /* This is a default service used to prime a services structure */
539 static struct service sDefault = {
540         True,                   /* valid */
541         False,                  /* not autoloaded */
542         0,                      /* not a usershare */
543         {0, },                  /* No last mod time */
544         NULL,                   /* szService */
545         NULL,                   /* szPath */
546         NULL,                   /* szUsername */
547         NULL,                   /* szInvalidUsers */
548         NULL,                   /* szValidUsers */
549         NULL,                   /* szAdminUsers */
550         NULL,                   /* szCopy */
551         NULL,                   /* szInclude */
552         NULL,                   /* szPreExec */
553         NULL,                   /* szPostExec */
554         NULL,                   /* szRootPreExec */
555         NULL,                   /* szRootPostExec */
556         NULL,                   /* szCupsOptions */
557         NULL,                   /* szPrintcommand */
558         NULL,                   /* szLpqcommand */
559         NULL,                   /* szLprmcommand */
560         NULL,                   /* szLppausecommand */
561         NULL,                   /* szLpresumecommand */
562         NULL,                   /* szQueuepausecommand */
563         NULL,                   /* szQueueresumecommand */
564         NULL,                   /* szPrintername */
565         NULL,                   /* szPrintjobUsername */
566         NULL,                   /* szDontdescend */
567         NULL,                   /* szHostsallow */
568         NULL,                   /* szHostsdeny */
569         NULL,                   /* szMagicScript */
570         NULL,                   /* szMagicOutput */
571         NULL,                   /* szVetoFiles */
572         NULL,                   /* szHideFiles */
573         NULL,                   /* szVetoOplockFiles */
574         NULL,                   /* comment */
575         NULL,                   /* force user */
576         NULL,                   /* force group */
577         NULL,                   /* readlist */
578         NULL,                   /* writelist */
579         NULL,                   /* printer admin */
580         NULL,                   /* volume */
581         NULL,                   /* fstype */
582         NULL,                   /* vfs objects */
583         NULL,                   /* szMSDfsProxy */
584         NULL,                   /* szAioWriteBehind */
585         NULL,                   /* szDfree */
586         0,                      /* iMinPrintSpace */
587         1000,                   /* iMaxPrintJobs */
588         0,                      /* iMaxReportedPrintJobs */
589         0,                      /* iWriteCacheSize */
590         0744,                   /* iCreate_mask */
591         0000,                   /* iCreate_force_mode */
592         0777,                   /* iSecurity_mask */
593         0,                      /* iSecurity_force_mode */
594         0755,                   /* iDir_mask */
595         0000,                   /* iDir_force_mode */
596         0777,                   /* iDir_Security_mask */
597         0,                      /* iDir_Security_force_mode */
598         0,                      /* iMaxConnections */
599         CASE_LOWER,             /* iDefaultCase */
600         DEFAULT_PRINTING,       /* iPrinting */
601         2,                      /* iOplockContentionLimit */
602         0,                      /* iCSCPolicy */
603         1024,                   /* iBlock_size */
604         0,                      /* iDfreeCacheTime */
605         False,                  /* bPreexecClose */
606         False,                  /* bRootpreexecClose */
607         Auto,                   /* case sensitive */
608         True,                   /* case preserve */
609         True,                   /* short case preserve */
610         True,                   /* bHideDotFiles */
611         False,                  /* bHideSpecialFiles */
612         False,                  /* bHideUnReadable */
613         False,                  /* bHideUnWriteableFiles */
614         True,                   /* bBrowseable */
615         False,                  /* bAccessBasedShareEnum */
616         True,                   /* bAvailable */
617         True,                   /* bRead_only */
618         True,                   /* bNo_set_dir */
619         False,                  /* bGuest_only */
620         False,                  /* bAdministrative_share */
621         False,                  /* bGuest_ok */
622         False,                  /* bPrint_ok */
623         True,                   /* bPrintNotifyBackchannel */
624         False,                  /* bMap_system */
625         False,                  /* bMap_hidden */
626         True,                   /* bMap_archive */
627         False,                  /* bStoreDosAttributes */
628         False,                  /* bDmapiSupport */
629         True,                   /* bLocking */
630         Auto,                   /* iStrictLocking */
631         True,                   /* bPosixLocking */
632         True,                   /* bShareModes */
633         True,                   /* bOpLocks */
634         True,                   /* bLevel2OpLocks */
635         False,                  /* bOnlyUser */
636         True,                   /* bMangledNames */
637         false,                  /* bWidelinks */
638         True,                   /* bSymlinks */
639         False,                  /* bSyncAlways */
640         False,                  /* bStrictAllocate */
641         False,                  /* bStrictSync */
642         '~',                    /* magic char */
643         NULL,                   /* copymap */
644         False,                  /* bDeleteReadonly */
645         False,                  /* bFakeOplocks */
646         False,                  /* bDeleteVetoFiles */
647         False,                  /* bDosFilemode */
648         True,                   /* bDosFiletimes */
649         False,                  /* bDosFiletimeResolution */
650         False,                  /* bFakeDirCreateTimes */
651         True,                   /* bBlockingLocks */
652         False,                  /* bInheritPerms */
653         False,                  /* bInheritACLS */
654         False,                  /* bInheritOwner */
655         False,                  /* bMSDfsRoot */
656         False,                  /* bUseClientDriver */
657         True,                   /* bDefaultDevmode */
658         False,                  /* bForcePrintername */
659         True,                   /* bNTAclSupport */
660         False,                  /* bForceUnknownAclUser */
661         False,                  /* bUseSendfile */
662         False,                  /* bProfileAcls */
663         False,                  /* bMap_acl_inherit */
664         False,                  /* bAfs_Share */
665         False,                  /* bEASupport */
666         True,                   /* bAclCheckPermissions */
667         True,                   /* bAclMapFullControl */
668         False,                  /* bAclGroupControl */
669         True,                   /* bChangeNotify */
670         True,                   /* bKernelChangeNotify */
671         SMB_ROUNDUP_ALLOCATION_SIZE,            /* iallocation_roundup_size */
672         0,                      /* iAioReadSize */
673         0,                      /* iAioWriteSize */
674         MAP_READONLY_YES,       /* iMap_readonly */
675 #ifdef BROKEN_DIRECTORY_HANDLING
676         0,                      /* iDirectoryNameCacheSize */
677 #else
678         100,                    /* iDirectoryNameCacheSize */
679 #endif
680         Auto,                   /* ismb_encrypt */
681         NULL,                   /* Parametric options */
682
683         ""                      /* dummy */
684 };
685
686 /* local variables */
687 static struct service **ServicePtrs = NULL;
688 static int iNumServices = 0;
689 static int iServiceIndex = 0;
690 static struct db_context *ServiceHash;
691 static int *invalid_services = NULL;
692 static int num_invalid_services = 0;
693 static bool bInGlobalSection = True;
694 static bool bGlobalOnly = False;
695 static int default_server_announce;
696
697 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
698
699 /* prototypes for the special type handlers */
700 static bool handle_include( int snum, const char *pszParmValue, char **ptr);
701 static bool handle_copy( int snum, const char *pszParmValue, char **ptr);
702 static bool handle_netbios_name( int snum, const char *pszParmValue, char **ptr);
703 static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr);
704 static bool handle_idmap_uid( int snum, const char *pszParmValue, char **ptr);
705 static bool handle_idmap_gid( int snum, const char *pszParmValue, char **ptr);
706 static bool handle_debug_list( int snum, const char *pszParmValue, char **ptr );
707 static bool handle_workgroup( int snum, const char *pszParmValue, char **ptr );
708 static bool handle_netbios_aliases( int snum, const char *pszParmValue, char **ptr );
709 static bool handle_netbios_scope( int snum, const char *pszParmValue, char **ptr );
710 static bool handle_charset( int snum, const char *pszParmValue, char **ptr );
711 static bool handle_dos_charset( int snum, const char *pszParmValue, char **ptr );
712 static bool handle_printing( int snum, const char *pszParmValue, char **ptr);
713 static bool handle_ldap_debug_level( int snum, const char *pszParmValue, char **ptr);
714
715 static void set_default_server_announce_type(void);
716 static void set_allowed_client_auth(void);
717
718 static void *lp_local_ptr(struct service *service, void *ptr);
719
720 static void add_to_file_list(const char *fname, const char *subfname);
721 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
722
723 static const struct enum_list enum_protocol[] = {
724         {PROTOCOL_SMB2, "SMB2"},
725         {PROTOCOL_NT1, "NT1"},
726         {PROTOCOL_LANMAN2, "LANMAN2"},
727         {PROTOCOL_LANMAN1, "LANMAN1"},
728         {PROTOCOL_CORE, "CORE"},
729         {PROTOCOL_COREPLUS, "COREPLUS"},
730         {PROTOCOL_COREPLUS, "CORE+"},
731         {-1, NULL}
732 };
733
734 static const struct enum_list enum_security[] = {
735         {SEC_SHARE, "SHARE"},
736         {SEC_USER, "USER"},
737         {SEC_SERVER, "SERVER"},
738         {SEC_DOMAIN, "DOMAIN"},
739 #ifdef HAVE_ADS
740         {SEC_ADS, "ADS"},
741 #endif
742         {-1, NULL}
743 };
744
745 static const struct enum_list enum_printing[] = {
746         {PRINT_SYSV, "sysv"},
747         {PRINT_AIX, "aix"},
748         {PRINT_HPUX, "hpux"},
749         {PRINT_BSD, "bsd"},
750         {PRINT_QNX, "qnx"},
751         {PRINT_PLP, "plp"},
752         {PRINT_LPRNG, "lprng"},
753         {PRINT_CUPS, "cups"},
754         {PRINT_IPRINT, "iprint"},
755         {PRINT_LPRNT, "nt"},
756         {PRINT_LPROS2, "os2"},
757 #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS)
758         {PRINT_TEST, "test"},
759         {PRINT_VLP, "vlp"},
760 #endif /* DEVELOPER */
761         {-1, NULL}
762 };
763
764 static const struct enum_list enum_ldap_sasl_wrapping[] = {
765         {0, "plain"},
766         {ADS_AUTH_SASL_SIGN, "sign"},
767         {ADS_AUTH_SASL_SEAL, "seal"},
768         {-1, NULL}
769 };
770
771 static const struct enum_list enum_ldap_ssl[] = {
772         {LDAP_SSL_OFF, "no"},
773         {LDAP_SSL_OFF, "off"},
774         {LDAP_SSL_START_TLS, "start tls"},
775         {LDAP_SSL_START_TLS, "start_tls"},
776         {-1, NULL}
777 };
778
779 /* LDAP Dereferencing Alias types */
780 #define SAMBA_LDAP_DEREF_NEVER          0
781 #define SAMBA_LDAP_DEREF_SEARCHING      1
782 #define SAMBA_LDAP_DEREF_FINDING        2
783 #define SAMBA_LDAP_DEREF_ALWAYS         3
784
785 static const struct enum_list enum_ldap_deref[] = {
786         {SAMBA_LDAP_DEREF_NEVER, "never"},
787         {SAMBA_LDAP_DEREF_SEARCHING, "searching"},
788         {SAMBA_LDAP_DEREF_FINDING, "finding"},
789         {SAMBA_LDAP_DEREF_ALWAYS, "always"},
790         {-1, "auto"}
791 };
792
793 static const struct enum_list enum_ldap_passwd_sync[] = {
794         {LDAP_PASSWD_SYNC_OFF, "no"},
795         {LDAP_PASSWD_SYNC_OFF, "off"},
796         {LDAP_PASSWD_SYNC_ON, "yes"},
797         {LDAP_PASSWD_SYNC_ON, "on"},
798         {LDAP_PASSWD_SYNC_ONLY, "only"},
799         {-1, NULL}
800 };
801
802 /* Types of machine we can announce as. */
803 #define ANNOUNCE_AS_NT_SERVER 1
804 #define ANNOUNCE_AS_WIN95 2
805 #define ANNOUNCE_AS_WFW 3
806 #define ANNOUNCE_AS_NT_WORKSTATION 4
807
808 static const struct enum_list enum_announce_as[] = {
809         {ANNOUNCE_AS_NT_SERVER, "NT"},
810         {ANNOUNCE_AS_NT_SERVER, "NT Server"},
811         {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"},
812         {ANNOUNCE_AS_WIN95, "win95"},
813         {ANNOUNCE_AS_WFW, "WfW"},
814         {-1, NULL}
815 };
816
817 static const struct enum_list enum_map_readonly[] = {
818         {MAP_READONLY_NO, "no"},
819         {MAP_READONLY_NO, "false"},
820         {MAP_READONLY_NO, "0"},
821         {MAP_READONLY_YES, "yes"},
822         {MAP_READONLY_YES, "true"},
823         {MAP_READONLY_YES, "1"},
824         {MAP_READONLY_PERMISSIONS, "permissions"},
825         {MAP_READONLY_PERMISSIONS, "perms"},
826         {-1, NULL}
827 };
828
829 static const struct enum_list enum_case[] = {
830         {CASE_LOWER, "lower"},
831         {CASE_UPPER, "upper"},
832         {-1, NULL}
833 };
834
835
836
837 static const struct enum_list enum_bool_auto[] = {
838         {False, "No"},
839         {False, "False"},
840         {False, "0"},
841         {True, "Yes"},
842         {True, "True"},
843         {True, "1"},
844         {Auto, "Auto"},
845         {-1, NULL}
846 };
847
848 static const struct enum_list enum_csc_policy[] = {
849         {CSC_POLICY_MANUAL, "manual"},
850         {CSC_POLICY_DOCUMENTS, "documents"},
851         {CSC_POLICY_PROGRAMS, "programs"},
852         {CSC_POLICY_DISABLE, "disable"},
853         {-1, NULL}
854 };
855
856 /* SMB signing types. */
857 static const struct enum_list enum_smb_signing_vals[] = {
858         {False, "No"},
859         {False, "False"},
860         {False, "0"},
861         {False, "Off"},
862         {False, "disabled"},
863         {True, "Yes"},
864         {True, "True"},
865         {True, "1"},
866         {True, "On"},
867         {True, "enabled"},
868         {Auto, "auto"},
869         {Required, "required"},
870         {Required, "mandatory"},
871         {Required, "force"},
872         {Required, "forced"},
873         {Required, "enforced"},
874         {-1, NULL}
875 };
876
877 /* ACL compatibility options. */
878 static const struct enum_list enum_acl_compat_vals[] = {
879     { ACL_COMPAT_AUTO, "auto" },
880     { ACL_COMPAT_WINNT, "winnt" },
881     { ACL_COMPAT_WIN2K, "win2k" },
882     { -1, NULL}
883 };
884
885 /* 
886    Do you want session setups at user level security with a invalid
887    password to be rejected or allowed in as guest? WinNT rejects them
888    but it can be a pain as it means "net view" needs to use a password
889
890    You have 3 choices in the setting of map_to_guest:
891
892    "Never" means session setups with an invalid password
893    are rejected. This is the default.
894
895    "Bad User" means session setups with an invalid password
896    are rejected, unless the username does not exist, in which case it
897    is treated as a guest login
898
899    "Bad Password" means session setups with an invalid password
900    are treated as a guest login
901
902    Note that map_to_guest only has an effect in user or server
903    level security.
904 */
905
906 static const struct enum_list enum_map_to_guest[] = {
907         {NEVER_MAP_TO_GUEST, "Never"},
908         {MAP_TO_GUEST_ON_BAD_USER, "Bad User"},
909         {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"},
910         {MAP_TO_GUEST_ON_BAD_UID, "Bad Uid"},
911         {-1, NULL}
912 };
913
914 /* Config backend options */
915
916 static const struct enum_list enum_config_backend[] = {
917         {CONFIG_BACKEND_FILE, "file"},
918         {CONFIG_BACKEND_REGISTRY, "registry"},
919         {-1, NULL}
920 };
921
922 /* ADS kerberos ticket verification options */
923
924 static const struct enum_list enum_kerberos_method[] = {
925         {KERBEROS_VERIFY_SECRETS, "default"},
926         {KERBEROS_VERIFY_SECRETS, "secrets only"},
927         {KERBEROS_VERIFY_SYSTEM_KEYTAB, "system keytab"},
928         {KERBEROS_VERIFY_DEDICATED_KEYTAB, "dedicated keytab"},
929         {KERBEROS_VERIFY_SECRETS_AND_KEYTAB, "secrets and keytab"},
930         {-1, NULL}
931 };
932
933 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
934  *
935  * The FLAG_HIDE is explicit. Parameters set this way do NOT appear in any edit
936  * screen in SWAT. This is used to exclude parameters as well as to squash all
937  * parameters that have been duplicated by pseudonyms.
938  *
939  * NOTE: To display a parameter in BASIC view set FLAG_BASIC
940  *       Any parameter that does NOT have FLAG_ADVANCED will not disply at all
941  *       Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in
942  *        respective views.
943  *
944  * NOTE2: Handling of duplicated (synonym) parameters:
945  *      Only the first occurance of a parameter should be enabled by FLAG_BASIC
946  *      and/or FLAG_ADVANCED. All duplicates following the first mention should be
947  *      set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred
948  *      name first, and all synonyms must follow it with the FLAG_HIDE attribute.
949  */
950
951 static struct parm_struct parm_table[] = {
952         {N_("Base Options"), P_SEP, P_SEPARATOR},
953
954         {
955                 .label          = "dos charset",
956                 .type           = P_STRING,
957                 .p_class        = P_GLOBAL,
958                 .ptr            = &Globals.dos_charset,
959                 .special        = handle_dos_charset,
960                 .enum_list      = NULL,
961                 .flags          = FLAG_ADVANCED
962         },
963         {
964                 .label          = "unix charset",
965                 .type           = P_STRING,
966                 .p_class        = P_GLOBAL,
967                 .ptr            = &Globals.unix_charset,
968                 .special        = handle_charset,
969                 .enum_list      = NULL,
970                 .flags          = FLAG_ADVANCED
971         },
972         {
973                 .label          = "display charset",
974                 .type           = P_STRING,
975                 .p_class        = P_GLOBAL,
976                 .ptr            = &Globals.display_charset,
977                 .special        = handle_charset,
978                 .enum_list      = NULL,
979                 .flags          = FLAG_ADVANCED
980         },
981         {
982                 .label          = "comment",
983                 .type           = P_STRING,
984                 .p_class        = P_LOCAL,
985                 .ptr            = &sDefault.comment,
986                 .special        = NULL,
987                 .enum_list      = NULL,
988                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT
989         },
990         {
991                 .label          = "path",
992                 .type           = P_STRING,
993                 .p_class        = P_LOCAL,
994                 .ptr            = &sDefault.szPath,
995                 .special        = NULL,
996                 .enum_list      = NULL,
997                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
998         },
999         {
1000                 .label          = "directory",
1001                 .type           = P_STRING,
1002                 .p_class        = P_LOCAL,
1003                 .ptr            = &sDefault.szPath,
1004                 .special        = NULL,
1005                 .enum_list      = NULL,
1006                 .flags          = FLAG_HIDE,
1007         },
1008         {
1009                 .label          = "workgroup",
1010                 .type           = P_USTRING,
1011                 .p_class        = P_GLOBAL,
1012                 .ptr            = &Globals.szWorkgroup,
1013                 .special        = handle_workgroup,
1014                 .enum_list      = NULL,
1015                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1016         },
1017 #ifdef WITH_ADS
1018         {
1019                 .label          = "realm",
1020                 .type           = P_USTRING,
1021                 .p_class        = P_GLOBAL,
1022                 .ptr            = &Globals.szRealm,
1023                 .special        = NULL,
1024                 .enum_list      = NULL,
1025                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1026         },
1027 #endif
1028         {
1029                 .label          = "netbios name",
1030                 .type           = P_USTRING,
1031                 .p_class        = P_GLOBAL,
1032                 .ptr            = &Globals.szNetbiosName,
1033                 .special        = handle_netbios_name,
1034                 .enum_list      = NULL,
1035                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1036         },
1037         {
1038                 .label          = "netbios aliases",
1039                 .type           = P_LIST,
1040                 .p_class        = P_GLOBAL,
1041                 .ptr            = &Globals.szNetbiosAliases,
1042                 .special        = handle_netbios_aliases,
1043                 .enum_list      = NULL,
1044                 .flags          = FLAG_ADVANCED,
1045         },
1046         {
1047                 .label          = "netbios scope",
1048                 .type           = P_USTRING,
1049                 .p_class        = P_GLOBAL,
1050                 .ptr            = &Globals.szNetbiosScope,
1051                 .special        = handle_netbios_scope,
1052                 .enum_list      = NULL,
1053                 .flags          = FLAG_ADVANCED,
1054         },
1055         {
1056                 .label          = "server string",
1057                 .type           = P_STRING,
1058                 .p_class        = P_GLOBAL,
1059                 .ptr            = &Globals.szServerString,
1060                 .special        = NULL,
1061                 .enum_list      = NULL,
1062                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1063         },
1064         {
1065                 .label          = "interfaces",
1066                 .type           = P_LIST,
1067                 .p_class        = P_GLOBAL,
1068                 .ptr            = &Globals.szInterfaces,
1069                 .special        = NULL,
1070                 .enum_list      = NULL,
1071                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1072         },
1073         {
1074                 .label          = "bind interfaces only",
1075                 .type           = P_BOOL,
1076                 .p_class        = P_GLOBAL,
1077                 .ptr            = &Globals.bBindInterfacesOnly,
1078                 .special        = NULL,
1079                 .enum_list      = NULL,
1080                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1081         },
1082         {
1083                 .label          = "config backend",
1084                 .type           = P_ENUM,
1085                 .p_class        = P_GLOBAL,
1086                 .ptr            = &Globals.ConfigBackend,
1087                 .special        = NULL,
1088                 .enum_list      = enum_config_backend,
1089                 .flags          = FLAG_HIDE|FLAG_ADVANCED|FLAG_META,
1090         },
1091
1092         {N_("Security Options"), P_SEP, P_SEPARATOR},
1093
1094         {
1095                 .label          = "security",
1096                 .type           = P_ENUM,
1097                 .p_class        = P_GLOBAL,
1098                 .ptr            = &Globals.security,
1099                 .special        = NULL,
1100                 .enum_list      = enum_security,
1101                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1102         },
1103         {
1104                 .label          = "auth methods",
1105                 .type           = P_LIST,
1106                 .p_class        = P_GLOBAL,
1107                 .ptr            = &Globals.AuthMethods,
1108                 .special        = NULL,
1109                 .enum_list      = NULL,
1110                 .flags          = FLAG_ADVANCED,
1111         },
1112         {
1113                 .label          = "encrypt passwords",
1114                 .type           = P_BOOL,
1115                 .p_class        = P_GLOBAL,
1116                 .ptr            = &Globals.bEncryptPasswords,
1117                 .special        = NULL,
1118                 .enum_list      = NULL,
1119                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1120         },
1121         {
1122                 .label          = "client schannel",
1123                 .type           = P_ENUM,
1124                 .p_class        = P_GLOBAL,
1125                 .ptr            = &Globals.clientSchannel,
1126                 .special        = NULL,
1127                 .enum_list      = enum_bool_auto,
1128                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1129         },
1130         {
1131                 .label          = "server schannel",
1132                 .type           = P_ENUM,
1133                 .p_class        = P_GLOBAL,
1134                 .ptr            = &Globals.serverSchannel,
1135                 .special        = NULL,
1136                 .enum_list      = enum_bool_auto,
1137                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1138         },
1139         {
1140                 .label          = "allow trusted domains",
1141                 .type           = P_BOOL,
1142                 .p_class        = P_GLOBAL,
1143                 .ptr            = &Globals.bAllowTrustedDomains,
1144                 .special        = NULL,
1145                 .enum_list      = NULL,
1146                 .flags          = FLAG_ADVANCED,
1147         },
1148         {
1149                 .label          = "map to guest",
1150                 .type           = P_ENUM,
1151                 .p_class        = P_GLOBAL,
1152                 .ptr            = &Globals.map_to_guest,
1153                 .special        = NULL,
1154                 .enum_list      = enum_map_to_guest,
1155                 .flags          = FLAG_ADVANCED,
1156         },
1157         {
1158                 .label          = "null passwords",
1159                 .type           = P_BOOL,
1160                 .p_class        = P_GLOBAL,
1161                 .ptr            = &Globals.bNullPasswords,
1162                 .special        = NULL,
1163                 .enum_list      = NULL,
1164                 .flags          = FLAG_ADVANCED | FLAG_DEPRECATED,
1165         },
1166         {
1167                 .label          = "obey pam restrictions",
1168                 .type           = P_BOOL,
1169                 .p_class        = P_GLOBAL,
1170                 .ptr            = &Globals.bObeyPamRestrictions,
1171                 .special        = NULL,
1172                 .enum_list      = NULL,
1173                 .flags          = FLAG_ADVANCED,
1174         },
1175         {
1176                 .label          = "password server",
1177                 .type           = P_STRING,
1178                 .p_class        = P_GLOBAL,
1179                 .ptr            = &Globals.szPasswordServer,
1180                 .special        = NULL,
1181                 .enum_list      = NULL,
1182                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1183         },
1184         {
1185                 .label          = "smb passwd file",
1186                 .type           = P_STRING,
1187                 .p_class        = P_GLOBAL,
1188                 .ptr            = &Globals.szSMBPasswdFile,
1189                 .special        = NULL,
1190                 .enum_list      = NULL,
1191                 .flags          = FLAG_ADVANCED,
1192         },
1193         {
1194                 .label          = "private dir",
1195                 .type           = P_STRING,
1196                 .p_class        = P_GLOBAL,
1197                 .ptr            = &Globals.szPrivateDir,
1198                 .special        = NULL,
1199                 .enum_list      = NULL,
1200                 .flags          = FLAG_ADVANCED,
1201         },
1202         {
1203                 .label          = "passdb backend",
1204                 .type           = P_STRING,
1205                 .p_class        = P_GLOBAL,
1206                 .ptr            = &Globals.szPassdbBackend,
1207                 .special        = NULL,
1208                 .enum_list      = NULL,
1209                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1210         },
1211         {
1212                 .label          = "algorithmic rid base",
1213                 .type           = P_INTEGER,
1214                 .p_class        = P_GLOBAL,
1215                 .ptr            = &Globals.AlgorithmicRidBase,
1216                 .special        = NULL,
1217                 .enum_list      = NULL,
1218                 .flags          = FLAG_ADVANCED,
1219         },
1220         {
1221                 .label          = "root directory",
1222                 .type           = P_STRING,
1223                 .p_class        = P_GLOBAL,
1224                 .ptr            = &Globals.szRootdir,
1225                 .special        = NULL,
1226                 .enum_list      = NULL,
1227                 .flags          = FLAG_ADVANCED,
1228         },
1229         {
1230                 .label          = "root dir",
1231                 .type           = P_STRING,
1232                 .p_class        = P_GLOBAL,
1233                 .ptr            = &Globals.szRootdir,
1234                 .special        = NULL,
1235                 .enum_list      = NULL,
1236                 .flags          = FLAG_HIDE,
1237         },
1238         {
1239                 .label          = "root",
1240                 .type           = P_STRING,
1241                 .p_class        = P_GLOBAL,
1242                 .ptr            = &Globals.szRootdir,
1243                 .special        = NULL,
1244                 .enum_list      = NULL,
1245                 .flags          = FLAG_HIDE,
1246         },
1247         {
1248                 .label          = "guest account",
1249                 .type           = P_STRING,
1250                 .p_class        = P_GLOBAL,
1251                 .ptr            = &Globals.szGuestaccount,
1252                 .special        = NULL,
1253                 .enum_list      = NULL,
1254                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1255         },
1256         {
1257                 .label          = "enable privileges",
1258                 .type           = P_BOOL,
1259                 .p_class        = P_GLOBAL,
1260                 .ptr            = &Globals.bEnablePrivileges,
1261                 .special        = NULL,
1262                 .enum_list      = NULL,
1263                 .flags          = FLAG_ADVANCED | FLAG_DEPRECATED,
1264         },
1265
1266         {
1267                 .label          = "pam password change",
1268                 .type           = P_BOOL,
1269                 .p_class        = P_GLOBAL,
1270                 .ptr            = &Globals.bPamPasswordChange,
1271                 .special        = NULL,
1272                 .enum_list      = NULL,
1273                 .flags          = FLAG_ADVANCED,
1274         },
1275         {
1276                 .label          = "passwd program",
1277                 .type           = P_STRING,
1278                 .p_class        = P_GLOBAL,
1279                 .ptr            = &Globals.szPasswdProgram,
1280                 .special        = NULL,
1281                 .enum_list      = NULL,
1282                 .flags          = FLAG_ADVANCED,
1283         },
1284         {
1285                 .label          = "passwd chat",
1286                 .type           = P_STRING,
1287                 .p_class        = P_GLOBAL,
1288                 .ptr            = &Globals.szPasswdChat,
1289                 .special        = NULL,
1290                 .enum_list      = NULL,
1291                 .flags          = FLAG_ADVANCED,
1292         },
1293         {
1294                 .label          = "passwd chat debug",
1295                 .type           = P_BOOL,
1296                 .p_class        = P_GLOBAL,
1297                 .ptr            = &Globals.bPasswdChatDebug,
1298                 .special        = NULL,
1299                 .enum_list      = NULL,
1300                 .flags          = FLAG_ADVANCED,
1301         },
1302         {
1303                 .label          = "passwd chat timeout",
1304                 .type           = P_INTEGER,
1305                 .p_class        = P_GLOBAL,
1306                 .ptr            = &Globals.iPasswdChatTimeout,
1307                 .special        = NULL,
1308                 .enum_list      = NULL,
1309                 .flags          = FLAG_ADVANCED,
1310         },
1311         {
1312                 .label          = "check password script",
1313                 .type           = P_STRING,
1314                 .p_class        = P_GLOBAL,
1315                 .ptr            = &Globals.szCheckPasswordScript,
1316                 .special        = NULL,
1317                 .enum_list      = NULL,
1318                 .flags          = FLAG_ADVANCED,
1319         },
1320         {
1321                 .label          = "username map",
1322                 .type           = P_STRING,
1323                 .p_class        = P_GLOBAL,
1324                 .ptr            = &Globals.szUsernameMap,
1325                 .special        = NULL,
1326                 .enum_list      = NULL,
1327                 .flags          = FLAG_ADVANCED,
1328         },
1329         {
1330                 .label          = "password level",
1331                 .type           = P_INTEGER,
1332                 .p_class        = P_GLOBAL,
1333                 .ptr            = &Globals.pwordlevel,
1334                 .special        = NULL,
1335                 .enum_list      = NULL,
1336                 .flags          = FLAG_ADVANCED | FLAG_DEPRECATED,
1337         },
1338         {
1339                 .label          = "username level",
1340                 .type           = P_INTEGER,
1341                 .p_class        = P_GLOBAL,
1342                 .ptr            = &Globals.unamelevel,
1343                 .special        = NULL,
1344                 .enum_list      = NULL,
1345                 .flags          = FLAG_ADVANCED,
1346         },
1347         {
1348                 .label          = "unix password sync",
1349                 .type           = P_BOOL,
1350                 .p_class        = P_GLOBAL,
1351                 .ptr            = &Globals.bUnixPasswdSync,
1352                 .special        = NULL,
1353                 .enum_list      = NULL,
1354                 .flags          = FLAG_ADVANCED,
1355         },
1356         {
1357                 .label          = "restrict anonymous",
1358                 .type           = P_INTEGER,
1359                 .p_class        = P_GLOBAL,
1360                 .ptr            = &Globals.restrict_anonymous,
1361                 .special        = NULL,
1362                 .enum_list      = NULL,
1363                 .flags          = FLAG_ADVANCED,
1364         },
1365         {
1366                 .label          = "lanman auth",
1367                 .type           = P_BOOL,
1368                 .p_class        = P_GLOBAL,
1369                 .ptr            = &Globals.bLanmanAuth,
1370                 .special        = NULL,
1371                 .enum_list      = NULL,
1372                 .flags          = FLAG_ADVANCED,
1373         },
1374         {
1375                 .label          = "ntlm auth",
1376                 .type           = P_BOOL,
1377                 .p_class        = P_GLOBAL,
1378                 .ptr            = &Globals.bNTLMAuth,
1379                 .special        = NULL,
1380                 .enum_list      = NULL,
1381                 .flags          = FLAG_ADVANCED,
1382         },
1383         {
1384                 .label          = "client NTLMv2 auth",
1385                 .type           = P_BOOL,
1386                 .p_class        = P_GLOBAL,
1387                 .ptr            = &Globals.bClientNTLMv2Auth,
1388                 .special        = NULL,
1389                 .enum_list      = NULL,
1390                 .flags          = FLAG_ADVANCED,
1391         },
1392         {
1393                 .label          = "client lanman auth",
1394                 .type           = P_BOOL,
1395                 .p_class        = P_GLOBAL,
1396                 .ptr            = &Globals.bClientLanManAuth,
1397                 .special        = NULL,
1398                 .enum_list      = NULL,
1399                 .flags          = FLAG_ADVANCED,
1400         },
1401         {
1402                 .label          = "client plaintext auth",
1403                 .type           = P_BOOL,
1404                 .p_class        = P_GLOBAL,
1405                 .ptr            = &Globals.bClientPlaintextAuth,
1406                 .special        = NULL,
1407                 .enum_list      = NULL,
1408                 .flags          = FLAG_ADVANCED,
1409         },
1410         {
1411                 .label          = "client use spnego principal",
1412                 .type           = P_BOOL,
1413                 .p_class        = P_GLOBAL,
1414                 .ptr            = &Globals.client_use_spnego_principal,
1415                 .special        = NULL,
1416                 .enum_list      = NULL,
1417                 .flags          = FLAG_ADVANCED,
1418         },
1419         {
1420                 .label          = "send spnego principal",
1421                 .type           = P_BOOL,
1422                 .p_class        = P_GLOBAL,
1423                 .ptr            = &Globals.send_spnego_principal,
1424                 .special        = NULL,
1425                 .enum_list      = NULL,
1426                 .flags          = FLAG_ADVANCED,
1427         },
1428         {
1429                 .label          = "username",
1430                 .type           = P_STRING,
1431                 .p_class        = P_LOCAL,
1432                 .ptr            = &sDefault.szUsername,
1433                 .special        = NULL,
1434                 .enum_list      = NULL,
1435                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED,
1436         },
1437         {
1438                 .label          = "user",
1439                 .type           = P_STRING,
1440                 .p_class        = P_LOCAL,
1441                 .ptr            = &sDefault.szUsername,
1442                 .special        = NULL,
1443                 .enum_list      = NULL,
1444                 .flags          = FLAG_HIDE,
1445         },
1446         {
1447                 .label          = "users",
1448                 .type           = P_STRING,
1449                 .p_class        = P_LOCAL,
1450                 .ptr            = &sDefault.szUsername,
1451                 .special        = NULL,
1452                 .enum_list      = NULL,
1453                 .flags          = FLAG_HIDE,
1454         },
1455         {
1456                 .label          = "invalid users",
1457                 .type           = P_LIST,
1458                 .p_class        = P_LOCAL,
1459                 .ptr            = &sDefault.szInvalidUsers,
1460                 .special        = NULL,
1461                 .enum_list      = NULL,
1462                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1463         },
1464         {
1465                 .label          = "valid users",
1466                 .type           = P_LIST,
1467                 .p_class        = P_LOCAL,
1468                 .ptr            = &sDefault.szValidUsers,
1469                 .special        = NULL,
1470                 .enum_list      = NULL,
1471                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1472         },
1473         {
1474                 .label          = "admin users",
1475                 .type           = P_LIST,
1476                 .p_class        = P_LOCAL,
1477                 .ptr            = &sDefault.szAdminUsers,
1478                 .special        = NULL,
1479                 .enum_list      = NULL,
1480                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1481         },
1482         {
1483                 .label          = "read list",
1484                 .type           = P_LIST,
1485                 .p_class        = P_LOCAL,
1486                 .ptr            = &sDefault.readlist,
1487                 .special        = NULL,
1488                 .enum_list      = NULL,
1489                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1490         },
1491         {
1492                 .label          = "write list",
1493                 .type           = P_LIST,
1494                 .p_class        = P_LOCAL,
1495                 .ptr            = &sDefault.writelist,
1496                 .special        = NULL,
1497                 .enum_list      = NULL,
1498                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1499         },
1500         {
1501                 .label          = "printer admin",
1502                 .type           = P_LIST,
1503                 .p_class        = P_LOCAL,
1504                 .ptr            = &sDefault.printer_admin,
1505                 .special        = NULL,
1506                 .enum_list      = NULL,
1507                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT | FLAG_DEPRECATED,
1508         },
1509         {
1510                 .label          = "force user",
1511                 .type           = P_STRING,
1512                 .p_class        = P_LOCAL,
1513                 .ptr            = &sDefault.force_user,
1514                 .special        = NULL,
1515                 .enum_list      = NULL,
1516                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1517         },
1518         {
1519                 .label          = "force group",
1520                 .type           = P_STRING,
1521                 .p_class        = P_LOCAL,
1522                 .ptr            = &sDefault.force_group,
1523                 .special        = NULL,
1524                 .enum_list      = NULL,
1525                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1526         },
1527         {
1528                 .label          = "group",
1529                 .type           = P_STRING,
1530                 .p_class        = P_LOCAL,
1531                 .ptr            = &sDefault.force_group,
1532                 .special        = NULL,
1533                 .enum_list      = NULL,
1534                 .flags          = FLAG_ADVANCED,
1535         },
1536         {
1537                 .label          = "read only",
1538                 .type           = P_BOOL,
1539                 .p_class        = P_LOCAL,
1540                 .ptr            = &sDefault.bRead_only,
1541                 .special        = NULL,
1542                 .enum_list      = NULL,
1543                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE,
1544         },
1545         {
1546                 .label          = "write ok",
1547                 .type           = P_BOOLREV,
1548                 .p_class        = P_LOCAL,
1549                 .ptr            = &sDefault.bRead_only,
1550                 .special        = NULL,
1551                 .enum_list      = NULL,
1552                 .flags          = FLAG_HIDE,
1553         },
1554         {
1555                 .label          = "writeable",
1556                 .type           = P_BOOLREV,
1557                 .p_class        = P_LOCAL,
1558                 .ptr            = &sDefault.bRead_only,
1559                 .special        = NULL,
1560                 .enum_list      = NULL,
1561                 .flags          = FLAG_HIDE,
1562         },
1563         {
1564                 .label          = "writable",
1565                 .type           = P_BOOLREV,
1566                 .p_class        = P_LOCAL,
1567                 .ptr            = &sDefault.bRead_only,
1568                 .special        = NULL,
1569                 .enum_list      = NULL,
1570                 .flags          = FLAG_HIDE,
1571         },
1572         {
1573                 .label          = "acl check permissions",
1574                 .type           = P_BOOL,
1575                 .p_class        = P_LOCAL,
1576                 .ptr            = &sDefault.bAclCheckPermissions,
1577                 .special        = NULL,
1578                 .enum_list      = NULL,
1579                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1580         },
1581         {
1582                 .label          = "acl group control",
1583                 .type           = P_BOOL,
1584                 .p_class        = P_LOCAL,
1585                 .ptr            = &sDefault.bAclGroupControl,
1586                 .special        = NULL,
1587                 .enum_list      = NULL,
1588                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1589         },
1590         {
1591                 .label          = "acl map full control",
1592                 .type           = P_BOOL,
1593                 .p_class        = P_LOCAL,
1594                 .ptr            = &sDefault.bAclMapFullControl,
1595                 .special        = NULL,
1596                 .enum_list      = NULL,
1597                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1598         },
1599         {
1600                 .label          = "create mask",
1601                 .type           = P_OCTAL,
1602                 .p_class        = P_LOCAL,
1603                 .ptr            = &sDefault.iCreate_mask,
1604                 .special        = NULL,
1605                 .enum_list      = NULL,
1606                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1607         },
1608         {
1609                 .label          = "create mode",
1610                 .type           = P_OCTAL,
1611                 .p_class        = P_LOCAL,
1612                 .ptr            = &sDefault.iCreate_mask,
1613                 .special        = NULL,
1614                 .enum_list      = NULL,
1615                 .flags          = FLAG_HIDE,
1616         },
1617         {
1618                 .label          = "force create mode",
1619                 .type           = P_OCTAL,
1620                 .p_class        = P_LOCAL,
1621                 .ptr            = &sDefault.iCreate_force_mode,
1622                 .special        = NULL,
1623                 .enum_list      = NULL,
1624                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1625         },
1626         {
1627                 .label          = "security mask",
1628                 .type           = P_OCTAL,
1629                 .p_class        = P_LOCAL,
1630                 .ptr            = &sDefault.iSecurity_mask,
1631                 .special        = NULL,
1632                 .enum_list      = NULL,
1633                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1634         },
1635         {
1636                 .label          = "force security mode",
1637                 .type           = P_OCTAL,
1638                 .p_class        = P_LOCAL,
1639                 .ptr            = &sDefault.iSecurity_force_mode,
1640                 .special        = NULL,
1641                 .enum_list      = NULL,
1642                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1643         },
1644         {
1645                 .label          = "directory mask",
1646                 .type           = P_OCTAL,
1647                 .p_class        = P_LOCAL,
1648                 .ptr            = &sDefault.iDir_mask,
1649                 .special        = NULL,
1650                 .enum_list      = NULL,
1651                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1652         },
1653         {
1654                 .label          = "directory mode",
1655                 .type           = P_OCTAL,
1656                 .p_class        = P_LOCAL,
1657                 .ptr            = &sDefault.iDir_mask,
1658                 .special        = NULL,
1659                 .enum_list      = NULL,
1660                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1661         },
1662         {
1663                 .label          = "force directory mode",
1664                 .type           = P_OCTAL,
1665                 .p_class        = P_LOCAL,
1666                 .ptr            = &sDefault.iDir_force_mode,
1667                 .special        = NULL,
1668                 .enum_list      = NULL,
1669                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1670         },
1671         {
1672                 .label          = "directory security mask",
1673                 .type           = P_OCTAL,
1674                 .p_class        = P_LOCAL,
1675                 .ptr            = &sDefault.iDir_Security_mask,
1676                 .special        = NULL,
1677                 .enum_list      = NULL,
1678                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1679         },
1680         {
1681                 .label          = "force directory security mode",
1682                 .type           = P_OCTAL,
1683                 .p_class        = P_LOCAL,
1684                 .ptr            = &sDefault.iDir_Security_force_mode,
1685                 .special        = NULL,
1686                 .enum_list      = NULL,
1687                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1688         },
1689         {
1690                 .label          = "force unknown acl user",
1691                 .type           = P_BOOL,
1692                 .p_class        = P_LOCAL,
1693                 .ptr            = &sDefault.bForceUnknownAclUser,
1694                 .special        = NULL,
1695                 .enum_list      = NULL,
1696                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1697         },
1698         {
1699                 .label          = "inherit permissions",
1700                 .type           = P_BOOL,
1701                 .p_class        = P_LOCAL,
1702                 .ptr            = &sDefault.bInheritPerms,
1703                 .special        = NULL,
1704                 .enum_list      = NULL,
1705                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1706         },
1707         {
1708                 .label          = "inherit acls",
1709                 .type           = P_BOOL,
1710                 .p_class        = P_LOCAL,
1711                 .ptr            = &sDefault.bInheritACLS,
1712                 .special        = NULL,
1713                 .enum_list      = NULL,
1714                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1715         },
1716         {
1717                 .label          = "inherit owner",
1718                 .type           = P_BOOL,
1719                 .p_class        = P_LOCAL,
1720                 .ptr            = &sDefault.bInheritOwner,
1721                 .special        = NULL,
1722                 .enum_list      = NULL,
1723                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1724         },
1725         {
1726                 .label          = "guest only",
1727                 .type           = P_BOOL,
1728                 .p_class        = P_LOCAL,
1729                 .ptr            = &sDefault.bGuest_only,
1730                 .special        = NULL,
1731                 .enum_list      = NULL,
1732                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1733         },
1734         {
1735                 .label          = "only guest",
1736                 .type           = P_BOOL,
1737                 .p_class        = P_LOCAL,
1738                 .ptr            = &sDefault.bGuest_only,
1739                 .special        = NULL,
1740                 .enum_list      = NULL,
1741                 .flags          = FLAG_HIDE,
1742         },
1743         {
1744                 .label          = "administrative share",
1745                 .type           = P_BOOL,
1746                 .p_class        = P_LOCAL,
1747                 .ptr            = &sDefault.bAdministrative_share,
1748                 .special        = NULL,
1749                 .enum_list      = NULL,
1750                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1751         },
1752
1753         {
1754                 .label          = "guest ok",
1755                 .type           = P_BOOL,
1756                 .p_class        = P_LOCAL,
1757                 .ptr            = &sDefault.bGuest_ok,
1758                 .special        = NULL,
1759                 .enum_list      = NULL,
1760                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1761         },
1762         {
1763                 .label          = "public",
1764                 .type           = P_BOOL,
1765                 .p_class        = P_LOCAL,
1766                 .ptr            = &sDefault.bGuest_ok,
1767                 .special        = NULL,
1768                 .enum_list      = NULL,
1769                 .flags          = FLAG_HIDE,
1770         },
1771         {
1772                 .label          = "only user",
1773                 .type           = P_BOOL,
1774                 .p_class        = P_LOCAL,
1775                 .ptr            = &sDefault.bOnlyUser,
1776                 .special        = NULL,
1777                 .enum_list      = NULL,
1778                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED,
1779         },
1780         {
1781                 .label          = "hosts allow",
1782                 .type           = P_LIST,
1783                 .p_class        = P_LOCAL,
1784                 .ptr            = &sDefault.szHostsallow,
1785                 .special        = NULL,
1786                 .enum_list      = NULL,
1787                 .flags          = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1788         },
1789         {
1790                 .label          = "allow hosts",
1791                 .type           = P_LIST,
1792                 .p_class        = P_LOCAL,
1793                 .ptr            = &sDefault.szHostsallow,
1794                 .special        = NULL,
1795                 .enum_list      = NULL,
1796                 .flags          = FLAG_HIDE,
1797         },
1798         {
1799                 .label          = "hosts deny",
1800                 .type           = P_LIST,
1801                 .p_class        = P_LOCAL,
1802                 .ptr            = &sDefault.szHostsdeny,
1803                 .special        = NULL,
1804                 .enum_list      = NULL,
1805                 .flags          = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1806         },
1807         {
1808                 .label          = "deny hosts",
1809                 .type           = P_LIST,
1810                 .p_class        = P_LOCAL,
1811                 .ptr            = &sDefault.szHostsdeny,
1812                 .special        = NULL,
1813                 .enum_list      = NULL,
1814                 .flags          = FLAG_HIDE,
1815         },
1816         {
1817                 .label          = "preload modules",
1818                 .type           = P_LIST,
1819                 .p_class        = P_GLOBAL,
1820                 .ptr            = &Globals.szPreloadModules,
1821                 .special        = NULL,
1822                 .enum_list      = NULL,
1823                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1824         },
1825         {
1826                 .label          = "dedicated keytab file",
1827                 .type           = P_STRING,
1828                 .p_class        = P_GLOBAL,
1829                 .ptr            = &Globals.szDedicatedKeytabFile,
1830                 .special        = NULL,
1831                 .enum_list      = NULL,
1832                 .flags          = FLAG_ADVANCED,
1833         },
1834         {
1835                 .label          = "kerberos method",
1836                 .type           = P_ENUM,
1837                 .p_class        = P_GLOBAL,
1838                 .ptr            = &Globals.iKerberosMethod,
1839                 .special        = NULL,
1840                 .enum_list      = enum_kerberos_method,
1841                 .flags          = FLAG_ADVANCED,
1842         },
1843         {
1844                 .label          = "map untrusted to domain",
1845                 .type           = P_BOOL,
1846                 .p_class        = P_GLOBAL,
1847                 .ptr            = &Globals.bMapUntrustedToDomain,
1848                 .special        = NULL,
1849                 .enum_list      = NULL,
1850                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1851         },
1852
1853
1854         {N_("Logging Options"), P_SEP, P_SEPARATOR},
1855
1856         {
1857                 .label          = "log level",
1858                 .type           = P_STRING,
1859                 .p_class        = P_GLOBAL,
1860                 .ptr            = &Globals.szLogLevel,
1861                 .special        = handle_debug_list,
1862                 .enum_list      = NULL,
1863                 .flags          = FLAG_ADVANCED,
1864         },
1865         {
1866                 .label          = "debuglevel",
1867                 .type           = P_STRING,
1868                 .p_class        = P_GLOBAL,
1869                 .ptr            = &Globals.szLogLevel,
1870                 .special        = handle_debug_list,
1871                 .enum_list      = NULL,
1872                 .flags          = FLAG_HIDE,
1873         },
1874         {
1875                 .label          = "syslog",
1876                 .type           = P_INTEGER,
1877                 .p_class        = P_GLOBAL,
1878                 .ptr            = &Globals.syslog,
1879                 .special        = NULL,
1880                 .enum_list      = NULL,
1881                 .flags          = FLAG_ADVANCED,
1882         },
1883         {
1884                 .label          = "syslog only",
1885                 .type           = P_BOOL,
1886                 .p_class        = P_GLOBAL,
1887                 .ptr            = &Globals.bSyslogOnly,
1888                 .special        = NULL,
1889                 .enum_list      = NULL,
1890                 .flags          = FLAG_ADVANCED,
1891         },
1892         {
1893                 .label          = "log file",
1894                 .type           = P_STRING,
1895                 .p_class        = P_GLOBAL,
1896                 .ptr            = &Globals.szLogFile,
1897                 .special        = NULL,
1898                 .enum_list      = NULL,
1899                 .flags          = FLAG_ADVANCED,
1900         },
1901         {
1902                 .label          = "max log size",
1903                 .type           = P_INTEGER,
1904                 .p_class        = P_GLOBAL,
1905                 .ptr            = &Globals.max_log_size,
1906                 .special        = NULL,
1907                 .enum_list      = NULL,
1908                 .flags          = FLAG_ADVANCED,
1909         },
1910         {
1911                 .label          = "debug timestamp",
1912                 .type           = P_BOOL,
1913                 .p_class        = P_GLOBAL,
1914                 .ptr            = &Globals.bTimestampLogs,
1915                 .special        = NULL,
1916                 .enum_list      = NULL,
1917                 .flags          = FLAG_ADVANCED,
1918         },
1919         {
1920                 .label          = "timestamp logs",
1921                 .type           = P_BOOL,
1922                 .p_class        = P_GLOBAL,
1923                 .ptr            = &Globals.bTimestampLogs,
1924                 .special        = NULL,
1925                 .enum_list      = NULL,
1926                 .flags          = FLAG_ADVANCED,
1927         },
1928         {
1929                 .label          = "debug prefix timestamp",
1930                 .type           = P_BOOL,
1931                 .p_class        = P_GLOBAL,
1932                 .ptr            = &Globals.bDebugPrefixTimestamp,
1933                 .special        = NULL,
1934                 .enum_list      = NULL,
1935                 .flags          = FLAG_ADVANCED,
1936         },
1937         {
1938                 .label          = "debug hires timestamp",
1939                 .type           = P_BOOL,
1940                 .p_class        = P_GLOBAL,
1941                 .ptr            = &Globals.bDebugHiresTimestamp,
1942                 .special        = NULL,
1943                 .enum_list      = NULL,
1944                 .flags          = FLAG_ADVANCED,
1945         },
1946         {
1947                 .label          = "debug pid",
1948                 .type           = P_BOOL,
1949                 .p_class        = P_GLOBAL,
1950                 .ptr            = &Globals.bDebugPid,
1951                 .special        = NULL,
1952                 .enum_list      = NULL,
1953                 .flags          = FLAG_ADVANCED,
1954         },
1955         {
1956                 .label          = "debug uid",
1957                 .type           = P_BOOL,
1958                 .p_class        = P_GLOBAL,
1959                 .ptr            = &Globals.bDebugUid,
1960                 .special        = NULL,
1961                 .enum_list      = NULL,
1962                 .flags          = FLAG_ADVANCED,
1963         },
1964         {
1965                 .label          = "debug class",
1966                 .type           = P_BOOL,
1967                 .p_class        = P_GLOBAL,
1968                 .ptr            = &Globals.bDebugClass,
1969                 .special        = NULL,
1970                 .enum_list      = NULL,
1971                 .flags          = FLAG_ADVANCED,
1972         },
1973         {
1974                 .label          = "enable core files",
1975                 .type           = P_BOOL,
1976                 .p_class        = P_GLOBAL,
1977                 .ptr            = &Globals.bEnableCoreFiles,
1978                 .special        = NULL,
1979                 .enum_list      = NULL,
1980                 .flags          = FLAG_ADVANCED,
1981         },
1982
1983         {N_("Protocol Options"), P_SEP, P_SEPARATOR},
1984
1985         {
1986                 .label          = "allocation roundup size",
1987                 .type           = P_INTEGER,
1988                 .p_class        = P_LOCAL,
1989                 .ptr            = &sDefault.iallocation_roundup_size,
1990                 .special        = NULL,
1991                 .enum_list      = NULL,
1992                 .flags          = FLAG_ADVANCED,
1993         },
1994         {
1995                 .label          = "aio read size",
1996                 .type           = P_INTEGER,
1997                 .p_class        = P_LOCAL,
1998                 .ptr            = &sDefault.iAioReadSize,
1999                 .special        = NULL,
2000                 .enum_list      = NULL,
2001                 .flags          = FLAG_ADVANCED,
2002         },
2003         {
2004                 .label          = "aio write size",
2005                 .type           = P_INTEGER,
2006                 .p_class        = P_LOCAL,
2007                 .ptr            = &sDefault.iAioWriteSize,
2008                 .special        = NULL,
2009                 .enum_list      = NULL,
2010                 .flags          = FLAG_ADVANCED,
2011         },
2012         {
2013                 .label          = "aio write behind",
2014                 .type           = P_STRING,
2015                 .p_class        = P_LOCAL,
2016                 .ptr            = &sDefault.szAioWriteBehind,
2017                 .special        = NULL,
2018                 .enum_list      = NULL,
2019                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2020         },
2021         {
2022                 .label          = "smb ports",
2023                 .type           = P_STRING,
2024                 .p_class        = P_GLOBAL,
2025                 .ptr            = &Globals.smb_ports,
2026                 .special        = NULL,
2027                 .enum_list      = NULL,
2028                 .flags          = FLAG_ADVANCED,
2029         },
2030         {
2031                 .label          = "large readwrite",
2032                 .type           = P_BOOL,
2033                 .p_class        = P_GLOBAL,
2034                 .ptr            = &Globals.bLargeReadwrite,
2035                 .special        = NULL,
2036                 .enum_list      = NULL,
2037                 .flags          = FLAG_ADVANCED,
2038         },
2039         {
2040                 .label          = "max protocol",
2041                 .type           = P_ENUM,
2042                 .p_class        = P_GLOBAL,
2043                 .ptr            = &Globals.maxprotocol,
2044                 .special        = NULL,
2045                 .enum_list      = enum_protocol,
2046                 .flags          = FLAG_ADVANCED,
2047         },
2048         {
2049                 .label          = "protocol",
2050                 .type           = P_ENUM,
2051                 .p_class        = P_GLOBAL,
2052                 .ptr            = &Globals.maxprotocol,
2053                 .special        = NULL,
2054                 .enum_list      = enum_protocol,
2055                 .flags          = FLAG_ADVANCED,
2056         },
2057         {
2058                 .label          = "min protocol",
2059                 .type           = P_ENUM,
2060                 .p_class        = P_GLOBAL,
2061                 .ptr            = &Globals.minprotocol,
2062                 .special        = NULL,
2063                 .enum_list      = enum_protocol,
2064                 .flags          = FLAG_ADVANCED,
2065         },
2066         {
2067                 .label          = "min receivefile size",
2068                 .type           = P_INTEGER,
2069                 .p_class        = P_GLOBAL,
2070                 .ptr            = &Globals.iminreceivefile,
2071                 .special        = NULL,
2072                 .enum_list      = NULL,
2073                 .flags          = FLAG_ADVANCED,
2074         },
2075         {
2076                 .label          = "read raw",
2077                 .type           = P_BOOL,
2078                 .p_class        = P_GLOBAL,
2079                 .ptr            = &Globals.bReadRaw,
2080                 .special        = NULL,
2081                 .enum_list      = NULL,
2082                 .flags          = FLAG_ADVANCED,
2083         },
2084         {
2085                 .label          = "write raw",
2086                 .type           = P_BOOL,
2087                 .p_class        = P_GLOBAL,
2088                 .ptr            = &Globals.bWriteRaw,
2089                 .special        = NULL,
2090                 .enum_list      = NULL,
2091                 .flags          = FLAG_ADVANCED,
2092         },
2093         {
2094                 .label          = "disable netbios",
2095                 .type           = P_BOOL,
2096                 .p_class        = P_GLOBAL,
2097                 .ptr            = &Globals.bDisableNetbios,
2098                 .special        = NULL,
2099                 .enum_list      = NULL,
2100                 .flags          = FLAG_ADVANCED,
2101         },
2102         {
2103                 .label          = "reset on zero vc",
2104                 .type           = P_BOOL,
2105                 .p_class        = P_GLOBAL,
2106                 .ptr            = &Globals.bResetOnZeroVC,
2107                 .special        = NULL,
2108                 .enum_list      = NULL,
2109                 .flags          = FLAG_ADVANCED,
2110         },
2111         {
2112                 .label          = "log writeable files on exit",
2113                 .type           = P_BOOL,
2114                 .p_class        = P_GLOBAL,
2115                 .ptr            = &Globals.bLogWriteableFilesOnExit,
2116                 .special        = NULL,
2117                 .enum_list      = NULL,
2118                 .flags          = FLAG_ADVANCED,
2119         },
2120         {
2121                 .label          = "acl compatibility",
2122                 .type           = P_ENUM,
2123                 .p_class        = P_GLOBAL,
2124                 .ptr            = &Globals.iAclCompat,
2125                 .special        = NULL,
2126                 .enum_list      = enum_acl_compat_vals,
2127                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2128         },
2129         {
2130                 .label          = "defer sharing violations",
2131                 .type           = P_BOOL,
2132                 .p_class        = P_GLOBAL,
2133                 .ptr            = &Globals.bDeferSharingViolations,
2134                 .special        = NULL,
2135                 .enum_list      = NULL,
2136                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2137         },
2138         {
2139                 .label          = "ea support",
2140                 .type           = P_BOOL,
2141                 .p_class        = P_LOCAL,
2142                 .ptr            = &sDefault.bEASupport,
2143                 .special        = NULL,
2144                 .enum_list      = NULL,
2145                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2146         },
2147         {
2148                 .label          = "nt acl support",
2149                 .type           = P_BOOL,
2150                 .p_class        = P_LOCAL,
2151                 .ptr            = &sDefault.bNTAclSupport,
2152                 .special        = NULL,
2153                 .enum_list      = NULL,
2154                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2155         },
2156         {
2157                 .label          = "nt pipe support",
2158                 .type           = P_BOOL,
2159                 .p_class        = P_GLOBAL,
2160                 .ptr            = &Globals.bNTPipeSupport,
2161                 .special        = NULL,
2162                 .enum_list      = NULL,
2163                 .flags          = FLAG_ADVANCED,
2164         },
2165         {
2166                 .label          = "nt status support",
2167                 .type           = P_BOOL,
2168                 .p_class        = P_GLOBAL,
2169                 .ptr            = &Globals.bNTStatusSupport,
2170                 .special        = NULL,
2171                 .enum_list      = NULL,
2172                 .flags          = FLAG_ADVANCED,
2173         },
2174         {
2175                 .label          = "profile acls",
2176                 .type           = P_BOOL,
2177                 .p_class        = P_LOCAL,
2178                 .ptr            = &sDefault.bProfileAcls,
2179                 .special        = NULL,
2180                 .enum_list      = NULL,
2181                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
2182         },
2183         {
2184                 .label          = "announce version",
2185                 .type           = P_STRING,
2186                 .p_class        = P_GLOBAL,
2187                 .ptr            = &Globals.szAnnounceVersion,
2188                 .special        = NULL,
2189                 .enum_list      = NULL,
2190                 .flags          = FLAG_ADVANCED,
2191         },
2192         {
2193                 .label          = "announce as",
2194                 .type           = P_ENUM,
2195                 .p_class        = P_GLOBAL,
2196                 .ptr            = &Globals.announce_as,
2197                 .special        = NULL,
2198                 .enum_list      = enum_announce_as,
2199                 .flags          = FLAG_ADVANCED,
2200         },
2201         {
2202                 .label          = "map acl inherit",
2203                 .type           = P_BOOL,
2204                 .p_class        = P_LOCAL,
2205                 .ptr            = &sDefault.bMap_acl_inherit,
2206                 .special        = NULL,
2207                 .enum_list      = NULL,
2208                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2209         },
2210         {
2211                 .label          = "afs share",
2212                 .type           = P_BOOL,
2213                 .p_class        = P_LOCAL,
2214                 .ptr            = &sDefault.bAfs_Share,
2215                 .special        = NULL,
2216                 .enum_list      = NULL,
2217                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2218         },
2219         {
2220                 .label          = "max mux",
2221                 .type           = P_INTEGER,
2222                 .p_class        = P_GLOBAL,
2223                 .ptr            = &Globals.max_mux,
2224                 .special        = NULL,
2225                 .enum_list      = NULL,
2226                 .flags          = FLAG_ADVANCED,
2227         },
2228         {
2229                 .label          = "max xmit",
2230                 .type           = P_INTEGER,
2231                 .p_class        = P_GLOBAL,
2232                 .ptr            = &Globals.max_xmit,
2233                 .special        = NULL,
2234                 .enum_list      = NULL,
2235                 .flags          = FLAG_ADVANCED,
2236         },
2237         {
2238                 .label          = "name resolve order",
2239                 .type           = P_STRING,
2240                 .p_class        = P_GLOBAL,
2241                 .ptr            = &Globals.szNameResolveOrder,
2242                 .special        = NULL,
2243                 .enum_list      = NULL,
2244                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
2245         },
2246         {
2247                 .label          = "max ttl",
2248                 .type           = P_INTEGER,
2249                 .p_class        = P_GLOBAL,
2250                 .ptr            = &Globals.max_ttl,
2251                 .special        = NULL,
2252                 .enum_list      = NULL,
2253                 .flags          = FLAG_ADVANCED,
2254         },
2255         {
2256                 .label          = "max wins ttl",
2257                 .type           = P_INTEGER,
2258                 .p_class        = P_GLOBAL,
2259                 .ptr            = &Globals.max_wins_ttl,
2260                 .special        = NULL,
2261                 .enum_list      = NULL,
2262                 .flags          = FLAG_ADVANCED,
2263         },
2264         {
2265                 .label          = "min wins ttl",
2266                 .type           = P_INTEGER,
2267                 .p_class        = P_GLOBAL,
2268                 .ptr            = &Globals.min_wins_ttl,
2269                 .special        = NULL,
2270                 .enum_list      = NULL,
2271                 .flags          = FLAG_ADVANCED,
2272         },
2273         {
2274                 .label          = "time server",
2275                 .type           = P_BOOL,
2276                 .p_class        = P_GLOBAL,
2277                 .ptr            = &Globals.bTimeServer,
2278                 .special        = NULL,
2279                 .enum_list      = NULL,
2280                 .flags          = FLAG_ADVANCED,
2281         },
2282         {
2283                 .label          = "unix extensions",
2284                 .type           = P_BOOL,
2285                 .p_class        = P_GLOBAL,
2286                 .ptr            = &Globals.bUnixExtensions,
2287                 .special        = NULL,
2288                 .enum_list      = NULL,
2289                 .flags          = FLAG_ADVANCED,
2290         },
2291         {
2292                 .label          = "use spnego",
2293                 .type           = P_BOOL,
2294                 .p_class        = P_GLOBAL,
2295                 .ptr            = &Globals.bUseSpnego,
2296                 .special        = NULL,
2297                 .enum_list      = NULL,
2298                 .flags          = FLAG_ADVANCED | FLAG_DEPRECATED,
2299         },
2300         {
2301                 .label          = "client signing",
2302                 .type           = P_ENUM,
2303                 .p_class        = P_GLOBAL,
2304                 .ptr            = &Globals.client_signing,
2305                 .special        = NULL,
2306                 .enum_list      = enum_smb_signing_vals,
2307                 .flags          = FLAG_ADVANCED,
2308         },
2309         {
2310                 .label          = "server signing",
2311                 .type           = P_ENUM,
2312                 .p_class        = P_GLOBAL,
2313                 .ptr            = &Globals.server_signing,
2314                 .special        = NULL,
2315                 .enum_list      = enum_smb_signing_vals,
2316                 .flags          = FLAG_ADVANCED,
2317         },
2318         {
2319                 .label          = "smb encrypt",
2320                 .type           = P_ENUM,
2321                 .p_class        = P_LOCAL,
2322                 .ptr            = &sDefault.ismb_encrypt,
2323                 .special        = NULL,
2324                 .enum_list      = enum_smb_signing_vals,
2325                 .flags          = FLAG_ADVANCED,
2326         },
2327         {
2328                 .label          = "client use spnego",
2329                 .type           = P_BOOL,
2330                 .p_class        = P_GLOBAL,
2331                 .ptr            = &Globals.bClientUseSpnego,
2332                 .special        = NULL,
2333                 .enum_list      = NULL,
2334                 .flags          = FLAG_ADVANCED,
2335         },
2336         {
2337                 .label          = "client ldap sasl wrapping",
2338                 .type           = P_ENUM,
2339                 .p_class        = P_GLOBAL,
2340                 .ptr            = &Globals.client_ldap_sasl_wrapping,
2341                 .special        = NULL,
2342                 .enum_list      = enum_ldap_sasl_wrapping,
2343                 .flags          = FLAG_ADVANCED,
2344         },
2345         {
2346                 .label          = "enable asu support",
2347                 .type           = P_BOOL,
2348                 .p_class        = P_GLOBAL,
2349                 .ptr            = &Globals.bASUSupport,
2350                 .special        = NULL,
2351                 .enum_list      = NULL,
2352                 .flags          = FLAG_ADVANCED,
2353         },
2354         {
2355                 .label          = "svcctl list",
2356                 .type           = P_LIST,
2357                 .p_class        = P_GLOBAL,
2358                 .ptr            = &Globals.szServicesList,
2359                 .special        = NULL,
2360                 .enum_list      = NULL,
2361                 .flags          = FLAG_ADVANCED,
2362         },
2363
2364         {N_("Tuning Options"), P_SEP, P_SEPARATOR},
2365
2366         {
2367                 .label          = "block size",
2368                 .type           = P_INTEGER,
2369                 .p_class        = P_LOCAL,
2370                 .ptr            = &sDefault.iBlock_size,
2371                 .special        = NULL,
2372                 .enum_list      = NULL,
2373                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2374         },
2375         {
2376                 .label          = "deadtime",
2377                 .type           = P_INTEGER,
2378                 .p_class        = P_GLOBAL,
2379                 .ptr            = &Globals.deadtime,
2380                 .special        = NULL,
2381                 .enum_list      = NULL,
2382                 .flags          = FLAG_ADVANCED,
2383         },
2384         {
2385                 .label          = "getwd cache",
2386                 .type           = P_BOOL,
2387                 .p_class        = P_GLOBAL,
2388                 .ptr            = &Globals.getwd_cache,
2389                 .special        = NULL,
2390                 .enum_list      = NULL,
2391                 .flags          = FLAG_ADVANCED,
2392         },
2393         {
2394                 .label          = "keepalive",
2395                 .type           = P_INTEGER,
2396                 .p_class        = P_GLOBAL,
2397                 .ptr            = &Globals.iKeepalive,
2398                 .special        = NULL,
2399                 .enum_list      = NULL,
2400                 .flags          = FLAG_ADVANCED,
2401         },
2402         {
2403                 .label          = "change notify",
2404                 .type           = P_BOOL,
2405                 .p_class        = P_LOCAL,
2406                 .ptr            = &sDefault.bChangeNotify,
2407                 .special        = NULL,
2408                 .enum_list      = NULL,
2409                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2410         },
2411         {
2412                 .label          = "directory name cache size",
2413                 .type           = P_INTEGER,
2414                 .p_class        = P_LOCAL,
2415                 .ptr            = &sDefault.iDirectoryNameCacheSize,
2416                 .special        = NULL,
2417                 .enum_list      = NULL,
2418                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2419         },
2420         {
2421                 .label          = "kernel change notify",
2422                 .type           = P_BOOL,
2423                 .p_class        = P_LOCAL,
2424                 .ptr            = &sDefault.bKernelChangeNotify,
2425                 .special        = NULL,
2426                 .enum_list      = NULL,
2427                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2428         },
2429         {
2430                 .label          = "lpq cache time",
2431                 .type           = P_INTEGER,
2432                 .p_class        = P_GLOBAL,
2433                 .ptr            = &Globals.lpqcachetime,
2434                 .special        = NULL,
2435                 .enum_list      = NULL,
2436                 .flags          = FLAG_ADVANCED,
2437         },
2438         {
2439                 .label          = "max smbd processes",
2440                 .type           = P_INTEGER,
2441                 .p_class        = P_GLOBAL,
2442                 .ptr            = &Globals.iMaxSmbdProcesses,
2443                 .special        = NULL,
2444                 .enum_list      = NULL,
2445                 .flags          = FLAG_ADVANCED,
2446         },
2447         {
2448                 .label          = "max connections",
2449                 .type           = P_INTEGER,
2450                 .p_class        = P_LOCAL,
2451                 .ptr            = &sDefault.iMaxConnections,
2452                 .special        = NULL,
2453                 .enum_list      = NULL,
2454                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2455         },
2456         {
2457                 .label          = "paranoid server security",
2458                 .type           = P_BOOL,
2459                 .p_class        = P_GLOBAL,
2460                 .ptr            = &Globals.paranoid_server_security,
2461                 .special        = NULL,
2462                 .enum_list      = NULL,
2463                 .flags          = FLAG_ADVANCED,
2464         },
2465         {
2466                 .label          = "max disk size",
2467                 .type           = P_INTEGER,
2468                 .p_class        = P_GLOBAL,
2469                 .ptr            = &Globals.maxdisksize,
2470                 .special        = NULL,
2471                 .enum_list      = NULL,
2472                 .flags          = FLAG_ADVANCED,
2473         },
2474         {
2475                 .label          = "max open files",
2476                 .type           = P_INTEGER,
2477                 .p_class        = P_GLOBAL,
2478                 .ptr            = &Globals.max_open_files,
2479                 .special        = NULL,
2480                 .enum_list      = NULL,
2481                 .flags          = FLAG_ADVANCED,
2482         },
2483         {
2484                 .label          = "min print space",
2485                 .type           = P_INTEGER,
2486                 .p_class        = P_LOCAL,
2487                 .ptr            = &sDefault.iMinPrintSpace,
2488                 .special        = NULL,
2489                 .enum_list      = NULL,
2490                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2491         },
2492         {
2493                 .label          = "socket options",
2494                 .type           = P_STRING,
2495                 .p_class        = P_GLOBAL,
2496                 .ptr            = &Globals.szSocketOptions,
2497                 .special        = NULL,
2498                 .enum_list      = NULL,
2499                 .flags          = FLAG_ADVANCED,
2500         },
2501         {
2502                 .label          = "strict allocate",
2503                 .type           = P_BOOL,
2504                 .p_class        = P_LOCAL,
2505                 .ptr            = &sDefault.bStrictAllocate,
2506                 .special        = NULL,
2507                 .enum_list      = NULL,
2508                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2509         },
2510         {
2511                 .label          = "strict sync",
2512                 .type           = P_BOOL,
2513                 .p_class        = P_LOCAL,
2514                 .ptr            = &sDefault.bStrictSync,
2515                 .special        = NULL,
2516                 .enum_list      = NULL,
2517                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2518         },
2519         {
2520                 .label          = "sync always",
2521                 .type           = P_BOOL,
2522                 .p_class        = P_LOCAL,
2523                 .ptr            = &sDefault.bSyncAlways,
2524                 .special        = NULL,
2525                 .enum_list      = NULL,
2526                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2527         },
2528         {
2529                 .label          = "use mmap",
2530                 .type           = P_BOOL,
2531                 .p_class        = P_GLOBAL,
2532                 .ptr            = &Globals.bUseMmap,
2533                 .special        = NULL,
2534                 .enum_list      = NULL,
2535                 .flags          = FLAG_ADVANCED,
2536         },
2537         {
2538                 .label          = "use sendfile",
2539                 .type           = P_BOOL,
2540                 .p_class        = P_LOCAL,
2541                 .ptr            = &sDefault.bUseSendfile,
2542                 .special        = NULL,
2543                 .enum_list      = NULL,
2544                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2545         },
2546         {
2547                 .label          = "hostname lookups",
2548                 .type           = P_BOOL,
2549                 .p_class        = P_GLOBAL,
2550                 .ptr            = &Globals.bHostnameLookups,
2551                 .special        = NULL,
2552                 .enum_list      = NULL,
2553                 .flags          = FLAG_ADVANCED,
2554         },
2555         {
2556                 .label          = "write cache size",
2557                 .type           = P_INTEGER,
2558                 .p_class        = P_LOCAL,
2559                 .ptr            = &sDefault.iWriteCacheSize,
2560                 .special        = NULL,
2561                 .enum_list      = NULL,
2562                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2563         },
2564         {
2565                 .label          = "name cache timeout",
2566                 .type           = P_INTEGER,
2567                 .p_class        = P_GLOBAL,
2568                 .ptr            = &Globals.name_cache_timeout,
2569                 .special        = NULL,
2570                 .enum_list      = NULL,
2571                 .flags          = FLAG_ADVANCED,
2572         },
2573         {
2574                 .label          = "ctdbd socket",
2575                 .type           = P_STRING,
2576                 .p_class        = P_GLOBAL,
2577                 .ptr            = &Globals.ctdbdSocket,
2578                 .special        = NULL,
2579                 .enum_list      = NULL,
2580                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2581         },
2582         {
2583                 .label          = "cluster addresses",
2584                 .type           = P_LIST,
2585                 .p_class        = P_GLOBAL,
2586                 .ptr            = &Globals.szClusterAddresses,
2587                 .special        = NULL,
2588                 .enum_list      = NULL,
2589                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2590         },
2591         {
2592                 .label          = "clustering",
2593                 .type           = P_BOOL,
2594                 .p_class        = P_GLOBAL,
2595                 .ptr            = &Globals.clustering,
2596                 .special        = NULL,
2597                 .enum_list      = NULL,
2598                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2599         },
2600         {
2601                 .label          = "ctdb timeout",
2602                 .type           = P_INTEGER,
2603                 .p_class        = P_GLOBAL,
2604                 .ptr            = &Globals.ctdb_timeout,
2605                 .special        = NULL,
2606                 .enum_list      = NULL,
2607                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2608         },
2609         {
2610                 .label          = "ctdb locktime warn threshold",
2611                 .type           = P_INTEGER,
2612                 .p_class        = P_GLOBAL,
2613                 .ptr            = &Globals.ctdb_locktime_warn_threshold,
2614                 .special        = NULL,
2615                 .enum_list      = NULL,
2616                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2617         },
2618         {
2619                 .label          = "smb2 max read",
2620                 .type           = P_INTEGER,
2621                 .p_class        = P_GLOBAL,
2622                 .ptr            = &Globals.ismb2_max_read,
2623                 .special        = NULL,
2624                 .enum_list      = NULL,
2625                 .flags          = FLAG_ADVANCED,
2626         },
2627         {
2628                 .label          = "smb2 max write",
2629                 .type           = P_INTEGER,
2630                 .p_class        = P_GLOBAL,
2631                 .ptr            = &Globals.ismb2_max_write,
2632                 .special        = NULL,
2633                 .enum_list      = NULL,
2634                 .flags          = FLAG_ADVANCED,
2635         },
2636         {
2637                 .label          = "smb2 max trans",
2638                 .type           = P_INTEGER,
2639                 .p_class        = P_GLOBAL,
2640                 .ptr            = &Globals.ismb2_max_trans,
2641                 .special        = NULL,
2642                 .enum_list      = NULL,
2643                 .flags          = FLAG_ADVANCED,
2644         },
2645         {
2646                 .label          = "smb2 max credits",
2647                 .type           = P_INTEGER,
2648                 .p_class        = P_GLOBAL,
2649                 .ptr            = &Globals.ismb2_max_credits,
2650                 .special        = NULL,
2651                 .enum_list      = NULL,
2652                 .flags          = FLAG_ADVANCED,
2653         },
2654
2655         {N_("Printing Options"), P_SEP, P_SEPARATOR},
2656
2657         {
2658                 .label          = "max reported print jobs",
2659                 .type           = P_INTEGER,
2660                 .p_class        = P_LOCAL,
2661                 .ptr            = &sDefault.iMaxReportedPrintJobs,
2662                 .special        = NULL,
2663                 .enum_list      = NULL,
2664                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2665         },
2666         {
2667                 .label          = "max print jobs",
2668                 .type           = P_INTEGER,
2669                 .p_class        = P_LOCAL,
2670                 .ptr            = &sDefault.iMaxPrintJobs,
2671                 .special        = NULL,
2672                 .enum_list      = NULL,
2673                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2674         },
2675         {
2676                 .label          = "load printers",
2677                 .type           = P_BOOL,
2678                 .p_class        = P_GLOBAL,
2679                 .ptr            = &Globals.bLoadPrinters,
2680                 .special        = NULL,
2681                 .enum_list      = NULL,
2682                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2683         },
2684         {
2685                 .label          = "printcap cache time",
2686                 .type           = P_INTEGER,
2687                 .p_class        = P_GLOBAL,
2688                 .ptr            = &Globals.PrintcapCacheTime,
2689                 .special        = NULL,
2690                 .enum_list      = NULL,
2691                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2692         },
2693         {
2694                 .label          = "printcap name",
2695                 .type           = P_STRING,
2696                 .p_class        = P_GLOBAL,
2697                 .ptr            = &Globals.szPrintcapname,
2698                 .special        = NULL,
2699                 .enum_list      = NULL,
2700                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2701         },
2702         {
2703                 .label          = "printcap",
2704                 .type           = P_STRING,
2705                 .p_class        = P_GLOBAL,
2706                 .ptr            = &Globals.szPrintcapname,
2707                 .special        = NULL,
2708                 .enum_list      = NULL,
2709                 .flags          = FLAG_HIDE,
2710         },
2711         {
2712                 .label          = "printable",
2713                 .type           = P_BOOL,
2714                 .p_class        = P_LOCAL,
2715                 .ptr            = &sDefault.bPrint_ok,
2716                 .special        = NULL,
2717                 .enum_list      = NULL,
2718                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2719         },
2720         {
2721                 .label          = "print notify backchannel",
2722                 .type           = P_BOOL,
2723                 .p_class        = P_LOCAL,
2724                 .ptr            = &sDefault.bPrintNotifyBackchannel,
2725                 .special        = NULL,
2726                 .enum_list      = NULL,
2727                 .flags          = FLAG_ADVANCED,
2728         },
2729         {
2730                 .label          = "print ok",
2731                 .type           = P_BOOL,
2732                 .p_class        = P_LOCAL,
2733                 .ptr            = &sDefault.bPrint_ok,
2734                 .special        = NULL,
2735                 .enum_list      = NULL,
2736                 .flags          = FLAG_HIDE,
2737         },
2738         {
2739                 .label          = "printing",
2740                 .type           = P_ENUM,
2741                 .p_class        = P_LOCAL,
2742                 .ptr            = &sDefault.iPrinting,
2743                 .special        = handle_printing,
2744                 .enum_list      = enum_printing,
2745                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2746         },
2747         {
2748                 .label          = "cups options",
2749                 .type           = P_STRING,
2750                 .p_class        = P_LOCAL,
2751                 .ptr            = &sDefault.szCupsOptions,
2752                 .special        = NULL,
2753                 .enum_list      = NULL,
2754                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2755         },
2756         {
2757                 .label          = "cups server",
2758                 .type           = P_STRING,
2759                 .p_class        = P_GLOBAL,
2760                 .ptr            = &Globals.szCupsServer,
2761                 .special        = NULL,
2762                 .enum_list      = NULL,
2763                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2764         },
2765         {
2766                 .label          = "cups encrypt",
2767                 .type           = P_ENUM,
2768                 .p_class        = P_GLOBAL,
2769                 .ptr            = &Globals.CupsEncrypt,
2770                 .special        = NULL,
2771                 .enum_list      = enum_bool_auto,
2772                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2773         },
2774         {
2775
2776                 .label          = "cups connection timeout",
2777                 .type           = P_INTEGER,
2778                 .p_class        = P_GLOBAL,
2779                 .ptr            = &Globals.cups_connection_timeout,
2780                 .special        = NULL,
2781                 .enum_list      = NULL,
2782                 .flags          = FLAG_ADVANCED,
2783         },
2784         {
2785                 .label          = "iprint server",
2786                 .type           = P_STRING,
2787                 .p_class        = P_GLOBAL,
2788                 .ptr            = &Globals.szIPrintServer,
2789                 .special        = NULL,
2790                 .enum_list      = NULL,
2791                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2792         },
2793         {
2794                 .label          = "print command",
2795                 .type           = P_STRING,
2796                 .p_class        = P_LOCAL,
2797                 .ptr            = &sDefault.szPrintcommand,
2798                 .special        = NULL,
2799                 .enum_list      = NULL,
2800                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2801         },
2802         {
2803                 .label          = "disable spoolss",
2804                 .type           = P_BOOL,
2805                 .p_class        = P_GLOBAL,
2806                 .ptr            = &Globals.bDisableSpoolss,
2807                 .special        = NULL,
2808                 .enum_list      = NULL,
2809                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2810         },
2811         {
2812                 .label          = "enable spoolss",
2813                 .type           = P_BOOLREV,
2814                 .p_class        = P_GLOBAL,
2815                 .ptr            = &Globals.bDisableSpoolss,
2816                 .special        = NULL,
2817                 .enum_list      = NULL,
2818                 .flags          = FLAG_HIDE,
2819         },
2820         {
2821                 .label          = "lpq command",
2822                 .type           = P_STRING,
2823                 .p_class        = P_LOCAL,
2824                 .ptr            = &sDefault.szLpqcommand,
2825                 .special        = NULL,
2826                 .enum_list      = NULL,
2827                 .flags