s3-param Remove special case for lp_workgroup()
[kai/samba.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 *szRealmUpper;
163         char *szDnsDomain;
164         char *szAfsUsernameMap;
165         int iAfsTokenLifetime;
166         char *szLogNtTokenCommand;
167         char *szUsernameMap;
168         char *szLogonScript;
169         char *szLogonPath;
170         char *szLogonDrive;
171         char *szLogonHome;
172         char **szWINSservers;
173         char **szInterfaces;
174         char *szRemoteAnnounce;
175         char *szRemoteBrowseSync;
176         char *szSocketAddress;
177         bool bNmbdBindExplicitBroadcast;
178         char *szNISHomeMapName;
179         char *szAnnounceVersion;        /* This is initialised in init_globals */
180         char *szWorkgroup;
181         char *szNetbiosName;
182         char **szNetbiosAliases;
183         char *szNetbiosScope;
184         char *szNameResolveOrder;
185         char *szPanicAction;
186         char *szAddUserScript;
187         char *szRenameUserScript;
188         char *szDelUserScript;
189         char *szAddGroupScript;
190         char *szDelGroupScript;
191         char *szAddUserToGroupScript;
192         char *szDelUserFromGroupScript;
193         char *szSetPrimaryGroupScript;
194         char *szAddMachineScript;
195         char *szShutdownScript;
196         char *szAbortShutdownScript;
197         char *szUsernameMapScript;
198         int iUsernameMapCacheTime;
199         char *szCheckPasswordScript;
200         char *szWINSHook;
201         char *szUtmpDir;
202         char *szWtmpDir;
203         bool bUtmp;
204         char *szIdmapUID;
205         char *szIdmapGID;
206         bool bPassdbExpandExplicit;
207         int AlgorithmicRidBase;
208         char *szTemplateHomedir;
209         char *szTemplateShell;
210         char *szWinbindSeparator;
211         bool bWinbindEnumUsers;
212         bool bWinbindEnumGroups;
213         bool bWinbindUseDefaultDomain;
214         bool bWinbindTrustedDomainsOnly;
215         bool bWinbindNestedGroups;
216         int  winbind_expand_groups;
217         bool bWinbindRefreshTickets;
218         bool bWinbindOfflineLogon;
219         bool bWinbindNormalizeNames;
220         bool bWinbindRpcOnly;
221         bool bCreateKrb5Conf;
222         int winbindMaxDomainConnections;
223         char *szIdmapBackend;
224         bool bIdmapReadOnly;
225         char *szAddShareCommand;
226         char *szChangeShareCommand;
227         char *szDeleteShareCommand;
228         char **szEventLogs;
229         char *szGuestaccount;
230         char *szManglingMethod;
231         char **szServicesList;
232         char *szUsersharePath;
233         char *szUsershareTemplateShare;
234         char **szUsersharePrefixAllowList;
235         char **szUsersharePrefixDenyList;
236         int mangle_prefix;
237         int max_log_size;
238         char *szLogLevel;
239         int max_xmit;
240         int max_mux;
241         int max_open_files;
242         int open_files_db_hash_size;
243         int pwordlevel;
244         int unamelevel;
245         int deadtime;
246         bool getwd_cache;
247         int maxprotocol;
248         int minprotocol;
249         int security;
250         char **AuthMethods;
251         bool paranoid_server_security;
252         int maxdisksize;
253         int lpqcachetime;
254         int iMaxSmbdProcesses;
255         bool bDisableSpoolss;
256         int syslog;
257         int os_level;
258         bool enhanced_browsing;
259         int max_ttl;
260         int max_wins_ttl;
261         int min_wins_ttl;
262         int lm_announce;
263         int lm_interval;
264         int announce_as;        /* This is initialised in init_globals */
265         int machine_password_timeout;
266         int map_to_guest;
267         int oplock_break_wait_time;
268         int winbind_cache_time;
269         int winbind_reconnect_delay;
270         int winbind_max_clients;
271         char **szWinbindNssInfo;
272         int iLockSpinTime;
273         char *szLdapMachineSuffix;
274         char *szLdapUserSuffix;
275         char *szLdapIdmapSuffix;
276         char *szLdapGroupSuffix;
277         int ldap_ssl;
278         bool ldap_ssl_ads;
279         int ldap_deref;
280         int ldap_follow_referral;
281         char *szLdapSuffix;
282         char *szLdapAdminDn;
283         int ldap_debug_level;
284         int ldap_debug_threshold;
285         int iAclCompat;
286         char *szCupsServer;
287         int CupsEncrypt;
288         char *szIPrintServer;
289         char *ctdbdSocket;
290         char **szClusterAddresses;
291         bool clustering;
292         int ctdb_timeout;
293         int ctdb_locktime_warn_threshold;
294         int ldap_passwd_sync;
295         int ldap_replication_sleep;
296         int ldap_timeout; /* This is initialised in init_globals */
297         int ldap_connection_timeout;
298         int ldap_page_size;
299         bool ldap_delete_dn;
300         bool bMsAddPrinterWizard;
301         bool bDNSproxy;
302         bool bWINSsupport;
303         bool bWINSproxy;
304         bool bLocalMaster;
305         int  iPreferredMaster;
306         int iDomainMaster;
307         bool bDomainLogons;
308         char **szInitLogonDelayedHosts;
309         int InitLogonDelay;
310         bool bEncryptPasswords;
311         bool bUpdateEncrypt;
312         int  clientSchannel;
313         int  serverSchannel;
314         bool bNullPasswords;
315         bool bObeyPamRestrictions;
316         bool bLoadPrinters;
317         int PrintcapCacheTime;
318         bool bLargeReadwrite;
319         bool bReadRaw;
320         bool bWriteRaw;
321         bool bSyslogOnly;
322         bool bBrowseList;
323         bool bNISHomeMap;
324         bool bTimeServer;
325         bool bBindInterfacesOnly;
326         bool bPamPasswordChange;
327         bool bUnixPasswdSync;
328         bool bPasswdChatDebug;
329         int iPasswdChatTimeout;
330         bool bTimestampLogs;
331         bool bNTSmbSupport;
332         bool bNTPipeSupport;
333         bool bNTStatusSupport;
334         bool bStatCache;
335         int iMaxStatCacheSize;
336         bool bKernelOplocks;
337         bool bAllowTrustedDomains;
338         bool bLanmanAuth;
339         bool bNTLMAuth;
340         bool bUseSpnego;
341         bool bClientLanManAuth;
342         bool bClientNTLMv2Auth;
343         bool bClientPlaintextAuth;
344         bool bClientUseSpnego;
345         bool client_use_spnego_principal;
346         bool send_spnego_principal;
347         bool bDebugPrefixTimestamp;
348         bool bDebugHiresTimestamp;
349         bool bDebugPid;
350         bool bDebugUid;
351         bool bDebugClass;
352         bool bEnableCoreFiles;
353         bool bHostMSDfs;
354         bool bUseMmap;
355         bool bHostnameLookups;
356         bool bUnixExtensions;
357         bool bDisableNetbios;
358         char * szDedicatedKeytabFile;
359         int  iKerberosMethod;
360         bool bDeferSharingViolations;
361         bool bEnablePrivileges;
362         bool bASUSupport;
363         bool bUsershareOwnerOnly;
364         bool bUsershareAllowGuests;
365         bool bRegistryShares;
366         int restrict_anonymous;
367         int name_cache_timeout;
368         int client_signing;
369         int server_signing;
370         int client_ldap_sasl_wrapping;
371         int iUsershareMaxShares;
372         int iIdmapCacheTime;
373         int iIdmapNegativeCacheTime;
374         bool bResetOnZeroVC;
375         bool bLogWriteableFilesOnExit;
376         int iKeepalive;
377         int iminreceivefile;
378         struct param_opt_struct *param_opt;
379         int cups_connection_timeout;
380         char *szSMBPerfcountModule;
381         bool bMapUntrustedToDomain;
382         bool bAsyncSMBEchoHandler;
383         bool bMulticastDnsRegister;
384         int ismb2_max_read;
385         int ismb2_max_write;
386         int ismb2_max_trans;
387         int ismb2_max_credits;
388         char *ncalrpc_dir;
389 };
390
391 static struct global Globals;
392
393 /*
394  * This structure describes a single service.
395  */
396 struct service {
397         bool valid;
398         bool autoloaded;
399         int usershare;
400         struct timespec usershare_last_mod;
401         char *szService;
402         char *szPath;
403         char *szUsername;
404         char **szInvalidUsers;
405         char **szValidUsers;
406         char **szAdminUsers;
407         char *szCopy;
408         char *szInclude;
409         char *szPreExec;
410         char *szPostExec;
411         char *szRootPreExec;
412         char *szRootPostExec;
413         char *szCupsOptions;
414         char *szPrintcommand;
415         char *szLpqcommand;
416         char *szLprmcommand;
417         char *szLppausecommand;
418         char *szLpresumecommand;
419         char *szQueuepausecommand;
420         char *szQueueresumecommand;
421         char *szPrintername;
422         char *szPrintjobUsername;
423         char *szDontdescend;
424         char **szHostsallow;
425         char **szHostsdeny;
426         char *szMagicScript;
427         char *szMagicOutput;
428         char *szVetoFiles;
429         char *szHideFiles;
430         char *szVetoOplockFiles;
431         char *comment;
432         char *force_user;
433         char *force_group;
434         char **readlist;
435         char **writelist;
436         char **printer_admin;
437         char *volume;
438         char *fstype;
439         char **szVfsObjects;
440         char *szMSDfsProxy;
441         char *szAioWriteBehind;
442         char *szDfree;
443         int iMinPrintSpace;
444         int iMaxPrintJobs;
445         int iMaxReportedPrintJobs;
446         int iWriteCacheSize;
447         int iCreate_mask;
448         int iCreate_force_mode;
449         int iSecurity_mask;
450         int iSecurity_force_mode;
451         int iDir_mask;
452         int iDir_force_mode;
453         int iDir_Security_mask;
454         int iDir_Security_force_mode;
455         int iMaxConnections;
456         int iDefaultCase;
457         int iPrinting;
458         int iOplockContentionLimit;
459         int iCSCPolicy;
460         int iBlock_size;
461         int iDfreeCacheTime;
462         bool bPreexecClose;
463         bool bRootpreexecClose;
464         int  iCaseSensitive;
465         bool bCasePreserve;
466         bool bShortCasePreserve;
467         bool bHideDotFiles;
468         bool bHideSpecialFiles;
469         bool bHideUnReadable;
470         bool bHideUnWriteableFiles;
471         bool bBrowseable;
472         bool bAccessBasedShareEnum;
473         bool bAvailable;
474         bool bRead_only;
475         bool bNo_set_dir;
476         bool bGuest_only;
477         bool bAdministrative_share;
478         bool bGuest_ok;
479         bool bPrint_ok;
480         bool bPrintNotifyBackchannel;
481         bool bMap_system;
482         bool bMap_hidden;
483         bool bMap_archive;
484         bool bStoreDosAttributes;
485         bool bDmapiSupport;
486         bool bLocking;
487         int iStrictLocking;
488         bool bPosixLocking;
489         bool bShareModes;
490         bool bOpLocks;
491         bool bLevel2OpLocks;
492         bool bOnlyUser;
493         bool bMangledNames;
494         bool bWidelinks;
495         bool bSymlinks;
496         bool bSyncAlways;
497         bool bStrictAllocate;
498         bool bStrictSync;
499         char magic_char;
500         struct bitmap *copymap;
501         bool bDeleteReadonly;
502         bool bFakeOplocks;
503         bool bDeleteVetoFiles;
504         bool bDosFilemode;
505         bool bDosFiletimes;
506         bool bDosFiletimeResolution;
507         bool bFakeDirCreateTimes;
508         bool bBlockingLocks;
509         bool bInheritPerms;
510         bool bInheritACLS;
511         bool bInheritOwner;
512         bool bMSDfsRoot;
513         bool bUseClientDriver;
514         bool bDefaultDevmode;
515         bool bForcePrintername;
516         bool bNTAclSupport;
517         bool bForceUnknownAclUser;
518         bool bUseSendfile;
519         bool bProfileAcls;
520         bool bMap_acl_inherit;
521         bool bAfs_Share;
522         bool bEASupport;
523         bool bAclCheckPermissions;
524         bool bAclMapFullControl;
525         bool bAclGroupControl;
526         bool bChangeNotify;
527         bool bKernelChangeNotify;
528         int iallocation_roundup_size;
529         int iAioReadSize;
530         int iAioWriteSize;
531         int iMap_readonly;
532         int iDirectoryNameCacheSize;
533         int ismb_encrypt;
534         struct param_opt_struct *param_opt;
535
536         char dummy[3];          /* for alignment */
537 };
538
539
540 /* This is a default service used to prime a services structure */
541 static struct service sDefault = {
542         True,                   /* valid */
543         False,                  /* not autoloaded */
544         0,                      /* not a usershare */
545         {0, },                  /* No last mod time */
546         NULL,                   /* szService */
547         NULL,                   /* szPath */
548         NULL,                   /* szUsername */
549         NULL,                   /* szInvalidUsers */
550         NULL,                   /* szValidUsers */
551         NULL,                   /* szAdminUsers */
552         NULL,                   /* szCopy */
553         NULL,                   /* szInclude */
554         NULL,                   /* szPreExec */
555         NULL,                   /* szPostExec */
556         NULL,                   /* szRootPreExec */
557         NULL,                   /* szRootPostExec */
558         NULL,                   /* szCupsOptions */
559         NULL,                   /* szPrintcommand */
560         NULL,                   /* szLpqcommand */
561         NULL,                   /* szLprmcommand */
562         NULL,                   /* szLppausecommand */
563         NULL,                   /* szLpresumecommand */
564         NULL,                   /* szQueuepausecommand */
565         NULL,                   /* szQueueresumecommand */
566         NULL,                   /* szPrintername */
567         NULL,                   /* szPrintjobUsername */
568         NULL,                   /* szDontdescend */
569         NULL,                   /* szHostsallow */
570         NULL,                   /* szHostsdeny */
571         NULL,                   /* szMagicScript */
572         NULL,                   /* szMagicOutput */
573         NULL,                   /* szVetoFiles */
574         NULL,                   /* szHideFiles */
575         NULL,                   /* szVetoOplockFiles */
576         NULL,                   /* comment */
577         NULL,                   /* force user */
578         NULL,                   /* force group */
579         NULL,                   /* readlist */
580         NULL,                   /* writelist */
581         NULL,                   /* printer admin */
582         NULL,                   /* volume */
583         NULL,                   /* fstype */
584         NULL,                   /* vfs objects */
585         NULL,                   /* szMSDfsProxy */
586         NULL,                   /* szAioWriteBehind */
587         NULL,                   /* szDfree */
588         0,                      /* iMinPrintSpace */
589         1000,                   /* iMaxPrintJobs */
590         0,                      /* iMaxReportedPrintJobs */
591         0,                      /* iWriteCacheSize */
592         0744,                   /* iCreate_mask */
593         0000,                   /* iCreate_force_mode */
594         0777,                   /* iSecurity_mask */
595         0,                      /* iSecurity_force_mode */
596         0755,                   /* iDir_mask */
597         0000,                   /* iDir_force_mode */
598         0777,                   /* iDir_Security_mask */
599         0,                      /* iDir_Security_force_mode */
600         0,                      /* iMaxConnections */
601         CASE_LOWER,             /* iDefaultCase */
602         DEFAULT_PRINTING,       /* iPrinting */
603         2,                      /* iOplockContentionLimit */
604         0,                      /* iCSCPolicy */
605         1024,                   /* iBlock_size */
606         0,                      /* iDfreeCacheTime */
607         False,                  /* bPreexecClose */
608         False,                  /* bRootpreexecClose */
609         Auto,                   /* case sensitive */
610         True,                   /* case preserve */
611         True,                   /* short case preserve */
612         True,                   /* bHideDotFiles */
613         False,                  /* bHideSpecialFiles */
614         False,                  /* bHideUnReadable */
615         False,                  /* bHideUnWriteableFiles */
616         True,                   /* bBrowseable */
617         False,                  /* bAccessBasedShareEnum */
618         True,                   /* bAvailable */
619         True,                   /* bRead_only */
620         True,                   /* bNo_set_dir */
621         False,                  /* bGuest_only */
622         False,                  /* bAdministrative_share */
623         False,                  /* bGuest_ok */
624         False,                  /* bPrint_ok */
625         True,                   /* bPrintNotifyBackchannel */
626         False,                  /* bMap_system */
627         False,                  /* bMap_hidden */
628         True,                   /* bMap_archive */
629         False,                  /* bStoreDosAttributes */
630         False,                  /* bDmapiSupport */
631         True,                   /* bLocking */
632         Auto,                   /* iStrictLocking */
633         True,                   /* bPosixLocking */
634         True,                   /* bShareModes */
635         True,                   /* bOpLocks */
636         True,                   /* bLevel2OpLocks */
637         False,                  /* bOnlyUser */
638         True,                   /* bMangledNames */
639         false,                  /* bWidelinks */
640         True,                   /* bSymlinks */
641         False,                  /* bSyncAlways */
642         False,                  /* bStrictAllocate */
643         False,                  /* bStrictSync */
644         '~',                    /* magic char */
645         NULL,                   /* copymap */
646         False,                  /* bDeleteReadonly */
647         False,                  /* bFakeOplocks */
648         False,                  /* bDeleteVetoFiles */
649         False,                  /* bDosFilemode */
650         True,                   /* bDosFiletimes */
651         False,                  /* bDosFiletimeResolution */
652         False,                  /* bFakeDirCreateTimes */
653         True,                   /* bBlockingLocks */
654         False,                  /* bInheritPerms */
655         False,                  /* bInheritACLS */
656         False,                  /* bInheritOwner */
657         False,                  /* bMSDfsRoot */
658         False,                  /* bUseClientDriver */
659         True,                   /* bDefaultDevmode */
660         False,                  /* bForcePrintername */
661         True,                   /* bNTAclSupport */
662         False,                  /* bForceUnknownAclUser */
663         False,                  /* bUseSendfile */
664         False,                  /* bProfileAcls */
665         False,                  /* bMap_acl_inherit */
666         False,                  /* bAfs_Share */
667         False,                  /* bEASupport */
668         True,                   /* bAclCheckPermissions */
669         True,                   /* bAclMapFullControl */
670         False,                  /* bAclGroupControl */
671         True,                   /* bChangeNotify */
672         True,                   /* bKernelChangeNotify */
673         SMB_ROUNDUP_ALLOCATION_SIZE,            /* iallocation_roundup_size */
674         0,                      /* iAioReadSize */
675         0,                      /* iAioWriteSize */
676         MAP_READONLY_YES,       /* iMap_readonly */
677 #ifdef BROKEN_DIRECTORY_HANDLING
678         0,                      /* iDirectoryNameCacheSize */
679 #else
680         100,                    /* iDirectoryNameCacheSize */
681 #endif
682         Auto,                   /* ismb_encrypt */
683         NULL,                   /* Parametric options */
684
685         ""                      /* dummy */
686 };
687
688 /* local variables */
689 static struct service **ServicePtrs = NULL;
690 static int iNumServices = 0;
691 static int iServiceIndex = 0;
692 static struct db_context *ServiceHash;
693 static int *invalid_services = NULL;
694 static int num_invalid_services = 0;
695 static bool bInGlobalSection = True;
696 static bool bGlobalOnly = False;
697 static int default_server_announce;
698
699 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
700
701 /* prototypes for the special type handlers */
702 static bool handle_include( int snum, const char *pszParmValue, char **ptr);
703 static bool handle_copy( int snum, const char *pszParmValue, char **ptr);
704 static bool handle_netbios_name( int snum, const char *pszParmValue, char **ptr);
705 static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr);
706 static bool handle_idmap_uid( int snum, const char *pszParmValue, char **ptr);
707 static bool handle_idmap_gid( int snum, const char *pszParmValue, char **ptr);
708 static bool handle_debug_list( int snum, const char *pszParmValue, char **ptr );
709 static bool handle_realm( int snum, const char *pszParmValue, char **ptr );
710 static bool handle_netbios_aliases( int snum, const char *pszParmValue, char **ptr );
711 static bool handle_netbios_scope( int snum, const char *pszParmValue, char **ptr );
712 static bool handle_charset( int snum, const char *pszParmValue, char **ptr );
713 static bool handle_dos_charset( int snum, const char *pszParmValue, char **ptr );
714 static bool handle_printing( int snum, const char *pszParmValue, char **ptr);
715 static bool handle_ldap_debug_level( int snum, const char *pszParmValue, char **ptr);
716
717 static void set_default_server_announce_type(void);
718 static void set_allowed_client_auth(void);
719
720 static void *lp_local_ptr(struct service *service, void *ptr);
721
722 static void add_to_file_list(const char *fname, const char *subfname);
723 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
724
725 static const struct enum_list enum_protocol[] = {
726         {PROTOCOL_SMB2, "SMB2"},
727         {PROTOCOL_NT1, "NT1"},
728         {PROTOCOL_LANMAN2, "LANMAN2"},
729         {PROTOCOL_LANMAN1, "LANMAN1"},
730         {PROTOCOL_CORE, "CORE"},
731         {PROTOCOL_COREPLUS, "COREPLUS"},
732         {PROTOCOL_COREPLUS, "CORE+"},
733         {-1, NULL}
734 };
735
736 static const struct enum_list enum_security[] = {
737         {SEC_SHARE, "SHARE"},
738         {SEC_USER, "USER"},
739         {SEC_SERVER, "SERVER"},
740         {SEC_DOMAIN, "DOMAIN"},
741 #ifdef HAVE_ADS
742         {SEC_ADS, "ADS"},
743 #endif
744         {-1, NULL}
745 };
746
747 static const struct enum_list enum_printing[] = {
748         {PRINT_SYSV, "sysv"},
749         {PRINT_AIX, "aix"},
750         {PRINT_HPUX, "hpux"},
751         {PRINT_BSD, "bsd"},
752         {PRINT_QNX, "qnx"},
753         {PRINT_PLP, "plp"},
754         {PRINT_LPRNG, "lprng"},
755         {PRINT_CUPS, "cups"},
756         {PRINT_IPRINT, "iprint"},
757         {PRINT_LPRNT, "nt"},
758         {PRINT_LPROS2, "os2"},
759 #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS)
760         {PRINT_TEST, "test"},
761         {PRINT_VLP, "vlp"},
762 #endif /* DEVELOPER */
763         {-1, NULL}
764 };
765
766 static const struct enum_list enum_ldap_sasl_wrapping[] = {
767         {0, "plain"},
768         {ADS_AUTH_SASL_SIGN, "sign"},
769         {ADS_AUTH_SASL_SEAL, "seal"},
770         {-1, NULL}
771 };
772
773 static const struct enum_list enum_ldap_ssl[] = {
774         {LDAP_SSL_OFF, "no"},
775         {LDAP_SSL_OFF, "off"},
776         {LDAP_SSL_START_TLS, "start tls"},
777         {LDAP_SSL_START_TLS, "start_tls"},
778         {-1, NULL}
779 };
780
781 /* LDAP Dereferencing Alias types */
782 #define SAMBA_LDAP_DEREF_NEVER          0
783 #define SAMBA_LDAP_DEREF_SEARCHING      1
784 #define SAMBA_LDAP_DEREF_FINDING        2
785 #define SAMBA_LDAP_DEREF_ALWAYS         3
786
787 static const struct enum_list enum_ldap_deref[] = {
788         {SAMBA_LDAP_DEREF_NEVER, "never"},
789         {SAMBA_LDAP_DEREF_SEARCHING, "searching"},
790         {SAMBA_LDAP_DEREF_FINDING, "finding"},
791         {SAMBA_LDAP_DEREF_ALWAYS, "always"},
792         {-1, "auto"}
793 };
794
795 static const struct enum_list enum_ldap_passwd_sync[] = {
796         {LDAP_PASSWD_SYNC_OFF, "no"},
797         {LDAP_PASSWD_SYNC_OFF, "off"},
798         {LDAP_PASSWD_SYNC_ON, "yes"},
799         {LDAP_PASSWD_SYNC_ON, "on"},
800         {LDAP_PASSWD_SYNC_ONLY, "only"},
801         {-1, NULL}
802 };
803
804 /* Types of machine we can announce as. */
805 #define ANNOUNCE_AS_NT_SERVER 1
806 #define ANNOUNCE_AS_WIN95 2
807 #define ANNOUNCE_AS_WFW 3
808 #define ANNOUNCE_AS_NT_WORKSTATION 4
809
810 static const struct enum_list enum_announce_as[] = {
811         {ANNOUNCE_AS_NT_SERVER, "NT"},
812         {ANNOUNCE_AS_NT_SERVER, "NT Server"},
813         {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"},
814         {ANNOUNCE_AS_WIN95, "win95"},
815         {ANNOUNCE_AS_WFW, "WfW"},
816         {-1, NULL}
817 };
818
819 static const struct enum_list enum_map_readonly[] = {
820         {MAP_READONLY_NO, "no"},
821         {MAP_READONLY_NO, "false"},
822         {MAP_READONLY_NO, "0"},
823         {MAP_READONLY_YES, "yes"},
824         {MAP_READONLY_YES, "true"},
825         {MAP_READONLY_YES, "1"},
826         {MAP_READONLY_PERMISSIONS, "permissions"},
827         {MAP_READONLY_PERMISSIONS, "perms"},
828         {-1, NULL}
829 };
830
831 static const struct enum_list enum_case[] = {
832         {CASE_LOWER, "lower"},
833         {CASE_UPPER, "upper"},
834         {-1, NULL}
835 };
836
837
838
839 static const struct enum_list enum_bool_auto[] = {
840         {False, "No"},
841         {False, "False"},
842         {False, "0"},
843         {True, "Yes"},
844         {True, "True"},
845         {True, "1"},
846         {Auto, "Auto"},
847         {-1, NULL}
848 };
849
850 static const struct enum_list enum_csc_policy[] = {
851         {CSC_POLICY_MANUAL, "manual"},
852         {CSC_POLICY_DOCUMENTS, "documents"},
853         {CSC_POLICY_PROGRAMS, "programs"},
854         {CSC_POLICY_DISABLE, "disable"},
855         {-1, NULL}
856 };
857
858 /* SMB signing types. */
859 static const struct enum_list enum_smb_signing_vals[] = {
860         {False, "No"},
861         {False, "False"},
862         {False, "0"},
863         {False, "Off"},
864         {False, "disabled"},
865         {True, "Yes"},
866         {True, "True"},
867         {True, "1"},
868         {True, "On"},
869         {True, "enabled"},
870         {Auto, "auto"},
871         {Required, "required"},
872         {Required, "mandatory"},
873         {Required, "force"},
874         {Required, "forced"},
875         {Required, "enforced"},
876         {-1, NULL}
877 };
878
879 /* ACL compatibility options. */
880 static const struct enum_list enum_acl_compat_vals[] = {
881     { ACL_COMPAT_AUTO, "auto" },
882     { ACL_COMPAT_WINNT, "winnt" },
883     { ACL_COMPAT_WIN2K, "win2k" },
884     { -1, NULL}
885 };
886
887 /* 
888    Do you want session setups at user level security with a invalid
889    password to be rejected or allowed in as guest? WinNT rejects them
890    but it can be a pain as it means "net view" needs to use a password
891
892    You have 3 choices in the setting of map_to_guest:
893
894    "Never" means session setups with an invalid password
895    are rejected. This is the default.
896
897    "Bad User" means session setups with an invalid password
898    are rejected, unless the username does not exist, in which case it
899    is treated as a guest login
900
901    "Bad Password" means session setups with an invalid password
902    are treated as a guest login
903
904    Note that map_to_guest only has an effect in user or server
905    level security.
906 */
907
908 static const struct enum_list enum_map_to_guest[] = {
909         {NEVER_MAP_TO_GUEST, "Never"},
910         {MAP_TO_GUEST_ON_BAD_USER, "Bad User"},
911         {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"},
912         {MAP_TO_GUEST_ON_BAD_UID, "Bad Uid"},
913         {-1, NULL}
914 };
915
916 /* Config backend options */
917
918 static const struct enum_list enum_config_backend[] = {
919         {CONFIG_BACKEND_FILE, "file"},
920         {CONFIG_BACKEND_REGISTRY, "registry"},
921         {-1, NULL}
922 };
923
924 /* ADS kerberos ticket verification options */
925
926 static const struct enum_list enum_kerberos_method[] = {
927         {KERBEROS_VERIFY_SECRETS, "default"},
928         {KERBEROS_VERIFY_SECRETS, "secrets only"},
929         {KERBEROS_VERIFY_SYSTEM_KEYTAB, "system keytab"},
930         {KERBEROS_VERIFY_DEDICATED_KEYTAB, "dedicated keytab"},
931         {KERBEROS_VERIFY_SECRETS_AND_KEYTAB, "secrets and keytab"},
932         {-1, NULL}
933 };
934
935 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
936  *
937  * The FLAG_HIDE is explicit. Parameters set this way do NOT appear in any edit
938  * screen in SWAT. This is used to exclude parameters as well as to squash all
939  * parameters that have been duplicated by pseudonyms.
940  *
941  * NOTE: To display a parameter in BASIC view set FLAG_BASIC
942  *       Any parameter that does NOT have FLAG_ADVANCED will not disply at all
943  *       Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in
944  *        respective views.
945  *
946  * NOTE2: Handling of duplicated (synonym) parameters:
947  *      Only the first occurance of a parameter should be enabled by FLAG_BASIC
948  *      and/or FLAG_ADVANCED. All duplicates following the first mention should be
949  *      set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred
950  *      name first, and all synonyms must follow it with the FLAG_HIDE attribute.
951  */
952
953 static struct parm_struct parm_table[] = {
954         {N_("Base Options"), P_SEP, P_SEPARATOR},
955
956         {
957                 .label          = "dos charset",
958                 .type           = P_STRING,
959                 .p_class        = P_GLOBAL,
960                 .ptr            = &Globals.dos_charset,
961                 .special        = handle_dos_charset,
962                 .enum_list      = NULL,
963                 .flags          = FLAG_ADVANCED
964         },
965         {
966                 .label          = "unix charset",
967                 .type           = P_STRING,
968                 .p_class        = P_GLOBAL,
969                 .ptr            = &Globals.unix_charset,
970                 .special        = handle_charset,
971                 .enum_list      = NULL,
972                 .flags          = FLAG_ADVANCED
973         },
974         {
975                 .label          = "display charset",
976                 .type           = P_STRING,
977                 .p_class        = P_GLOBAL,
978                 .ptr            = &Globals.display_charset,
979                 .special        = handle_charset,
980                 .enum_list      = NULL,
981                 .flags          = FLAG_ADVANCED
982         },
983         {
984                 .label          = "comment",
985                 .type           = P_STRING,
986                 .p_class        = P_LOCAL,
987                 .ptr            = &sDefault.comment,
988                 .special        = NULL,
989                 .enum_list      = NULL,
990                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT
991         },
992         {
993                 .label          = "path",
994                 .type           = P_STRING,
995                 .p_class        = P_LOCAL,
996                 .ptr            = &sDefault.szPath,
997                 .special        = NULL,
998                 .enum_list      = NULL,
999                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1000         },
1001         {
1002                 .label          = "directory",
1003                 .type           = P_STRING,
1004                 .p_class        = P_LOCAL,
1005                 .ptr            = &sDefault.szPath,
1006                 .special        = NULL,
1007                 .enum_list      = NULL,
1008                 .flags          = FLAG_HIDE,
1009         },
1010         {
1011                 .label          = "workgroup",
1012                 .type           = P_USTRING,
1013                 .p_class        = P_GLOBAL,
1014                 .ptr            = &Globals.szWorkgroup,
1015                 .special        = NULL,
1016                 .enum_list      = NULL,
1017                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1018         },
1019         {
1020                 .label          = "realm",
1021                 .type           = P_USTRING,
1022                 .p_class        = P_GLOBAL,
1023                 .ptr            = &Globals.szRealm,
1024                 .special        = handle_realm,
1025                 .enum_list      = NULL,
1026                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1027         },
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          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2828         },
2829         {
2830                 .label          = "lprm command",
2831                 .type           = P_STRING,
2832                 .p_class        = P_LOCAL,
2833                 .ptr            = &sDefault.szLprmcommand,
2834                 .special        = NULL,
2835                 .enum_list      = NULL,
2836                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2837         },
2838         {
2839                 .label          = "lppause command",
2840                 .type           = P_STRING,
2841                 .p_class        = P_LOCAL,
2842                 .ptr            = &sDefault.szLppausecommand,
2843                 .special        = NULL,
2844                 .enum_list      = NULL,
2845                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2846         },
2847         {
2848                 .label          = "lpresume command",
2849                 .type           = P_STRING,
2850                 .p_class        = P_LOCAL,
2851                 .ptr            = &sDefault.szLpresumecommand,
2852                 .special        = NULL,
2853                 .enum_list      = NULL,
2854                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2855         },
2856         {
2857                 .label          = "queuepause command",
2858                 .type           = P_STRING,
2859                 .p_class        = P_LOCAL,
2860                 .ptr            = &sDefault.szQueuepausecommand,
2861                 .special        = NULL,
2862                 .enum_list      = NULL,
2863                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2864         },
2865         {
2866                 .label          = "queueresume command",
2867                 .type           = P_STRING,
2868                 .p_class        = P_LOCAL,
2869                 .ptr            = &sDefault.szQueueresumecommand,
2870                 .special        = NULL,
2871                 .enum_list      = NULL,
2872                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2873         },
2874         {
2875                 .label          = "addport command",
2876                 .type           = P_STRING,
2877                 .p_class        = P_GLOBAL,
2878                 .ptr            = &Globals.szAddPortCommand,
2879                 .special        = NULL,
2880                 .enum_list      = NULL,
2881                 .flags          = FLAG_ADVANCED,
2882         },
2883         {
2884                 .label          = "enumports command",
2885                 .type           = P_STRING,
2886                 .p_class        = P_GLOBAL,
2887                 .ptr            = &Globals.szEnumPortsCommand,
2888                 .special        = NULL,
2889                 .enum_list      = NULL,
2890                 .flags          = FLAG_ADVANCED,
2891         },
2892         {
2893                 .label          = "addprinter command",
2894                 .type           = P_STRING,
2895                 .p_class        = P_GLOBAL,
2896                 .ptr            = &Globals.szAddPrinterCommand,
2897                 .special        = NULL,
2898                 .enum_list      = NULL,
2899                 .flags          = FLAG_ADVANCED,
2900         },
2901         {
2902                 .label          = "deleteprinter command",
2903                 .type           = P_STRING,
2904                 .p_class        = P_GLOBAL,
2905                 .ptr            = &Globals.szDeletePrinterCommand,
2906                 .special        = NULL,
2907                 .enum_list      = NULL,
2908                 .flags          = FLAG_ADVANCED,
2909         },
2910         {
2911                 .label          = "show add printer wizard",
2912                 .type           = P_BOOL,
2913                 .p_class        = P_GLOBAL,
2914                 .ptr            = &Globals.bMsAddPrinterWizard,
2915                 .special        = NULL,
2916                 .enum_list      = NULL,
2917                 .flags          = FLAG_ADVANCED,
2918         },
2919         {
2920                 .label          = "os2 driver map",
2921                 .type           = P_STRING,
2922                 .p_class        = P_GLOBAL,
2923                 .ptr            = &Globals.szOs2DriverMap,
2924                 .special        = NULL,
2925                 .enum_list      = NULL,
2926                 .flags          = FLAG_ADVANCED,
2927         },
2928
2929         {
2930                 .label          = "printer name",
2931                 .type           = P_STRING,
2932                 .p_class        = P_LOCAL,
2933                 .ptr            = &sDefault.szPrintername,
2934                 .special        = NULL,
2935                 .enum_list      = NULL,
2936                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2937         },
2938         {
2939                 .label          = "printer",
2940                 .type           = P_STRING,
2941                 .p_class        = P_LOCAL,
2942                 .ptr            = &sDefault.szPrintername,
2943                 .special        = NULL,
2944                 .enum_list      = NULL,
2945                 .flags          = FLAG_HIDE,
2946         },
2947         {
2948                 .label          = "use client driver",