2 Unix SMB/CIFS implementation.
3 Parameter loading functions
4 Copyright (C) Karl Auer 1993-1998
6 Largely re-written by Andrew Tridgell, September 1994
8 Copyright (C) Simo Sorce 2001
9 Copyright (C) Alexander Bokovoy 2002
10 Copyright (C) Stefan (metze) Metzmacher 2002
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 * This module provides suitable callback functions for the params
31 * module. It builds the internal table of service details which is
32 * then used by the rest of the server.
36 * 1) add it to the global or service structure definition
37 * 2) add it to the parm_table
38 * 3) add it to the list of available functions (eg: using FN_GLOBAL_STRING())
39 * 4) If it's a global then initialise it in init_globals. If a local
40 * (ie. service) parameter then initialise it in the sDefault structure
44 * The configuration file is processed sequentially for speed. It is NOT
45 * accessed randomly as happens in 'real' Windows. For this reason, there
46 * is a fair bit of sequence-dependent code here - ie., code which assumes
47 * that certain things happen before others. In particular, the code which
48 * happens at the boundary between sections is delicately poised, so be
55 BOOL in_client
= False
; /* Not in the client by default */
58 extern userdom_struct current_user_info
;
59 extern pstring user_socket_options
;
62 #define GLOBAL_NAME "global"
66 #define PRINTERS_NAME "printers"
70 #define HOMES_NAME "homes"
73 /* some helpful bits */
74 #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && ServicePtrs[(i)]->valid)
75 #define VALID(i) ServicePtrs[i]->valid
77 int keepalive
= DEFAULT_KEEPALIVE
;
78 BOOL use_getwd_cache
= True
;
80 extern int extra_time_offset
;
82 static BOOL defaults_saved
= False
;
84 typedef struct _param_opt_struct param_opt_struct
;
85 struct _param_opt_struct
{
86 param_opt_struct
*prev
, *next
;
92 * This structure describes global (ie., server-wide) parameters.
99 char *display_charset
;
100 char *szPrintcapname
;
101 char *szEnumPortsCommand
;
102 char *szAddPrinterCommand
;
103 char *szDeletePrinterCommand
;
104 char *szOs2DriverMap
;
108 char *szDefaultService
;
112 char *szServerString
;
113 char *szAutoServices
;
114 char *szPasswdProgram
;
118 char *szSMBPasswdFile
;
120 char **szPassdbBackend
;
123 char *szPasswordServer
;
124 char *szSocketOptions
;
132 char **szWINSservers
;
134 char *szRemoteAnnounce
;
135 char *szRemoteBrowseSync
;
136 char *szSocketAddress
;
137 char *szNISHomeMapName
;
138 char *szAnnounceVersion
; /* This is initialised in init_globals */
141 char **szNetbiosAliases
;
142 char *szNetbiosScope
;
143 char *szDomainOtherSIDs
;
144 char *szNameResolveOrder
;
146 char *szAddUserScript
;
147 char *szDelUserScript
;
148 char *szAddGroupScript
;
149 char *szDelGroupScript
;
150 char *szAddUserToGroupScript
;
151 char *szDelUserFromGroupScript
;
152 char *szSetPrimaryGroupScript
;
153 char *szAddMachineScript
;
154 char *szShutdownScript
;
155 char *szAbortShutdownScript
;
157 char *szWINSPartners
;
166 char *szNonUnixAccountRange
;
167 int AlgorithmicRidBase
;
168 char *szTemplateHomedir
;
169 char *szTemplateShell
;
170 char *szWinbindSeparator
;
171 BOOL bWinbindEnumUsers
;
172 BOOL bWinbindEnumGroups
;
173 BOOL bWinbindUseDefaultDomain
;
174 char *szAddShareCommand
;
175 char *szChangeShareCommand
;
176 char *szDeleteShareCommand
;
177 char *szGuestaccount
;
178 char *szManglingMethod
;
193 BOOL paranoid_server_security
;
196 int iMaxSmbdProcesses
;
197 BOOL bDisableSpoolss
;
201 int enhanced_browsing
;
208 int announce_as
; /* This is initialised in init_globals */
209 int machine_password_timeout
;
210 int change_notify_timeout
;
213 int min_passwd_length
;
214 int oplock_break_wait_time
;
215 int winbind_cache_time
;
218 char *szLdapMachineSuffix
;
219 char *szLdapUserSuffix
;
220 #ifdef WITH_LDAP_SAMCONFIG
230 int ldap_passwd_sync
;
231 BOOL bMsAddPrinterWizard
;
236 BOOL bPreferredMaster
;
239 BOOL bEncryptPasswords
;
243 BOOL bObeyPamRestrictions
;
245 BOOL bLargeReadwrite
;
248 BOOL bReadPrediction
;
254 BOOL bBindInterfacesOnly
;
255 BOOL bPamPasswordChange
;
256 BOOL bUnixPasswdSync
;
257 BOOL bPasswdChatDebug
;
261 BOOL bNTStatusSupport
;
264 BOOL bAllowTrustedDomains
;
268 BOOL bClientLanManAuth
;
269 BOOL bClientNTLMv2Auth
;
270 BOOL bClientUseSpnego
;
271 BOOL bDebugHiresTimestamp
;
275 BOOL bHideLocalUsers
;
278 BOOL bHostnameLookups
;
279 BOOL bUnixExtensions
;
280 BOOL bDisableNetbios
;
281 BOOL bKernelChangeNotify
;
282 int restrict_anonymous
;
283 int name_cache_timeout
;
285 param_opt_struct
*param_opt
;
289 static global Globals
;
292 * This structure describes a single service.
301 char **szInvalidUsers
;
309 char *szRootPostExec
;
310 char *szPrintcommand
;
313 char *szLppausecommand
;
314 char *szLpresumecommand
;
315 char *szQueuepausecommand
;
316 char *szQueueresumecommand
;
326 char *szVetoOplockFiles
;
332 char **printer_admin
;
335 char *szVfsObjectFile
;
343 int iCreate_force_mode
;
345 int iSecurity_force_mode
;
348 int iDir_Security_mask
;
349 int iDir_Security_force_mode
;
353 int iOplockContentionLimit
;
357 BOOL bRootpreexecClose
;
360 BOOL bShortCasePreserve
;
363 BOOL bHideSpecialFiles
;
364 BOOL bHideUnReadable
;
365 BOOL bHideUnWriteableFiles
;
387 BOOL bStrictAllocate
;
391 BOOL bDeleteReadonly
;
393 BOOL bDeleteVetoFiles
;
396 BOOL bDosFiletimeResolution
;
397 BOOL bFakeDirCreateTimes
;
402 BOOL bUseClientDriver
;
403 BOOL bDefaultDevmode
;
407 param_opt_struct
*param_opt
;
409 char dummy
[3]; /* for alignment */
414 /* This is a default service used to prime a services structure */
415 static service sDefault
= {
417 False
, /* not autoloaded */
418 NULL
, /* szService */
420 NULL
, /* szUsername */
421 NULL
, /* szInvalidUsers */
422 NULL
, /* szValidUsers */
423 NULL
, /* szAdminUsers */
425 NULL
, /* szInclude */
426 NULL
, /* szPreExec */
427 NULL
, /* szPostExec */
428 NULL
, /* szRootPreExec */
429 NULL
, /* szRootPostExec */
430 NULL
, /* szPrintcommand */
431 NULL
, /* szLpqcommand */
432 NULL
, /* szLprmcommand */
433 NULL
, /* szLppausecommand */
434 NULL
, /* szLpresumecommand */
435 NULL
, /* szQueuepausecommand */
436 NULL
, /* szQueueresumecommand */
437 NULL
, /* szPrintername */
438 NULL
, /* szDontdescend */
439 NULL
, /* szHostsallow */
440 NULL
, /* szHostsdeny */
441 NULL
, /* szMagicScript */
442 NULL
, /* szMagicOutput */
443 NULL
, /* szMangledMap */
444 NULL
, /* szVetoFiles */
445 NULL
, /* szHideFiles */
446 NULL
, /* szVetoOplockFiles */
448 NULL
, /* force user */
449 NULL
, /* force group */
451 NULL
, /* writelist */
452 NULL
, /* printer admin */
455 NULL
, /* vfs object */
456 NULL
, /* vfs options */
458 NULL
, /* szMSDfsProxy */
459 0, /* iMinPrintSpace */
460 1000, /* iMaxPrintJobs */
461 0, /* iWriteCacheSize */
462 0744, /* iCreate_mask */
463 0000, /* iCreate_force_mode */
464 0777, /* iSecurity_mask */
465 0, /* iSecurity_force_mode */
466 0755, /* iDir_mask */
467 0000, /* iDir_force_mode */
468 0777, /* iDir_Security_mask */
469 0, /* iDir_Security_force_mode */
470 0, /* iMaxConnections */
471 CASE_LOWER
, /* iDefaultCase */
472 DEFAULT_PRINTING
, /* iPrinting */
473 2, /* iOplockContentionLimit */
475 1024, /* iBlock_size */
476 False
, /* bPreexecClose */
477 False
, /* bRootpreexecClose */
478 False
, /* case sensitive */
479 True
, /* case preserve */
480 True
, /* short case preserve */
481 False
, /* case mangle */
482 True
, /* bHideDotFiles */
483 False
, /* bHideSpecialFiles */
484 False
, /* bHideUnReadable */
485 False
, /* bHideUnWriteableFiles */
486 True
, /* bBrowseable */
487 True
, /* bAvailable */
488 True
, /* bRead_only */
489 True
, /* bNo_set_dir */
490 False
, /* bGuest_only */
491 False
, /* bGuest_ok */
492 False
, /* bPrint_ok */
493 False
, /* bMap_system */
494 False
, /* bMap_hidden */
495 True
, /* bMap_archive */
497 True
, /* bStrictLocking */
498 True
, /* bPosixLocking */
499 True
, /* bShareModes */
501 True
, /* bLevel2OpLocks */
502 False
, /* bOnlyUser */
503 True
, /* bMangledNames */
504 True
, /* bWidelinks */
505 True
, /* bSymlinks */
506 False
, /* bSyncAlways */
507 False
, /* bStrictAllocate */
508 False
, /* bStrictSync */
509 '~', /* magic char */
511 False
, /* bDeleteReadonly */
512 False
, /* bFakeOplocks */
513 False
, /* bDeleteVetoFiles */
514 False
, /* bDosFilemode */
515 False
, /* bDosFiletimes */
516 False
, /* bDosFiletimeResolution */
517 False
, /* bFakeDirCreateTimes */
518 True
, /* bBlockingLocks */
519 False
, /* bInheritPerms */
520 False
, /* bInheritACLS */
521 False
, /* bMSDfsRoot */
522 False
, /* bUseClientDriver */
523 False
, /* bDefaultDevmode */
524 True
, /* bNTAclSupport */
525 False
, /* bUseSendfile */
526 False
, /* bProfileAcls */
528 NULL
, /* Parametric options */
533 /* local variables */
534 static service
**ServicePtrs
= NULL
;
535 static int iNumServices
= 0;
536 static int iServiceIndex
= 0;
537 static BOOL bInGlobalSection
= True
;
538 static BOOL bGlobalOnly
= False
;
539 static int server_role
;
540 static int default_server_announce
;
542 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
544 /* prototypes for the special type handlers */
545 static BOOL
handle_include(const char *pszParmValue
, char **ptr
);
546 static BOOL
handle_copy(const char *pszParmValue
, char **ptr
);
547 static BOOL
handle_vfs_object(const char *pszParmValue
, char **ptr
);
548 static BOOL
handle_source_env(const char *pszParmValue
, char **ptr
);
549 static BOOL
handle_netbios_name(const char *pszParmValue
, char **ptr
);
550 static BOOL
handle_winbind_uid(const char *pszParmValue
, char **ptr
);
551 static BOOL
handle_winbind_gid(const char *pszParmValue
, char **ptr
);
552 static BOOL
handle_non_unix_account_range(const char *pszParmValue
, char **ptr
);
553 static BOOL
handle_debug_list( const char *pszParmValue
, char **ptr
);
554 static BOOL
handle_workgroup( const char *pszParmValue
, char **ptr
);
555 static BOOL
handle_netbios_aliases( const char *pszParmValue
, char **ptr
);
556 static BOOL
handle_netbios_scope( const char *pszParmValue
, char **ptr
);
558 static BOOL
handle_ldap_machine_suffix ( const char *pszParmValue
, char **ptr
);
559 static BOOL
handle_ldap_user_suffix ( const char *pszParmValue
, char **ptr
);
560 static BOOL
handle_ldap_suffix ( const char *pszParmValue
, char **ptr
);
562 static BOOL
handle_acl_compatibility(const char *pszParmValue
, char **ptr
);
564 static void set_server_role(void);
565 static void set_default_server_announce_type(void);
567 static const struct enum_list enum_protocol
[] = {
568 {PROTOCOL_NT1
, "NT1"},
569 {PROTOCOL_LANMAN2
, "LANMAN2"},
570 {PROTOCOL_LANMAN1
, "LANMAN1"},
571 {PROTOCOL_CORE
, "CORE"},
572 {PROTOCOL_COREPLUS
, "COREPLUS"},
573 {PROTOCOL_COREPLUS
, "CORE+"},
577 static const struct enum_list enum_security
[] = {
578 {SEC_SHARE
, "SHARE"},
580 {SEC_SERVER
, "SERVER"},
581 {SEC_DOMAIN
, "DOMAIN"},
588 static const struct enum_list enum_printing
[] = {
589 {PRINT_SYSV
, "sysv"},
591 {PRINT_HPUX
, "hpux"},
595 {PRINT_LPRNG
, "lprng"},
596 {PRINT_SOFTQ
, "softq"},
597 {PRINT_CUPS
, "cups"},
599 {PRINT_LPROS2
, "os2"},
601 {PRINT_TEST
, "test"},
603 #endif /* DEVELOPER */
607 static const struct enum_list enum_ldap_ssl
[] = {
608 #ifdef WITH_LDAP_SAMCONFIG
609 {LDAP_SSL_ON
, "Yes"},
610 {LDAP_SSL_ON
, "yes"},
614 {LDAP_SSL_OFF
, "no"},
615 {LDAP_SSL_OFF
, "No"},
616 {LDAP_SSL_OFF
, "off"},
617 {LDAP_SSL_OFF
, "Off"},
618 {LDAP_SSL_START_TLS
, "start tls"},
619 {LDAP_SSL_START_TLS
, "Start_tls"},
623 static const struct enum_list enum_ldap_passwd_sync
[] = {
624 {LDAP_PASSWD_SYNC_ON
, "Yes"},
625 {LDAP_PASSWD_SYNC_ON
, "yes"},
626 {LDAP_PASSWD_SYNC_ON
, "on"},
627 {LDAP_PASSWD_SYNC_ON
, "On"},
628 {LDAP_PASSWD_SYNC_OFF
, "no"},
629 {LDAP_PASSWD_SYNC_OFF
, "No"},
630 {LDAP_PASSWD_SYNC_OFF
, "off"},
631 {LDAP_PASSWD_SYNC_OFF
, "Off"},
632 #ifdef LDAP_EXOP_X_MODIFY_PASSWD
633 {LDAP_PASSWD_SYNC_ONLY
, "Only"},
634 {LDAP_PASSWD_SYNC_ONLY
, "only"},
635 #endif /* LDAP_EXOP_X_MODIFY_PASSWD */
639 /* Types of machine we can announce as. */
640 #define ANNOUNCE_AS_NT_SERVER 1
641 #define ANNOUNCE_AS_WIN95 2
642 #define ANNOUNCE_AS_WFW 3
643 #define ANNOUNCE_AS_NT_WORKSTATION 4
645 static const struct enum_list enum_announce_as
[] = {
646 {ANNOUNCE_AS_NT_SERVER
, "NT"},
647 {ANNOUNCE_AS_NT_SERVER
, "NT Server"},
648 {ANNOUNCE_AS_NT_WORKSTATION
, "NT Workstation"},
649 {ANNOUNCE_AS_WIN95
, "win95"},
650 {ANNOUNCE_AS_WFW
, "WfW"},
654 static const struct enum_list enum_case
[] = {
655 {CASE_LOWER
, "lower"},
656 {CASE_UPPER
, "upper"},
660 static const struct enum_list enum_bool_auto
[] = {
671 /* Client-side offline caching policy types */
672 #define CSC_POLICY_MANUAL 0
673 #define CSC_POLICY_DOCUMENTS 1
674 #define CSC_POLICY_PROGRAMS 2
675 #define CSC_POLICY_DISABLE 3
677 static const struct enum_list enum_csc_policy
[] = {
678 {CSC_POLICY_MANUAL
, "manual"},
679 {CSC_POLICY_DOCUMENTS
, "documents"},
680 {CSC_POLICY_PROGRAMS
, "programs"},
681 {CSC_POLICY_DISABLE
, "disable"},
686 Do you want session setups at user level security with a invalid
687 password to be rejected or allowed in as guest? WinNT rejects them
688 but it can be a pain as it means "net view" needs to use a password
690 You have 3 choices in the setting of map_to_guest:
692 "Never" means session setups with an invalid password
693 are rejected. This is the default.
695 "Bad User" means session setups with an invalid password
696 are rejected, unless the username does not exist, in which case it
697 is treated as a guest login
699 "Bad Password" means session setups with an invalid password
700 are treated as a guest login
702 Note that map_to_guest only has an effect in user or server
706 static const struct enum_list enum_map_to_guest
[] = {
707 {NEVER_MAP_TO_GUEST
, "Never"},
708 {MAP_TO_GUEST_ON_BAD_USER
, "Bad User"},
709 {MAP_TO_GUEST_ON_BAD_PASSWORD
, "Bad Password"},
713 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
715 * Note: We have a flag called FLAG_DEVELOPER but is not used at this time, it
716 * is implied in current control logic. This may change at some later time. A
717 * flag value of 0 means - show as development option only.
719 * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit
720 * screen in SWAT. This is used to exclude parameters as well as to squash all
721 * parameters that have been duplicated by pseudonyms.
723 static struct parm_struct parm_table
[] = {
724 {"Base Options", P_SEP
, P_SEPARATOR
},
726 {"dos charset", P_STRING
, P_GLOBAL
, &Globals
.dos_charset
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
727 {"unix charset", P_STRING
, P_GLOBAL
, &Globals
.unix_charset
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
728 {"display charset", P_STRING
, P_GLOBAL
, &Globals
.display_charset
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
729 {"comment", P_STRING
, P_LOCAL
, &sDefault
.comment
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
730 {"path", P_STRING
, P_LOCAL
, &sDefault
.szPath
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
731 {"directory", P_STRING
, P_LOCAL
, &sDefault
.szPath
, NULL
, NULL
, FLAG_HIDE
},
732 {"workgroup", P_USTRING
, P_GLOBAL
, &Globals
.szWorkgroup
, handle_workgroup
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
733 {"realm", P_USTRING
, P_GLOBAL
, &Globals
.szRealm
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
734 {"ADS server", P_STRING
, P_GLOBAL
, &Globals
.szADSserver
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
735 {"netbios name", P_USTRING
, P_GLOBAL
, &Globals
.szNetbiosName
, handle_netbios_name
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
736 {"netbios aliases", P_LIST
, P_GLOBAL
, &Globals
.szNetbiosAliases
, handle_netbios_aliases
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
737 {"netbios scope", P_USTRING
, P_GLOBAL
, &Globals
.szNetbiosScope
, handle_netbios_scope
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
738 {"server string", P_STRING
, P_GLOBAL
, &Globals
.szServerString
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
739 {"interfaces", P_LIST
, P_GLOBAL
, &Globals
.szInterfaces
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
740 {"bind interfaces only", P_BOOL
, P_GLOBAL
, &Globals
.bBindInterfacesOnly
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
742 {"Security Options", P_SEP
, P_SEPARATOR
},
744 {"security", P_ENUM
, P_GLOBAL
, &Globals
.security
, NULL
, enum_security
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
745 {"auth methods", P_LIST
, P_GLOBAL
, &Globals
.AuthMethods
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
746 {"encrypt passwords", P_BOOL
, P_GLOBAL
, &Globals
.bEncryptPasswords
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
747 {"update encrypted", P_BOOL
, P_GLOBAL
, &Globals
.bUpdateEncrypt
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
748 {"allow trusted domains", P_BOOL
, P_GLOBAL
, &Globals
.bAllowTrustedDomains
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
749 {"hosts equiv", P_STRING
, P_GLOBAL
, &Globals
.szHostsEquiv
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
750 {"min passwd length", P_INTEGER
, P_GLOBAL
, &Globals
.min_passwd_length
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
751 {"min password length", P_INTEGER
, P_GLOBAL
, &Globals
.min_passwd_length
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
752 {"map to guest", P_ENUM
, P_GLOBAL
, &Globals
.map_to_guest
, NULL
, enum_map_to_guest
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
753 {"null passwords", P_BOOL
, P_GLOBAL
, &Globals
.bNullPasswords
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
754 {"obey pam restrictions", P_BOOL
, P_GLOBAL
, &Globals
.bObeyPamRestrictions
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
755 {"password server", P_STRING
, P_GLOBAL
, &Globals
.szPasswordServer
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
756 {"smb passwd file", P_STRING
, P_GLOBAL
, &Globals
.szSMBPasswdFile
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
757 {"private dir", P_STRING
, P_GLOBAL
, &Globals
.szPrivateDir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
758 {"passdb backend", P_LIST
, P_GLOBAL
, &Globals
.szPassdbBackend
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
759 {"sam backend", P_LIST
, P_GLOBAL
, &Globals
.szSamBackend
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
760 {"non unix account range", P_STRING
, P_GLOBAL
, &Globals
.szNonUnixAccountRange
, handle_non_unix_account_range
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
761 {"algorithmic rid base", P_INTEGER
, P_GLOBAL
, &Globals
.AlgorithmicRidBase
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
762 {"root directory", P_STRING
, P_GLOBAL
, &Globals
.szRootdir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
763 {"root dir", P_STRING
, P_GLOBAL
, &Globals
.szRootdir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
764 {"root", P_STRING
, P_GLOBAL
, &Globals
.szRootdir
, NULL
, NULL
, FLAG_HIDE
| FLAG_DEVELOPER
},
765 {"guest account", P_STRING
, P_GLOBAL
, &Globals
.szGuestaccount
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
767 {"pam password change", P_BOOL
, P_GLOBAL
, &Globals
.bPamPasswordChange
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
768 {"passwd program", P_STRING
, P_GLOBAL
, &Globals
.szPasswdProgram
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
769 {"passwd chat", P_STRING
, P_GLOBAL
, &Globals
.szPasswdChat
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
770 {"passwd chat debug", P_BOOL
, P_GLOBAL
, &Globals
.bPasswdChatDebug
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
771 {"username map", P_STRING
, P_GLOBAL
, &Globals
.szUsernameMap
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
| FLAG_DEVELOPER
},
772 {"password level", P_INTEGER
, P_GLOBAL
, &Globals
.pwordlevel
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
773 {"username level", P_INTEGER
, P_GLOBAL
, &Globals
.unamelevel
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
774 {"unix password sync", P_BOOL
, P_GLOBAL
, &Globals
.bUnixPasswdSync
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
775 {"restrict anonymous", P_INTEGER
, P_GLOBAL
, &Globals
.restrict_anonymous
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
776 {"lanman auth", P_BOOL
, P_GLOBAL
, &Globals
.bLanmanAuth
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
777 {"ntlm auth", P_BOOL
, P_GLOBAL
, &Globals
.bNTLMAuth
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
778 {"client NTLMv2 auth", P_BOOL
, P_GLOBAL
, &Globals
.bClientNTLMv2Auth
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
779 {"client lanman auth", P_BOOL
, P_GLOBAL
, &Globals
.bClientLanManAuth
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
781 {"username", P_STRING
, P_LOCAL
, &sDefault
.szUsername
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
782 {"user", P_STRING
, P_LOCAL
, &sDefault
.szUsername
, NULL
, NULL
, FLAG_HIDE
},
783 {"users", P_STRING
, P_LOCAL
, &sDefault
.szUsername
, NULL
, NULL
, FLAG_HIDE
},
785 {"invalid users", P_LIST
, P_LOCAL
, &sDefault
.szInvalidUsers
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
786 {"valid users", P_LIST
, P_LOCAL
, &sDefault
.szValidUsers
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
787 {"admin users", P_LIST
, P_LOCAL
, &sDefault
.szAdminUsers
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
788 {"read list", P_LIST
, P_LOCAL
, &sDefault
.readlist
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
789 {"write list", P_LIST
, P_LOCAL
, &sDefault
.writelist
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
790 {"printer admin", P_LIST
, P_LOCAL
, &sDefault
.printer_admin
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_PRINT
},
791 {"force user", P_STRING
, P_LOCAL
, &sDefault
.force_user
, NULL
, NULL
, FLAG_SHARE
},
792 {"force group", P_STRING
, P_LOCAL
, &sDefault
.force_group
, NULL
, NULL
, FLAG_SHARE
},
793 {"group", P_STRING
, P_LOCAL
, &sDefault
.force_group
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
795 {"read only", P_BOOL
, P_LOCAL
, &sDefault
.bRead_only
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
},
796 {"write ok", P_BOOLREV
, P_LOCAL
, &sDefault
.bRead_only
, NULL
, NULL
, FLAG_HIDE
},
797 {"writeable", P_BOOLREV
, P_LOCAL
, &sDefault
.bRead_only
, NULL
, NULL
, FLAG_HIDE
},
798 {"writable", P_BOOLREV
, P_LOCAL
, &sDefault
.bRead_only
, NULL
, NULL
, FLAG_HIDE
},
800 {"create mask", P_OCTAL
, P_LOCAL
, &sDefault
.iCreate_mask
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
801 {"create mode", P_OCTAL
, P_LOCAL
, &sDefault
.iCreate_mask
, NULL
, NULL
, FLAG_GLOBAL
},
802 {"force create mode", P_OCTAL
, P_LOCAL
, &sDefault
.iCreate_force_mode
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
803 {"security mask", P_OCTAL
, P_LOCAL
, &sDefault
.iSecurity_mask
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
804 {"force security mode", P_OCTAL
, P_LOCAL
, &sDefault
.iSecurity_force_mode
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
805 {"directory mask", P_OCTAL
, P_LOCAL
, &sDefault
.iDir_mask
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
806 {"directory mode", P_OCTAL
, P_LOCAL
, &sDefault
.iDir_mask
, NULL
, NULL
, FLAG_GLOBAL
},
807 {"force directory mode", P_OCTAL
, P_LOCAL
, &sDefault
.iDir_force_mode
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
808 {"directory security mask", P_OCTAL
, P_LOCAL
, &sDefault
.iDir_Security_mask
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
809 {"force directory security mode", P_OCTAL
, P_LOCAL
, &sDefault
.iDir_Security_force_mode
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
},
810 {"inherit permissions", P_BOOL
, P_LOCAL
, &sDefault
.bInheritPerms
, NULL
, NULL
, FLAG_SHARE
},
811 {"inherit acls", P_BOOL
, P_LOCAL
, &sDefault
.bInheritACLS
, NULL
, NULL
, FLAG_SHARE
},
812 {"guest only", P_BOOL
, P_LOCAL
, &sDefault
.bGuest_only
, NULL
, NULL
, FLAG_SHARE
},
813 {"only guest", P_BOOL
, P_LOCAL
, &sDefault
.bGuest_only
, NULL
, NULL
, FLAG_HIDE
},
815 {"guest ok", P_BOOL
, P_LOCAL
, &sDefault
.bGuest_ok
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
816 {"public", P_BOOL
, P_LOCAL
, &sDefault
.bGuest_ok
, NULL
, NULL
, FLAG_HIDE
},
818 {"only user", P_BOOL
, P_LOCAL
, &sDefault
.bOnlyUser
, NULL
, NULL
, FLAG_SHARE
},
819 {"hosts allow", P_LIST
, P_LOCAL
, &sDefault
.szHostsallow
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
820 {"allow hosts", P_LIST
, P_LOCAL
, &sDefault
.szHostsallow
, NULL
, NULL
, FLAG_HIDE
},
821 {"hosts deny", P_LIST
, P_LOCAL
, &sDefault
.szHostsdeny
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
822 {"deny hosts", P_LIST
, P_LOCAL
, &sDefault
.szHostsdeny
, NULL
, NULL
, FLAG_HIDE
},
823 {"modules", P_LIST
, P_GLOBAL
, &Globals
.szModules
, NULL
, NULL
, FLAG_BASIC
| FLAG_GLOBAL
},
825 {"Logging Options", P_SEP
, P_SEPARATOR
},
827 {"log level", P_STRING
, P_GLOBAL
, &Globals
.szLogLevel
, handle_debug_list
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
828 {"debuglevel", P_STRING
, P_GLOBAL
, &Globals
.szLogLevel
, handle_debug_list
, NULL
, FLAG_HIDE
},
829 {"syslog", P_INTEGER
, P_GLOBAL
, &Globals
.syslog
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
830 {"syslog only", P_BOOL
, P_GLOBAL
, &Globals
.bSyslogOnly
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
831 {"log file", P_STRING
, P_GLOBAL
, &Globals
.szLogFile
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
833 {"max log size", P_INTEGER
, P_GLOBAL
, &Globals
.max_log_size
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
834 {"timestamp logs", P_BOOL
, P_GLOBAL
, &Globals
.bTimestampLogs
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
835 {"debug timestamp", P_BOOL
, P_GLOBAL
, &Globals
.bTimestampLogs
, NULL
, NULL
, FLAG_DEVELOPER
},
836 {"debug hires timestamp", P_BOOL
, P_GLOBAL
, &Globals
.bDebugHiresTimestamp
, NULL
, NULL
, FLAG_DEVELOPER
},
837 {"debug pid", P_BOOL
, P_GLOBAL
, &Globals
.bDebugPid
, NULL
, NULL
, FLAG_DEVELOPER
},
838 {"debug uid", P_BOOL
, P_GLOBAL
, &Globals
.bDebugUid
, NULL
, NULL
, FLAG_DEVELOPER
},
840 {"Protocol Options", P_SEP
, P_SEPARATOR
},
842 {"smb ports", P_STRING
, P_GLOBAL
, &Globals
.smb_ports
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
843 {"protocol", P_ENUM
, P_GLOBAL
, &Globals
.maxprotocol
, NULL
, enum_protocol
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
844 {"large readwrite", P_BOOL
, P_GLOBAL
, &Globals
.bLargeReadwrite
, NULL
, NULL
, FLAG_DEVELOPER
},
845 {"max protocol", P_ENUM
, P_GLOBAL
, &Globals
.maxprotocol
, NULL
, enum_protocol
, FLAG_DEVELOPER
},
846 {"min protocol", P_ENUM
, P_GLOBAL
, &Globals
.minprotocol
, NULL
, enum_protocol
, FLAG_DEVELOPER
},
847 {"unicode", P_BOOL
, P_GLOBAL
, &Globals
.bUnicode
, NULL
, NULL
, FLAG_DEVELOPER
},
848 {"read bmpx", P_BOOL
, P_GLOBAL
, &Globals
.bReadbmpx
, NULL
, NULL
, FLAG_DEVELOPER
},
849 {"read raw", P_BOOL
, P_GLOBAL
, &Globals
.bReadRaw
, NULL
, NULL
, FLAG_DEVELOPER
},
850 {"write raw", P_BOOL
, P_GLOBAL
, &Globals
.bWriteRaw
, NULL
, NULL
, FLAG_DEVELOPER
},
851 {"disable netbios", P_BOOL
, P_GLOBAL
, &Globals
.bDisableNetbios
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
853 {"acl compatibility", P_STRING
, P_GLOBAL
, &Globals
.szAclCompat
, handle_acl_compatibility
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
| FLAG_ADVANCED
},
854 {"nt acl support", P_BOOL
, P_LOCAL
, &sDefault
.bNTAclSupport
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
| FLAG_ADVANCED
| FLAG_WIZARD
},
855 {"nt pipe support", P_BOOL
, P_GLOBAL
, &Globals
.bNTPipeSupport
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
856 {"nt status support", P_BOOL
, P_GLOBAL
, &Globals
.bNTStatusSupport
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
857 {"profile acls", P_BOOL
, P_LOCAL
, &sDefault
.bProfileAcls
, NULL
, NULL
, FLAG_GLOBAL
| FLAG_SHARE
| FLAG_ADVANCED
| FLAG_WIZARD
},
859 {"announce version", P_STRING
, P_GLOBAL
, &Globals
.szAnnounceVersion
, NULL
, NULL
, FLAG_DEVELOPER
},
860 {"announce as", P_ENUM
, P_GLOBAL
, &Globals
.announce_as
, NULL
, enum_announce_as
, FLAG_DEVELOPER
},
861 {"max mux", P_INTEGER
, P_GLOBAL
, &Globals
.max_mux
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
862 {"max xmit", P_INTEGER
, P_GLOBAL
, &Globals
.max_xmit
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
864 {"name resolve order", P_STRING
, P_GLOBAL
, &Globals
.szNameResolveOrder
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
865 {"max ttl", P_INTEGER
, P_GLOBAL
, &Globals
.max_ttl
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
866 {"max wins ttl", P_INTEGER
, P_GLOBAL
, &Globals
.max_wins_ttl
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
867 {"min wins ttl", P_INTEGER
, P_GLOBAL
, &Globals
.min_wins_ttl
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
868 {"time server", P_BOOL
, P_GLOBAL
, &Globals
.bTimeServer
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
869 {"unix extensions", P_BOOL
, P_GLOBAL
, &Globals
.bUnixExtensions
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
870 {"use spnego", P_BOOL
, P_GLOBAL
, &Globals
.bUseSpnego
, NULL
, NULL
, FLAG_DEVELOPER
},
871 {"client signing", P_BOOL
, P_GLOBAL
, &Globals
.client_signing
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
872 {"client use spnego", P_BOOL
, P_GLOBAL
, &Globals
.bClientUseSpnego
, NULL
, NULL
, FLAG_DEVELOPER
},
874 {"Tuning Options", P_SEP
, P_SEPARATOR
},
876 {"block size", P_INTEGER
, P_LOCAL
, &sDefault
.iBlock_size
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
877 {"change notify timeout", P_INTEGER
, P_GLOBAL
, &Globals
.change_notify_timeout
, NULL
, NULL
, FLAG_DEVELOPER
},
878 {"deadtime", P_INTEGER
, P_GLOBAL
, &Globals
.deadtime
, NULL
, NULL
, FLAG_DEVELOPER
},
879 {"getwd cache", P_BOOL
, P_GLOBAL
, &use_getwd_cache
, NULL
, NULL
, FLAG_DEVELOPER
},
880 {"keepalive", P_INTEGER
, P_GLOBAL
, &keepalive
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
881 {"kernel change notify", P_BOOL
, P_GLOBAL
, &Globals
.bKernelChangeNotify
, NULL
, NULL
, FLAG_DEVELOPER
},
883 {"lpq cache time", P_INTEGER
, P_GLOBAL
, &Globals
.lpqcachetime
, NULL
, NULL
, FLAG_DEVELOPER
},
884 {"max smbd processes", P_INTEGER
, P_GLOBAL
, &Globals
.iMaxSmbdProcesses
, NULL
, NULL
, FLAG_DEVELOPER
},
885 {"max connections", P_INTEGER
, P_LOCAL
, &sDefault
.iMaxConnections
, NULL
, NULL
, FLAG_SHARE
},
886 {"paranoid server security", P_BOOL
, P_GLOBAL
, &Globals
.paranoid_server_security
, NULL
, NULL
, FLAG_DEVELOPER
},
887 {"max disk size", P_INTEGER
, P_GLOBAL
, &Globals
.maxdisksize
, NULL
, NULL
, FLAG_DEVELOPER
},
888 {"max open files", P_INTEGER
, P_GLOBAL
, &Globals
.max_open_files
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
889 {"min print space", P_INTEGER
, P_LOCAL
, &sDefault
.iMinPrintSpace
, NULL
, NULL
, FLAG_PRINT
},
890 {"read size", P_INTEGER
, P_GLOBAL
, &Globals
.ReadSize
, NULL
, NULL
, FLAG_DEVELOPER
},
892 {"socket options", P_GSTRING
, P_GLOBAL
, user_socket_options
, NULL
, NULL
, FLAG_DEVELOPER
},
893 {"stat cache size", P_INTEGER
, P_GLOBAL
, &Globals
.stat_cache_size
, NULL
, NULL
, FLAG_DEVELOPER
},
894 {"strict allocate", P_BOOL
, P_LOCAL
, &sDefault
.bStrictAllocate
, NULL
, NULL
, FLAG_SHARE
},
895 {"strict sync", P_BOOL
, P_LOCAL
, &sDefault
.bStrictSync
, NULL
, NULL
, FLAG_SHARE
},
896 {"sync always", P_BOOL
, P_LOCAL
, &sDefault
.bSyncAlways
, NULL
, NULL
, FLAG_SHARE
},
897 {"use mmap", P_BOOL
, P_GLOBAL
, &Globals
.bUseMmap
, NULL
, NULL
, FLAG_DEVELOPER
},
898 {"use sendfile", P_BOOL
, P_LOCAL
, &sDefault
.bUseSendfile
, NULL
, NULL
, FLAG_SHARE
},
899 {"hostname lookups", P_BOOL
, P_GLOBAL
, &Globals
.bHostnameLookups
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
900 {"write cache size", P_INTEGER
, P_LOCAL
, &sDefault
.iWriteCacheSize
, NULL
, NULL
, FLAG_SHARE
},
902 {"name cache timeout", P_INTEGER
, P_GLOBAL
, &Globals
.name_cache_timeout
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
904 {"Printing Options", P_SEP
, P_SEPARATOR
},
906 {"total print jobs", P_INTEGER
, P_GLOBAL
, &Globals
.iTotalPrintJobs
, NULL
, NULL
, FLAG_PRINT
},
907 {"max print jobs", P_INTEGER
, P_LOCAL
, &sDefault
.iMaxPrintJobs
, NULL
, NULL
, FLAG_PRINT
},
908 {"load printers", P_BOOL
, P_GLOBAL
, &Globals
.bLoadPrinters
, NULL
, NULL
, FLAG_PRINT
},
909 {"printcap name", P_STRING
, P_GLOBAL
, &Globals
.szPrintcapname
, NULL
, NULL
, FLAG_PRINT
| FLAG_DEVELOPER
},
910 {"printcap", P_STRING
, P_GLOBAL
, &Globals
.szPrintcapname
, NULL
, NULL
, FLAG_HIDE
},
911 {"printable", P_BOOL
, P_LOCAL
, &sDefault
.bPrint_ok
, NULL
, NULL
, FLAG_PRINT
},
912 {"print ok", P_BOOL
, P_LOCAL
, &sDefault
.bPrint_ok
, NULL
, NULL
, FLAG_HIDE
},
913 {"printing", P_ENUM
, P_LOCAL
, &sDefault
.iPrinting
, NULL
, enum_printing
, FLAG_PRINT
| FLAG_GLOBAL
},
914 {"print command", P_STRING
, P_LOCAL
, &sDefault
.szPrintcommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
915 {"disable spoolss", P_BOOL
, P_GLOBAL
, &Globals
.bDisableSpoolss
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
916 {"lpq command", P_STRING
, P_LOCAL
, &sDefault
.szLpqcommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
917 {"lprm command", P_STRING
, P_LOCAL
, &sDefault
.szLprmcommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
918 {"lppause command", P_STRING
, P_LOCAL
, &sDefault
.szLppausecommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
919 {"lpresume command", P_STRING
, P_LOCAL
, &sDefault
.szLpresumecommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
920 {"queuepause command", P_STRING
, P_LOCAL
, &sDefault
.szQueuepausecommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
921 {"queueresume command", P_STRING
, P_LOCAL
, &sDefault
.szQueueresumecommand
, NULL
, NULL
, FLAG_PRINT
| FLAG_GLOBAL
},
923 {"enumports command", P_STRING
, P_GLOBAL
, &Globals
.szEnumPortsCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
924 {"addprinter command", P_STRING
, P_GLOBAL
, &Globals
.szAddPrinterCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
925 {"deleteprinter command", P_STRING
, P_GLOBAL
, &Globals
.szDeletePrinterCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
926 {"show add printer wizard", P_BOOL
, P_GLOBAL
, &Globals
.bMsAddPrinterWizard
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
927 {"os2 driver map", P_STRING
, P_GLOBAL
, &Globals
.szOs2DriverMap
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
929 {"printer name", P_STRING
, P_LOCAL
, &sDefault
.szPrintername
, NULL
, NULL
, FLAG_PRINT
},
930 {"printer", P_STRING
, P_LOCAL
, &sDefault
.szPrintername
, NULL
, NULL
, FLAG_HIDE
},
931 {"use client driver", P_BOOL
, P_LOCAL
, &sDefault
.bUseClientDriver
, NULL
, NULL
, FLAG_PRINT
},
932 {"default devmode", P_BOOL
, P_LOCAL
, &sDefault
.bDefaultDevmode
, NULL
, NULL
, FLAG_PRINT
},
934 {"Filename Handling", P_SEP
, P_SEPARATOR
},
935 {"strip dot", P_BOOL
, P_GLOBAL
, &Globals
.bStripDot
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
936 {"mangling method", P_STRING
, P_GLOBAL
, &Globals
.szManglingMethod
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
937 {"mangle prefix", P_INTEGER
, P_GLOBAL
, &Globals
.mangle_prefix
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
939 {"mangled stack", P_INTEGER
, P_GLOBAL
, &Globals
.mangled_stack
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
940 {"default case", P_ENUM
, P_LOCAL
, &sDefault
.iDefaultCase
, NULL
, enum_case
, FLAG_SHARE
},
941 {"case sensitive", P_BOOL
, P_LOCAL
, &sDefault
.bCaseSensitive
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
942 {"casesignames", P_BOOL
, P_LOCAL
, &sDefault
.bCaseSensitive
, NULL
, NULL
, FLAG_HIDE
},
943 {"preserve case", P_BOOL
, P_LOCAL
, &sDefault
.bCasePreserve
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
944 {"short preserve case", P_BOOL
, P_LOCAL
, &sDefault
.bShortCasePreserve
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
945 {"mangle case", P_BOOL
, P_LOCAL
, &sDefault
.bCaseMangle
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
946 {"mangling char", P_CHAR
, P_LOCAL
, &sDefault
.magic_char
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
947 {"hide dot files", P_BOOL
, P_LOCAL
, &sDefault
.bHideDotFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
948 {"hide special files", P_BOOL
, P_LOCAL
, &sDefault
.bHideSpecialFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
949 {"hide unreadable", P_BOOL
, P_LOCAL
, &sDefault
.bHideUnReadable
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
950 {"hide unwriteable files", P_BOOL
, P_LOCAL
, &sDefault
.bHideUnWriteableFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
951 {"delete veto files", P_BOOL
, P_LOCAL
, &sDefault
.bDeleteVetoFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
952 {"veto files", P_STRING
, P_LOCAL
, &sDefault
.szVetoFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
953 {"hide files", P_STRING
, P_LOCAL
, &sDefault
.szHideFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
954 {"veto oplock files", P_STRING
, P_LOCAL
, &sDefault
.szVetoOplockFiles
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
955 {"map system", P_BOOL
, P_LOCAL
, &sDefault
.bMap_system
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
956 {"map hidden", P_BOOL
, P_LOCAL
, &sDefault
.bMap_hidden
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
957 {"map archive", P_BOOL
, P_LOCAL
, &sDefault
.bMap_archive
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
958 {"mangled names", P_BOOL
, P_LOCAL
, &sDefault
.bMangledNames
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
959 {"mangled map", P_STRING
, P_LOCAL
, &sDefault
.szMangledMap
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
960 {"stat cache", P_BOOL
, P_GLOBAL
, &Globals
.bStatCache
, NULL
, NULL
, FLAG_DEVELOPER
},
962 {"Domain Options", P_SEP
, P_SEPARATOR
},
964 {"machine password timeout", P_INTEGER
, P_GLOBAL
, &Globals
.machine_password_timeout
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
966 {"Logon Options", P_SEP
, P_SEPARATOR
},
968 {"add user script", P_STRING
, P_GLOBAL
, &Globals
.szAddUserScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
969 {"delete user script", P_STRING
, P_GLOBAL
, &Globals
.szDelUserScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
970 {"add group script", P_STRING
, P_GLOBAL
, &Globals
.szAddGroupScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
971 {"delete group script", P_STRING
, P_GLOBAL
, &Globals
.szDelGroupScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
972 {"add user to group script", P_STRING
, P_GLOBAL
, &Globals
.szAddUserToGroupScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
973 {"delete user from group script", P_STRING
, P_GLOBAL
, &Globals
.szDelUserFromGroupScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
974 {"set primary group script", P_STRING
, P_GLOBAL
, &Globals
.szSetPrimaryGroupScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
975 {"add machine script", P_STRING
, P_GLOBAL
, &Globals
.szAddMachineScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
976 {"shutdown script", P_STRING
, P_GLOBAL
, &Globals
.szShutdownScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
977 {"abort shutdown script", P_STRING
, P_GLOBAL
, &Globals
.szAbortShutdownScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
979 {"logon script", P_STRING
, P_GLOBAL
, &Globals
.szLogonScript
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
980 {"logon path", P_STRING
, P_GLOBAL
, &Globals
.szLogonPath
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
981 {"logon drive", P_STRING
, P_GLOBAL
, &Globals
.szLogonDrive
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
982 {"logon home", P_STRING
, P_GLOBAL
, &Globals
.szLogonHome
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
983 {"domain logons", P_BOOL
, P_GLOBAL
, &Globals
.bDomainLogons
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
985 {"Browse Options", P_SEP
, P_SEPARATOR
},
987 {"os level", P_INTEGER
, P_GLOBAL
, &Globals
.os_level
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
988 {"lm announce", P_ENUM
, P_GLOBAL
, &Globals
.lm_announce
, NULL
, enum_bool_auto
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
989 {"lm interval", P_INTEGER
, P_GLOBAL
, &Globals
.lm_interval
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
990 {"preferred master", P_ENUM
, P_GLOBAL
, &Globals
.bPreferredMaster
, NULL
, enum_bool_auto
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
991 {"prefered master", P_ENUM
, P_GLOBAL
, &Globals
.bPreferredMaster
, NULL
, enum_bool_auto
, FLAG_HIDE
},
992 {"local master", P_BOOL
, P_GLOBAL
, &Globals
.bLocalMaster
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
993 {"domain master", P_ENUM
, P_GLOBAL
, &Globals
.bDomainMaster
, NULL
, enum_bool_auto
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_DEVELOPER
},
994 {"browse list", P_BOOL
, P_GLOBAL
, &Globals
.bBrowseList
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
995 {"browseable", P_BOOL
, P_LOCAL
, &sDefault
.bBrowseable
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
| FLAG_DEVELOPER
},
996 {"browsable", P_BOOL
, P_LOCAL
, &sDefault
.bBrowseable
, NULL
, NULL
, FLAG_HIDE
},
997 {"enhanced browsing", P_BOOL
, P_GLOBAL
, &Globals
.enhanced_browsing
, NULL
, NULL
, FLAG_DEVELOPER
| FLAG_ADVANCED
},
999 {"WINS Options", P_SEP
, P_SEPARATOR
},
1000 {"dns proxy", P_BOOL
, P_GLOBAL
, &Globals
.bDNSproxy
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1001 {"wins proxy", P_BOOL
, P_GLOBAL
, &Globals
.bWINSproxy
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1003 {"wins server", P_LIST
, P_GLOBAL
, &Globals
.szWINSservers
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
1004 {"wins support", P_BOOL
, P_GLOBAL
, &Globals
.bWINSsupport
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
1005 {"wins hook", P_STRING
, P_GLOBAL
, &Globals
.szWINSHook
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1006 {"wins partners", P_STRING
, P_GLOBAL
, &Globals
.szWINSPartners
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_WIZARD
| FLAG_DEVELOPER
},
1008 {"Locking Options", P_SEP
, P_SEPARATOR
},
1010 {"blocking locks", P_BOOL
, P_LOCAL
, &sDefault
.bBlockingLocks
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1011 {"csc policy", P_ENUM
, P_LOCAL
, &sDefault
.iCSCPolicy
, NULL
, enum_csc_policy
, FLAG_SHARE
| FLAG_GLOBAL
},
1012 {"fake oplocks", P_BOOL
, P_LOCAL
, &sDefault
.bFakeOplocks
, NULL
, NULL
, FLAG_SHARE
},
1013 {"kernel oplocks", P_BOOL
, P_GLOBAL
, &Globals
.bKernelOplocks
, NULL
, NULL
, FLAG_GLOBAL
},
1014 {"locking", P_BOOL
, P_LOCAL
, &sDefault
.bLocking
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1015 {"lock spin count", P_INTEGER
, P_GLOBAL
, &Globals
.iLockSpinCount
, NULL
, NULL
, FLAG_GLOBAL
},
1016 {"lock spin time", P_INTEGER
, P_GLOBAL
, &Globals
.iLockSpinTime
, NULL
, NULL
, FLAG_GLOBAL
},
1018 {"oplocks", P_BOOL
, P_LOCAL
, &sDefault
.bOpLocks
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1019 {"level2 oplocks", P_BOOL
, P_LOCAL
, &sDefault
.bLevel2OpLocks
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1020 {"oplock break wait time", P_INTEGER
, P_GLOBAL
, &Globals
.oplock_break_wait_time
, NULL
, NULL
, FLAG_GLOBAL
},
1021 {"oplock contention limit", P_INTEGER
, P_LOCAL
, &sDefault
.iOplockContentionLimit
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1022 {"posix locking", P_BOOL
, P_LOCAL
, &sDefault
.bPosixLocking
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1023 {"strict locking", P_BOOL
, P_LOCAL
, &sDefault
.bStrictLocking
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1024 {"share modes", P_BOOL
, P_LOCAL
, &sDefault
.bShareModes
, NULL
, NULL
, FLAG_SHARE
|FLAG_GLOBAL
},
1026 {"Ldap Options", P_SEP
, P_SEPARATOR
},
1028 #ifdef WITH_LDAP_SAMCONFIG
1029 {"ldap server", P_STRING
, P_GLOBAL
, &Globals
.szLdapServer
, NULL
, NULL
, 0},
1030 {"ldap port", P_INTEGER
, P_GLOBAL
, &Globals
.ldap_port
, NULL
, NULL
, 0},
1032 {"ldap suffix", P_STRING
, P_GLOBAL
, &Globals
.szLdapSuffix
, handle_ldap_suffix
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1033 {"ldap machine suffix", P_STRING
, P_GLOBAL
, &Globals
.szLdapMachineSuffix
, handle_ldap_machine_suffix
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1034 {"ldap user suffix", P_STRING
, P_GLOBAL
, &Globals
.szLdapUserSuffix
, handle_ldap_user_suffix
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1035 {"ldap filter", P_STRING
, P_GLOBAL
, &Globals
.szLdapFilter
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1036 {"ldap admin dn", P_STRING
, P_GLOBAL
, &Globals
.szLdapAdminDn
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1037 {"ldap ssl", P_ENUM
, P_GLOBAL
, &Globals
.ldap_ssl
, NULL
, enum_ldap_ssl
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1038 {"ldap passwd sync", P_ENUM
, P_GLOBAL
, &Globals
.ldap_passwd_sync
, NULL
, enum_ldap_passwd_sync
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1039 {"ldap trust ids", P_BOOL
, P_GLOBAL
, &Globals
.ldap_trust_ids
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1041 {"Miscellaneous Options", P_SEP
, P_SEPARATOR
},
1042 {"add share command", P_STRING
, P_GLOBAL
, &Globals
.szAddShareCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1043 {"change share command", P_STRING
, P_GLOBAL
, &Globals
.szChangeShareCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1044 {"delete share command", P_STRING
, P_GLOBAL
, &Globals
.szDeleteShareCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1046 {"config file", P_STRING
, P_GLOBAL
, &Globals
.szConfigFile
, NULL
, NULL
, FLAG_HIDE
},
1047 {"preload", P_STRING
, P_GLOBAL
, &Globals
.szAutoServices
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1048 {"auto services", P_STRING
, P_GLOBAL
, &Globals
.szAutoServices
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1049 {"lock dir", P_STRING
, P_GLOBAL
, &Globals
.szLockDir
, NULL
, NULL
, FLAG_HIDE
},
1050 {"lock directory", P_STRING
, P_GLOBAL
, &Globals
.szLockDir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1051 {"pid directory", P_STRING
, P_GLOBAL
, &Globals
.szPidDir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1053 {"utmp directory", P_STRING
, P_GLOBAL
, &Globals
.szUtmpDir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1054 {"wtmp directory", P_STRING
, P_GLOBAL
, &Globals
.szWtmpDir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1055 {"utmp", P_BOOL
, P_GLOBAL
, &Globals
.bUtmp
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1058 {"default service", P_STRING
, P_GLOBAL
, &Globals
.szDefaultService
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1059 {"default", P_STRING
, P_GLOBAL
, &Globals
.szDefaultService
, NULL
, NULL
, FLAG_DEVELOPER
},
1060 {"message command", P_STRING
, P_GLOBAL
, &Globals
.szMsgCommand
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1061 {"dfree command", P_STRING
, P_GLOBAL
, &Globals
.szDfree
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1062 {"remote announce", P_STRING
, P_GLOBAL
, &Globals
.szRemoteAnnounce
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1063 {"remote browse sync", P_STRING
, P_GLOBAL
, &Globals
.szRemoteBrowseSync
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1064 {"socket address", P_STRING
, P_GLOBAL
, &Globals
.szSocketAddress
, NULL
, NULL
, FLAG_DEVELOPER
},
1065 {"homedir map", P_STRING
, P_GLOBAL
, &Globals
.szNISHomeMapName
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1066 {"time offset", P_INTEGER
, P_GLOBAL
, &extra_time_offset
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1067 {"NIS homedir", P_BOOL
, P_GLOBAL
, &Globals
.bNISHomeMap
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1068 {"-valid", P_BOOL
, P_LOCAL
, &sDefault
.valid
, NULL
, NULL
, FLAG_HIDE
},
1070 {"copy", P_STRING
, P_LOCAL
, &sDefault
.szCopy
, handle_copy
, NULL
, FLAG_HIDE
},
1071 {"include", P_STRING
, P_LOCAL
, &sDefault
.szInclude
, handle_include
, NULL
, FLAG_HIDE
},
1072 {"exec", P_STRING
, P_LOCAL
, &sDefault
.szPreExec
, NULL
, NULL
, FLAG_SHARE
| FLAG_PRINT
},
1073 {"preexec", P_STRING
, P_LOCAL
, &sDefault
.szPreExec
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1075 {"preexec close", P_BOOL
, P_LOCAL
, &sDefault
.bPreexecClose
, NULL
, NULL
, FLAG_SHARE
},
1076 {"postexec", P_STRING
, P_LOCAL
, &sDefault
.szPostExec
, NULL
, NULL
, FLAG_SHARE
| FLAG_PRINT
},
1077 {"root preexec", P_STRING
, P_LOCAL
, &sDefault
.szRootPreExec
, NULL
, NULL
, FLAG_SHARE
| FLAG_PRINT
},
1078 {"root preexec close", P_BOOL
, P_LOCAL
, &sDefault
.bRootpreexecClose
, NULL
, NULL
, FLAG_SHARE
},
1079 {"root postexec", P_STRING
, P_LOCAL
, &sDefault
.szRootPostExec
, NULL
, NULL
, FLAG_SHARE
| FLAG_PRINT
},
1080 {"available", P_BOOL
, P_LOCAL
, &sDefault
.bAvailable
, NULL
, NULL
, FLAG_BASIC
| FLAG_ADVANCED
| FLAG_SHARE
| FLAG_PRINT
},
1081 {"volume", P_STRING
, P_LOCAL
, &sDefault
.volume
, NULL
, NULL
, FLAG_SHARE
},
1082 {"fstype", P_STRING
, P_LOCAL
, &sDefault
.fstype
, NULL
, NULL
, FLAG_SHARE
},
1083 {"set directory", P_BOOLREV
, P_LOCAL
, &sDefault
.bNo_set_dir
, NULL
, NULL
, FLAG_SHARE
},
1084 {"source environment", P_STRING
, P_GLOBAL
, &Globals
.szSourceEnv
, handle_source_env
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1085 {"wide links", P_BOOL
, P_LOCAL
, &sDefault
.bWidelinks
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1086 {"follow symlinks", P_BOOL
, P_LOCAL
, &sDefault
.bSymlinks
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1087 {"dont descend", P_STRING
, P_LOCAL
, &sDefault
.szDontdescend
, NULL
, NULL
, FLAG_SHARE
},
1088 {"magic script", P_STRING
, P_LOCAL
, &sDefault
.szMagicScript
, NULL
, NULL
, FLAG_SHARE
},
1089 {"magic output", P_STRING
, P_LOCAL
, &sDefault
.szMagicOutput
, NULL
, NULL
, FLAG_SHARE
},
1090 {"delete readonly", P_BOOL
, P_LOCAL
, &sDefault
.bDeleteReadonly
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1091 {"dos filemode", P_BOOL
, P_LOCAL
, &sDefault
.bDosFilemode
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1092 {"dos filetimes", P_BOOL
, P_LOCAL
, &sDefault
.bDosFiletimes
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1093 {"dos filetime resolution", P_BOOL
, P_LOCAL
, &sDefault
.bDosFiletimeResolution
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1095 {"fake directory create times", P_BOOL
, P_LOCAL
, &sDefault
.bFakeDirCreateTimes
, NULL
, NULL
, FLAG_SHARE
| FLAG_GLOBAL
},
1096 {"panic action", P_STRING
, P_GLOBAL
, &Globals
.szPanicAction
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1097 {"hide local users", P_BOOL
, P_GLOBAL
, &Globals
.bHideLocalUsers
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1099 {"VFS module options", P_SEP
, P_SEPARATOR
},
1101 {"vfs object", P_STRING
, P_LOCAL
, &sDefault
.szVfsObjectFile
, handle_vfs_object
, NULL
, FLAG_SHARE
},
1102 {"vfs options", P_STRING
, P_LOCAL
, &sDefault
.szVfsOptions
, NULL
, NULL
, FLAG_SHARE
},
1103 {"vfs path", P_STRING
, P_LOCAL
, &sDefault
.szVfsPath
, NULL
, NULL
, FLAG_SHARE
},
1106 {"msdfs root", P_BOOL
, P_LOCAL
, &sDefault
.bMSDfsRoot
, NULL
, NULL
, FLAG_SHARE
},
1107 {"msdfs proxy", P_STRING
, P_LOCAL
, &sDefault
.szMSDfsProxy
, NULL
, NULL
, FLAG_SHARE
},
1108 {"host msdfs", P_BOOL
, P_GLOBAL
, &Globals
.bHostMSDfs
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1110 {"Winbind options", P_SEP
, P_SEPARATOR
},
1112 {"winbind uid", P_STRING
, P_GLOBAL
, &Globals
.szWinbindUID
, handle_winbind_uid
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1113 {"winbind gid", P_STRING
, P_GLOBAL
, &Globals
.szWinbindGID
, handle_winbind_gid
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1114 {"template homedir", P_STRING
, P_GLOBAL
, &Globals
.szTemplateHomedir
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1115 {"template shell", P_STRING
, P_GLOBAL
, &Globals
.szTemplateShell
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1116 {"winbind separator", P_STRING
, P_GLOBAL
, &Globals
.szWinbindSeparator
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1117 {"winbind cache time", P_INTEGER
, P_GLOBAL
, &Globals
.winbind_cache_time
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1118 {"winbind enum users", P_BOOL
, P_GLOBAL
, &Globals
.bWinbindEnumUsers
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1119 {"winbind enum groups", P_BOOL
, P_GLOBAL
, &Globals
.bWinbindEnumGroups
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1120 {"winbind use default domain", P_BOOL
, P_GLOBAL
, &Globals
.bWinbindUseDefaultDomain
, NULL
, NULL
, FLAG_ADVANCED
| FLAG_DEVELOPER
},
1122 {NULL
, P_BOOL
, P_NONE
, NULL
, NULL
, NULL
, 0}
1125 /***************************************************************************
1126 Initialise the sDefault parameter structure for the printer values.
1127 ***************************************************************************/
1129 static void init_printer_values(void)
1131 /* choose defaults depending on the type of printing */
1132 switch (sDefault
.iPrinting
) {
1137 string_set(&sDefault
.szLpqcommand
, "lpq -P'%p'");
1138 string_set(&sDefault
.szLprmcommand
, "lprm -P'%p' %j");
1139 string_set(&sDefault
.szPrintcommand
,
1140 "lpr -r -P'%p' %s");
1145 string_set(&sDefault
.szLpqcommand
, "lpq -P'%p'");
1146 string_set(&sDefault
.szLprmcommand
, "lprm -P'%p' %j");
1147 string_set(&sDefault
.szPrintcommand
,
1148 "lpr -r -P'%p' %s");
1149 string_set(&sDefault
.szQueuepausecommand
,
1151 string_set(&sDefault
.szQueueresumecommand
,
1153 string_set(&sDefault
.szLppausecommand
,
1154 "lpc hold '%p' %j");
1155 string_set(&sDefault
.szLpresumecommand
,
1156 "lpc release '%p' %j");
1161 string_set(&sDefault
.szLpqcommand
, "");
1162 string_set(&sDefault
.szLprmcommand
, "");
1163 string_set(&sDefault
.szPrintcommand
, "");
1164 string_set(&sDefault
.szLppausecommand
, "");
1165 string_set(&sDefault
.szLpresumecommand
, "");
1166 string_set(&sDefault
.szQueuepausecommand
, "");
1167 string_set(&sDefault
.szQueueresumecommand
, "");
1169 string_set(&Globals
.szPrintcapname
, "cups");
1171 string_set(&sDefault
.szLpqcommand
,
1172 "/usr/bin/lpstat -o '%p'");
1173 string_set(&sDefault
.szLprmcommand
,
1174 "/usr/bin/cancel '%p-%j'");
1175 string_set(&sDefault
.szPrintcommand
,
1176 "/usr/bin/lp -d '%p' %s; rm %s");
1177 string_set(&sDefault
.szLppausecommand
,
1178 "lp -i '%p-%j' -H hold");
1179 string_set(&sDefault
.szLpresumecommand
,
1180 "lp -i '%p-%j' -H resume");
1181 string_set(&sDefault
.szQueuepausecommand
,
1182 "/usr/bin/disable '%p'");
1183 string_set(&sDefault
.szQueueresumecommand
,
1184 "/usr/bin/enable '%p'");
1185 string_set(&Globals
.szPrintcapname
, "lpstat");
1186 #endif /* HAVE_CUPS */
1191 string_set(&sDefault
.szLpqcommand
, "lpstat -o%p");
1192 string_set(&sDefault
.szLprmcommand
, "cancel %p-%j");
1193 string_set(&sDefault
.szPrintcommand
,
1194 "lp -c -d%p %s; rm %s");
1195 string_set(&sDefault
.szQueuepausecommand
,
1197 string_set(&sDefault
.szQueueresumecommand
,
1200 string_set(&sDefault
.szLppausecommand
,
1201 "lp -i %p-%j -H hold");
1202 string_set(&sDefault
.szLpresumecommand
,
1203 "lp -i %p-%j -H resume");
1208 string_set(&sDefault
.szLpqcommand
, "lpq -P%p");
1209 string_set(&sDefault
.szLprmcommand
, "lprm -P%p %j");
1210 string_set(&sDefault
.szPrintcommand
, "lp -r -P%p %s");
1214 string_set(&sDefault
.szLpqcommand
, "qstat -l -d%p");
1215 string_set(&sDefault
.szLprmcommand
,
1216 "qstat -s -j%j -c");
1217 string_set(&sDefault
.szPrintcommand
,
1218 "lp -d%p -s %s; rm %s");
1219 string_set(&sDefault
.szLppausecommand
,
1220 "qstat -s -j%j -h");
1221 string_set(&sDefault
.szLpresumecommand
,
1222 "qstat -s -j%j -r");
1227 string_set(&sDefault
.szPrintcommand
, "vlp print %p %s");
1228 string_set(&sDefault
.szLpqcommand
, "vlp lpq %p");
1229 string_set(&sDefault
.szLprmcommand
, "vlp lprm %p %j");
1230 string_set(&sDefault
.szLppausecommand
, "vlp lppause %p %j");
1231 string_set(&sDefault
.szLpresumecommand
, "vlp lpresum %p %j");
1232 string_set(&sDefault
.szQueuepausecommand
, "vlp queuepause %p");
1233 string_set(&sDefault
.szQueueresumecommand
, "vlp queueresume %p");
1235 #endif /* DEVELOPER */
1240 /***************************************************************************
1241 Initialise the global parameter structure.
1242 ***************************************************************************/
1244 static void init_globals(void)
1246 static BOOL done_init
= False
;
1251 memset((void *)&Globals
, '\0', sizeof(Globals
));
1253 for (i
= 0; parm_table
[i
].label
; i
++)
1254 if ((parm_table
[i
].type
== P_STRING
||
1255 parm_table
[i
].type
== P_USTRING
) &&
1257 string_set(parm_table
[i
].ptr
, "");
1259 string_set(&sDefault
.fstype
, FSTYPE_STRING
);
1261 init_printer_values();
1267 DEBUG(3, ("Initialising global parameters\n"));
1269 string_set(&Globals
.szSMBPasswdFile
, dyn_SMB_PASSWD_FILE
);
1270 string_set(&Globals
.szPrivateDir
, dyn_PRIVATE_DIR
);
1272 /* use the new 'hash2' method by default, with a prefix of 1 */
1273 string_set(&Globals
.szManglingMethod
, "hash2");
1274 Globals
.mangle_prefix
= 1;
1276 string_set(&Globals
.szGuestaccount
, GUEST_ACCOUNT
);
1278 /* using UTF8 by default allows us to support all chars */
1279 string_set(&Globals
.unix_charset
, "UTF8");
1281 /* Use codepage 850 as a default for the dos character set */
1282 string_set(&Globals
.dos_charset
, "CP850");
1285 * Allow the default PASSWD_CHAT to be overridden in local.h.
1287 string_set(&Globals
.szPasswdChat
, DEFAULT_PASSWD_CHAT
);
1289 set_global_myname(myhostname());
1290 string_set(&Globals
.szNetbiosName
,global_myname());
1292 set_global_myworkgroup(WORKGROUP
);
1293 string_set(&Globals
.szWorkgroup
, lp_workgroup());
1295 string_set(&Globals
.szPasswdProgram
, "");
1296 string_set(&Globals
.szPrintcapname
, PRINTCAP_NAME
);
1297 string_set(&Globals
.szPidDir
, dyn_PIDDIR
);
1298 string_set(&Globals
.szLockDir
, dyn_LOCKDIR
);
1299 string_set(&Globals
.szSocketAddress
, "0.0.0.0");
1300 pstrcpy(s
, "Samba ");
1301 pstrcat(s
, VERSION
);
1302 string_set(&Globals
.szServerString
, s
);
1303 slprintf(s
, sizeof(s
) - 1, "%d.%d", DEFAULT_MAJOR_VERSION
,
1304 DEFAULT_MINOR_VERSION
);
1305 string_set(&Globals
.szAnnounceVersion
, s
);
1307 pstrcpy(user_socket_options
, DEFAULT_SOCKET_OPTIONS
);
1309 string_set(&Globals
.szLogonDrive
, "");
1310 /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */
1311 string_set(&Globals
.szLogonHome
, "\\\\%N\\%U");
1312 string_set(&Globals
.szLogonPath
, "\\\\%N\\%U\\profile");
1314 string_set(&Globals
.szNameResolveOrder
, "lmhosts wins host bcast");
1315 string_set(&Globals
.szPasswordServer
, "*");
1317 Globals
.AlgorithmicRidBase
= BASE_RID
;
1319 Globals
.bLoadPrinters
= True
;
1320 Globals
.mangled_stack
= 50;
1321 /* Was 65535 (0xFFFF). 0x4101 matches W2K and causes major speed improvements... */
1322 /* Discovered by 2 days of pain by Don McCall @ HP :-). */
1323 Globals
.max_xmit
= 0x4104;
1324 Globals
.max_mux
= 50; /* This is *needed* for profile support. */
1325 Globals
.lpqcachetime
= 10;
1326 Globals
.bDisableSpoolss
= False
;
1327 Globals
.iMaxSmbdProcesses
= 0;/* no limit specified */
1328 Globals
.iTotalPrintJobs
= 0; /* no limit specified */
1329 Globals
.pwordlevel
= 0;
1330 Globals
.unamelevel
= 0;
1331 Globals
.deadtime
= 0;
1332 Globals
.bLargeReadwrite
= True
;
1333 Globals
.max_log_size
= 5000;
1334 Globals
.max_open_files
= MAX_OPEN_FILES
;
1335 Globals
.maxprotocol
= PROTOCOL_NT1
;
1336 Globals
.minprotocol
= PROTOCOL_CORE
;
1337 Globals
.security
= SEC_USER
;
1338 Globals
.paranoid_server_security
= True
;
1339 Globals
.bEncryptPasswords
= True
;
1340 Globals
.bUpdateEncrypt
= False
;
1341 Globals
.bReadRaw
= True
;
1342 Globals
.bWriteRaw
= True
;
1343 Globals
.bReadPrediction
= False
;
1344 Globals
.bReadbmpx
= False
;
1345 Globals
.bNullPasswords
= False
;
1346 Globals
.bObeyPamRestrictions
= False
;
1347 Globals
.bStripDot
= False
;
1349 Globals
.bSyslogOnly
= False
;
1350 Globals
.bTimestampLogs
= True
;
1351 string_set(&Globals
.szLogLevel
, "0");
1352 Globals
.bDebugHiresTimestamp
= False
;
1353 Globals
.bDebugPid
= False
;
1354 Globals
.bDebugUid
= False
;
1355 Globals
.max_ttl
= 60 * 60 * 24 * 3; /* 3 days default. */
1356 Globals
.max_wins_ttl
= 60 * 60 * 24 * 6; /* 6 days default. */
1357 Globals
.min_wins_ttl
= 60 * 60 * 6; /* 6 hours default. */
1358 Globals
.machine_password_timeout
= 60 * 60 * 24 * 7; /* 7 days default. */
1359 Globals
.change_notify_timeout
= 60; /* 1 minute default. */
1360 Globals
.bKernelChangeNotify
= True
; /* On if we have it. */
1361 Globals
.ReadSize
= 16 * 1024;
1362 Globals
.lm_announce
= 2; /* = Auto: send only if LM clients found */
1363 Globals
.lm_interval
= 60;
1364 Globals
.stat_cache_size
= 50; /* Number of stat translations we'll keep */
1365 Globals
.announce_as
= ANNOUNCE_AS_NT_SERVER
;
1366 #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
1367 Globals
.bNISHomeMap
= False
;
1368 #ifdef WITH_NISPLUS_HOME
1369 string_set(&Globals
.szNISHomeMapName
, "auto_home.org_dir");
1371 string_set(&Globals
.szNISHomeMapName
, "auto.home");
1374 Globals
.bTimeServer
= False
;
1375 Globals
.bBindInterfacesOnly
= False
;
1376 Globals
.bUnixPasswdSync
= False
;
1377 Globals
.bPamPasswordChange
= False
;
1378 Globals
.bPasswdChatDebug
= False
;
1379 Globals
.bUnicode
= True
; /* Do unicode on the wire by default */
1380 Globals
.bNTPipeSupport
= True
; /* Do NT pipes by default. */
1381 Globals
.bNTStatusSupport
= True
; /* Use NT status by default. */
1382 Globals
.bStatCache
= True
; /* use stat cache by default */
1383 Globals
.restrict_anonymous
= 0;
1384 Globals
.bClientLanManAuth
= True
; /* Do use the LanMan hash if it is available */
1385 Globals
.bLanmanAuth
= True
; /* Do use the LanMan hash if it is available */
1386 Globals
.bNTLMAuth
= True
; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */
1388 Globals
.map_to_guest
= 0; /* By Default, "Never" */
1389 Globals
.min_passwd_length
= MINPASSWDLENGTH
; /* By Default, 5. */
1390 Globals
.oplock_break_wait_time
= 0; /* By Default, 0 msecs. */
1391 Globals
.enhanced_browsing
= True
;
1392 Globals
.iLockSpinCount
= 3; /* Try 2 times. */
1393 Globals
.iLockSpinTime
= 10; /* usec. */
1394 #ifdef MMAP_BLACKLIST
1395 Globals
.bUseMmap
= False
;
1397 Globals
.bUseMmap
= True
;
1399 Globals
.bUnixExtensions
= False
;
1401 /* hostname lookups can be very expensive and are broken on
1402 a large number of sites (tridge) */
1403 Globals
.bHostnameLookups
= False
;
1405 #ifdef WITH_LDAP_SAMCONFIG
1406 string_set(&Globals
.szLdapServer
, "localhost");
1407 Globals
.ldap_port
= 636;
1408 Globals
.szPassdbBackend
= str_list_make("ldapsam unixsam", NULL
);
1410 Globals
.szPassdbBackend
= str_list_make("smbpasswd unixsam", NULL
);
1411 #endif /* WITH_LDAP_SAMCONFIG */
1413 string_set(&Globals
.szLdapSuffix
, "");
1414 string_set(&Globals
.szLdapMachineSuffix
, "");
1415 string_set(&Globals
.szLdapUserSuffix
, "");
1417 string_set(&Globals
.szLdapFilter
, "(&(uid=%u)(objectclass=sambaAccount))");
1418 string_set(&Globals
.szLdapAdminDn
, "");
1419 Globals
.ldap_ssl
= LDAP_SSL_ON
;
1420 Globals
.ldap_passwd_sync
= LDAP_PASSWD_SYNC_OFF
;
1422 /* these parameters are set to defaults that are more appropriate
1423 for the increasing samba install base:
1425 as a member of the workgroup, that will possibly become a
1426 _local_ master browser (lm = True). this is opposed to a forced
1427 local master browser startup (pm = True).
1429 doesn't provide WINS server service by default (wsupp = False),
1430 and doesn't provide domain master browser services by default, either.
1434 Globals
.bMsAddPrinterWizard
= True
;
1435 Globals
.bPreferredMaster
= Auto
; /* depending on bDomainMaster */
1436 Globals
.os_level
= 20;
1437 Globals
.bLocalMaster
= True
;
1438 Globals
.bDomainMaster
= Auto
; /* depending on bDomainLogons */
1439 Globals
.bDomainLogons
= False
;
1440 Globals
.bBrowseList
= True
;
1441 Globals
.bWINSsupport
= False
;
1442 Globals
.bWINSproxy
= False
;
1444 Globals
.bDNSproxy
= True
;
1446 /* this just means to use them if they exist */
1447 Globals
.bKernelOplocks
= True
;
1449 Globals
.bAllowTrustedDomains
= True
;
1451 string_set(&Globals
.szTemplateShell
, "/bin/false");
1452 string_set(&Globals
.szTemplateHomedir
, "/home/%D/%U");
1453 string_set(&Globals
.szWinbindSeparator
, "\\");
1454 string_set(&Globals
.szAclCompat
, "");
1456 Globals
.winbind_cache_time
= 15;
1457 Globals
.bWinbindEnumUsers
= True
;
1458 Globals
.bWinbindEnumGroups
= True
;
1459 Globals
.bWinbindUseDefaultDomain
= False
;
1461 Globals
.name_cache_timeout
= 660; /* In seconds */
1463 Globals
.bUseSpnego
= True
;
1464 Globals
.bClientUseSpnego
= True
;
1466 string_set(&Globals
.smb_ports
, SMB_PORTS
);
1469 static TALLOC_CTX
*lp_talloc
;
1471 /******************************************************************* a
1472 Free up temporary memory - called from the main loop.
1473 ********************************************************************/
1475 void lp_talloc_free(void)
1479 talloc_destroy(lp_talloc
);
1483 /*******************************************************************
1484 Convenience routine to grab string parameters into temporary memory
1485 and run standard_sub_basic on them. The buffers can be written to by
1486 callers without affecting the source string.
1487 ********************************************************************/
1489 static char *lp_string(const char *s
)
1491 size_t len
= s
? strlen(s
) : 0;
1494 /* The follow debug is useful for tracking down memory problems
1495 especially if you have an inner loop that is calling a lp_*()
1496 function that returns a string. Perhaps this debug should be
1497 present all the time? */
1500 DEBUG(10, ("lp_string(%s)\n", s
));
1504 lp_talloc
= talloc_init("lp_talloc");
1506 ret
= (char *)talloc(lp_talloc
, len
+ 100); /* leave room for substitution */
1514 StrnCpy(ret
, s
, len
);
1516 if (trim_string(ret
, "\"", "\"")) {
1517 if (strchr(ret
,'"') != NULL
)
1518 StrnCpy(ret
, s
, len
);
1521 standard_sub_basic(current_user_info
.smb_name
,ret
,len
+100);
1526 In this section all the functions that are used to access the
1527 parameters from the rest of the program are defined
1530 #define FN_GLOBAL_STRING(fn_name,ptr) \
1531 char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));}
1532 #define FN_GLOBAL_CONST_STRING(fn_name,ptr) \
1533 const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : "");}
1534 #define FN_GLOBAL_LIST(fn_name,ptr) \
1535 const char **fn_name(void) {return(*(const char ***)(ptr));}
1536 #define FN_GLOBAL_BOOL(fn_name,ptr) \
1537 BOOL fn_name(void) {return(*(BOOL *)(ptr));}
1538 #define FN_GLOBAL_CHAR(fn_name,ptr) \
1539 char fn_name(void) {return(*(char *)(ptr));}
1540 #define FN_GLOBAL_INTEGER(fn_name,ptr) \
1541 int fn_name(void) {return(*(int *)(ptr));}
1543 #define FN_LOCAL_STRING(fn_name,val) \
1544 char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));}
1545 #define FN_LOCAL_CONST_STRING(fn_name,val) \
1546 const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val);}
1547 #define FN_LOCAL_LIST(fn_name,val) \
1548 const char **fn_name(int i) {return(const char **)(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);}
1549 #define FN_LOCAL_BOOL(fn_name,val) \
1550 BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);}
1551 #define FN_LOCAL_CHAR(fn_name,val) \
1552 char fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);}
1553 #define FN_LOCAL_INTEGER(fn_name,val) \
1554 int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);}
1556 FN_GLOBAL_STRING(lp_smb_ports
, &Globals
.smb_ports
)
1557 FN_GLOBAL_STRING(lp_dos_charset
, &Globals
.dos_charset
)
1558 FN_GLOBAL_STRING(lp_unix_charset
, &Globals
.unix_charset
)
1559 FN_GLOBAL_STRING(lp_display_charset
, &Globals
.display_charset
)
1560 FN_GLOBAL_STRING(lp_logfile
, &Globals
.szLogFile
)
1561 FN_GLOBAL_STRING(lp_configfile
, &Globals
.szConfigFile
)
1562 FN_GLOBAL_STRING(lp_smb_passwd_file
, &Globals
.szSMBPasswdFile
)
1563 FN_GLOBAL_STRING(lp_private_dir
, &Globals
.szPrivateDir
)
1564 FN_GLOBAL_STRING(lp_serverstring
, &Globals
.szServerString
)
1565 FN_GLOBAL_STRING(lp_printcapname
, &Globals
.szPrintcapname
)
1566 FN_GLOBAL_STRING(lp_enumports_cmd
, &Globals
.szEnumPortsCommand
)
1567 FN_GLOBAL_STRING(lp_addprinter_cmd
, &Globals
.szAddPrinterCommand
)
1568 FN_GLOBAL_STRING(lp_deleteprinter_cmd
, &Globals
.szDeletePrinterCommand
)
1569 FN_GLOBAL_STRING(lp_os2_driver_map
, &Globals
.szOs2DriverMap
)
1570 FN_GLOBAL_STRING(lp_lockdir
, &Globals
.szLockDir
)
1571 FN_GLOBAL_STRING(lp_piddir
, &Globals
.szPidDir
)
1572 FN_GLOBAL_STRING(lp_mangling_method
, &Globals
.szManglingMethod
)
1573 FN_GLOBAL_INTEGER(lp_mangle_prefix
, &Globals
.mangle_prefix
)
1575 FN_GLOBAL_STRING(lp_utmpdir
, &Globals
.szUtmpDir
)
1576 FN_GLOBAL_STRING(lp_wtmpdir
, &Globals
.szWtmpDir
)
1577 FN_GLOBAL_BOOL(lp_utmp
, &Globals
.bUtmp
)
1579 FN_GLOBAL_STRING(lp_rootdir
, &Globals
.szRootdir
)
1580 FN_GLOBAL_STRING(lp_source_environment
, &Globals
.szSourceEnv
)
1581 FN_GLOBAL_STRING(lp_defaultservice
, &Globals
.szDefaultService
)
1582 FN_GLOBAL_STRING(lp_msg_command
, &Globals
.szMsgCommand
)
1583 FN_GLOBAL_STRING(lp_dfree_command
, &Globals
.szDfree
)
1584 FN_GLOBAL_STRING(lp_hosts_equiv
, &Globals
.szHostsEquiv
)
1585 FN_GLOBAL_STRING(lp_auto_services
, &Globals
.szAutoServices
)
1586 FN_GLOBAL_STRING(lp_passwd_program
, &Globals
.szPasswdProgram
)
1587 FN_GLOBAL_STRING(lp_passwd_chat
, &Globals
.szPasswdChat
)
1588 FN_GLOBAL_STRING(lp_passwordserver
, &Globals
.szPasswordServer
)
1589 FN_GLOBAL_STRING(lp_name_resolve_order
, &Globals
.szNameResolveOrder
)
1590 FN_GLOBAL_STRING(lp_realm
, &Globals
.szRealm
)
1591 FN_GLOBAL_STRING(lp_ads_server
, &Globals
.szADSserver
)
1592 FN_GLOBAL_STRING(lp_username_map
, &Globals
.szUsernameMap
)
1593 FN_GLOBAL_CONST_STRING(lp_logon_script
, &Globals
.szLogonScript
)
1594 FN_GLOBAL_CONST_STRING(lp_logon_path
, &Globals
.szLogonPath
)
1595 FN_GLOBAL_CONST_STRING(lp_logon_drive
, &Globals
.szLogonDrive
)
1596 FN_GLOBAL_CONST_STRING(lp_logon_home
, &Globals
.szLogonHome
)
1597 FN_GLOBAL_STRING(lp_remote_announce
, &Globals
.szRemoteAnnounce
)
1598 FN_GLOBAL_STRING(lp_remote_browse_sync
, &Globals
.szRemoteBrowseSync
)
1599 FN_GLOBAL_LIST(lp_wins_server_list
, &Globals
.szWINSservers
)
1600 FN_GLOBAL_LIST(lp_interfaces
, &Globals
.szInterfaces
)
1601 FN_GLOBAL_STRING(lp_socket_address
, &Globals
.szSocketAddress
)
1602 FN_GLOBAL_STRING(lp_nis_home_map_name
, &Globals
.szNISHomeMapName
)
1603 static FN_GLOBAL_STRING(lp_announce_version
, &Globals
.szAnnounceVersion
)
1604 FN_GLOBAL_LIST(lp_netbios_aliases
, &Globals
.szNetbiosAliases
)
1605 FN_GLOBAL_LIST(lp_passdb_backend
, &Globals
.szPassdbBackend
)
1606 FN_GLOBAL_LIST(lp_sam_backend
, &Globals
.szSamBackend
)
1607 FN_GLOBAL_LIST(lp_modules
, &Globals
.szModules
)
1608 FN_GLOBAL_STRING(lp_panic_action
, &Globals
.szPanicAction
)
1609 FN_GLOBAL_STRING(lp_adduser_script
, &Globals
.szAddUserScript
)
1610 FN_GLOBAL_STRING(lp_deluser_script
, &Globals
.szDelUserScript
)
1612 FN_GLOBAL_CONST_STRING(lp_guestaccount
, &Globals
.szGuestaccount
)
1613 FN_GLOBAL_STRING(lp_addgroup_script
, &Globals
.szAddGroupScript
)
1614 FN_GLOBAL_STRING(lp_delgroup_script
, &Globals
.szDelGroupScript
)
1615 FN_GLOBAL_STRING(lp_addusertogroup_script
, &Globals
.szAddUserToGroupScript
)
1616 FN_GLOBAL_STRING(lp_deluserfromgroup_script
, &Globals
.szDelUserFromGroupScript
)
1617 FN_GLOBAL_STRING(lp_setprimarygroup_script
, &Globals
.szSetPrimaryGroupScript
)
1619 FN_GLOBAL_STRING(lp_addmachine_script
, &Globals
.szAddMachineScript
)
1621 FN_GLOBAL_STRING(lp_shutdown_script
, &Globals
.szShutdownScript
)
1622 FN_GLOBAL_STRING(lp_abort_shutdown_script
, &Globals
.szAbortShutdownScript
)
1624 FN_GLOBAL_STRING(lp_wins_hook
, &Globals
.szWINSHook
)
1625 FN_GLOBAL_STRING(lp_wins_partners
, &Globals
.szWINSPartners
)
1626 FN_GLOBAL_STRING(lp_template_homedir
, &Globals
.szTemplateHomedir
)
1627 FN_GLOBAL_STRING(lp_template_shell
, &Globals
.szTemplateShell
)
1628 FN_GLOBAL_CONST_STRING(lp_winbind_separator
, &Globals
.szWinbindSeparator
)
1629 FN_GLOBAL_STRING(lp_acl_compatibility
, &Globals
.szAclCompat
)
1630 FN_GLOBAL_BOOL(lp_winbind_enum_users
, &Globals
.bWinbindEnumUsers
)
1631 FN_GLOBAL_BOOL(lp_winbind_enum_groups
, &Globals
.bWinbindEnumGroups
)
1632 FN_GLOBAL_BOOL(lp_winbind_use_default_domain
, &Globals
.bWinbindUseDefaultDomain
)
1634 #ifdef WITH_LDAP_SAMCONFIG
1635 FN_GLOBAL_STRING(lp_ldap_server
, &Globals
.szLdapServer
)
1636 FN_GLOBAL_INTEGER(lp_ldap_port
, &Globals
.ldap_port
)
1638 FN_GLOBAL_STRING(lp_ldap_suffix
, &Globals
.szLdapSuffix
)
1639 FN_GLOBAL_STRING(lp_ldap_machine_suffix
, &Globals
.szLdapMachineSuffix
)
1640 FN_GLOBAL_STRING(lp_ldap_user_suffix
, &Globals
.szLdapUserSuffix
)
1641 FN_GLOBAL_STRING(lp_ldap_filter
, &Globals
.szLdapFilter
)
1642 FN_GLOBAL_STRING(lp_ldap_admin_dn
, &Globals
.szLdapAdminDn
)
1643 FN_GLOBAL_INTEGER(lp_ldap_ssl
, &Globals
.ldap_ssl
)
1644 FN_GLOBAL_INTEGER(lp_ldap_passwd_sync
, &Globals
.ldap_passwd_sync
)
1645 FN_GLOBAL_BOOL(lp_ldap_trust_ids
, &Globals
.ldap_trust_ids
)
1646 FN_GLOBAL_STRING(lp_add_share_cmd
, &Globals
.szAddShareCommand
)
1647 FN_GLOBAL_STRING(lp_change_share_cmd
, &Globals
.szChangeShareCommand
)
1648 FN_GLOBAL_STRING(lp_delete_share_cmd
, &Globals
.szDeleteShareCommand
)
1650 FN_GLOBAL_BOOL(lp_disable_netbios
, &Globals
.bDisableNetbios
)
1651 FN_GLOBAL_BOOL(lp_ms_add_printer_wizard
, &Globals
.bMsAddPrinterWizard
)
1652 FN_GLOBAL_BOOL(lp_dns_proxy
, &Globals
.bDNSproxy
)
1653 FN_GLOBAL_BOOL(lp_wins_support
, &Globals
.bWINSsupport
)
1654 FN_GLOBAL_BOOL(lp_we_are_a_wins_server
, &Globals
.bWINSsupport
)
1655 FN_GLOBAL_BOOL(lp_wins_proxy
, &Globals
.bWINSproxy
)
1656 FN_GLOBAL_BOOL(lp_local_master
, &Globals
.bLocalMaster
)
1657 FN_GLOBAL_BOOL(lp_domain_logons
, &Globals
.bDomainLogons
)
1658 FN_GLOBAL_BOOL(lp_load_printers
, &Globals
.bLoadPrinters
)
1659 FN_GLOBAL_BOOL(lp_readprediction
, &Globals
.bReadPrediction
)
1660 FN_GLOBAL_BOOL(lp_readbmpx
, &Globals
.bReadbmpx
)
1661 FN_GLOBAL_BOOL(lp_readraw
, &Globals
.bReadRaw
)
1662 FN_GLOBAL_BOOL(lp_large_readwrite
, &Globals
.bLargeReadwrite
)
1663 FN_GLOBAL_BOOL(lp_writeraw
, &Globals
.bWriteRaw
)
1664 FN_GLOBAL_BOOL(lp_null_passwords
, &Globals
.bNullPasswords
)
1665 FN_GLOBAL_BOOL(lp_obey_pam_restrictions
, &Globals
.bObeyPamRestrictions
)
1666 FN_GLOBAL_BOOL(lp_strip_dot
, &Globals
.bStripDot
)
1667 FN_GLOBAL_BOOL(lp_encrypted_passwords
, &Globals
.bEncryptPasswords
)
1668 FN_GLOBAL_BOOL(lp_update_encrypted
, &Globals
.bUpdateEncrypt
)
1669 FN_GLOBAL_BOOL(lp_syslog_only
, &Globals
.bSyslogOnly
)
1670 FN_GLOBAL_BOOL(lp_timestamp_logs
, &Globals
.bTimestampLogs
)
1671 FN_GLOBAL_BOOL(lp_debug_hires_timestamp
, &Globals
.bDebugHiresTimestamp
)
1672 FN_GLOBAL_BOOL(lp_debug_pid
, &Globals
.bDebugPid
)
1673 FN_GLOBAL_BOOL(lp_debug_uid
, &Globals
.bDebugUid
)
1674 FN_GLOBAL_BOOL(lp_browse_list
, &Globals
.bBrowseList
)
1675 FN_GLOBAL_BOOL(lp_nis_home_map
, &Globals
.bNISHomeMap
)
1676 static FN_GLOBAL_BOOL(lp_time_server
, &Globals
.bTimeServer
)
1677 FN_GLOBAL_BOOL(lp_bind_interfaces_only
, &Globals
.bBindInterfacesOnly
)
1678 FN_GLOBAL_BOOL(lp_pam_password_change
, &Globals
.bPamPasswordChange
)
1679 FN_GLOBAL_BOOL(lp_unix_password_sync
, &Globals
.bUnixPasswdSync
)
1680 FN_GLOBAL_BOOL(lp_passwd_chat_debug
, &Globals
.bPasswdChatDebug
)
1681 FN_GLOBAL_BOOL(lp_unicode
, &Globals
.bUnicode
)
1682 FN_GLOBAL_BOOL(lp_nt_pipe_support
, &Globals
.bNTPipeSupport
)
1683 FN_GLOBAL_BOOL(lp_nt_status_support
, &Globals
.bNTStatusSupport
)
1684 FN_GLOBAL_BOOL(lp_stat_cache
, &Globals
.bStatCache
)
1685 FN_GLOBAL_BOOL(lp_allow_trusted_domains
, &Globals
.bAllowTrustedDomains
)
1686 FN_GLOBAL_INTEGER(lp_restrict_anonymous
, &Globals
.restrict_anonymous
)
1687 FN_GLOBAL_BOOL(lp_lanman_auth
, &Globals
.bLanmanAuth
)
1688 FN_GLOBAL_BOOL(lp_ntlm_auth
, &Globals
.bNTLMAuth
)
1689 FN_GLOBAL_BOOL(lp_client_lanman_auth
, &Globals
.bClientLanManAuth
)
1690 FN_GLOBAL_BOOL(lp_client_ntlmv2_auth
, &Globals
.bClientNTLMv2Auth
)
1691 FN_GLOBAL_BOOL(lp_host_msdfs
, &Globals
.bHostMSDfs
)
1692 FN_GLOBAL_BOOL(lp_kernel_oplocks
, &Globals
.bKernelOplocks
)
1693 FN_GLOBAL_BOOL(lp_enhanced_browsing
, &Globals
.enhanced_browsing
)
1694 FN_GLOBAL_BOOL(lp_use_mmap
, &Globals
.bUseMmap
)
1695 FN_GLOBAL_BOOL(lp_unix_extensions
, &Globals
.bUnixExtensions
)
1696 FN_GLOBAL_BOOL(lp_use_spnego
, &Globals
.bUseSpnego
)
1697 FN_GLOBAL_BOOL(lp_client_use_spnego
, &Globals
.bClientUseSpnego
)
1698 FN_GLOBAL_BOOL(lp_hostname_lookups
, &Globals
.bHostnameLookups
)
1699 FN_GLOBAL_BOOL(lp_kernel_change_notify
, &Globals
.bKernelChangeNotify
)
1700 FN_GLOBAL_INTEGER(lp_os_level
, &Globals
.os_level
)
1701 FN_GLOBAL_INTEGER(lp_max_ttl
, &Globals
.max_ttl
)
1702 FN_GLOBAL_INTEGER(lp_max_wins_ttl
, &Globals
.max_wins_ttl
)
1703 FN_GLOBAL_INTEGER(lp_min_wins_ttl
, &Globals
.min_wins_ttl
)
1704 FN_GLOBAL_INTEGER(lp_max_log_size
, &Globals
.max_log_size
)
1705 FN_GLOBAL_INTEGER(lp_max_open_files
, &Globals
.max_open_files
)
1706 FN_GLOBAL_INTEGER(lp_maxxmit
, &Globals
.max_xmit
)
1707 FN_GLOBAL_INTEGER(lp_maxmux
, &Globals
.max_mux
)
1708 FN_GLOBAL_INTEGER(lp_passwordlevel
, &Globals
.pwordlevel
)
1709 FN_GLOBAL_INTEGER(lp_usernamelevel
, &Globals
.unamelevel
)
1710 FN_GLOBAL_INTEGER(lp_readsize
, &Globals
.ReadSize
)
1711 FN_GLOBAL_INTEGER(lp_deadtime
, &Globals
.deadtime
)
1712 FN_GLOBAL_INTEGER(lp_maxprotocol
, &Globals
.maxprotocol
)
1713 FN_GLOBAL_INTEGER(lp_minprotocol
, &Globals
.minprotocol
)
1714 FN_GLOBAL_INTEGER(lp_security
, &Globals
.security
)
1715 FN_GLOBAL_LIST(lp_auth_methods
, &Globals
.AuthMethods
)
1716 FN_GLOBAL_BOOL(lp_paranoid_server_security
, &Globals
.paranoid_server_security
)
1717 FN_GLOBAL_INTEGER(lp_maxdisksize
, &Globals
.maxdisksize
)
1718 FN_GLOBAL_INTEGER(lp_lpqcachetime
, &Globals
.lpqcachetime
)
1719 FN_GLOBAL_INTEGER(lp_max_smbd_processes
, &Globals
.iMaxSmbdProcesses
)
1720 FN_GLOBAL_INTEGER(lp_disable_spoolss
, &Globals
.bDisableSpoolss
)
1721 FN_GLOBAL_INTEGER(lp_totalprintjobs
, &Globals
.iTotalPrintJobs
)
1722 FN_GLOBAL_INTEGER(lp_syslog
, &Globals
.syslog
)
1723 static FN_GLOBAL_INTEGER(lp_announce_as
, &Globals
.announce_as
)
1724 FN_GLOBAL_INTEGER(lp_lm_announce
, &Globals
.lm_announce
)
1725 FN_GLOBAL_INTEGER(lp_lm_interval
, &Globals
.lm_interval
)
1726 FN_GLOBAL_INTEGER(lp_machine_password_timeout
, &Globals
.machine_password_timeout
)
1727 FN_GLOBAL_INTEGER(lp_change_notify_timeout
, &Globals
.change_notify_timeout
)
1728 FN_GLOBAL_INTEGER(lp_stat_cache_size
, &Globals
.stat_cache_size
)
1729 FN_GLOBAL_INTEGER(lp_map_to_guest
, &Globals
.map_to_guest
)
1730 FN_GLOBAL_INTEGER(lp_min_passwd_length
, &Globals
.min_passwd_length
)
1731 FN_GLOBAL_INTEGER(lp_oplock_break_wait_time
, &Globals
.oplock_break_wait_time
)
1732 FN_GLOBAL_INTEGER(lp_lock_spin_count
, &Globals
.iLockSpinCount
)
1733 FN_GLOBAL_INTEGER(lp_lock_sleep_time
, &Globals
.iLockSpinTime
)
1734 FN_LOCAL_STRING(lp_preexec
, szPreExec
)
1735 FN_LOCAL_STRING(lp_postexec
, szPostExec
)
1736 FN_LOCAL_STRING(lp_rootpreexec
, szRootPreExec
)
1737 FN_LOCAL_STRING(lp_rootpostexec
, szRootPostExec
)
1738 FN_LOCAL_STRING(lp_servicename
, szService
)
1739 FN_LOCAL_CONST_STRING(lp_const_servicename
, szService
)
1740 FN_LOCAL_STRING(lp_pathname
, szPath
)
1741 FN_LOCAL_STRING(lp_dontdescend
, szDontdescend
)
1742 FN_LOCAL_STRING(lp_username
, szUsername
)
1743 FN_LOCAL_LIST(lp_invalid_users
, szInvalidUsers
)
1744 FN_LOCAL_LIST(lp_valid_users
, szValidUsers
)
1745 FN_LOCAL_LIST(lp_admin_users
, szAdminUsers
)
1746 FN_LOCAL_STRING(lp_printcommand
, szPrintcommand
)
1747 FN_LOCAL_STRING(lp_lpqcommand
, szLpqcommand
)
1748 FN_LOCAL_STRING(lp_lprmcommand
, szLprmcommand
)
1749 FN_LOCAL_STRING(lp_lppausecommand
, szLppausecommand
)
1750 FN_LOCAL_STRING(lp_lpresumecommand
, szLpresumecommand
)
1751 FN_LOCAL_STRING(lp_queuepausecommand
, szQueuepausecommand
)
1752 FN_LOCAL_STRING(lp_queueresumecommand
, szQueueresumecommand
)
1753 static FN_LOCAL_STRING(_lp_printername
, szPrintername
)
1754 FN_LOCAL_LIST(lp_hostsallow
, szHostsallow
)
1755 FN_LOCAL_LIST(lp_hostsdeny
, szHostsdeny
)
1756 FN_LOCAL_STRING(lp_magicscript
, szMagicScript
)
1757 FN_LOCAL_STRING(lp_magicoutput
, szMagicOutput
)
1758 FN_LOCAL_STRING(lp_comment
, comment
)
1759 FN_LOCAL_STRING(lp_force_user
, force_user
)
1760 FN_LOCAL_STRING(lp_force_group
, force_group
)
1761 FN_LOCAL_LIST(lp_readlist
, readlist
)
1762 FN_LOCAL_LIST(lp_writelist
, writelist
)
1763 FN_LOCAL_LIST(lp_printer_admin
, printer_admin
)
1764 FN_LOCAL_STRING(lp_fstype
, fstype
)
1765 FN_LOCAL_STRING(lp_vfsobj
, szVfsObjectFile
)
1766 FN_LOCAL_STRING(lp_vfs_options
, szVfsOptions
)
1767 FN_LOCAL_STRING(lp_vfs_path
, szVfsPath
)
1768 FN_LOCAL_STRING(lp_msdfs_proxy
, szMSDfsProxy
)
1769 static FN_LOCAL_STRING(lp_volume
, volume
)
1770 FN_LOCAL_STRING(lp_mangled_map
, szMangledMap
)
1771 FN_LOCAL_STRING(lp_veto_files
, szVetoFiles
)
1772 FN_LOCAL_STRING(lp_hide_files
, szHideFiles
)
1773 FN_LOCAL_STRING(lp_veto_oplocks
, szVetoOplockFiles
)
1774 FN_LOCAL_BOOL(lp_msdfs_root
, bMSDfsRoot
)
1775 FN_LOCAL_BOOL(lp_autoloaded
, autoloaded
)
1776 FN_LOCAL_BOOL(lp_preexec_close
, bPreexecClose
)
1777 FN_LOCAL_BOOL(lp_rootpreexec_close
, bRootpreexecClose
)
1778 FN_LOCAL_BOOL(lp_casesensitive
, bCaseSensitive
)
1779 FN_LOCAL_BOOL(lp_preservecase
, bCasePreserve
)
1780 FN_LOCAL_BOOL(lp_shortpreservecase
, bShortCasePreserve
)
1781 FN_LOCAL_BOOL(lp_casemangle
, bCaseMangle
)
1782 FN_LOCAL_BOOL(lp_hide_dot_files
, bHideDotFiles
)
1783 FN_LOCAL_BOOL(lp_hide_special_files
, bHideSpecialFiles
)
1784 FN_LOCAL_BOOL(lp_hideunreadable
, bHideUnReadable
)
1785 FN_LOCAL_BOOL(lp_hideunwriteable_files
, bHideUnWriteableFiles
)
1786 FN_LOCAL_BOOL(lp_browseable
, bBrowseable
)
1787 FN_LOCAL_BOOL(lp_readonly
, bRead_only
)
1788 FN_LOCAL_BOOL(lp_no_set_dir
, bNo_set_dir
)
1789 FN_LOCAL_BOOL(lp_guest_ok
, bGuest_ok
)
1790 FN_LOCAL_BOOL(lp_guest_only
, bGuest_only
)
1791 FN_LOCAL_BOOL(lp_print_ok
, bPrint_ok
)
1792 FN_LOCAL_BOOL(lp_map_hidden
, bMap_hidden
)
1793 FN_LOCAL_BOOL(lp_map_archive
, bMap_archive
)
1794 FN_LOCAL_BOOL(lp_locking
, bLocking
)
1795 FN_LOCAL_BOOL(lp_strict_locking
, bStrictLocking
)
1796 FN_LOCAL_BOOL(lp_posix_locking
, bPosixLocking
)
1797 FN_LOCAL_BOOL(lp_share_modes
, bShareModes
)
1798 FN_LOCAL_BOOL(lp_oplocks
, bOpLocks
)
1799 FN_LOCAL_BOOL(lp_level2_oplocks
, bLevel2OpLocks
)
1800 FN_LOCAL_BOOL(lp_onlyuser
, bOnlyUser
)
1801 FN_LOCAL_BOOL(lp_manglednames
, bMangledNames
)
1802 FN_LOCAL_BOOL(lp_widelinks
, bWidelinks
)
1803 FN_LOCAL_BOOL(lp_symlinks
, bSymlinks
)
1804 FN_LOCAL_BOOL(lp_syncalways
, bSyncAlways
)
1805 FN_LOCAL_BOOL(lp_strict_allocate
, bStrictAllocate
)
1806 FN_LOCAL_BOOL(lp_strict_sync
, bStrictSync
)
1807 FN_LOCAL_BOOL(lp_map_system
, bMap_system
)
1808 FN_LOCAL_BOOL(lp_delete_readonly
, bDeleteReadonly
)
1809 FN_LOCAL_BOOL(lp_fake_oplocks
, bFakeOplocks
)
1810 FN_LOCAL_BOOL(lp_recursive_veto_delete
, bDeleteVetoFiles
)
1811 FN_LOCAL_BOOL(lp_dos_filemode
, bDosFilemode
)
1812 FN_LOCAL_BOOL(lp_dos_filetimes
, bDosFiletimes
)
1813 FN_LOCAL_BOOL(lp_dos_filetime_resolution
, bDosFiletimeResolution
)
1814 FN_LOCAL_BOOL(lp_fake_dir_create_times
, bFakeDirCreateTimes
)
1815 FN_LOCAL_BOOL(lp_blocking_locks
, bBlockingLocks
)
1816 FN_LOCAL_BOOL(lp_inherit_perms
, bInheritPerms
)
1817 FN_LOCAL_BOOL(lp_inherit_acls
, bInheritACLS
)
1818 FN_LOCAL_BOOL(lp_use_client_driver
, bUseClientDriver
)
1819 FN_LOCAL_BOOL(lp_default_devmode
, bDefaultDevmode
)
1820 FN_LOCAL_BOOL(lp_nt_acl_support
, bNTAclSupport
)
1821 FN_LOCAL_BOOL(lp_use_sendfile
, bUseSendfile
)
1822 FN_LOCAL_BOOL(lp_profile_acls
, bProfileAcls
)
1823 FN_LOCAL_INTEGER(lp_create_mask
, iCreate_mask
)
1824 FN_LOCAL_INTEGER(lp_force_create_mode
, iCreate_force_mode
)
1825 FN_LOCAL_INTEGER(lp_security_mask
, iSecurity_mask
)
1826 FN_LOCAL_INTEGER(lp_force_security_mode
, iSecurity_force_mode
)
1827 FN_LOCAL_INTEGER(lp_dir_mask
, iDir_mask
)
1828 FN_LOCAL_INTEGER(lp_force_dir_mode
, iDir_force_mode
)
1829 FN_LOCAL_INTEGER(lp_dir_security_mask
, iDir_Security_mask
)
1830 FN_LOCAL_INTEGER(lp_force_dir_security_mode
, iDir_Security_force_mode
)
1831 FN_LOCAL_INTEGER(lp_max_connections
, iMaxConnections
)
1832 FN_LOCAL_INTEGER(lp_defaultcase
, iDefaultCase
)
1833 FN_LOCAL_INTEGER(lp_minprintspace
, iMinPrintSpace
)
1834 FN_LOCAL_INTEGER(lp_printing
, iPrinting
)
1835 FN_LOCAL_INTEGER(lp_oplock_contention_limit
, iOplockContentionLimit
)
1836 FN_LOCAL_INTEGER(lp_csc_policy
, iCSCPolicy
)
1837 FN_LOCAL_INTEGER(lp_write_cache_size
, iWriteCacheSize
)
1838 FN_LOCAL_INTEGER(lp_block_size
, iBlock_size
)
1839 FN_LOCAL_CHAR(lp_magicchar
, magic_char
)
1840 FN_GLOBAL_INTEGER(lp_winbind_cache_time
, &Globals
.winbind_cache_time
)
1841 FN_GLOBAL_BOOL(lp_hide_local_users
, &Globals
.bHideLocalUsers
)
1842 FN_GLOBAL_INTEGER(lp_algorithmic_rid_base
, &Globals
.AlgorithmicRidBase
)
1843 FN_GLOBAL_INTEGER(lp_name_cache_timeout
, &Globals
.name_cache_timeout
)
1844 FN_GLOBAL_BOOL(lp_client_signing
, &Globals
.client_signing
)
1846 /* local prototypes */
1848 static int map_parameter(const char *pszParmName
);
1849 static BOOL
set_boolean(BOOL
*pb
, const char *pszParmValue
);
1850 static int getservicebyname(const char *pszServiceName
,
1851 service
* pserviceDest
);
1852 static void copy_service(service
* pserviceDest
,
1853 service
* pserviceSource
, BOOL
*pcopymapDest
);
1854 static BOOL
service_ok(int iService
);
1855 static BOOL
do_parameter(const char *pszParmName
, const char *pszParmValue
);
1856 static BOOL
do_section(const char *pszSectionName
);
1857 static void init_copymap(service
* pservice
);
1859 /* This is a helper function for parametrical options support. */
1860 /* It returns a pointer to parametrical option value if it exists or NULL otherwise */
1861 /* Actual parametrical functions are quite simple */
1862 static const char *get_parametrics(int lookup_service
, const char *type
, const char *option
)
1865 param_opt_struct
*data
;
1867 if (lookup_service
>= iNumServices
) return NULL
;
1869 data
= (lookup_service
< 0) ?
1870 Globals
.param_opt
: ServicePtrs
[lookup_service
]->param_opt
;
1872 asprintf(&vfskey
, "%s:%s", type
, option
);
1874 if (strcmp(data
->key
, vfskey
) == 0) {
1875 string_free(&vfskey
);
1881 if (lookup_service
>= 0) {
1882 /* Try to fetch the same option but from globals */
1883 /* but only if we are not already working with Globals */
1884 data
= Globals
.param_opt
;
1886 if (strcmp(data
->key
, vfskey
) == 0) {
1887 string_free(&vfskey
);
1894 string_free(&vfskey
);
1900 /*******************************************************************
1901 convenience routine to return int parameters.
1902 ********************************************************************/
1903 static int lp_int(const char *s
)
1907 DEBUG(0,("lp_int(%s): is called with NULL!\n",s
));
1914 /*******************************************************************
1915 convenience routine to return unsigned long parameters.
1916 ********************************************************************/
1917 static int lp_ulong(const char *s
)
1921 DEBUG(0,("lp_int(%s): is called with NULL!\n",s
));
1925 return strtoul(s
, NULL
, 10);
1928 /*******************************************************************
1929 convenience routine to return boolean parameters.
1930 ********************************************************************/
1931 static BOOL
lp_bool(const char *s
)
1936 DEBUG(0,("lp_bool(%s): is called with NULL!\n",s
));
1940 if (!set_boolean(&ret
,s
)) {
1941 DEBUG(0,("lp_bool(%s): value is not boolean!\n",s
));
1948 /*******************************************************************
1949 convenience routine to return enum parameters.
1950 ********************************************************************/
1951 static int lp_enum(const char *s
,const struct enum_list
*_enum
)
1956 DEBUG(0,("lp_enum(%s,enum): is called with NULL!\n",s
));
1960 for (i
=0; _enum
[i
].name
; i
++) {
1961 if (strcasecmp(_enum
[i
].name
,s
)==0)
1962 return _enum
[i
].value
;
1965 DEBUG(0,("lp_enum(%s,enum): value is not in enum_list!\n",s
));
1969 /* Return parametric option from a given service. Type is a part of option before ':' */
1970 /* Parametric option has following syntax: 'Type: option = value' */
1971 /* Returned value is allocated in 'lp_talloc' context */
1973 char *lp_parm_string(int lookup_service
, const char *type
, const char *option
)
1975 const char *value
= get_parametrics(lookup_service
, type
, option
);
1978 return lp_string(value
);
1983 /* Return parametric option from a given service. Type is a part of option before ':' */
1984 /* Parametric option has following syntax: 'Type: option = value' */
1985 /* Returned value is allocated in 'lp_talloc' context */
1987 char **lp_parm_string_list(int lookup_service
, const char *type
, const char *option
,
1988 const char *separator
)
1990 const char *value
= get_parametrics(lookup_service
, type
, option
);
1993 return str_list_make(value
, separator
);
1998 /* Return parametric option from a given service. Type is a part of option before ':' */
1999 /* Parametric option has following syntax: 'Type: option = value' */
2001 int lp_parm_int(int lookup_service
, const char *type
, const char *option
)
2003 const char *value
= get_parametrics(lookup_service
, type
, option
);
2006 return lp_int(value
);
2011 /* Return parametric option from a given service. Type is a part of option before ':' */
2012 /* Parametric option has following syntax: 'Type: option = value' */
2014 unsigned long lp_parm_ulong(int lookup_service
, const char *type
, const char *option
)
2016 const char *value
= get_parametrics(lookup_service
, type
, option
);
2019 return lp_ulong(value
);
2024 /* Return parametric option from a given service. Type is a part of option before ':' */
2025 /* Parametric option has following syntax: 'Type: option = value' */
2027 BOOL
lp_parm_bool(int lookup_service
, const char *type
, const char *option
)
2029 const char *value
= get_parametrics(lookup_service
, type
, option
);
2032 return lp_bool(value
);
2037 /* Return parametric option from a given service. Type is a part of option before ':' */
2038 /* Parametric option has following syntax: 'Type: option = value' */
2040 int lp_parm_enum(int lookup_service
, const char *type
, const char *option
,
2041 const struct enum_list
*_enum
)
2043 const char *value
= get_parametrics(lookup_service
, type
, option
);
2046 return lp_enum(value
, _enum
);
2052 /***************************************************************************
2053 Initialise a service to the defaults.
2054 ***************************************************************************/
2056 static void init_service(service
* pservice
)
2058 memset((char *)pservice
, '\0', sizeof(service
));
2059 copy_service(pservice
, &sDefault
, NULL
);
2062 /***************************************************************************
2063 Free the dynamically allocated parts of a service struct.
2064 ***************************************************************************/
2066 static void free_service(service
*pservice
)
2069 param_opt_struct
*data
, *pdata
;
2073 if (pservice
->szService
)
2074 DEBUG(5, ("free_service: Freeing service %s\n",
2075 pservice
->szService
));
2077 string_free(&pservice
->szService
);
2078 SAFE_FREE(pservice
->copymap
);
2080 for (i
= 0; parm_table
[i
].label
; i
++) {
2081 if ((parm_table
[i
].type
== P_STRING
||
2082 parm_table
[i
].type
== P_USTRING
) &&
2083 parm_table
[i
].class == P_LOCAL
)
2084 string_free((char **)
2085 (((char *)pservice
) +
2086 PTR_DIFF(parm_table
[i
].ptr
, &sDefault
)));
2087 else if (parm_table
[i
].type
== P_LIST
&&
2088 parm_table
[i
].class == P_LOCAL
)
2089 str_list_free((char ***)
2090 (((char *)pservice
) +
2091 PTR_DIFF(parm_table
[i
].ptr
, &sDefault
)));
2094 DEBUG(5,("Freeing parametrics:\n"));
2095 data
= pservice
->param_opt
;
2097 DEBUG(5,("[%s = %s]\n", data
->key
, data
->value
));
2098 string_free(&data
->key
);
2099 string_free(&data
->value
);
2105 ZERO_STRUCTP(pservice
);
2108 /***************************************************************************
2109 Add a new service to the services array initialising it with the given
2111 ***************************************************************************/
2113 static int add_a_service(const service
*pservice
, const char *name
)
2117 int num_to_alloc
= iNumServices
+ 1;
2118 param_opt_struct
*data
, *pdata
;
2120 tservice
= *pservice
;
2122 /* it might already exist */
2124 i
= getservicebyname(name
, NULL
);
2126 /* Clean all parametric options for service */
2127 /* They will be added during parsing again */
2128 data
= ServicePtrs
[i
]->param_opt
;
2130 string_free(&data
->key
);
2131 string_free(&data
->value
);
2136 ServicePtrs
[i
]->param_opt
= NULL
;
2141 /* find an invalid one */
2142 for (i
= 0; i
< iNumServices
; i
++)
2143 if (!ServicePtrs
[i
]->valid
)
2146 /* if not, then create one */
2147 if (i
== iNumServices
) {
2150 tsp
= (service
**) Realloc(ServicePtrs
,
2155 DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
2160 ServicePtrs
[iNumServices
] =
2161 (service
*) malloc(sizeof(service
));
2163 if (!ServicePtrs
[iNumServices
]) {
2164 DEBUG(0,("add_a_service: out of memory!\n"));
2170 free_service(ServicePtrs
[i
]);
2172 ServicePtrs
[i
]->valid
= True
;
2174 init_service(ServicePtrs
[i
]);
2175 copy_service(ServicePtrs
[i
], &tservice
, NULL
);
2177 string_set(&ServicePtrs
[i
]->szService
, name
);
2181 /***************************************************************************
2182 Add a new home service, with the specified home directory, defaults coming
2184 ***************************************************************************/
2186 BOOL
lp_add_home(const char *pszHomename
, int iDefaultService
,
2187 const char *user
, const char *pszHomedir
)
2192 i
= add_a_service(ServicePtrs
[iDefaultService
], pszHomename
);
2197 if (!(*(ServicePtrs
[iDefaultService
]->szPath
))
2198 || strequal(ServicePtrs
[iDefaultService
]->szPath
, lp_pathname(-1))) {
2199 pstrcpy(newHomedir
, pszHomedir
);
2201 pstrcpy(newHomedir
, lp_pathname(iDefaultService
));
2202 string_sub(newHomedir
,"%H", pszHomedir
, sizeof(newHomedir
));
2205 string_set(&ServicePtrs
[i
]->szPath
, newHomedir
);
2207 if (!(*(ServicePtrs
[i
]->comment
))) {
2209 slprintf(comment
, sizeof(comment
) - 1,
2210 "Home directory of %s", user
);
2211 string_set(&ServicePtrs
[i
]->comment
, comment
);
2213 ServicePtrs
[i
]->bAvailable
= sDefault
.bAvailable
;
2214 ServicePtrs
[i
]->bBrowseable
= sDefault
.bBrowseable
;
2216 DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename
,
2222 /***************************************************************************
2223 Add a new service, based on an old one.
2224 ***************************************************************************/
2226 int lp_add_service(const char *pszService
, int iDefaultService
)
2228 return (add_a_service(ServicePtrs
[iDefaultService
], pszService
));
2231 /***************************************************************************
2232 Add the IPC service.
2233 ***************************************************************************/
2235 static BOOL
lp_add_ipc(const char *ipc_name
, BOOL guest_ok
)
2238 int i
= add_a_service(&sDefault
, ipc_name
);
2243 slprintf(comment
, sizeof(comment
) - 1,
2244 "IPC Service (%s)", Globals
.szServerString
);
2246 string_set(&ServicePtrs
[i
]->szPath
, tmpdir());
2247 string_set(&ServicePtrs
[i
]->szUsername
, "");
2248 string_set(&ServicePtrs
[i
]->comment
, comment
);
2249 string_set(&ServicePtrs
[i
]->fstype
, "IPC");
2250 ServicePtrs
[i
]->iMaxConnections
= 0;
2251 ServicePtrs
[i
]->bAvailable
= True
;
2252 ServicePtrs
[i
]->bRead_only
= True
;
2253 ServicePtrs
[i
]->bGuest_only
= False
;
2254 ServicePtrs
[i
]->bGuest_ok
= guest_ok
;
2255 ServicePtrs
[i
]->bPrint_ok
= False
;
2256 ServicePtrs
[i
]->bBrowseable
= sDefault
.bBrowseable
;
2258 DEBUG(3, ("adding IPC service\n"));
2263 /***************************************************************************
2264 Add a new printer service, with defaults coming from service iFrom.
2265 ***************************************************************************/
2267 BOOL
lp_add_printer(const char *pszPrintername
, int iDefaultService
)
2269 const char *comment
= "From Printcap";
2270 int i
= add_a_service(ServicePtrs
[iDefaultService
], pszPrintername
);
2275 /* note that we do NOT default the availability flag to True - */
2276 /* we take it from the default service passed. This allows all */
2277 /* dynamic printers to be disabled by disabling the [printers] */
2278 /* entry (if/when the 'available' keyword is implemented!). */
2280 /* the printer name is set to the service name. */
2281 string_set(&ServicePtrs
[i
]->szPrintername
, pszPrintername
);
2282 string_set(&ServicePtrs
[i
]->comment
, comment
);
2283 ServicePtrs
[i
]->bBrowseable
= sDefault
.bBrowseable
;
2284 /* Printers cannot be read_only. */
2285 ServicePtrs
[i
]->bRead_only
= False
;
2286 /* No share modes on printer services. */
2287 ServicePtrs
[i
]->bShareModes
= False
;
2288 /* No oplocks on printer services. */
2289 ServicePtrs
[i
]->bOpLocks
= False
;
2290 /* Printer services must be printable. */
2291 ServicePtrs
[i
]->bPrint_ok
= True
;
2293 DEBUG(3, ("adding printer service %s\n", pszPrintername
));
2295 update_server_announce_as_printserver();
2300 /***************************************************************************
2301 Map a parameter's string representation to something we can use.
2302 Returns False if the parameter string is not recognised, else TRUE.
2303 ***************************************************************************/
2305 static int map_parameter(const char *pszParmName
)
2309 if (*pszParmName
== '-')
2312 for (iIndex
= 0; parm_table
[iIndex
].label
; iIndex
++)
2313 if (strwicmp(parm_table
[iIndex
].label
, pszParmName
) == 0)
2316 /* Warn only if it isn't parametric option */
2317 if (strchr(pszParmName
, ':') == NULL
)
2318 DEBUG(0, ("Unknown parameter encountered: \"%s\"\n", pszParmName
));
2319 /* We do return 'fail' for parametric options as well because they are
2320 stored in different storage
2325 /***************************************************************************
2326 Set a boolean variable from the text value stored in the passed string.
2327 Returns True in success, False if the passed string does not correctly
2328 represent a boolean.
2329 ***************************************************************************/
2331 static BOOL
set_boolean(BOOL
*pb
, const char *pszParmValue
)
2336 if (strwicmp(pszParmValue
, "yes") == 0 ||
2337 strwicmp(pszParmValue
, "true") == 0 ||
2338 strwicmp(pszParmValue
, "1") == 0)
2340 else if (strwicmp(pszParmValue
, "no") == 0 ||
2341 strwicmp(pszParmValue
, "False") == 0 ||
2342 strwicmp(pszParmValue
, "0") == 0)
2346 ("ERROR: Badly formed boolean in configuration file: \"%s\".\n",
2353 /***************************************************************************
2354 Find a service by name. Otherwise works like get_service.
2355 ***************************************************************************/
2357 static int getservicebyname(const char *pszServiceName
, service
* pserviceDest
)
2361 for (iService
= iNumServices
- 1; iService
>= 0; iService
--)
2362 if (VALID(iService
) &&
2363 strwicmp(ServicePtrs
[iService
]->szService
, pszServiceName
) == 0) {
2364 if (pserviceDest
!= NULL
)
2365 copy_service(pserviceDest
, ServicePtrs
[iService
], NULL
);
2372 /***************************************************************************
2373 Copy a service structure to another.
2374 If pcopymapDest is NULL then copy all fields
2375 ***************************************************************************/
2377 static void copy_service(service
* pserviceDest
, service
* pserviceSource
, BOOL
*pcopymapDest
)
2380 BOOL bcopyall
= (pcopymapDest
== NULL
);
2381 param_opt_struct
*data
, *pdata
, *paramo
;
2384 for (i
= 0; parm_table
[i
].label
; i
++)
2385 if (parm_table
[i
].ptr
&& parm_table
[i
].class == P_LOCAL
&&
2386 (bcopyall
|| pcopymapDest
[i
])) {
2387 void *def_ptr
= parm_table
[i
].ptr
;
2389 ((char *)pserviceSource
) + PTR_DIFF(def_ptr
,
2392 ((char *)pserviceDest
) + PTR_DIFF(def_ptr
,
2395 switch (parm_table
[i
].type
) {
2398 *(BOOL
*)dest_ptr
= *(BOOL
*)src_ptr
;
2404 *(int *)dest_ptr
= *(int *)src_ptr
;
2408 *(char *)dest_ptr
= *(char *)src_ptr
;
2412 string_set(dest_ptr
,
2417 string_set(dest_ptr
,
2419 strupper(*(char **)dest_ptr
);
2422 str_list_copy((char ***)dest_ptr
, *(const char ***)src_ptr
);
2430 init_copymap(pserviceDest
);
2431 if (pserviceSource
->copymap
)
2432 memcpy((void *)pserviceDest
->copymap
,
2433 (void *)pserviceSource
->copymap
,
2434 sizeof(BOOL
) * NUMPARAMETERS
);
2437 data
= pserviceSource
->param_opt
;
2440 pdata
= pserviceDest
->param_opt
;
2441 /* Traverse destination */
2443 /* If we already have same option, override it */
2444 if (strcmp(pdata
->key
, data
->key
) == 0) {
2445 string_free(&pdata
->value
);
2446 pdata
->value
= strdup(data
->value
);
2450 pdata
= pdata
->next
;
2453 paramo
= smb_xmalloc(sizeof(param_opt_struct
));
2454 paramo
->key
= strdup(data
->key
);
2455 paramo
->value
= strdup(data
->value
);
2456 DLIST_ADD(pserviceDest
->param_opt
, paramo
);
2462 /***************************************************************************
2463 Check a service for consistency. Return False if the service is in any way
2464 incomplete or faulty, else True.
2465 ***************************************************************************/
2467 static BOOL
service_ok(int iService
)
2472 if (ServicePtrs
[iService
]->szService
[0] == '\0') {
2473 DEBUG(0, ("The following message indicates an internal error:\n"));
2474 DEBUG(0, ("No service name in service entry.\n"));
2478 /* The [printers] entry MUST be printable. I'm all for flexibility, but */
2479 /* I can't see why you'd want a non-printable printer service... */
2480 if (strwicmp(ServicePtrs
[iService
]->szService
, PRINTERS_NAME
) == 0) {
2481 if (!ServicePtrs
[iService
]->bPrint_ok
) {
2482 DEBUG(0, ("WARNING: [%s] service MUST be printable!\n",
2483 ServicePtrs
[iService
]->szService
));
2484 ServicePtrs
[iService
]->bPrint_ok
= True
;
2486 /* [printers] service must also be non-browsable. */
2487 if (ServicePtrs
[iService
]->bBrowseable
)
2488 ServicePtrs
[iService
]->bBrowseable
= False
;
2491 if (ServicePtrs
[iService
]->szPath
[0] == '\0' &&
2492 strwicmp(ServicePtrs
[iService
]->szService
, HOMES_NAME
) != 0) {
2493 DEBUG(0, ("No path in service %s - using %s\n",
2494 ServicePtrs
[iService
]->szService
, tmpdir()));
2495 string_set(&ServicePtrs
[iService
]->szPath
, tmpdir());
2498 /* If a service is flagged unavailable, log the fact at level 0. */
2499 if (!ServicePtrs
[iService
]->bAvailable
)
2500 DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n",
2501 ServicePtrs
[iService
]->szService
));
2506 static struct file_lists
{
2507 struct file_lists
*next
;
2511 } *file_lists
= NULL
;
2513 /*******************************************************************
2514 Keep a linked list of all config files so we know when one has changed
2515 it's date and needs to be reloaded.
2516 ********************************************************************/
2518 static void add_to_file_list(const char *fname
, const char *subfname
)
2520 struct file_lists
*f
= file_lists
;
2523 if (f
->name
&& !strcmp(f
->name
, fname
))
2529 f
= (struct file_lists
*)malloc(sizeof(file_lists
[0]));
2532 f
->next
= file_lists
;
2533 f
->name
= strdup(fname
);
2538 f
->subfname
= strdup(subfname
);
2544 f
->modtime
= file_modtime(subfname
);
2546 time_t t
= file_modtime(subfname
);
2552 /*******************************************************************
2553 Check if a config file has changed date.
2554 ********************************************************************/
2556 BOOL
lp_file_list_changed(void)
2558 struct file_lists
*f
= file_lists
;
2559 DEBUG(6, ("lp_file_list_changed()\n"));
2565 pstrcpy(n2
, f
->name
);
2566 standard_sub_basic(current_user_info
.smb_name
, n2
,sizeof(n2
));
2568 DEBUGADD(6, ("file %s -> %s last mod_time: %s\n",
2569 f
->name
, n2
, ctime(&f
->modtime
)));
2571 mod_time
= file_modtime(n2
);
2573 if (mod_time
&& ((f
->modtime
!= mod_time
) || (f
->subfname
== NULL
) || (strcmp(n2
, f
->subfname
) != 0))) {
2575 ("file %s modified: %s\n", n2
,
2577 f
->modtime
= mod_time
;
2578 SAFE_FREE(f
->subfname
);
2579 f
->subfname
= strdup(n2
);
2587 /***************************************************************************
2588 Run standard_sub_basic on netbios name... needed because global_myname
2589 is not accessed through any lp_ macro.
2590 Note: We must *NOT* use string_set() here as ptr points to global_myname.
2591 ***************************************************************************/
2593 static BOOL
handle_netbios_name(const char *pszParmValue
, char **ptr
)
2596 pstring netbios_name
;
2598 pstrcpy(netbios_name
, pszParmValue
);
2600 standard_sub_basic(current_user_info
.smb_name
, netbios_name
,sizeof(netbios_name
));
2603 ret
= set_global_myname(netbios_name
);
2604 string_set(&Globals
.szNetbiosName
,global_myname());
2606 DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n",
2612 static BOOL
handle_workgroup(const char *pszParmValue
, char **ptr
)
2616 ret
= set_global_myworkgroup(pszParmValue
);
2617 string_set(&Globals
.szWorkgroup
,lp_workgroup());
2622 static BOOL
handle_netbios_scope(const char *pszParmValue
, char **ptr
)
2626 ret
= set_global_scope(pszParmValue
);
2627 string_set(&Globals
.szNetbiosScope
,global_scope());
2632 static BOOL
handle_netbios_aliases(const char *pszParmValue
, char **ptr
)
2634 Globals
.szNetbiosAliases
= str_list_make(pszParmValue
, NULL
);
2635 return set_netbios_aliases((const char **)Globals
.szNetbiosAliases
);
2638 /***************************************************************************
2639 Do the work of sourcing in environment variable/value pairs.
2640 ***************************************************************************/
2642 static BOOL
source_env(char **lines
)
2649 for (i
= 0; lines
[i
]; i
++) {
2650 char *line
= lines
[i
];
2652 if ((len
= strlen(line
)) == 0)
2655 if (line
[len
- 1] == '\n')
2658 if ((varval
= malloc(len
+ 1)) == NULL
) {
2659 DEBUG(0, ("source_env: Not enough memory!\n"));
2663 DEBUG(4, ("source_env: Adding to environment: %s\n", line
));
2664 strncpy(varval
, line
, len
);
2667 p
= strchr_m(line
, (int)'=');
2669 DEBUG(4, ("source_env: missing '=': %s\n", line
));
2673 if (putenv(varval
)) {
2674 DEBUG(0, ("source_env: Failed to put environment variable %s\n",
2681 DEBUG(4, ("source_env: getting var %s = %s\n", line
, getenv(line
)));
2684 DEBUG(4, ("source_env: returning successfully\n"));
2688 /***************************************************************************
2689 Handle the source environment operation.
2690 ***************************************************************************/
2692 static BOOL
handle_source_env(const char *pszParmValue
, char **ptr
)
2699 pstrcpy(fname
, pszParmValue
);
2701 standard_sub_basic(current_user_info
.smb_name
, fname
,sizeof(fname
));
2703 string_set(ptr
, pszParmValue
);
2705 DEBUG(4, ("handle_source_env: checking env type\n"));
2708 * Filename starting with '|' means popen and read from stdin.
2712 lines
= file_lines_pload(p
+ 1, NULL
);
2714 lines
= file_lines_load(fname
, NULL
);
2717 DEBUG(0, ("handle_source_env: Failed to open file %s, Error was %s\n",
2718 fname
, strerror(errno
)));
2722 result
= source_env(lines
);
2723 file_lines_free(lines
);
2728 /***************************************************************************
2729 Handle the interpretation of the vfs object parameter.
2730 *************************************************************************/
2732 static BOOL
handle_vfs_object(const char *pszParmValue
, char **ptr
)
2734 /* Set string value */
2736 string_set(ptr
, pszParmValue
);
2738 /* Do any other initialisation required for vfs. Note that
2739 anything done here may have linking repercussions in nmbd. */
2744 /***************************************************************************
2745 Handle the include operation.
2746 ***************************************************************************/
2748 static BOOL
handle_include(const char *pszParmValue
, char **ptr
)
2751 pstrcpy(fname
, pszParmValue
);
2753 standard_sub_basic(current_user_info
.smb_name
, fname
,sizeof(fname
));
2755 add_to_file_list(pszParmValue
, fname
);
2757 string_set(ptr
, fname
);
2759 if (file_exist(fname
, NULL
))
2760 return (pm_process(fname
, do_section
, do_parameter
));
2762 DEBUG(2, ("Can't find include file %s\n", fname
));
2767 /***************************************************************************
2768 Handle the interpretation of the copy parameter.
2769 ***************************************************************************/
2771 static BOOL
handle_copy(const char *pszParmValue
, char **ptr
)
2775 service serviceTemp
;
2777 string_set(ptr
, pszParmValue
);
2779 init_service(&serviceTemp
);
2783 DEBUG(3, ("Copying service from service %s\n", pszParmValue
));
2785 if ((iTemp
= getservicebyname(pszParmValue
, &serviceTemp
)) >= 0) {
2786 if (iTemp
== iServiceIndex
) {
2787 DEBUG(0, ("Can't copy service %s - unable to copy self!\n", pszParmValue
));
2789 copy_service(ServicePtrs
[iServiceIndex
],
2791 ServicePtrs
[iServiceIndex
]->copymap
);
2795 DEBUG(0, ("Unable to copy service - source not found: %s\n", pszParmValue
));
2799 free_service(&serviceTemp
);
2803 /***************************************************************************
2804 Handle winbind/non unix account uid and gid allocation parameters. The format of these
2809 winbind uid = 1000-1999
2810 winbind gid = 700-899
2812 We only do simple parsing checks here. The strings are parsed into useful
2813 structures in the winbind daemon code.
2815 ***************************************************************************/
2817 /* Some lp_ routines to return winbind [ug]id information */
2819 static uid_t winbind_uid_low
, winbind_uid_high
;
2820 static gid_t winbind_gid_low
, winbind_gid_high
;
2821 static uint32 non_unix_account_low
, non_unix_account_high
;
2823 BOOL
lp_winbind_uid(uid_t
*low
, uid_t
*high
)
2825 if (winbind_uid_low
== 0 || winbind_uid_high
== 0)
2829 *low
= winbind_uid_low
;
2832 *high
= winbind_uid_high
;
2837 BOOL
lp_winbind_gid(gid_t
*low
, gid_t
*high
)
2839 if (winbind_gid_low
== 0 || winbind_gid_high
== 0)
2843 *low
= winbind_gid_low
;
2846 *high
= winbind_gid_high
;
2851 BOOL
lp_non_unix_account_range(uint32
*low
, uint32
*high
)
2853 if (non_unix_account_low
== 0 || non_unix_account_high
== 0)
2857 *low
= non_unix_account_low
;
2860 *high
= non_unix_account_high
;
2865 /* Do some simple checks on "winbind [ug]id" parameter values */
2867 static BOOL
handle_winbind_uid(const char *pszParmValue
, char **ptr
)
2871 if (sscanf(pszParmValue
, "%u-%u", &low
, &high
) != 2 || high
< low
)
2876 string_set(ptr
, pszParmValue
);
2878 winbind_uid_low
= low
;
2879 winbind_uid_high
= high
;
2884 static BOOL
handle_winbind_gid(const char *pszParmValue
, char **ptr
)
2888 if (sscanf(pszParmValue
, "%u-%u", &low
, &high
) != 2 || high
< low
)
2893 string_set(ptr
, pszParmValue
);
2895 winbind_gid_low
= low
;
2896 winbind_gid_high
= high
;
2901 /***************************************************************************
2902 Do some simple checks on "non unix account range" parameter values.
2903 ***************************************************************************/
2905 static BOOL
handle_non_unix_account_range(const char *pszParmValue
, char **ptr
)
2909 if (sscanf(pszParmValue
, "%u-%u", &low
, &high
) != 2 || high
< low
)
2914 string_set(ptr
, pszParmValue
);
2916 non_unix_account_low
= low
;
2917 non_unix_account_high
= high
;
2922 /***************************************************************************
2923 Handle the DEBUG level list.
2924 ***************************************************************************/
2926 static BOOL
handle_debug_list( const char *pszParmValueIn
, char **ptr
)
2928 pstring pszParmValue
;
2930 pstrcpy(pszParmValue
, pszParmValueIn
);
2931 string_set(ptr
, pszParmValueIn
);
2932 return debug_parse_levels( pszParmValue
);
2935 /***************************************************************************
2936 Handle the ldap machine suffix option.
2937 ***************************************************************************/
2939 static BOOL
handle_ldap_machine_suffix( const char *pszParmValue
, char **ptr
)
2943 pstrcpy(suffix
, pszParmValue
);
2945 if (! *Globals
.szLdapSuffix
) {
2946 string_set( ptr
, suffix
);
2950 if (! strstr(suffix
, Globals
.szLdapSuffix
) ) {
2951 if ( *pszParmValue
)
2952 pstrcat(suffix
, ",");
2953 pstrcat(suffix
, Globals
.szLdapSuffix
);
2955 string_set( ptr
, suffix
);
2959 /***************************************************************************
2960 Handle the ldap user suffix option.
2961 ***************************************************************************/
2963 static BOOL
handle_ldap_user_suffix( const char *pszParmValue
, char **ptr
)
2967 pstrcpy(suffix
, pszParmValue
);
2969 if (! *Globals
.szLdapSuffix
) {
2970 string_set( ptr
, suffix
);
2974 if (! strstr(suffix
, Globals
.szLdapSuffix
) ) {
2975 if ( *pszParmValue
)
2976 pstrcat(suffix
, ",");
2977 pstrcat(suffix
, Globals
.szLdapSuffix
);
2979 string_set( ptr
, suffix
);
2983 /***************************************************************************
2984 Handle setting ldap suffix and determines whether ldap machine suffix needs
2986 ***************************************************************************/
2988 static BOOL
handle_ldap_suffix( const char *pszParmValue
, char **ptr
)
2991 pstring user_suffix
;
2992 pstring machine_suffix
;
2994 pstrcpy(suffix
, pszParmValue
);
2996 if (! *Globals
.szLdapMachineSuffix
)
2997 string_set(&Globals
.szLdapMachineSuffix
, suffix
);
2998 if (! *Globals
.szLdapUserSuffix
)
2999 string_set(&Globals
.szLdapUserSuffix
, suffix
);
3001 if (! strstr(Globals
.szLdapMachineSuffix
, suffix
)) {
3002 pstrcpy(machine_suffix
, Globals
.szLdapMachineSuffix
);
3003 if ( *Globals
.szLdapMachineSuffix
)
3004 pstrcat(machine_suffix
, ",");
3005 pstrcat(machine_suffix
, suffix
);
3006 string_set(&Globals
.szLdapMachineSuffix
, machine_suffix
);
3009 if (! strstr(Globals
.szLdapUserSuffix
, suffix
)) {
3010 pstrcpy(user_suffix
, Globals
.szLdapUserSuffix
);
3011 if ( *Globals
.szLdapUserSuffix
)
3012 pstrcat(user_suffix
, ",");
3013 pstrcat(user_suffix
, suffix
);
3014 string_set(&Globals
.szLdapUserSuffix
, user_suffix
);
3017 string_set(ptr
, suffix
);
3021 static BOOL
handle_acl_compatibility(const char *pszParmValue
, char **ptr
)
3023 if (strequal(pszParmValue
, "auto"))
3024 string_set(ptr
, "");
3025 else if (strequal(pszParmValue
, "winnt"))
3026 string_set(ptr
, "winnt");
3027 else if (strequal(pszParmValue
, "win2k"))
3028 string_set(ptr
, "win2k");
3034 /***************************************************************************
3035 Initialise a copymap.
3036 ***************************************************************************/
3038 static void init_copymap(service
* pservice
)
3041 SAFE_FREE(pservice
->copymap
);
3042 pservice
->copymap
= (BOOL
*)malloc(sizeof(BOOL
) * NUMPARAMETERS
);
3043 if (!pservice
->copymap
)
3045 ("Couldn't allocate copymap!! (size %d)\n",
3046 (int)NUMPARAMETERS
));
3048 for (i
= 0; i
< NUMPARAMETERS
; i
++)
3049 pservice
->copymap
[i
] = True
;
3052 /***************************************************************************
3053 Return the local pointer to a parameter given the service number and the
3054 pointer into the default structure.
3055 ***************************************************************************/
3057 void *lp_local_ptr(int snum
, void *ptr
)
3059 return (void *)(((char *)ServicePtrs
[snum
]) + PTR_DIFF(ptr
, &sDefault
));
3062 /***************************************************************************
3063 Process a parameter for a particular service number. If snum < 0
3064 then assume we are in the globals.
3065 ***************************************************************************/
3067 BOOL
lp_do_parameter(int snum
, const char *pszParmName
, const char *pszParmValue
)
3069 int parmnum
, i
, slen
;
3070 void *parm_ptr
= NULL
; /* where we are going to store the result */
3071 void *def_ptr
= NULL
;
3074 param_opt_struct
*paramo
, *data
;
3077 parmnum
= map_parameter(pszParmName
);
3080 if ((sep
=strchr(pszParmName
, ':')) != NULL
) {
3082 ZERO_STRUCT(vfskey
);
3083 pstr_sprintf(vfskey
, "%s:", pszParmName
);
3084 slen
= strlen(vfskey
);
3085 safe_strcat(vfskey
, sep
+1, sizeof(pstring
));
3086 trim_string(vfskey
+slen
, " ", " ");
3088 data
= (snum
< 0) ? Globals
.param_opt
:
3089 ServicePtrs
[snum
]->param_opt
;
3090 /* Traverse destination */
3092 /* If we already have same option, override it */
3093 if (strcmp(data
->key
, vfskey
) == 0) {
3094 string_free(&data
->value
);
3095 data
->value
= strdup(pszParmValue
);
3102 paramo
= smb_xmalloc(sizeof(param_opt_struct
));
3103 paramo
->key
= strdup(vfskey
);
3104 paramo
->value
= strdup(pszParmValue
);
3106 DLIST_ADD(Globals
.param_opt
, paramo
);
3108 DLIST_ADD(ServicePtrs
[snum
]->param_opt
, paramo
);
3115 DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName
));
3119 if (parm_table
[parmnum
].flags
& FLAG_DEPRECATED
) {
3120 DEBUG(1, ("WARNING: The \"%s\" option is deprecated\n",
3124 def_ptr
= parm_table
[parmnum
].ptr
;
3126 /* we might point at a service, the default service or a global */
3130 if (parm_table
[parmnum
].class == P_GLOBAL
) {
3132 ("Global parameter %s found in service section!\n",
3137 ((char *)ServicePtrs
[snum
]) + PTR_DIFF(def_ptr
,
3142 if (!ServicePtrs
[snum
]->copymap
)
3143 init_copymap(ServicePtrs
[snum
]);
3145 /* this handles the aliases - set the copymap for other entries with
3146 the same data pointer */
3147 for (i
= 0; parm_table
[i
].label
; i
++)
3148 if (parm_table
[i
].ptr
== parm_table
[parmnum
].ptr
)
3149 ServicePtrs
[snum
]->copymap
[i
] = False
;
3152 /* if it is a special case then go ahead */
3153 if (parm_table
[parmnum
].special
) {
3154 parm_table
[parmnum
].special(pszParmValue
, (char **)parm_ptr
);
3158 /* now switch on the type of variable it is */
3159 switch (parm_table
[parmnum
].type
)
3162 set_boolean(parm_ptr
, pszParmValue
);
3166 set_boolean(parm_ptr
, pszParmValue
);
3167 *(BOOL
*)parm_ptr
= !*(BOOL
*)parm_ptr
;
3171 *(int *)parm_ptr
= atoi(pszParmValue
);
3175 *(char *)parm_ptr
= *pszParmValue
;
3179 sscanf(pszParmValue
, "%o", (int *)parm_ptr
);
3183 *(char ***)parm_ptr
= str_list_make(pszParmValue
, NULL
);
3187 string_set(parm_ptr
, pszParmValue
);
3191 string_set(parm_ptr
, pszParmValue
);
3192 strupper(*(char **)parm_ptr
);
3196 pstrcpy((char *)parm_ptr
, pszParmValue
);
3200 pstrcpy((char *)parm_ptr
, pszParmValue
);
3201 strupper((char *)parm_ptr
);
3205 for (i
= 0; parm_table
[parmnum
].enum_list
[i
].name
; i
++) {
3208 parm_table
[parmnum
].enum_list
[i
].name
)) {
3210 parm_table
[parmnum
].
3223 /***************************************************************************
3224 Process a parameter.
3225 ***************************************************************************/
3227 static BOOL
do_parameter(const char *pszParmName
, const char *pszParmValue
)
3229 if (!bInGlobalSection
&& bGlobalOnly
)
3232 DEBUGADD(4, ("doing parameter %s = %s\n", pszParmName
, pszParmValue
));
3234 return (lp_do_parameter(bInGlobalSection
? -2 : iServiceIndex
,
3235 pszParmName
, pszParmValue
));
3238 /***************************************************************************
3239 Print a parameter of the specified type.
3240 ***************************************************************************/
3242 static void print_parameter(struct parm_struct
*p
, void *ptr
, FILE * f
)
3248 for (i
= 0; p
->enum_list
[i
].name
; i
++) {
3249 if (*(int *)ptr
== p
->enum_list
[i
].value
) {
3251 p
->enum_list
[i
].name
);
3258 fprintf(f
, "%s", BOOLSTR(*(BOOL
*)ptr
));
3262 fprintf(f
, "%s", BOOLSTR(!*(BOOL
*)ptr
));
3266 fprintf(f
, "%d", *(int *)ptr
);
3270 fprintf(f
, "%c", *(char *)ptr
);
3274 fprintf(f
, "%s", octal_string(*(int *)ptr
));
3278 if ((char ***)ptr
&& *(char ***)ptr
) {
3279 char **list
= *(char ***)ptr
;
3281 for (; *list
; list
++)
3282 fprintf(f
, "%s%s", *list
,
3283 ((*(list
+1))?", ":""));
3290 fprintf(f
, "%s", (char *)ptr
);
3296 if (*(char **)ptr
) {
3297 fprintf(f
, "%s", *(char **)ptr
);
3305 /***************************************************************************
3306 Check if two parameters are equal.
3307 ***************************************************************************/
3309 static BOOL
equal_parameter(parm_type type
, void *ptr1
, void *ptr2
)
3314 return (*((BOOL
*)ptr1
) == *((BOOL
*)ptr2
));
3319 return (*((int *)ptr1
) == *((int *)ptr2
));
3322 return (*((char *)ptr1
) == *((char *)ptr2
));
3325 return str_list_compare(*(char ***)ptr1
, *(char ***)ptr2
);
3330 char *p1
= (char *)ptr1
, *p2
= (char *)ptr2
;
3335 return (p1
== p2
|| strequal(p1
, p2
));
3340 char *p1
= *(char **)ptr1
, *p2
= *(char **)ptr2
;
3345 return (p1
== p2
|| strequal(p1
, p2
));
3353 /***************************************************************************
3354 Initialize any local varients in the sDefault table.
3355 ***************************************************************************/
3357 void init_locals(void)
3362 /***************************************************************************
3363 Process a new section (service). At this stage all sections are services.
3364 Later we'll have special sections that permit server parameters to be set.
3365 Returns True on success, False on failure.
3366 ***************************************************************************/
3368 static BOOL
do_section(const char *pszSectionName
)
3371 BOOL isglobal
= ((strwicmp(pszSectionName
, GLOBAL_NAME
) == 0) ||
3372 (strwicmp(pszSectionName
, GLOBAL_NAME2
) == 0));
3375 /* if we were in a global section then do the local inits */
3376 if (bInGlobalSection
&& !isglobal
)
3379 /* if we've just struck a global section, note the fact. */
3380 bInGlobalSection
= isglobal
;
3382 /* check for multiple global sections */
3383 if (bInGlobalSection
) {
3384 DEBUG(3, ("Processing section \"[%s]\"\n", pszSectionName
));
3388 if (!bInGlobalSection
&& bGlobalOnly
)
3391 /* if we have a current service, tidy it up before moving on */
3394 if (iServiceIndex
>= 0)
3395 bRetval
= service_ok(iServiceIndex
);
3397 /* if all is still well, move to the next record in the services array */
3399 /* We put this here to avoid an odd message order if messages are */
3400 /* issued by the post-processing of a previous section. */
3401 DEBUG(2, ("Processing section \"[%s]\"\n", pszSectionName
));
3403 if ((iServiceIndex
= add_a_service(&sDefault
, pszSectionName
))
3405 DEBUG(0, ("Failed to add a new service\n"));
3414 /***************************************************************************
3415 Determine if a partcular base parameter is currentl set to the default value.
3416 ***************************************************************************/
3418 static BOOL
is_default(int i
)
3420 if (!defaults_saved
)
3422 switch (parm_table
[i
].type
) {
3424 return str_list_compare (parm_table
[i
].def
.lvalue
,
3425 *(char ***)parm_table
[i
].ptr
);
3428 return strequal(parm_table
[i
].def
.svalue
,
3429 *(char **)parm_table
[i
].ptr
);
3432 return strequal(parm_table
[i
].def
.svalue
,
3433 (char *)parm_table
[i
].ptr
);
3436 return parm_table
[i
].def
.bvalue
==
3437 *(BOOL
*)parm_table
[i
].ptr
;
3439 return parm_table
[i
].def
.cvalue
==
3440 *(char *)parm_table
[i
].ptr
;
3444 return parm_table
[i
].def
.ivalue
==
3445 *(int *)parm_table
[i
].ptr
;
3452 /***************************************************************************
3453 Display the contents of the global structure.
3454 ***************************************************************************/
3456 static void dump_globals(FILE *f
)
3459 param_opt_struct
*data
;
3461 fprintf(f
, "# Global parameters\n[global]\n");
3463 for (i
= 0; parm_table
[i
].label
; i
++)
3464 if (parm_table
[i
].class == P_GLOBAL
&&
3465 parm_table
[i
].ptr
&&
3466 (i
== 0 || (parm_table
[i
].ptr
!= parm_table
[i
- 1].ptr
))) {
3467 if (defaults_saved
&& is_default(i
))
3469 fprintf(f
, "\t%s = ", parm_table
[i
].label
);
3470 print_parameter(&parm_table
[i
], parm_table
[i
].ptr
, f
);
3473 if (Globals
.param_opt
!= NULL
) {
3474 data
= Globals
.param_opt
;
3476 fprintf(f
, "\t%s = %s\n", data
->key
, data
->value
);
3483 /***************************************************************************
3484 Return True if a local parameter is currently set to the global default.
3485 ***************************************************************************/
3487 BOOL
lp_is_default(int snum
, struct parm_struct
*parm
)
3489 int pdiff
= PTR_DIFF(parm
->ptr
, &sDefault
);
3491 return equal_parameter(parm
->type
,
3492 ((char *)ServicePtrs
[snum
]) + pdiff
,
3493 ((char *)&sDefault
) + pdiff
);
3496 /***************************************************************************
3497 Display the contents of a single services record.
3498 ***************************************************************************/
3500 static void dump_a_service(service
* pService
, FILE * f
)
3503 param_opt_struct
*data
;
3505 if (pService
!= &sDefault
)
3506 fprintf(f
, "\n[%s]\n", pService
->szService
);
3508 for (i
= 0; parm_table
[i
].label
; i
++)
3509 if (parm_table
[i
].class == P_LOCAL
&&
3510 parm_table
[i
].ptr
&&
3511 (*parm_table
[i
].label
!= '-') &&
3512 (i
== 0 || (parm_table
[i
].ptr
!= parm_table
[i
- 1].ptr
))) {
3513 int pdiff
= PTR_DIFF(parm_table
[i
].ptr
, &sDefault
);
3515 if (pService
== &sDefault
) {
3516 if (defaults_saved
&& is_default(i
))
3519 if (equal_parameter(parm_table
[i
].type
,
3520 ((char *)pService
) +
3522 ((char *)&sDefault
) +
3527 fprintf(f
, "\t%s = ", parm_table
[i
].label
);
3528 print_parameter(&parm_table
[i
],
3529 ((char *)pService
) + pdiff
, f
);
3532 if (pService
->param_opt
!= NULL
) {
3533 data
= pService
->param_opt
;
3535 fprintf(f
, "\t%s = %s\n", data
->key
, data
->value
);
3542 /***************************************************************************
3543 Return info about the next service in a service. snum==-1 gives the globals.
3544 Return NULL when out of parameters.
3545 ***************************************************************************/
3547 struct parm_struct
*lp_next_parameter(int snum
, int *i
, int allparameters
)
3550 /* do the globals */
3551 for (; parm_table
[*i
].label
; (*i
)++) {
3552 if (parm_table
[*i
].class == P_SEPARATOR
)
3553 return &parm_table
[(*i
)++];
3555 if (!parm_table
[*i
].ptr
3556 || (*parm_table
[*i
].label
== '-'))
3560 && (parm_table
[*i
].ptr
==
3561 parm_table
[(*i
) - 1].ptr
))
3564 return &parm_table
[(*i
)++];
3567 service
*pService
= ServicePtrs
[snum
];
3569 for (; parm_table
[*i
].label
; (*i
)++) {
3570 if (parm_table
[*i
].class == P_SEPARATOR
)
3571 return &parm_table
[(*i
)++];
3573 if (parm_table
[*i
].class == P_LOCAL
&&
3574 parm_table
[*i
].ptr
&&
3575 (*parm_table
[*i
].label
!= '-') &&
3577 (parm_table
[*i
].ptr
!=
3578 parm_table
[(*i
) - 1].ptr
)))
3581 PTR_DIFF(parm_table
[*i
].ptr
,
3584 if (allparameters
||
3585 !equal_parameter(parm_table
[*i
].type
,
3586 ((char *)pService
) +
3588 ((char *)&sDefault
) +
3591 return &parm_table
[(*i
)++];
3602 /***************************************************************************
3603 Display the contents of a single copy structure.
3604 ***************************************************************************/
3605 static void dump_copy_map(BOOL
*pcopymap
)
3611 printf("\n\tNon-Copied parameters:\n");
3613 for (i
= 0; parm_table
[i
].label
; i
++)
3614 if (parm_table
[i
].class == P_LOCAL
&&
3615 parm_table
[i
].ptr
&& !pcopymap
[i
] &&
3616 (i
== 0 || (parm_table
[i
].ptr
!= parm_table
[i
- 1].ptr
)))
3618 printf("\t\t%s\n", parm_table
[i
].label
);
3623 /***************************************************************************
3624 Return TRUE if the passed service number is within range.
3625 ***************************************************************************/
3627 BOOL
lp_snum_ok(int iService
)
3629 return (LP_SNUM_OK(iService
) && ServicePtrs
[iService
]->bAvailable
);
3632 /***************************************************************************
3633 Auto-load some home services.
3634 ***************************************************************************/
3636 static void lp_add_auto_services(char *str
)
3649 homes
= lp_servicenumber(HOMES_NAME
);
3651 for (p
= strtok(s
, LIST_SEP
); p
; p
= strtok(NULL
, LIST_SEP
)) {
3652 char *home
= get_user_home_dir(p
);
3654 if (lp_servicenumber(p
) >= 0)
3657 if (home
&& homes
>= 0)
3658 lp_add_home(p
, homes
, p
, home
);
3663 /***************************************************************************
3664 Auto-load one printer.
3665 ***************************************************************************/
3667 void lp_add_one_printer(char *name
, char *comment
)
3669 int printers
= lp_servicenumber(PRINTERS_NAME
);
3672 if (lp_servicenumber(name
) < 0) {
3673 lp_add_printer(name
, printers
);
3674 if ((i
= lp_servicenumber(name
)) >= 0) {
3675 string_set(&ServicePtrs
[i
]->comment
, comment
);
3676 ServicePtrs
[i
]->autoloaded
= True
;
3681 /***************************************************************************
3682 Announce ourselves as a print server.
3683 ***************************************************************************/
3685 void update_server_announce_as_printserver(void)
3687 default_server_announce
|= SV_TYPE_PRINTQ_SERVER
;
3690 /***************************************************************************
3691 Have we loaded a services file yet?
3692 ***************************************************************************/
3694 BOOL
lp_loaded(void)
3699 /***************************************************************************
3700 Unload unused services.
3701 ***************************************************************************/
3703 void lp_killunused(BOOL (*snumused
) (int))
3706 for (i
= 0; i
< iNumServices
; i
++) {
3710 if (!snumused
|| !snumused(i
)) {
3711 ServicePtrs
[i
]->valid
= False
;
3712 free_service(ServicePtrs
[i
]);
3717 /***************************************************************************
3719 ***************************************************************************/
3721 void lp_killservice(int iServiceIn
)
3723 if (VALID(iServiceIn
)) {
3724 ServicePtrs
[iServiceIn
]->valid
= False
;
3725 free_service(ServicePtrs
[iServiceIn
]);
3729 /***************************************************************************
3730 Save the curent values of all global and sDefault parameters into the
3731 defaults union. This allows swat and testparm to show only the
3732 changed (ie. non-default) parameters.
3733 ***************************************************************************/
3735 static void lp_save_defaults(void)
3738 for (i
= 0; parm_table
[i
].label
; i
++) {
3739 if (i
> 0 && parm_table
[i
].ptr
== parm_table
[i
- 1].ptr
)
3741 switch (parm_table
[i
].type
) {
3743 str_list_copy(&(parm_table
[i
].def
.lvalue
),
3744 *(const char ***)parm_table
[i
].ptr
);
3748 if (parm_table
[i
].ptr
) {
3749 parm_table
[i
].def
.svalue
= strdup(*(char **)parm_table
[i
].ptr
);
3751 parm_table
[i
].def
.svalue
= NULL
;
3756 if (parm_table
[i
].ptr
) {
3757 parm_table
[i
].def
.svalue
= strdup((char *)parm_table
[i
].ptr
);
3759 parm_table
[i
].def
.svalue
= NULL
;
3764 parm_table
[i
].def
.bvalue
=
3765 *(BOOL
*)parm_table
[i
].ptr
;
3768 parm_table
[i
].def
.cvalue
=
3769 *(char *)parm_table
[i
].ptr
;
3774 parm_table
[i
].def
.ivalue
=
3775 *(int *)parm_table
[i
].ptr
;
3781 defaults_saved
= True
;
3784 /*******************************************************************
3785 Set the server type we will announce as via nmbd.
3786 ********************************************************************/
3788 static void set_server_role(void)
3790 server_role
= ROLE_STANDALONE
;
3792 switch (lp_security()) {
3794 if (lp_domain_logons())
3795 DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n"));
3800 if (lp_domain_logons()) {
3801 server_role
= ROLE_DOMAIN_PDC
;
3804 server_role
= ROLE_DOMAIN_MEMBER
;
3807 if (lp_domain_logons()) {
3809 if (Globals
.bDomainMaster
) /* auto or yes */
3810 server_role
= ROLE_DOMAIN_PDC
;
3812 server_role
= ROLE_DOMAIN_BDC
;
3816 DEBUG(0, ("Server's Role undefined due to unknown security mode\n"));
3820 DEBUG(10, ("set_server_role: role = "));
3822 switch(server_role
) {
3823 case ROLE_STANDALONE
:
3824 DEBUGADD(10, ("ROLE_STANDALONE\n"));
3826 case ROLE_DOMAIN_MEMBER
:
3827 DEBUGADD(10, ("ROLE_DOMAIN_MEMBER\n"));
3829 case ROLE_DOMAIN_BDC
:
3830 DEBUGADD(10, ("ROLE_DOMAIN_BDC\n"));
3832 case ROLE_DOMAIN_PDC
:
3833 DEBUGADD(10, ("ROLE_DOMAIN_PDC\n"));
3838 /***************************************************************************
3839 Load the services array from the services file. Return True on success,
3841 ***************************************************************************/
3843 BOOL
lp_load(const char *pszFname
, BOOL global_only
, BOOL save_defaults
,
3848 param_opt_struct
*data
, *pdata
;
3850 pstrcpy(n2
, pszFname
);
3851 standard_sub_basic(current_user_info
.smb_name
, n2
,sizeof(n2
));
3853 add_to_file_list(pszFname
, n2
);
3857 DEBUG(3, ("lp_load: refreshing parameters\n"));
3859 bInGlobalSection
= True
;
3860 bGlobalOnly
= global_only
;
3871 if (Globals
.param_opt
!= NULL
) {
3872 data
= Globals
.param_opt
;
3874 string_free(&data
->key
);
3875 string_free(&data
->value
);
3880 Globals
.param_opt
= NULL
;
3883 /* We get sections first, so have to start 'behind' to make up */
3885 bRetval
= pm_process(n2
, do_section
, do_parameter
);
3887 /* finish up the last section */
3888 DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval
)));
3890 if (iServiceIndex
>= 0)
3891 bRetval
= service_ok(iServiceIndex
);
3893 lp_add_auto_services(lp_auto_services());
3896 /* When 'restrict anonymous = 2' guest connections to ipc$
3898 lp_add_ipc("IPC$", (lp_restrict_anonymous() < 2));
3899 lp_add_ipc("ADMIN$", False
);
3903 set_default_server_announce_type();
3907 /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */
3908 /* if bWINSsupport is true and we are in the client */
3909 if (in_client
&& Globals
.bWINSsupport
) {
3910 lp_do_parameter(-1, "wins server", "127.0.0.1");
3918 /***************************************************************************
3919 Reset the max number of services.
3920 ***************************************************************************/
3922 void lp_resetnumservices(void)
3927 /***************************************************************************
3928 Return the max number of services.
3929 ***************************************************************************/
3931 int lp_numservices(void)
3933 return (iNumServices
);
3936 /***************************************************************************
3937 Display the contents of the services array in human-readable form.
3938 ***************************************************************************/
3940 void lp_dump(FILE *f
, BOOL show_defaults
, int maxtoprint
)
3945 defaults_saved
= False
;
3949 dump_a_service(&sDefault
, f
);
3951 for (iService
= 0; iService
< maxtoprint
; iService
++)
3952 lp_dump_one(f
, show_defaults
, iService
);
3955 /***************************************************************************
3956 Display the contents of one service in human-readable form.
3957 ***************************************************************************/
3959 void lp_dump_one(FILE * f
, BOOL show_defaults
, int snum
)
3962 if (ServicePtrs
[snum
]->szService
[0] == '\0')
3964 dump_a_service(ServicePtrs
[snum
], f
);
3968 /***************************************************************************
3969 Return the number of the service with the given name, or -1 if it doesn't
3970 exist. Note that this is a DIFFERENT ANIMAL from the internal function
3971 getservicebyname()! This works ONLY if all services have been loaded, and
3972 does not copy the found service.
3973 ***************************************************************************/
3975 int lp_servicenumber(const char *pszServiceName
)
3978 fstring serviceName
;
3981 for (iService
= iNumServices
- 1; iService
>= 0; iService
--) {
3982 if (VALID(iService
) && ServicePtrs
[iService
]->szService
) {
3984 * The substitution here is used to support %U is
3987 fstrcpy(serviceName
, ServicePtrs
[iService
]->szService
);
3988 standard_sub_basic(current_user_info
.smb_name
, serviceName
,sizeof(serviceName
));
3989 if (strequal(serviceName
, pszServiceName
))
3995 DEBUG(7,("lp_servicenumber: couldn't find %s\n", pszServiceName
));
4000 /*******************************************************************
4001 A useful volume label function.
4002 ********************************************************************/
4004 char *volume_label(int snum
)
4006 char *ret
= lp_volume(snum
);
4008 return lp_servicename(snum
);
4013 /*******************************************************************
4014 Set the server type we will announce as via nmbd.
4015 ********************************************************************/
4017 static void set_default_server_announce_type(void)
4019 default_server_announce
= 0;
4020 default_server_announce
|= SV_TYPE_WORKSTATION
;
4021 default_server_announce
|= SV_TYPE_SERVER
;
4022 default_server_announce
|= SV_TYPE_SERVER_UNIX
;
4024 switch (lp_announce_as()) {
4025 case ANNOUNCE_AS_NT_SERVER
:
4026 default_server_announce
|= SV_TYPE_SERVER_NT
;
4027 /* fall through... */
4028 case ANNOUNCE_AS_NT_WORKSTATION
:
4029 default_server_announce
|= SV_TYPE_NT
;
4031 case ANNOUNCE_AS_WIN95
:
4032 default_server_announce
|= SV_TYPE_WIN95_PLUS
;
4034 case ANNOUNCE_AS_WFW
:
4035 default_server_announce
|= SV_TYPE_WFW
;
4041 switch (lp_server_role()) {
4042 case ROLE_DOMAIN_MEMBER
:
4043 default_server_announce
|= SV_TYPE_DOMAIN_MEMBER
;
4045 case ROLE_DOMAIN_PDC
:
4046 default_server_announce
|= SV_TYPE_DOMAIN_CTRL
;
4048 case ROLE_DOMAIN_BDC
:
4049 default_server_announce
|= SV_TYPE_DOMAIN_BAKCTRL
;
4051 case ROLE_STANDALONE
:
4055 if (lp_time_server())
4056 default_server_announce
|= SV_TYPE_TIME_SOURCE
;
4058 if (lp_host_msdfs())
4059 default_server_announce
|= SV_TYPE_DFS_SERVER
;
4062 /***********************************************************
4063 returns role of Samba server
4064 ************************************************************/
4066 int lp_server_role(void)
4071 /***********************************************************
4072 If we are PDC then prefer us as DMB
4073 ************************************************************/
4075 BOOL
lp_domain_master(void)
4077 if (Globals
.bDomainMaster
== Auto
)
4078 return (lp_server_role() == ROLE_DOMAIN_PDC
);
4080 return Globals
.bDomainMaster
;
4083 /***********************************************************
4084 If we are DMB then prefer us as LMB
4085 ************************************************************/
4087 BOOL
lp_preferred_master(void)
4089 if (Globals
.bPreferredMaster
== Auto
)
4090 return (lp_local_master() && lp_domain_master());
4092 return Globals
.bPreferredMaster
;
4095 /*******************************************************************
4097 ********************************************************************/
4099 void lp_remove_service(int snum
)
4101 ServicePtrs
[snum
]->valid
= False
;
4104 /*******************************************************************
4106 ********************************************************************/
4108 void lp_copy_service(int snum
, const char *new_name
)
4110 char *oldname
= lp_servicename(snum
);
4111 do_section(new_name
);
4113 snum
= lp_servicenumber(new_name
);
4115 lp_do_parameter(snum
, "copy", oldname
);
4120 /*******************************************************************
4121 Get the default server type we will announce as via nmbd.
4122 ********************************************************************/
4124 int lp_default_server_announce(void)
4126 return default_server_announce
;
4129 /*******************************************************************
4130 Split the announce version into major and minor numbers.
4131 ********************************************************************/
4133 int lp_major_announce_version(void)
4135 static BOOL got_major
= False
;
4136 static int major_version
= DEFAULT_MAJOR_VERSION
;
4141 return major_version
;
4144 if ((vers
= lp_announce_version()) == NULL
)
4145 return major_version
;
4147 if ((p
= strchr_m(vers
, '.')) == 0)
4148 return major_version
;
4151 major_version
= atoi(vers
);
4152 return major_version
;
4155 int lp_minor_announce_version(void)
4157 static BOOL got_minor
= False
;
4158 static int minor_version
= DEFAULT_MINOR_VERSION
;
4163 return minor_version
;
4166 if ((vers
= lp_announce_version()) == NULL
)
4167 return minor_version
;
4169 if ((p
= strchr_m(vers
, '.')) == 0)
4170 return minor_version
;
4173 minor_version
= atoi(p
);
4174 return minor_version
;
4177 /***********************************************************
4178 Set the global name resolution order (used in smbclient).
4179 ************************************************************/
4181 void lp_set_name_resolve_order(char *new_order
)
4183 Globals
.szNameResolveOrder
= new_order
;
4186 const char *lp_printername(int snum
)
4188 const char *ret
= _lp_printername(snum
);
4189 if (ret
== NULL
|| (ret
!= NULL
&& *ret
== '\0'))
4190 ret
= lp_const_servicename(snum
);
4196 /****************************************************************
4197 Compatibility fn. for 2.2.2 code.....
4198 *****************************************************************/
4200 void get_private_directory(pstring privdir
)
4202 pstrcpy (privdir
, lp_private_dir());
4205 /***********************************************************
4206 Allow daemons such as winbindd to fix their logfile name.
4207 ************************************************************/
4209 void lp_set_logfile(const char *name
)
4211 extern pstring debugf
;
4212 string_set(&Globals
.szLogFile
, name
);
4213 pstrcpy(debugf
, name
);
4216 /*******************************************************************
4217 Return the NetBIOS called name.
4218 ********************************************************************/
4220 const char *get_called_name(void)
4222 extern fstring local_machine
;
4223 static fstring called_name
;
4225 if (! *local_machine
)
4226 return global_myname();
4229 * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV"
4230 * arrggg!!! but we've already rewritten the client's
4231 * netbios name at this point...
4234 if (*local_machine
) {
4235 if (!StrCaseCmp(local_machine
, "_SMBSERVER") || !StrCaseCmp(local_machine
, "_SMBSERV")) {
4236 fstrcpy(called_name
, get_my_primary_ip());
4237 DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n",
4243 return local_machine
;
4246 /*******************************************************************
4247 Return the max print jobs per queue.
4248 ********************************************************************/
4250 int lp_maxprintjobs(int snum
)
4252 int maxjobs
= LP_SNUM_OK(snum
) ? ServicePtrs
[snum
]->iMaxPrintJobs
: sDefault
.iMaxPrintJobs
;
4253 if (maxjobs
<= 0 || maxjobs
>= PRINT_MAX_JOBID
)
4254 maxjobs
= PRINT_MAX_JOBID
- 1;