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