s3-param: fix set_inherit_acls().
[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_follow_referral;
263         char *szLdapSuffix;
264         char *szLdapAdminDn;
265         int ldap_debug_level;
266         int ldap_debug_threshold;
267         int iAclCompat;
268         char *szCupsServer;
269         int CupsEncrypt;
270         char *szIPrintServer;
271         char *ctdbdSocket;
272         char **szClusterAddresses;
273         bool clustering;
274         int ctdb_timeout;
275         int ldap_passwd_sync;
276         int ldap_replication_sleep;
277         int ldap_timeout; /* This is initialised in init_globals */
278         int ldap_connection_timeout;
279         int ldap_page_size;
280         bool ldap_delete_dn;
281         bool bMsAddPrinterWizard;
282         bool bDNSproxy;
283         bool bWINSsupport;
284         bool bWINSproxy;
285         bool bLocalMaster;
286         int  iPreferredMaster;
287         int iDomainMaster;
288         bool bDomainLogons;
289         char **szInitLogonDelayedHosts;
290         int InitLogonDelay;
291         bool bEncryptPasswords;
292         bool bUpdateEncrypt;
293         int  clientSchannel;
294         int  serverSchannel;
295         bool bNullPasswords;
296         bool bObeyPamRestrictions;
297         bool bLoadPrinters;
298         int PrintcapCacheTime;
299         bool bLargeReadwrite;
300         bool bReadRaw;
301         bool bWriteRaw;
302         bool bSyslogOnly;
303         bool bBrowseList;
304         bool bNISHomeMap;
305         bool bTimeServer;
306         bool bBindInterfacesOnly;
307         bool bPamPasswordChange;
308         bool bUnixPasswdSync;
309         bool bPasswdChatDebug;
310         int iPasswdChatTimeout;
311         bool bTimestampLogs;
312         bool bNTSmbSupport;
313         bool bNTPipeSupport;
314         bool bNTStatusSupport;
315         bool bStatCache;
316         int iMaxStatCacheSize;
317         bool bKernelOplocks;
318         bool bAllowTrustedDomains;
319         bool bLanmanAuth;
320         bool bNTLMAuth;
321         bool bUseSpnego;
322         bool bClientLanManAuth;
323         bool bClientNTLMv2Auth;
324         bool bClientPlaintextAuth;
325         bool bClientUseSpnego;
326         bool bDebugPrefixTimestamp;
327         bool bDebugHiresTimestamp;
328         bool bDebugPid;
329         bool bDebugUid;
330         bool bDebugClass;
331         bool bEnableCoreFiles;
332         bool bHostMSDfs;
333         bool bUseMmap;
334         bool bHostnameLookups;
335         bool bUnixExtensions;
336         bool bDisableNetbios;
337         char * szDedicatedKeytabFile;
338         int  iKerberosMethod;
339         bool bDeferSharingViolations;
340         bool bEnablePrivileges;
341         bool bASUSupport;
342         bool bUsershareOwnerOnly;
343         bool bUsershareAllowGuests;
344         bool bRegistryShares;
345         int restrict_anonymous;
346         int name_cache_timeout;
347         int client_signing;
348         int server_signing;
349         int client_ldap_sasl_wrapping;
350         int iUsershareMaxShares;
351         int iIdmapCacheTime;
352         int iIdmapNegativeCacheTime;
353         bool bResetOnZeroVC;
354         int iKeepalive;
355         int iminreceivefile;
356         struct param_opt_struct *param_opt;
357         int cups_connection_timeout;
358         char *szSMBPerfcountModule;
359         bool bMapUntrustedToDomain;
360         bool bFakeDirCreateTimes;
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 bStoreCreateTime;
456         bool bStoreDosAttributes;
457         bool bDmapiSupport;
458         bool bLocking;
459         int iStrictLocking;
460         bool bPosixLocking;
461         bool bShareModes;
462         bool bOpLocks;
463         bool bLevel2OpLocks;
464         bool bOnlyUser;
465         bool bMangledNames;
466         bool bWidelinks;
467         bool bSymlinks;
468         bool bSyncAlways;
469         bool bStrictAllocate;
470         bool bStrictSync;
471         char magic_char;
472         struct bitmap *copymap;
473         bool bDeleteReadonly;
474         bool bFakeOplocks;
475         bool bDeleteVetoFiles;
476         bool bDosFilemode;
477         bool bDosFiletimes;
478         bool bDosFiletimeResolution;
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,                  /* bStoreCreateTime */
600         False,                  /* bStoreDosAttributes */
601         False,                  /* bDmapiSupport */
602         True,                   /* bLocking */
603         Auto,                   /* iStrictLocking */
604         True,                   /* bPosixLocking */
605         True,                   /* bShareModes */
606         True,                   /* bOpLocks */
607         True,                   /* bLevel2OpLocks */
608         False,                  /* bOnlyUser */
609         True,                   /* bMangledNames */
610         True,                   /* bWidelinks */
611         True,                   /* bSymlinks */
612         False,                  /* bSyncAlways */
613         False,                  /* bStrictAllocate */
614         False,                  /* bStrictSync */
615         '~',                    /* magic char */
616         NULL,                   /* copymap */
617         False,                  /* bDeleteReadonly */
618         False,                  /* bFakeOplocks */
619         False,                  /* bDeleteVetoFiles */
620         False,                  /* bDosFilemode */
621         True,                   /* bDosFiletimes */
622         False,                  /* bDosFiletimeResolution */
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 static const struct enum_list enum_ldap_passwd_sync[] = {
751         {LDAP_PASSWD_SYNC_OFF, "no"},
752         {LDAP_PASSWD_SYNC_OFF, "off"},
753         {LDAP_PASSWD_SYNC_ON, "yes"},
754         {LDAP_PASSWD_SYNC_ON, "on"},
755         {LDAP_PASSWD_SYNC_ONLY, "only"},
756         {-1, NULL}
757 };
758
759 /* Types of machine we can announce as. */
760 #define ANNOUNCE_AS_NT_SERVER 1
761 #define ANNOUNCE_AS_WIN95 2
762 #define ANNOUNCE_AS_WFW 3
763 #define ANNOUNCE_AS_NT_WORKSTATION 4
764
765 static const struct enum_list enum_announce_as[] = {
766         {ANNOUNCE_AS_NT_SERVER, "NT"},
767         {ANNOUNCE_AS_NT_SERVER, "NT Server"},
768         {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"},
769         {ANNOUNCE_AS_WIN95, "win95"},
770         {ANNOUNCE_AS_WFW, "WfW"},
771         {-1, NULL}
772 };
773
774 static const struct enum_list enum_map_readonly[] = {
775         {MAP_READONLY_NO, "no"},
776         {MAP_READONLY_NO, "false"},
777         {MAP_READONLY_NO, "0"},
778         {MAP_READONLY_YES, "yes"},
779         {MAP_READONLY_YES, "true"},
780         {MAP_READONLY_YES, "1"},
781         {MAP_READONLY_PERMISSIONS, "permissions"},
782         {MAP_READONLY_PERMISSIONS, "perms"},
783         {-1, NULL}
784 };
785
786 static const struct enum_list enum_case[] = {
787         {CASE_LOWER, "lower"},
788         {CASE_UPPER, "upper"},
789         {-1, NULL}
790 };
791
792
793
794 static const struct enum_list enum_bool_auto[] = {
795         {False, "No"},
796         {False, "False"},
797         {False, "0"},
798         {True, "Yes"},
799         {True, "True"},
800         {True, "1"},
801         {Auto, "Auto"},
802         {-1, NULL}
803 };
804
805 /* Client-side offline caching policy types */
806 #define CSC_POLICY_MANUAL 0
807 #define CSC_POLICY_DOCUMENTS 1
808 #define CSC_POLICY_PROGRAMS 2
809 #define CSC_POLICY_DISABLE 3
810
811 static const struct enum_list enum_csc_policy[] = {
812         {CSC_POLICY_MANUAL, "manual"},
813         {CSC_POLICY_DOCUMENTS, "documents"},
814         {CSC_POLICY_PROGRAMS, "programs"},
815         {CSC_POLICY_DISABLE, "disable"},
816         {-1, NULL}
817 };
818
819 /* SMB signing types. */
820 static const struct enum_list enum_smb_signing_vals[] = {
821         {False, "No"},
822         {False, "False"},
823         {False, "0"},
824         {False, "Off"},
825         {False, "disabled"},
826         {True, "Yes"},
827         {True, "True"},
828         {True, "1"},
829         {True, "On"},
830         {True, "enabled"},
831         {Auto, "auto"},
832         {Required, "required"},
833         {Required, "mandatory"},
834         {Required, "force"},
835         {Required, "forced"},
836         {Required, "enforced"},
837         {-1, NULL}
838 };
839
840 /* ACL compatibility options. */
841 static const struct enum_list enum_acl_compat_vals[] = {
842     { ACL_COMPAT_AUTO, "auto" },
843     { ACL_COMPAT_WINNT, "winnt" },
844     { ACL_COMPAT_WIN2K, "win2k" },
845     { -1, NULL}
846 };
847
848 /* 
849    Do you want session setups at user level security with a invalid
850    password to be rejected or allowed in as guest? WinNT rejects them
851    but it can be a pain as it means "net view" needs to use a password
852
853    You have 3 choices in the setting of map_to_guest:
854
855    "Never" means session setups with an invalid password
856    are rejected. This is the default.
857
858    "Bad User" means session setups with an invalid password
859    are rejected, unless the username does not exist, in which case it
860    is treated as a guest login
861
862    "Bad Password" means session setups with an invalid password
863    are treated as a guest login
864
865    Note that map_to_guest only has an effect in user or server
866    level security.
867 */
868
869 static const struct enum_list enum_map_to_guest[] = {
870         {NEVER_MAP_TO_GUEST, "Never"},
871         {MAP_TO_GUEST_ON_BAD_USER, "Bad User"},
872         {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"},
873         {MAP_TO_GUEST_ON_BAD_UID, "Bad Uid"},
874         {-1, NULL}
875 };
876
877 /* Config backend options */
878
879 static const struct enum_list enum_config_backend[] = {
880         {CONFIG_BACKEND_FILE, "file"},
881         {CONFIG_BACKEND_REGISTRY, "registry"},
882         {-1, NULL}
883 };
884
885 /* ADS kerberos ticket verification options */
886
887 static const struct enum_list enum_kerberos_method[] = {
888         {KERBEROS_VERIFY_SECRETS, "default"},
889         {KERBEROS_VERIFY_SECRETS, "secrets only"},
890         {KERBEROS_VERIFY_SYSTEM_KEYTAB, "system keytab"},
891         {KERBEROS_VERIFY_DEDICATED_KEYTAB, "dedicated keytab"},
892         {KERBEROS_VERIFY_SECRETS_AND_KEYTAB, "secrets and keytab"},
893         {-1, NULL}
894 };
895
896 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
897  *
898  * The FLAG_HIDE is explicit. Parameters set this way do NOT appear in any edit
899  * screen in SWAT. This is used to exclude parameters as well as to squash all
900  * parameters that have been duplicated by pseudonyms.
901  *
902  * NOTE: To display a parameter in BASIC view set FLAG_BASIC
903  *       Any parameter that does NOT have FLAG_ADVANCED will not disply at all
904  *       Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in
905  *        respective views.
906  *
907  * NOTE2: Handling of duplicated (synonym) parameters:
908  *      Only the first occurance of a parameter should be enabled by FLAG_BASIC
909  *      and/or FLAG_ADVANCED. All duplicates following the first mention should be
910  *      set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred
911  *      name first, and all synonyms must follow it with the FLAG_HIDE attribute.
912  */
913
914 static struct parm_struct parm_table[] = {
915         {N_("Base Options"), P_SEP, P_SEPARATOR},
916
917         {
918                 .label          = "dos charset",
919                 .type           = P_STRING,
920                 .p_class        = P_GLOBAL,
921                 .ptr            = &Globals.dos_charset,
922                 .special        = handle_charset,
923                 .enum_list      = NULL,
924                 .flags          = FLAG_ADVANCED
925         },
926         {
927                 .label          = "unix charset",
928                 .type           = P_STRING,
929                 .p_class        = P_GLOBAL,
930                 .ptr            = &Globals.unix_charset,
931                 .special        = handle_charset,
932                 .enum_list      = NULL,
933                 .flags          = FLAG_ADVANCED
934         },
935         {
936                 .label          = "display charset",
937                 .type           = P_STRING,
938                 .p_class        = P_GLOBAL,
939                 .ptr            = &Globals.display_charset,
940                 .special        = handle_charset,
941                 .enum_list      = NULL,
942                 .flags          = FLAG_ADVANCED
943         },
944         {
945                 .label          = "comment",
946                 .type           = P_STRING,
947                 .p_class        = P_LOCAL,
948                 .ptr            = &sDefault.comment,
949                 .special        = NULL,
950                 .enum_list      = NULL,
951                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT
952         },
953         {
954                 .label          = "path",
955                 .type           = P_STRING,
956                 .p_class        = P_LOCAL,
957                 .ptr            = &sDefault.szPath,
958                 .special        = NULL,
959                 .enum_list      = NULL,
960                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
961         },
962         {
963                 .label          = "directory",
964                 .type           = P_STRING,
965                 .p_class        = P_LOCAL,
966                 .ptr            = &sDefault.szPath,
967                 .special        = NULL,
968                 .enum_list      = NULL,
969                 .flags          = FLAG_HIDE,
970         },
971         {
972                 .label          = "workgroup",
973                 .type           = P_USTRING,
974                 .p_class        = P_GLOBAL,
975                 .ptr            = &Globals.szWorkgroup,
976                 .special        = handle_workgroup,
977                 .enum_list      = NULL,
978                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
979         },
980 #ifdef WITH_ADS
981         {
982                 .label          = "realm",
983                 .type           = P_USTRING,
984                 .p_class        = P_GLOBAL,
985                 .ptr            = &Globals.szRealm,
986                 .special        = NULL,
987                 .enum_list      = NULL,
988                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
989         },
990 #endif
991         {
992                 .label          = "netbios name",
993                 .type           = P_USTRING,
994                 .p_class        = P_GLOBAL,
995                 .ptr            = &Globals.szNetbiosName,
996                 .special        = handle_netbios_name,
997                 .enum_list      = NULL,
998                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
999         },
1000         {
1001                 .label          = "netbios aliases",
1002                 .type           = P_LIST,
1003                 .p_class        = P_GLOBAL,
1004                 .ptr            = &Globals.szNetbiosAliases,
1005                 .special        = handle_netbios_aliases,
1006                 .enum_list      = NULL,
1007                 .flags          = FLAG_ADVANCED,
1008         },
1009         {
1010                 .label          = "netbios scope",
1011                 .type           = P_USTRING,
1012                 .p_class        = P_GLOBAL,
1013                 .ptr            = &Globals.szNetbiosScope,
1014                 .special        = handle_netbios_scope,
1015                 .enum_list      = NULL,
1016                 .flags          = FLAG_ADVANCED,
1017         },
1018         {
1019                 .label          = "server string",
1020                 .type           = P_STRING,
1021                 .p_class        = P_GLOBAL,
1022                 .ptr            = &Globals.szServerString,
1023                 .special        = NULL,
1024                 .enum_list      = NULL,
1025                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1026         },
1027         {
1028                 .label          = "interfaces",
1029                 .type           = P_LIST,
1030                 .p_class        = P_GLOBAL,
1031                 .ptr            = &Globals.szInterfaces,
1032                 .special        = NULL,
1033                 .enum_list      = NULL,
1034                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1035         },
1036         {
1037                 .label          = "bind interfaces only",
1038                 .type           = P_BOOL,
1039                 .p_class        = P_GLOBAL,
1040                 .ptr            = &Globals.bBindInterfacesOnly,
1041                 .special        = NULL,
1042                 .enum_list      = NULL,
1043                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1044         },
1045         {
1046                 .label          = "config backend",
1047                 .type           = P_ENUM,
1048                 .p_class        = P_GLOBAL,
1049                 .ptr            = &Globals.ConfigBackend,
1050                 .special        = NULL,
1051                 .enum_list      = enum_config_backend,
1052                 .flags          = FLAG_HIDE|FLAG_ADVANCED|FLAG_META,
1053         },
1054
1055         {N_("Security Options"), P_SEP, P_SEPARATOR},
1056
1057         {
1058                 .label          = "security",
1059                 .type           = P_ENUM,
1060                 .p_class        = P_GLOBAL,
1061                 .ptr            = &Globals.security,
1062                 .special        = NULL,
1063                 .enum_list      = enum_security,
1064                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1065         },
1066         {
1067                 .label          = "auth methods",
1068                 .type           = P_LIST,
1069                 .p_class        = P_GLOBAL,
1070                 .ptr            = &Globals.AuthMethods,
1071                 .special        = NULL,
1072                 .enum_list      = NULL,
1073                 .flags          = FLAG_ADVANCED,
1074         },
1075         {
1076                 .label          = "encrypt passwords",
1077                 .type           = P_BOOL,
1078                 .p_class        = P_GLOBAL,
1079                 .ptr            = &Globals.bEncryptPasswords,
1080                 .special        = NULL,
1081                 .enum_list      = NULL,
1082                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
1083         },
1084         {
1085                 .label          = "update encrypted",
1086                 .type           = P_BOOL,
1087                 .p_class        = P_GLOBAL,
1088                 .ptr            = &Globals.bUpdateEncrypt,
1089                 .special        = NULL,
1090                 .enum_list      = NULL,
1091                 .flags          = FLAG_ADVANCED,
1092         },
1093         {
1094                 .label          = "client schannel",
1095                 .type           = P_ENUM,
1096                 .p_class        = P_GLOBAL,
1097                 .ptr            = &Globals.clientSchannel,
1098                 .special        = NULL,
1099                 .enum_list      = enum_bool_auto,
1100                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1101         },
1102         {
1103                 .label          = "server schannel",
1104                 .type           = P_ENUM,
1105                 .p_class        = P_GLOBAL,
1106                 .ptr            = &Globals.serverSchannel,
1107                 .special        = NULL,
1108                 .enum_list      = enum_bool_auto,
1109                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1110         },
1111         {
1112                 .label          = "allow trusted domains",
1113                 .type           = P_BOOL,
1114                 .p_class        = P_GLOBAL,
1115                 .ptr            = &Globals.bAllowTrustedDomains,
1116                 .special        = NULL,
1117                 .enum_list      = NULL,
1118                 .flags          = FLAG_ADVANCED,
1119         },
1120         {
1121                 .label          = "map to guest",
1122                 .type           = P_ENUM,
1123                 .p_class        = P_GLOBAL,
1124                 .ptr            = &Globals.map_to_guest,
1125                 .special        = NULL,
1126                 .enum_list      = enum_map_to_guest,
1127                 .flags          = FLAG_ADVANCED,
1128         },
1129         {
1130                 .label          = "null passwords",
1131                 .type           = P_BOOL,
1132                 .p_class        = P_GLOBAL,
1133                 .ptr            = &Globals.bNullPasswords,
1134                 .special        = NULL,
1135                 .enum_list      = NULL,
1136                 .flags          = FLAG_ADVANCED,
1137         },
1138         {
1139                 .label          = "obey pam restrictions",
1140                 .type           = P_BOOL,
1141                 .p_class        = P_GLOBAL,
1142                 .ptr            = &Globals.bObeyPamRestrictions,
1143                 .special        = NULL,
1144                 .enum_list      = NULL,
1145                 .flags          = FLAG_ADVANCED,
1146         },
1147         {
1148                 .label          = "password server",
1149                 .type           = P_STRING,
1150                 .p_class        = P_GLOBAL,
1151                 .ptr            = &Globals.szPasswordServer,
1152                 .special        = NULL,
1153                 .enum_list      = NULL,
1154                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1155         },
1156         {
1157                 .label          = "smb passwd file",
1158                 .type           = P_STRING,
1159                 .p_class        = P_GLOBAL,
1160                 .ptr            = &Globals.szSMBPasswdFile,
1161                 .special        = NULL,
1162                 .enum_list      = NULL,
1163                 .flags          = FLAG_ADVANCED,
1164         },
1165         {
1166                 .label          = "private dir",
1167                 .type           = P_STRING,
1168                 .p_class        = P_GLOBAL,
1169                 .ptr            = &Globals.szPrivateDir,
1170                 .special        = NULL,
1171                 .enum_list      = NULL,
1172                 .flags          = FLAG_ADVANCED,
1173         },
1174         {
1175                 .label          = "passdb backend",
1176                 .type           = P_STRING,
1177                 .p_class        = P_GLOBAL,
1178                 .ptr            = &Globals.szPassdbBackend,
1179                 .special        = NULL,
1180                 .enum_list      = NULL,
1181                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
1182         },
1183         {
1184                 .label          = "algorithmic rid base",
1185                 .type           = P_INTEGER,
1186                 .p_class        = P_GLOBAL,
1187                 .ptr            = &Globals.AlgorithmicRidBase,
1188                 .special        = NULL,
1189                 .enum_list      = NULL,
1190                 .flags          = FLAG_ADVANCED,
1191         },
1192         {
1193                 .label          = "root directory",
1194                 .type           = P_STRING,
1195                 .p_class        = P_GLOBAL,
1196                 .ptr            = &Globals.szRootdir,
1197                 .special        = NULL,
1198                 .enum_list      = NULL,
1199                 .flags          = FLAG_ADVANCED,
1200         },
1201         {
1202                 .label          = "root dir",
1203                 .type           = P_STRING,
1204                 .p_class        = P_GLOBAL,
1205                 .ptr            = &Globals.szRootdir,
1206                 .special        = NULL,
1207                 .enum_list      = NULL,
1208                 .flags          = FLAG_HIDE,
1209         },
1210         {
1211                 .label          = "root",
1212                 .type           = P_STRING,
1213                 .p_class        = P_GLOBAL,
1214                 .ptr            = &Globals.szRootdir,
1215                 .special        = NULL,
1216                 .enum_list      = NULL,
1217                 .flags          = FLAG_HIDE,
1218         },
1219         {
1220                 .label          = "guest account",
1221                 .type           = P_STRING,
1222                 .p_class        = P_GLOBAL,
1223                 .ptr            = &Globals.szGuestaccount,
1224                 .special        = NULL,
1225                 .enum_list      = NULL,
1226                 .flags          = FLAG_BASIC | FLAG_ADVANCED,
1227         },
1228         {
1229                 .label          = "enable privileges",
1230                 .type           = P_BOOL,
1231                 .p_class        = P_GLOBAL,
1232                 .ptr            = &Globals.bEnablePrivileges,
1233                 .special        = NULL,
1234                 .enum_list      = NULL,
1235                 .flags          = FLAG_ADVANCED,
1236         },
1237
1238         {
1239                 .label          = "pam password change",
1240                 .type           = P_BOOL,
1241                 .p_class        = P_GLOBAL,
1242                 .ptr            = &Globals.bPamPasswordChange,
1243                 .special        = NULL,
1244                 .enum_list      = NULL,
1245                 .flags          = FLAG_ADVANCED,
1246         },
1247         {
1248                 .label          = "passwd program",
1249                 .type           = P_STRING,
1250                 .p_class        = P_GLOBAL,
1251                 .ptr            = &Globals.szPasswdProgram,
1252                 .special        = NULL,
1253                 .enum_list      = NULL,
1254                 .flags          = FLAG_ADVANCED,
1255         },
1256         {
1257                 .label          = "passwd chat",
1258                 .type           = P_STRING,
1259                 .p_class        = P_GLOBAL,
1260                 .ptr            = &Globals.szPasswdChat,
1261                 .special        = NULL,
1262                 .enum_list      = NULL,
1263                 .flags          = FLAG_ADVANCED,
1264         },
1265         {
1266                 .label          = "passwd chat debug",
1267                 .type           = P_BOOL,
1268                 .p_class        = P_GLOBAL,
1269                 .ptr            = &Globals.bPasswdChatDebug,
1270                 .special        = NULL,
1271                 .enum_list      = NULL,
1272                 .flags          = FLAG_ADVANCED,
1273         },
1274         {
1275                 .label          = "passwd chat timeout",
1276                 .type           = P_INTEGER,
1277                 .p_class        = P_GLOBAL,
1278                 .ptr            = &Globals.iPasswdChatTimeout,
1279                 .special        = NULL,
1280                 .enum_list      = NULL,
1281                 .flags          = FLAG_ADVANCED,
1282         },
1283         {
1284                 .label          = "check password script",
1285                 .type           = P_STRING,
1286                 .p_class        = P_GLOBAL,
1287                 .ptr            = &Globals.szCheckPasswordScript,
1288                 .special        = NULL,
1289                 .enum_list      = NULL,
1290                 .flags          = FLAG_ADVANCED,
1291         },
1292         {
1293                 .label          = "username map",
1294                 .type           = P_STRING,
1295                 .p_class        = P_GLOBAL,
1296                 .ptr            = &Globals.szUsernameMap,
1297                 .special        = NULL,
1298                 .enum_list      = NULL,
1299                 .flags          = FLAG_ADVANCED,
1300         },
1301         {
1302                 .label          = "password level",
1303                 .type           = P_INTEGER,
1304                 .p_class        = P_GLOBAL,
1305                 .ptr            = &Globals.pwordlevel,
1306                 .special        = NULL,
1307                 .enum_list      = NULL,
1308                 .flags          = FLAG_ADVANCED,
1309         },
1310         {
1311                 .label          = "username level",
1312                 .type           = P_INTEGER,
1313                 .p_class        = P_GLOBAL,
1314                 .ptr            = &Globals.unamelevel,
1315                 .special        = NULL,
1316                 .enum_list      = NULL,
1317                 .flags          = FLAG_ADVANCED,
1318         },
1319         {
1320                 .label          = "unix password sync",
1321                 .type           = P_BOOL,
1322                 .p_class        = P_GLOBAL,
1323                 .ptr            = &Globals.bUnixPasswdSync,
1324                 .special        = NULL,
1325                 .enum_list      = NULL,
1326                 .flags          = FLAG_ADVANCED,
1327         },
1328         {
1329                 .label          = "restrict anonymous",
1330                 .type           = P_INTEGER,
1331                 .p_class        = P_GLOBAL,
1332                 .ptr            = &Globals.restrict_anonymous,
1333                 .special        = NULL,
1334                 .enum_list      = NULL,
1335                 .flags          = FLAG_ADVANCED,
1336         },
1337         {
1338                 .label          = "lanman auth",
1339                 .type           = P_BOOL,
1340                 .p_class        = P_GLOBAL,
1341                 .ptr            = &Globals.bLanmanAuth,
1342                 .special        = NULL,
1343                 .enum_list      = NULL,
1344                 .flags          = FLAG_ADVANCED,
1345         },
1346         {
1347                 .label          = "ntlm auth",
1348                 .type           = P_BOOL,
1349                 .p_class        = P_GLOBAL,
1350                 .ptr            = &Globals.bNTLMAuth,
1351                 .special        = NULL,
1352                 .enum_list      = NULL,
1353                 .flags          = FLAG_ADVANCED,
1354         },
1355         {
1356                 .label          = "client NTLMv2 auth",
1357                 .type           = P_BOOL,
1358                 .p_class        = P_GLOBAL,
1359                 .ptr            = &Globals.bClientNTLMv2Auth,
1360                 .special        = NULL,
1361                 .enum_list      = NULL,
1362                 .flags          = FLAG_ADVANCED,
1363         },
1364         {
1365                 .label          = "client lanman auth",
1366                 .type           = P_BOOL,
1367                 .p_class        = P_GLOBAL,
1368                 .ptr            = &Globals.bClientLanManAuth,
1369                 .special        = NULL,
1370                 .enum_list      = NULL,
1371                 .flags          = FLAG_ADVANCED,
1372         },
1373         {
1374                 .label          = "client plaintext auth",
1375                 .type           = P_BOOL,
1376                 .p_class        = P_GLOBAL,
1377                 .ptr            = &Globals.bClientPlaintextAuth,
1378                 .special        = NULL,
1379                 .enum_list      = NULL,
1380                 .flags          = FLAG_ADVANCED,
1381         },
1382         {
1383                 .label          = "username",
1384                 .type           = P_STRING,
1385                 .p_class        = P_LOCAL,
1386                 .ptr            = &sDefault.szUsername,
1387                 .special        = NULL,
1388                 .enum_list      = NULL,
1389                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1390         },
1391         {
1392                 .label          = "user",
1393                 .type           = P_STRING,
1394                 .p_class        = P_LOCAL,
1395                 .ptr            = &sDefault.szUsername,
1396                 .special        = NULL,
1397                 .enum_list      = NULL,
1398                 .flags          = FLAG_HIDE,
1399         },
1400         {
1401                 .label          = "users",
1402                 .type           = P_STRING,
1403                 .p_class        = P_LOCAL,
1404                 .ptr            = &sDefault.szUsername,
1405                 .special        = NULL,
1406                 .enum_list      = NULL,
1407                 .flags          = FLAG_HIDE,
1408         },
1409         {
1410                 .label          = "invalid users",
1411                 .type           = P_LIST,
1412                 .p_class        = P_LOCAL,
1413                 .ptr            = &sDefault.szInvalidUsers,
1414                 .special        = NULL,
1415                 .enum_list      = NULL,
1416                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1417         },
1418         {
1419                 .label          = "valid users",
1420                 .type           = P_LIST,
1421                 .p_class        = P_LOCAL,
1422                 .ptr            = &sDefault.szValidUsers,
1423                 .special        = NULL,
1424                 .enum_list      = NULL,
1425                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1426         },
1427         {
1428                 .label          = "admin users",
1429                 .type           = P_LIST,
1430                 .p_class        = P_LOCAL,
1431                 .ptr            = &sDefault.szAdminUsers,
1432                 .special        = NULL,
1433                 .enum_list      = NULL,
1434                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1435         },
1436         {
1437                 .label          = "read list",
1438                 .type           = P_LIST,
1439                 .p_class        = P_LOCAL,
1440                 .ptr            = &sDefault.readlist,
1441                 .special        = NULL,
1442                 .enum_list      = NULL,
1443                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1444         },
1445         {
1446                 .label          = "write list",
1447                 .type           = P_LIST,
1448                 .p_class        = P_LOCAL,
1449                 .ptr            = &sDefault.writelist,
1450                 .special        = NULL,
1451                 .enum_list      = NULL,
1452                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1453         },
1454         {
1455                 .label          = "printer admin",
1456                 .type           = P_LIST,
1457                 .p_class        = P_LOCAL,
1458                 .ptr            = &sDefault.printer_admin,
1459                 .special        = NULL,
1460                 .enum_list      = NULL,
1461                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT | FLAG_DEPRECATED,
1462         },
1463         {
1464                 .label          = "force user",
1465                 .type           = P_STRING,
1466                 .p_class        = P_LOCAL,
1467                 .ptr            = &sDefault.force_user,
1468                 .special        = NULL,
1469                 .enum_list      = NULL,
1470                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1471         },
1472         {
1473                 .label          = "force group",
1474                 .type           = P_STRING,
1475                 .p_class        = P_LOCAL,
1476                 .ptr            = &sDefault.force_group,
1477                 .special        = NULL,
1478                 .enum_list      = NULL,
1479                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1480         },
1481         {
1482                 .label          = "group",
1483                 .type           = P_STRING,
1484                 .p_class        = P_LOCAL,
1485                 .ptr            = &sDefault.force_group,
1486                 .special        = NULL,
1487                 .enum_list      = NULL,
1488                 .flags          = FLAG_ADVANCED,
1489         },
1490         {
1491                 .label          = "read only",
1492                 .type           = P_BOOL,
1493                 .p_class        = P_LOCAL,
1494                 .ptr            = &sDefault.bRead_only,
1495                 .special        = NULL,
1496                 .enum_list      = NULL,
1497                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE,
1498         },
1499         {
1500                 .label          = "write ok",
1501                 .type           = P_BOOLREV,
1502                 .p_class        = P_LOCAL,
1503                 .ptr            = &sDefault.bRead_only,
1504                 .special        = NULL,
1505                 .enum_list      = NULL,
1506                 .flags          = FLAG_HIDE,
1507         },
1508         {
1509                 .label          = "writeable",
1510                 .type           = P_BOOLREV,
1511                 .p_class        = P_LOCAL,
1512                 .ptr            = &sDefault.bRead_only,
1513                 .special        = NULL,
1514                 .enum_list      = NULL,
1515                 .flags          = FLAG_HIDE,
1516         },
1517         {
1518                 .label          = "writable",
1519                 .type           = P_BOOLREV,
1520                 .p_class        = P_LOCAL,
1521                 .ptr            = &sDefault.bRead_only,
1522                 .special        = NULL,
1523                 .enum_list      = NULL,
1524                 .flags          = FLAG_HIDE,
1525         },
1526         {
1527                 .label          = "acl check permissions",
1528                 .type           = P_BOOL,
1529                 .p_class        = P_LOCAL,
1530                 .ptr            = &sDefault.bAclCheckPermissions,
1531                 .special        = NULL,
1532                 .enum_list      = NULL,
1533                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1534         },
1535         {
1536                 .label          = "acl group control",
1537                 .type           = P_BOOL,
1538                 .p_class        = P_LOCAL,
1539                 .ptr            = &sDefault.bAclGroupControl,
1540                 .special        = NULL,
1541                 .enum_list      = NULL,
1542                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1543         },
1544         {
1545                 .label          = "acl map full control",
1546                 .type           = P_BOOL,
1547                 .p_class        = P_LOCAL,
1548                 .ptr            = &sDefault.bAclMapFullControl,
1549                 .special        = NULL,
1550                 .enum_list      = NULL,
1551                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1552         },
1553         {
1554                 .label          = "create mask",
1555                 .type           = P_OCTAL,
1556                 .p_class        = P_LOCAL,
1557                 .ptr            = &sDefault.iCreate_mask,
1558                 .special        = NULL,
1559                 .enum_list      = NULL,
1560                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1561         },
1562         {
1563                 .label          = "create mode",
1564                 .type           = P_OCTAL,
1565                 .p_class        = P_LOCAL,
1566                 .ptr            = &sDefault.iCreate_mask,
1567                 .special        = NULL,
1568                 .enum_list      = NULL,
1569                 .flags          = FLAG_HIDE,
1570         },
1571         {
1572                 .label          = "force create mode",
1573                 .type           = P_OCTAL,
1574                 .p_class        = P_LOCAL,
1575                 .ptr            = &sDefault.iCreate_force_mode,
1576                 .special        = NULL,
1577                 .enum_list      = NULL,
1578                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1579         },
1580         {
1581                 .label          = "security mask",
1582                 .type           = P_OCTAL,
1583                 .p_class        = P_LOCAL,
1584                 .ptr            = &sDefault.iSecurity_mask,
1585                 .special        = NULL,
1586                 .enum_list      = NULL,
1587                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1588         },
1589         {
1590                 .label          = "force security mode",
1591                 .type           = P_OCTAL,
1592                 .p_class        = P_LOCAL,
1593                 .ptr            = &sDefault.iSecurity_force_mode,
1594                 .special        = NULL,
1595                 .enum_list      = NULL,
1596                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1597         },
1598         {
1599                 .label          = "directory mask",
1600                 .type           = P_OCTAL,
1601                 .p_class        = P_LOCAL,
1602                 .ptr            = &sDefault.iDir_mask,
1603                 .special        = NULL,
1604                 .enum_list      = NULL,
1605                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1606         },
1607         {
1608                 .label          = "directory mode",
1609                 .type           = P_OCTAL,
1610                 .p_class        = P_LOCAL,
1611                 .ptr            = &sDefault.iDir_mask,
1612                 .special        = NULL,
1613                 .enum_list      = NULL,
1614                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1615         },
1616         {
1617                 .label          = "force directory mode",
1618                 .type           = P_OCTAL,
1619                 .p_class        = P_LOCAL,
1620                 .ptr            = &sDefault.iDir_force_mode,
1621                 .special        = NULL,
1622                 .enum_list      = NULL,
1623                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1624         },
1625         {
1626                 .label          = "directory security mask",
1627                 .type           = P_OCTAL,
1628                 .p_class        = P_LOCAL,
1629                 .ptr            = &sDefault.iDir_Security_mask,
1630                 .special        = NULL,
1631                 .enum_list      = NULL,
1632                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1633         },
1634         {
1635                 .label          = "force directory security mode",
1636                 .type           = P_OCTAL,
1637                 .p_class        = P_LOCAL,
1638                 .ptr            = &sDefault.iDir_Security_force_mode,
1639                 .special        = NULL,
1640                 .enum_list      = NULL,
1641                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1642         },
1643         {
1644                 .label          = "force unknown acl user",
1645                 .type           = P_BOOL,
1646                 .p_class        = P_LOCAL,
1647                 .ptr            = &sDefault.bForceUnknownAclUser,
1648                 .special        = NULL,
1649                 .enum_list      = NULL,
1650                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
1651         },
1652         {
1653                 .label          = "inherit permissions",
1654                 .type           = P_BOOL,
1655                 .p_class        = P_LOCAL,
1656                 .ptr            = &sDefault.bInheritPerms,
1657                 .special        = NULL,
1658                 .enum_list      = NULL,
1659                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1660         },
1661         {
1662                 .label          = "inherit acls",
1663                 .type           = P_BOOL,
1664                 .p_class        = P_LOCAL,
1665                 .ptr            = &sDefault.bInheritACLS,
1666                 .special        = NULL,
1667                 .enum_list      = NULL,
1668                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1669         },
1670         {
1671                 .label          = "inherit owner",
1672                 .type           = P_BOOL,
1673                 .p_class        = P_LOCAL,
1674                 .ptr            = &sDefault.bInheritOwner,
1675                 .special        = NULL,
1676                 .enum_list      = NULL,
1677                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1678         },
1679         {
1680                 .label          = "guest only",
1681                 .type           = P_BOOL,
1682                 .p_class        = P_LOCAL,
1683                 .ptr            = &sDefault.bGuest_only,
1684                 .special        = NULL,
1685                 .enum_list      = NULL,
1686                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
1687         },
1688         {
1689                 .label          = "only guest",
1690                 .type           = P_BOOL,
1691                 .p_class        = P_LOCAL,
1692                 .ptr            = &sDefault.bGuest_only,
1693                 .special        = NULL,
1694                 .enum_list      = NULL,
1695                 .flags          = FLAG_HIDE,
1696         },
1697         {
1698                 .label          = "administrative share",
1699                 .type           = P_BOOL,
1700                 .p_class        = P_LOCAL,
1701                 .ptr            = &sDefault.bAdministrative_share,
1702                 .special        = NULL,
1703                 .enum_list      = NULL,
1704                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1705         },
1706
1707         {
1708                 .label          = "guest ok",
1709                 .type           = P_BOOL,
1710                 .p_class        = P_LOCAL,
1711                 .ptr            = &sDefault.bGuest_ok,
1712                 .special        = NULL,
1713                 .enum_list      = NULL,
1714                 .flags          = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1715         },
1716         {
1717                 .label          = "public",
1718                 .type           = P_BOOL,
1719                 .p_class        = P_LOCAL,
1720                 .ptr            = &sDefault.bGuest_ok,
1721                 .special        = NULL,
1722                 .enum_list      = NULL,
1723                 .flags          = FLAG_HIDE,
1724         },
1725         {
1726                 .label          = "only user",
1727                 .type           = P_BOOL,
1728                 .p_class        = P_LOCAL,
1729                 .ptr            = &sDefault.bOnlyUser,
1730                 .special        = NULL,
1731                 .enum_list      = NULL,
1732                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED,
1733         },
1734         {
1735                 .label          = "hosts allow",
1736                 .type           = P_LIST,
1737                 .p_class        = P_LOCAL,
1738                 .ptr            = &sDefault.szHostsallow,
1739                 .special        = NULL,
1740                 .enum_list      = NULL,
1741                 .flags          = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1742         },
1743         {
1744                 .label          = "allow hosts",
1745                 .type           = P_LIST,
1746                 .p_class        = P_LOCAL,
1747                 .ptr            = &sDefault.szHostsallow,
1748                 .special        = NULL,
1749                 .enum_list      = NULL,
1750                 .flags          = FLAG_HIDE,
1751         },
1752         {
1753                 .label          = "hosts deny",
1754                 .type           = P_LIST,
1755                 .p_class        = P_LOCAL,
1756                 .ptr            = &sDefault.szHostsdeny,
1757                 .special        = NULL,
1758                 .enum_list      = NULL,
1759                 .flags          = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT,
1760         },
1761         {
1762                 .label          = "deny hosts",
1763                 .type           = P_LIST,
1764                 .p_class        = P_LOCAL,
1765                 .ptr            = &sDefault.szHostsdeny,
1766                 .special        = NULL,
1767                 .enum_list      = NULL,
1768                 .flags          = FLAG_HIDE,
1769         },
1770         {
1771                 .label          = "preload modules",
1772                 .type           = P_LIST,
1773                 .p_class        = P_GLOBAL,
1774                 .ptr            = &Globals.szPreloadModules,
1775                 .special        = NULL,
1776                 .enum_list      = NULL,
1777                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1778         },
1779         {
1780                 .label          = "dedicated keytab file",
1781                 .type           = P_STRING,
1782                 .p_class        = P_GLOBAL,
1783                 .ptr            = &Globals.szDedicatedKeytabFile,
1784                 .special        = NULL,
1785                 .enum_list      = NULL,
1786                 .flags          = FLAG_ADVANCED,
1787         },
1788         {
1789                 .label          = "kerberos method",
1790                 .type           = P_ENUM,
1791                 .p_class        = P_GLOBAL,
1792                 .ptr            = &Globals.iKerberosMethod,
1793                 .special        = NULL,
1794                 .enum_list      = enum_kerberos_method,
1795                 .flags          = FLAG_ADVANCED,
1796         },
1797         {
1798                 .label          = "map untrusted to domain",
1799                 .type           = P_BOOL,
1800                 .p_class        = P_GLOBAL,
1801                 .ptr            = &Globals.bMapUntrustedToDomain,
1802                 .special        = NULL,
1803                 .enum_list      = NULL,
1804                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
1805         },
1806
1807
1808         {N_("Logging Options"), P_SEP, P_SEPARATOR},
1809
1810         {
1811                 .label          = "log level",
1812                 .type           = P_STRING,
1813                 .p_class        = P_GLOBAL,
1814                 .ptr            = &Globals.szLogLevel,
1815                 .special        = handle_debug_list,
1816                 .enum_list      = NULL,
1817                 .flags          = FLAG_ADVANCED,
1818         },
1819         {
1820                 .label          = "debuglevel",
1821                 .type           = P_STRING,
1822                 .p_class        = P_GLOBAL,
1823                 .ptr            = &Globals.szLogLevel,
1824                 .special        = handle_debug_list,
1825                 .enum_list      = NULL,
1826                 .flags          = FLAG_HIDE,
1827         },
1828         {
1829                 .label          = "syslog",
1830                 .type           = P_INTEGER,
1831                 .p_class        = P_GLOBAL,
1832                 .ptr            = &Globals.syslog,
1833                 .special        = NULL,
1834                 .enum_list      = NULL,
1835                 .flags          = FLAG_ADVANCED,
1836         },
1837         {
1838                 .label          = "syslog only",
1839                 .type           = P_BOOL,
1840                 .p_class        = P_GLOBAL,
1841                 .ptr            = &Globals.bSyslogOnly,
1842                 .special        = NULL,
1843                 .enum_list      = NULL,
1844                 .flags          = FLAG_ADVANCED,
1845         },
1846         {
1847                 .label          = "log file",
1848                 .type           = P_STRING,
1849                 .p_class        = P_GLOBAL,
1850                 .ptr            = &Globals.szLogFile,
1851                 .special        = NULL,
1852                 .enum_list      = NULL,
1853                 .flags          = FLAG_ADVANCED,
1854         },
1855         {
1856                 .label          = "max log size",
1857                 .type           = P_INTEGER,
1858                 .p_class        = P_GLOBAL,
1859                 .ptr            = &Globals.max_log_size,
1860                 .special        = NULL,
1861                 .enum_list      = NULL,
1862                 .flags          = FLAG_ADVANCED,
1863         },
1864         {
1865                 .label          = "debug timestamp",
1866                 .type           = P_BOOL,
1867                 .p_class        = P_GLOBAL,
1868                 .ptr            = &Globals.bTimestampLogs,
1869                 .special        = NULL,
1870                 .enum_list      = NULL,
1871                 .flags          = FLAG_ADVANCED,
1872         },
1873         {
1874                 .label          = "timestamp logs",
1875                 .type           = P_BOOL,
1876                 .p_class        = P_GLOBAL,
1877                 .ptr            = &Globals.bTimestampLogs,
1878                 .special        = NULL,
1879                 .enum_list      = NULL,
1880                 .flags          = FLAG_ADVANCED,
1881         },
1882         {
1883                 .label          = "debug prefix timestamp",
1884                 .type           = P_BOOL,
1885                 .p_class        = P_GLOBAL,
1886                 .ptr            = &Globals.bDebugPrefixTimestamp,
1887                 .special        = NULL,
1888                 .enum_list      = NULL,
1889                 .flags          = FLAG_ADVANCED,
1890         },
1891         {
1892                 .label          = "debug hires timestamp",
1893                 .type           = P_BOOL,
1894                 .p_class        = P_GLOBAL,
1895                 .ptr            = &Globals.bDebugHiresTimestamp,
1896                 .special        = NULL,
1897                 .enum_list      = NULL,
1898                 .flags          = FLAG_ADVANCED,
1899         },
1900         {
1901                 .label          = "debug pid",
1902                 .type           = P_BOOL,
1903                 .p_class        = P_GLOBAL,
1904                 .ptr            = &Globals.bDebugPid,
1905                 .special        = NULL,
1906                 .enum_list      = NULL,
1907                 .flags          = FLAG_ADVANCED,
1908         },
1909         {
1910                 .label          = "debug uid",
1911                 .type           = P_BOOL,
1912                 .p_class        = P_GLOBAL,
1913                 .ptr            = &Globals.bDebugUid,
1914                 .special        = NULL,
1915                 .enum_list      = NULL,
1916                 .flags          = FLAG_ADVANCED,
1917         },
1918         {
1919                 .label          = "debug class",
1920                 .type           = P_BOOL,
1921                 .p_class        = P_GLOBAL,
1922                 .ptr            = &Globals.bDebugClass,
1923                 .special        = NULL,
1924                 .enum_list      = NULL,
1925                 .flags          = FLAG_ADVANCED,
1926         },
1927         {
1928                 .label          = "enable core files",
1929                 .type           = P_BOOL,
1930                 .p_class        = P_GLOBAL,
1931                 .ptr            = &Globals.bEnableCoreFiles,
1932                 .special        = NULL,
1933                 .enum_list      = NULL,
1934                 .flags          = FLAG_ADVANCED,
1935         },
1936
1937         {N_("Protocol Options"), P_SEP, P_SEPARATOR},
1938
1939         {
1940                 .label          = "allocation roundup size",
1941                 .type           = P_INTEGER,
1942                 .p_class        = P_LOCAL,
1943                 .ptr            = &sDefault.iallocation_roundup_size,
1944                 .special        = NULL,
1945                 .enum_list      = NULL,
1946                 .flags          = FLAG_ADVANCED,
1947         },
1948         {
1949                 .label          = "aio read size",
1950                 .type           = P_INTEGER,
1951                 .p_class        = P_LOCAL,
1952                 .ptr            = &sDefault.iAioReadSize,
1953                 .special        = NULL,
1954                 .enum_list      = NULL,
1955                 .flags          = FLAG_ADVANCED,
1956         },
1957         {
1958                 .label          = "aio write size",
1959                 .type           = P_INTEGER,
1960                 .p_class        = P_LOCAL,
1961                 .ptr            = &sDefault.iAioWriteSize,
1962                 .special        = NULL,
1963                 .enum_list      = NULL,
1964                 .flags          = FLAG_ADVANCED,
1965         },
1966         {
1967                 .label          = "aio write behind",
1968                 .type           = P_STRING,
1969                 .p_class        = P_LOCAL,
1970                 .ptr            = &sDefault.szAioWriteBehind,
1971                 .special        = NULL,
1972                 .enum_list      = NULL,
1973                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
1974         },
1975         {
1976                 .label          = "smb ports",
1977                 .type           = P_STRING,
1978                 .p_class        = P_GLOBAL,
1979                 .ptr            = &Globals.smb_ports,
1980                 .special        = NULL,
1981                 .enum_list      = NULL,
1982                 .flags          = FLAG_ADVANCED,
1983         },
1984         {
1985                 .label          = "large readwrite",
1986                 .type           = P_BOOL,
1987                 .p_class        = P_GLOBAL,
1988                 .ptr            = &Globals.bLargeReadwrite,
1989                 .special        = NULL,
1990                 .enum_list      = NULL,
1991                 .flags          = FLAG_ADVANCED,
1992         },
1993         {
1994                 .label          = "max protocol",
1995                 .type           = P_ENUM,
1996                 .p_class        = P_GLOBAL,
1997                 .ptr            = &Globals.maxprotocol,
1998                 .special        = NULL,
1999                 .enum_list      = enum_protocol,
2000                 .flags          = FLAG_ADVANCED,
2001         },
2002         {
2003                 .label          = "protocol",
2004                 .type           = P_ENUM,
2005                 .p_class        = P_GLOBAL,
2006                 .ptr            = &Globals.maxprotocol,
2007                 .special        = NULL,
2008                 .enum_list      = enum_protocol,
2009                 .flags          = FLAG_ADVANCED,
2010         },
2011         {
2012                 .label          = "min protocol",
2013                 .type           = P_ENUM,
2014                 .p_class        = P_GLOBAL,
2015                 .ptr            = &Globals.minprotocol,
2016                 .special        = NULL,
2017                 .enum_list      = enum_protocol,
2018                 .flags          = FLAG_ADVANCED,
2019         },
2020         {
2021                 .label          = "min receivefile size",
2022                 .type           = P_INTEGER,
2023                 .p_class        = P_GLOBAL,
2024                 .ptr            = &Globals.iminreceivefile,
2025                 .special        = NULL,
2026                 .enum_list      = NULL,
2027                 .flags          = FLAG_ADVANCED,
2028         },
2029         {
2030                 .label          = "read raw",
2031                 .type           = P_BOOL,
2032                 .p_class        = P_GLOBAL,
2033                 .ptr            = &Globals.bReadRaw,
2034                 .special        = NULL,
2035                 .enum_list      = NULL,
2036                 .flags          = FLAG_ADVANCED,
2037         },
2038         {
2039                 .label          = "write raw",
2040                 .type           = P_BOOL,
2041                 .p_class        = P_GLOBAL,
2042                 .ptr            = &Globals.bWriteRaw,
2043                 .special        = NULL,
2044                 .enum_list      = NULL,
2045                 .flags          = FLAG_ADVANCED,
2046         },
2047         {
2048                 .label          = "disable netbios",
2049                 .type           = P_BOOL,
2050                 .p_class        = P_GLOBAL,
2051                 .ptr            = &Globals.bDisableNetbios,
2052                 .special        = NULL,
2053                 .enum_list      = NULL,
2054                 .flags          = FLAG_ADVANCED,
2055         },
2056         {
2057                 .label          = "reset on zero vc",
2058                 .type           = P_BOOL,
2059                 .p_class        = P_GLOBAL,
2060                 .ptr            = &Globals.bResetOnZeroVC,
2061                 .special        = NULL,
2062                 .enum_list      = NULL,
2063                 .flags          = FLAG_ADVANCED,
2064         },
2065         {
2066                 .label          = "acl compatibility",
2067                 .type           = P_ENUM,
2068                 .p_class        = P_GLOBAL,
2069                 .ptr            = &Globals.iAclCompat,
2070                 .special        = NULL,
2071                 .enum_list      = enum_acl_compat_vals,
2072                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2073         },
2074         {
2075                 .label          = "defer sharing violations",
2076                 .type           = P_BOOL,
2077                 .p_class        = P_GLOBAL,
2078                 .ptr            = &Globals.bDeferSharingViolations,
2079                 .special        = NULL,
2080                 .enum_list      = NULL,
2081                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2082         },
2083         {
2084                 .label          = "ea support",
2085                 .type           = P_BOOL,
2086                 .p_class        = P_LOCAL,
2087                 .ptr            = &sDefault.bEASupport,
2088                 .special        = NULL,
2089                 .enum_list      = NULL,
2090                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2091         },
2092         {
2093                 .label          = "nt acl support",
2094                 .type           = P_BOOL,
2095                 .p_class        = P_LOCAL,
2096                 .ptr            = &sDefault.bNTAclSupport,
2097                 .special        = NULL,
2098                 .enum_list      = NULL,
2099                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2100         },
2101         {
2102                 .label          = "nt pipe support",
2103                 .type           = P_BOOL,
2104                 .p_class        = P_GLOBAL,
2105                 .ptr            = &Globals.bNTPipeSupport,
2106                 .special        = NULL,
2107                 .enum_list      = NULL,
2108                 .flags          = FLAG_ADVANCED,
2109         },
2110         {
2111                 .label          = "nt status support",
2112                 .type           = P_BOOL,
2113                 .p_class        = P_GLOBAL,
2114                 .ptr            = &Globals.bNTStatusSupport,
2115                 .special        = NULL,
2116                 .enum_list      = NULL,
2117                 .flags          = FLAG_ADVANCED,
2118         },
2119         {
2120                 .label          = "profile acls",
2121                 .type           = P_BOOL,
2122                 .p_class        = P_LOCAL,
2123                 .ptr            = &sDefault.bProfileAcls,
2124                 .special        = NULL,
2125                 .enum_list      = NULL,
2126                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
2127         },
2128         {
2129                 .label          = "announce version",
2130                 .type           = P_STRING,
2131                 .p_class        = P_GLOBAL,
2132                 .ptr            = &Globals.szAnnounceVersion,
2133                 .special        = NULL,
2134                 .enum_list      = NULL,
2135                 .flags          = FLAG_ADVANCED,
2136         },
2137         {
2138                 .label          = "announce as",
2139                 .type           = P_ENUM,
2140                 .p_class        = P_GLOBAL,
2141                 .ptr            = &Globals.announce_as,
2142                 .special        = NULL,
2143                 .enum_list      = enum_announce_as,
2144                 .flags          = FLAG_ADVANCED,
2145         },
2146         {
2147                 .label          = "map acl inherit",
2148                 .type           = P_BOOL,
2149                 .p_class        = P_LOCAL,
2150                 .ptr            = &sDefault.bMap_acl_inherit,
2151                 .special        = NULL,
2152                 .enum_list      = NULL,
2153                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2154         },
2155         {
2156                 .label          = "afs share",
2157                 .type           = P_BOOL,
2158                 .p_class        = P_LOCAL,
2159                 .ptr            = &sDefault.bAfs_Share,
2160                 .special        = NULL,
2161                 .enum_list      = NULL,
2162                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2163         },
2164         {
2165                 .label          = "max mux",
2166                 .type           = P_INTEGER,
2167                 .p_class        = P_GLOBAL,
2168                 .ptr            = &Globals.max_mux,
2169                 .special        = NULL,
2170                 .enum_list      = NULL,
2171                 .flags          = FLAG_ADVANCED,
2172         },
2173         {
2174                 .label          = "max xmit",
2175                 .type           = P_INTEGER,
2176                 .p_class        = P_GLOBAL,
2177                 .ptr            = &Globals.max_xmit,
2178                 .special        = NULL,
2179                 .enum_list      = NULL,
2180                 .flags          = FLAG_ADVANCED,
2181         },
2182         {
2183                 .label          = "name resolve order",
2184                 .type           = P_STRING,
2185                 .p_class        = P_GLOBAL,
2186                 .ptr            = &Globals.szNameResolveOrder,
2187                 .special        = NULL,
2188                 .enum_list      = NULL,
2189                 .flags          = FLAG_ADVANCED | FLAG_WIZARD,
2190         },
2191         {
2192                 .label          = "max ttl",
2193                 .type           = P_INTEGER,
2194                 .p_class        = P_GLOBAL,
2195                 .ptr            = &Globals.max_ttl,
2196                 .special        = NULL,
2197                 .enum_list      = NULL,
2198                 .flags          = FLAG_ADVANCED,
2199         },
2200         {
2201                 .label          = "max wins ttl",
2202                 .type           = P_INTEGER,
2203                 .p_class        = P_GLOBAL,
2204                 .ptr            = &Globals.max_wins_ttl,
2205                 .special        = NULL,
2206                 .enum_list      = NULL,
2207                 .flags          = FLAG_ADVANCED,
2208         },
2209         {
2210                 .label          = "min wins ttl",
2211                 .type           = P_INTEGER,
2212                 .p_class        = P_GLOBAL,
2213                 .ptr            = &Globals.min_wins_ttl,
2214                 .special        = NULL,
2215                 .enum_list      = NULL,
2216                 .flags          = FLAG_ADVANCED,
2217         },
2218         {
2219                 .label          = "time server",
2220                 .type           = P_BOOL,
2221                 .p_class        = P_GLOBAL,
2222                 .ptr            = &Globals.bTimeServer,
2223                 .special        = NULL,
2224                 .enum_list      = NULL,
2225                 .flags          = FLAG_ADVANCED,
2226         },
2227         {
2228                 .label          = "unix extensions",
2229                 .type           = P_BOOL,
2230                 .p_class        = P_GLOBAL,
2231                 .ptr            = &Globals.bUnixExtensions,
2232                 .special        = NULL,
2233                 .enum_list      = NULL,
2234                 .flags          = FLAG_ADVANCED,
2235         },
2236         {
2237                 .label          = "use spnego",
2238                 .type           = P_BOOL,
2239                 .p_class        = P_GLOBAL,
2240                 .ptr            = &Globals.bUseSpnego,
2241                 .special        = NULL,
2242                 .enum_list      = NULL,
2243                 .flags          = FLAG_ADVANCED,
2244         },
2245         {
2246                 .label          = "client signing",
2247                 .type           = P_ENUM,
2248                 .p_class        = P_GLOBAL,
2249                 .ptr            = &Globals.client_signing,
2250                 .special        = NULL,
2251                 .enum_list      = enum_smb_signing_vals,
2252                 .flags          = FLAG_ADVANCED,
2253         },
2254         {
2255                 .label          = "server signing",
2256                 .type           = P_ENUM,
2257                 .p_class        = P_GLOBAL,
2258                 .ptr            = &Globals.server_signing,
2259                 .special        = NULL,
2260                 .enum_list      = enum_smb_signing_vals,
2261                 .flags          = FLAG_ADVANCED,
2262         },
2263         {
2264                 .label          = "smb encrypt",
2265                 .type           = P_ENUM,
2266                 .p_class        = P_LOCAL,
2267                 .ptr            = &sDefault.ismb_encrypt,
2268                 .special        = NULL,
2269                 .enum_list      = enum_smb_signing_vals,
2270                 .flags          = FLAG_ADVANCED,
2271         },
2272         {
2273                 .label          = "client use spnego",
2274                 .type           = P_BOOL,
2275                 .p_class        = P_GLOBAL,
2276                 .ptr            = &Globals.bClientUseSpnego,
2277                 .special        = NULL,
2278                 .enum_list      = NULL,
2279                 .flags          = FLAG_ADVANCED,
2280         },
2281         {
2282                 .label          = "client ldap sasl wrapping",
2283                 .type           = P_ENUM,
2284                 .p_class        = P_GLOBAL,
2285                 .ptr            = &Globals.client_ldap_sasl_wrapping,
2286                 .special        = NULL,
2287                 .enum_list      = enum_ldap_sasl_wrapping,
2288                 .flags          = FLAG_ADVANCED,
2289         },
2290         {
2291                 .label          = "enable asu support",
2292                 .type           = P_BOOL,
2293                 .p_class        = P_GLOBAL,
2294                 .ptr            = &Globals.bASUSupport,
2295                 .special        = NULL,
2296                 .enum_list      = NULL,
2297                 .flags          = FLAG_ADVANCED,
2298         },
2299         {
2300                 .label          = "svcctl list",
2301                 .type           = P_LIST,
2302                 .p_class        = P_GLOBAL,
2303                 .ptr            = &Globals.szServicesList,
2304                 .special        = NULL,
2305                 .enum_list      = NULL,
2306                 .flags          = FLAG_ADVANCED,
2307         },
2308
2309         {N_("Tuning Options"), P_SEP, P_SEPARATOR},
2310
2311         {
2312                 .label          = "block size",
2313                 .type           = P_INTEGER,
2314                 .p_class        = P_LOCAL,
2315                 .ptr            = &sDefault.iBlock_size,
2316                 .special        = NULL,
2317                 .enum_list      = NULL,
2318                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2319         },
2320         {
2321                 .label          = "deadtime",
2322                 .type           = P_INTEGER,
2323                 .p_class        = P_GLOBAL,
2324                 .ptr            = &Globals.deadtime,
2325                 .special        = NULL,
2326                 .enum_list      = NULL,
2327                 .flags          = FLAG_ADVANCED,
2328         },
2329         {
2330                 .label          = "getwd cache",
2331                 .type           = P_BOOL,
2332                 .p_class        = P_GLOBAL,
2333                 .ptr            = &Globals.getwd_cache,
2334                 .special        = NULL,
2335                 .enum_list      = NULL,
2336                 .flags          = FLAG_ADVANCED,
2337         },
2338         {
2339                 .label          = "keepalive",
2340                 .type           = P_INTEGER,
2341                 .p_class        = P_GLOBAL,
2342                 .ptr            = &Globals.iKeepalive,
2343                 .special        = NULL,
2344                 .enum_list      = NULL,
2345                 .flags          = FLAG_ADVANCED,
2346         },
2347         {
2348                 .label          = "change notify",
2349                 .type           = P_BOOL,
2350                 .p_class        = P_LOCAL,
2351                 .ptr            = &sDefault.bChangeNotify,
2352                 .special        = NULL,
2353                 .enum_list      = NULL,
2354                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2355         },
2356         {
2357                 .label          = "directory name cache size",
2358                 .type           = P_INTEGER,
2359                 .p_class        = P_LOCAL,
2360                 .ptr            = &sDefault.iDirectoryNameCacheSize,
2361                 .special        = NULL,
2362                 .enum_list      = NULL,
2363                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2364         },
2365         {
2366                 .label          = "kernel change notify",
2367                 .type           = P_BOOL,
2368                 .p_class        = P_LOCAL,
2369                 .ptr            = &sDefault.bKernelChangeNotify,
2370                 .special        = NULL,
2371                 .enum_list      = NULL,
2372                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2373         },
2374         {
2375                 .label          = "lpq cache time",
2376                 .type           = P_INTEGER,
2377                 .p_class        = P_GLOBAL,
2378                 .ptr            = &Globals.lpqcachetime,
2379                 .special        = NULL,
2380                 .enum_list      = NULL,
2381                 .flags          = FLAG_ADVANCED,
2382         },
2383         {
2384                 .label          = "max smbd processes",
2385                 .type           = P_INTEGER,
2386                 .p_class        = P_GLOBAL,
2387                 .ptr            = &Globals.iMaxSmbdProcesses,
2388                 .special        = NULL,
2389                 .enum_list      = NULL,
2390                 .flags          = FLAG_ADVANCED,
2391         },
2392         {
2393                 .label          = "max connections",
2394                 .type           = P_INTEGER,
2395                 .p_class        = P_LOCAL,
2396                 .ptr            = &sDefault.iMaxConnections,
2397                 .special        = NULL,
2398                 .enum_list      = NULL,
2399                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2400         },
2401         {
2402                 .label          = "paranoid server security",
2403                 .type           = P_BOOL,
2404                 .p_class        = P_GLOBAL,
2405                 .ptr            = &Globals.paranoid_server_security,
2406                 .special        = NULL,
2407                 .enum_list      = NULL,
2408                 .flags          = FLAG_ADVANCED,
2409         },
2410         {
2411                 .label          = "max disk size",
2412                 .type           = P_INTEGER,
2413                 .p_class        = P_GLOBAL,
2414                 .ptr            = &Globals.maxdisksize,
2415                 .special        = NULL,
2416                 .enum_list      = NULL,
2417                 .flags          = FLAG_ADVANCED,
2418         },
2419         {
2420                 .label          = "max open files",
2421                 .type           = P_INTEGER,
2422                 .p_class        = P_GLOBAL,
2423                 .ptr            = &Globals.max_open_files,
2424                 .special        = NULL,
2425                 .enum_list      = NULL,
2426                 .flags          = FLAG_ADVANCED,
2427         },
2428         {
2429                 .label          = "min print space",
2430                 .type           = P_INTEGER,
2431                 .p_class        = P_LOCAL,
2432                 .ptr            = &sDefault.iMinPrintSpace,
2433                 .special        = NULL,
2434                 .enum_list      = NULL,
2435                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2436         },
2437         {
2438                 .label          = "socket options",
2439                 .type           = P_STRING,
2440                 .p_class        = P_GLOBAL,
2441                 .ptr            = &Globals.szSocketOptions,
2442                 .special        = NULL,
2443                 .enum_list      = NULL,
2444                 .flags          = FLAG_ADVANCED,
2445         },
2446         {
2447                 .label          = "strict allocate",
2448                 .type           = P_BOOL,
2449                 .p_class        = P_LOCAL,
2450                 .ptr            = &sDefault.bStrictAllocate,
2451                 .special        = NULL,
2452                 .enum_list      = NULL,
2453                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2454         },
2455         {
2456                 .label          = "strict sync",
2457                 .type           = P_BOOL,
2458                 .p_class        = P_LOCAL,
2459                 .ptr            = &sDefault.bStrictSync,
2460                 .special        = NULL,
2461                 .enum_list      = NULL,
2462                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2463         },
2464         {
2465                 .label          = "sync always",
2466                 .type           = P_BOOL,
2467                 .p_class        = P_LOCAL,
2468                 .ptr            = &sDefault.bSyncAlways,
2469                 .special        = NULL,
2470                 .enum_list      = NULL,
2471                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2472         },
2473         {
2474                 .label          = "use mmap",
2475                 .type           = P_BOOL,
2476                 .p_class        = P_GLOBAL,
2477                 .ptr            = &Globals.bUseMmap,
2478                 .special        = NULL,
2479                 .enum_list      = NULL,
2480                 .flags          = FLAG_ADVANCED,
2481         },
2482         {
2483                 .label          = "use sendfile",
2484                 .type           = P_BOOL,
2485                 .p_class        = P_LOCAL,
2486                 .ptr            = &sDefault.bUseSendfile,
2487                 .special        = NULL,
2488                 .enum_list      = NULL,
2489                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2490         },
2491         {
2492                 .label          = "hostname lookups",
2493                 .type           = P_BOOL,
2494                 .p_class        = P_GLOBAL,
2495                 .ptr            = &Globals.bHostnameLookups,
2496                 .special        = NULL,
2497                 .enum_list      = NULL,
2498                 .flags          = FLAG_ADVANCED,
2499         },
2500         {
2501                 .label          = "write cache size",
2502                 .type           = P_INTEGER,
2503                 .p_class        = P_LOCAL,
2504                 .ptr            = &sDefault.iWriteCacheSize,
2505                 .special        = NULL,
2506                 .enum_list      = NULL,
2507                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED,
2508         },
2509         {
2510                 .label          = "name cache timeout",
2511                 .type           = P_INTEGER,
2512                 .p_class        = P_GLOBAL,
2513                 .ptr            = &Globals.name_cache_timeout,
2514                 .special        = NULL,
2515                 .enum_list      = NULL,
2516                 .flags          = FLAG_ADVANCED,
2517         },
2518         {
2519                 .label          = "ctdbd socket",
2520                 .type           = P_STRING,
2521                 .p_class        = P_GLOBAL,
2522                 .ptr            = &Globals.ctdbdSocket,
2523                 .special        = NULL,
2524                 .enum_list      = NULL,
2525                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2526         },
2527         {
2528                 .label          = "cluster addresses",
2529                 .type           = P_LIST,
2530                 .p_class        = P_GLOBAL,
2531                 .ptr            = &Globals.szClusterAddresses,
2532                 .special        = NULL,
2533                 .enum_list      = NULL,
2534                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2535         },
2536         {
2537                 .label          = "clustering",
2538                 .type           = P_BOOL,
2539                 .p_class        = P_GLOBAL,
2540                 .ptr            = &Globals.clustering,
2541                 .special        = NULL,
2542                 .enum_list      = NULL,
2543                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2544         },
2545         {
2546                 .label          = "ctdb timeout",
2547                 .type           = P_INTEGER,
2548                 .p_class        = P_GLOBAL,
2549                 .ptr            = &Globals.ctdb_timeout,
2550                 .special        = NULL,
2551                 .enum_list      = NULL,
2552                 .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
2553         },
2554
2555         {N_("Printing Options"), P_SEP, P_SEPARATOR},
2556
2557         {
2558                 .label          = "max reported print jobs",
2559                 .type           = P_INTEGER,
2560                 .p_class        = P_LOCAL,
2561                 .ptr            = &sDefault.iMaxReportedPrintJobs,
2562                 .special        = NULL,
2563                 .enum_list      = NULL,
2564                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2565         },
2566         {
2567                 .label          = "max print jobs",
2568                 .type           = P_INTEGER,
2569                 .p_class        = P_LOCAL,
2570                 .ptr            = &sDefault.iMaxPrintJobs,
2571                 .special        = NULL,
2572                 .enum_list      = NULL,
2573                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2574         },
2575         {
2576                 .label          = "load printers",
2577                 .type           = P_BOOL,
2578                 .p_class        = P_GLOBAL,
2579                 .ptr            = &Globals.bLoadPrinters,
2580                 .special        = NULL,
2581                 .enum_list      = NULL,
2582                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2583         },
2584         {
2585                 .label          = "printcap cache time",
2586                 .type           = P_INTEGER,
2587                 .p_class        = P_GLOBAL,
2588                 .ptr            = &Globals.PrintcapCacheTime,
2589                 .special        = NULL,
2590                 .enum_list      = NULL,
2591                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2592         },
2593         {
2594                 .label          = "printcap name",
2595                 .type           = P_STRING,
2596                 .p_class        = P_GLOBAL,
2597                 .ptr            = &Globals.szPrintcapname,
2598                 .special        = NULL,
2599                 .enum_list      = NULL,
2600                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2601         },
2602         {
2603                 .label          = "printcap",
2604                 .type           = P_STRING,
2605                 .p_class        = P_GLOBAL,
2606                 .ptr            = &Globals.szPrintcapname,
2607                 .special        = NULL,
2608                 .enum_list      = NULL,
2609                 .flags          = FLAG_HIDE,
2610         },
2611         {
2612                 .label          = "printable",
2613                 .type           = P_BOOL,
2614                 .p_class        = P_LOCAL,
2615                 .ptr            = &sDefault.bPrint_ok,
2616                 .special        = NULL,
2617                 .enum_list      = NULL,
2618                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2619         },
2620         {
2621                 .label          = "print ok",
2622                 .type           = P_BOOL,
2623                 .p_class        = P_LOCAL,
2624                 .ptr            = &sDefault.bPrint_ok,
2625                 .special        = NULL,
2626                 .enum_list      = NULL,
2627                 .flags          = FLAG_HIDE,
2628         },
2629         {
2630                 .label          = "printing",
2631                 .type           = P_ENUM,
2632                 .p_class        = P_LOCAL,
2633                 .ptr            = &sDefault.iPrinting,
2634                 .special        = handle_printing,
2635                 .enum_list      = enum_printing,
2636                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2637         },
2638         {
2639                 .label          = "cups options",
2640                 .type           = P_STRING,
2641                 .p_class        = P_LOCAL,
2642                 .ptr            = &sDefault.szCupsOptions,
2643                 .special        = NULL,
2644                 .enum_list      = NULL,
2645                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2646         },
2647         {
2648                 .label          = "cups server",
2649                 .type           = P_STRING,
2650                 .p_class        = P_GLOBAL,
2651                 .ptr            = &Globals.szCupsServer,
2652                 .special        = NULL,
2653                 .enum_list      = NULL,
2654                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2655         },
2656         {
2657                 .label          = "cups encrypt",
2658                 .type           = P_ENUM,
2659                 .p_class        = P_GLOBAL,
2660                 .ptr            = &Globals.CupsEncrypt,
2661                 .special        = NULL,
2662                 .enum_list      = enum_bool_auto,
2663                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2664         },
2665         {
2666
2667                 .label          = "cups connection timeout",
2668                 .type           = P_INTEGER,
2669                 .p_class        = P_GLOBAL,
2670                 .ptr            = &Globals.cups_connection_timeout,
2671                 .special        = NULL,
2672                 .enum_list      = NULL,
2673                 .flags          = FLAG_ADVANCED,
2674         },
2675         {
2676                 .label          = "iprint server",
2677                 .type           = P_STRING,
2678                 .p_class        = P_GLOBAL,
2679                 .ptr            = &Globals.szIPrintServer,
2680                 .special        = NULL,
2681                 .enum_list      = NULL,
2682                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2683         },
2684         {
2685                 .label          = "print command",
2686                 .type           = P_STRING,
2687                 .p_class        = P_LOCAL,
2688                 .ptr            = &sDefault.szPrintcommand,
2689                 .special        = NULL,
2690                 .enum_list      = NULL,
2691                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2692         },
2693         {
2694                 .label          = "disable spoolss",
2695                 .type           = P_BOOL,
2696                 .p_class        = P_GLOBAL,
2697                 .ptr            = &Globals.bDisableSpoolss,
2698                 .special        = NULL,
2699                 .enum_list      = NULL,
2700                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2701         },
2702         {
2703                 .label          = "enable spoolss",
2704                 .type           = P_BOOLREV,
2705                 .p_class        = P_GLOBAL,
2706                 .ptr            = &Globals.bDisableSpoolss,
2707                 .special        = NULL,
2708                 .enum_list      = NULL,
2709                 .flags          = FLAG_HIDE,
2710         },
2711         {
2712                 .label          = "lpq command",
2713                 .type           = P_STRING,
2714                 .p_class        = P_LOCAL,
2715                 .ptr            = &sDefault.szLpqcommand,
2716                 .special        = NULL,
2717                 .enum_list      = NULL,
2718                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2719         },
2720         {
2721                 .label          = "lprm command",
2722                 .type           = P_STRING,
2723                 .p_class        = P_LOCAL,
2724                 .ptr            = &sDefault.szLprmcommand,
2725                 .special        = NULL,
2726                 .enum_list      = NULL,
2727                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2728         },
2729         {
2730                 .label          = "lppause command",
2731                 .type           = P_STRING,
2732                 .p_class        = P_LOCAL,
2733                 .ptr            = &sDefault.szLppausecommand,
2734                 .special        = NULL,
2735                 .enum_list      = NULL,
2736                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2737         },
2738         {
2739                 .label          = "lpresume command",
2740                 .type           = P_STRING,
2741                 .p_class        = P_LOCAL,
2742                 .ptr            = &sDefault.szLpresumecommand,
2743                 .special        = NULL,
2744                 .enum_list      = NULL,
2745                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2746         },
2747         {
2748                 .label          = "queuepause command",
2749                 .type           = P_STRING,
2750                 .p_class        = P_LOCAL,
2751                 .ptr            = &sDefault.szQueuepausecommand,
2752                 .special        = NULL,
2753                 .enum_list      = NULL,
2754                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2755         },
2756         {
2757                 .label          = "queueresume command",
2758                 .type           = P_STRING,
2759                 .p_class        = P_LOCAL,
2760                 .ptr            = &sDefault.szQueueresumecommand,
2761                 .special        = NULL,
2762                 .enum_list      = NULL,
2763                 .flags          = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL,
2764         },
2765         {
2766                 .label          = "addport command",
2767                 .type           = P_STRING,
2768                 .p_class        = P_GLOBAL,
2769                 .ptr            = &Globals.szAddPortCommand,
2770                 .special        = NULL,
2771                 .enum_list      = NULL,
2772                 .flags          = FLAG_ADVANCED,
2773         },
2774         {
2775                 .label          = "enumports command",
2776                 .type           = P_STRING,
2777                 .p_class        = P_GLOBAL,
2778                 .ptr            = &Globals.szEnumPortsCommand,
2779                 .special        = NULL,
2780                 .enum_list      = NULL,
2781                 .flags          = FLAG_ADVANCED,
2782         },
2783         {
2784                 .label          = "addprinter command",
2785                 .type           = P_STRING,
2786                 .p_class        = P_GLOBAL,
2787                 .ptr            = &Globals.szAddPrinterCommand,
2788                 .special        = NULL,
2789                 .enum_list      = NULL,
2790                 .flags          = FLAG_ADVANCED,
2791         },
2792         {
2793                 .label          = "deleteprinter command",
2794                 .type           = P_STRING,
2795                 .p_class        = P_GLOBAL,
2796                 .ptr            = &Globals.szDeletePrinterCommand,
2797                 .special        = NULL,
2798                 .enum_list      = NULL,
2799                 .flags          = FLAG_ADVANCED,
2800         },
2801         {
2802                 .label          = "show add printer wizard",
2803                 .type           = P_BOOL,
2804                 .p_class        = P_GLOBAL,
2805                 .ptr            = &Globals.bMsAddPrinterWizard,
2806                 .special        = NULL,
2807                 .enum_list      = NULL,
2808                 .flags          = FLAG_ADVANCED,
2809         },
2810         {
2811                 .label          = "os2 driver map",
2812                 .type           = P_STRING,
2813                 .p_class        = P_GLOBAL,
2814                 .ptr            = &Globals.szOs2DriverMap,
2815                 .special        = NULL,
2816                 .enum_list      = NULL,
2817                 .flags          = FLAG_ADVANCED,
2818         },
2819
2820         {
2821                 .label          = "printer name",
2822                 .type           = P_STRING,
2823                 .p_class        = P_LOCAL,
2824                 .ptr            = &sDefault.szPrintername,
2825                 .special        = NULL,
2826                 .enum_list      = NULL,
2827                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2828         },
2829         {
2830                 .label          = "printer",
2831                 .type           = P_STRING,
2832                 .p_class        = P_LOCAL,
2833                 .ptr            = &sDefault.szPrintername,
2834                 .special        = NULL,
2835                 .enum_list      = NULL,
2836                 .flags          = FLAG_HIDE,
2837         },
2838         {
2839                 .label          = "use client driver",
2840                 .type           = P_BOOL,
2841                 .p_class        = P_LOCAL,
2842                 .ptr            = &sDefault.bUseClientDriver,
2843                 .special        = NULL,
2844                 .enum_list      = NULL,
2845                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2846         },
2847         {
2848                 .label          = "default devmode",
2849                 .type           = P_BOOL,
2850                 .p_class        = P_LOCAL,
2851                 .ptr            = &sDefault.bDefaultDevmode,
2852                 .special        = NULL,
2853                 .enum_list      = NULL,
2854                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2855         },
2856         {
2857                 .label          = "force printername",
2858                 .type           = P_BOOL,
2859                 .p_class        = P_LOCAL,
2860                 .ptr            = &sDefault.bForcePrintername,
2861                 .special        = NULL,
2862                 .enum_list      = NULL,
2863                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2864         },
2865         {
2866                 .label          = "printjob username",
2867                 .type           = P_STRING,
2868                 .p_class        = P_LOCAL,
2869                 .ptr            = &sDefault.szPrintjobUsername,
2870                 .special        = NULL,
2871                 .enum_list      = NULL,
2872                 .flags          = FLAG_ADVANCED | FLAG_PRINT,
2873         },
2874
2875         {N_("Filename Handling"), P_SEP, P_SEPARATOR},
2876
2877         {
2878                 .label          = "mangling method",
2879                 .type           = P_STRING,
2880                 .p_class        = P_GLOBAL,
2881                 .ptr            = &Globals.szManglingMethod,
2882                 .special        = NULL,
2883                 .enum_list      = NULL,
2884                 .flags          = FLAG_ADVANCED,
2885         },
2886         {
2887                 .label          = "mangle prefix",
2888                 .type           = P_INTEGER,
2889                 .p_class        = P_GLOBAL,
2890                 .ptr            = &Globals.mangle_prefix,
2891                 .special        = NULL,
2892                 .enum_list      = NULL,
2893                 .flags          = FLAG_ADVANCED,
2894         },
2895
2896         {
2897                 .label          = "default case",
2898                 .type           = P_ENUM,
2899                 .p_class        = P_LOCAL,
2900                 .ptr            = &sDefault.iDefaultCase,
2901                 .special        = NULL,
2902                 .enum_list      = enum_case,
2903                 .flags          = FLAG_ADVANCED | FLAG_SHARE,
2904         },
2905         {
2906                 .label          = "case sensitive",
2907                 .type           = P_ENUM,
2908                 .p_class        = P_LOCAL,
2909                 .ptr            = &sDefault.iCaseSensitive,
2910                 .special        = NULL,
2911                 .enum_list      = enum_bool_auto,
2912                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2913         },
2914         {
2915                 .label          = "casesignames",
2916                 .type           = P_ENUM,
2917                 .p_class        = P_LOCAL,
2918                 .ptr            = &sDefault.iCaseSensitive,
2919                 .special        = NULL,
2920                 .enum_list      = enum_bool_auto,
2921                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL | FLAG_HIDE,
2922         },
2923         {
2924                 .label          = "preserve case",
2925                 .type           = P_BOOL,
2926                 .p_class        = P_LOCAL,
2927                 .ptr            = &sDefault.bCasePreserve,
2928                 .special        = NULL,
2929                 .enum_list      = NULL,
2930                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2931         },
2932         {
2933                 .label          = "short preserve case",
2934                 .type           = P_BOOL,
2935                 .p_class        = P_LOCAL,
2936                 .ptr            = &sDefault.bShortCasePreserve,
2937                 .special        = NULL,
2938                 .enum_list      = NULL,
2939                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2940         },
2941         {
2942                 .label          = "mangling char",
2943                 .type           = P_CHAR,
2944                 .p_class        = P_LOCAL,
2945                 .ptr            = &sDefault.magic_char,
2946                 .special        = NULL,
2947                 .enum_list      = NULL,
2948                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2949         },
2950         {
2951                 .label          = "hide dot files",
2952                 .type           = P_BOOL,
2953                 .p_class        = P_LOCAL,
2954                 .ptr            = &sDefault.bHideDotFiles,
2955                 .special        = NULL,
2956                 .enum_list      = NULL,
2957                 .flags          = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL,
2958         },