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