📄 loadparm.c
字号:
/* Unix SMB/Netbios implementation. Version 1.9. Parameter loading functions Copyright (C) Karl Auer 1993-1998 Largely re-written by Andrew Tridgell, September 1994 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*//* * Load parameters. * * This module provides suitable callback functions for the params * module. It builds the internal table of service details which is * then used by the rest of the server. * * To add a parameter: * * 1) add it to the global or service structure definition * 2) add it to the parm_table * 3) add it to the list of available functions (eg: using FN_GLOBAL_STRING()) * 4) If it's a global then initialise it in init_globals. If a local * (ie. service) parameter then initialise it in the sDefault structure * * * Notes: * The configuration file is processed sequentially for speed. It is NOT * accessed randomly as happens in 'real' Windows. For this reason, there * is a fair bit of sequence-dependent code here - ie., code which assumes * that certain things happen before others. In particular, the code which * happens at the boundary between sections is delicately poised, so be * careful! * */#include "includes.h"/* Set default coding system for KANJI if none specified in Makefile. *//* * We treat KANJI specially due to historical precedent (it was the * first non-english codepage added to Samba). With the new dynamic * codepage support this is not needed anymore. * * The define 'KANJI' is being overloaded to mean 'use kanji codepage * by default' and also 'this is the filename-to-disk conversion * method to use'. This really should be removed and all control * over this left in the smb.conf parameters 'client codepage' * and 'coding system'. */#ifndef KANJI#define KANJI "sbcs"#endif /* KANJI */BOOL in_client = False; /* Not in the client by default */BOOL bLoaded = False;extern int DEBUGLEVEL;extern pstring user_socket_options;extern pstring global_myname;pstring global_scope = "";#ifndef GLOBAL_NAME#define GLOBAL_NAME "global"#endif#ifndef PRINTERS_NAME#define PRINTERS_NAME "printers"#endif#ifndef HOMES_NAME#define HOMES_NAME "homes"#endif/* some helpful bits */#define pSERVICE(i) ServicePtrs[i]#define iSERVICE(i) (*pSERVICE(i))#define LP_SNUM_OK(iService) (((iService) >= 0) && ((iService) < iNumServices) && iSERVICE(iService).valid)#define VALID(i) iSERVICE(i).validint keepalive=DEFAULT_KEEPALIVE;extern BOOL use_getwd_cache;extern int extra_time_offset;static BOOL defaults_saved=False;/* * This structure describes global (ie., server-wide) parameters. */typedef struct{ char *szPrintcapname; char *szLockDir; char *szRootdir; char *szDefaultService; char *szDfree; char *szMsgCommand; char *szHostsEquiv; char *szServerString; char *szAutoServices; char *szPasswdProgram; char *szPasswdChat; char *szLogFile; char *szConfigFile; char *szSMBPasswdFile; char *szPasswordServer; char *szSocketOptions; char *szValidChars; char *szWorkGroup; char *szDomainAdminGroup; char *szDomainGuestGroup; char *szDomainAdminUsers; char *szDomainGuestUsers; char *szDomainHostsallow; char *szDomainHostsdeny; char *szUsernameMap;#ifdef USING_GROUPNAME_MAP char *szGroupnameMap;#endif /* USING_GROUPNAME_MAP */ char *szCharacterSet; char *szLogonScript; char *szLogonPath; char *szLogonDrive; char *szLogonHome; char *szSmbrun; char *szWINSserver; char *szCodingSystem; char *szInterfaces; char *szRemoteAnnounce; char *szRemoteBrowseSync; char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainOtherSIDs; char *szDomainGroups; char *szDriverFile; char *szNameResolveOrder; char *szLdapServer; char *szLdapSuffix; char *szLdapFilter; char *szLdapRoot; char *szLdapRootPassword; char *szPanicAction; char *szAddUserScript; char *szDelUserScript; int max_log_size; int mangled_stack; int max_xmit; int max_mux; int max_open_files; int max_packet; int pwordlevel; int unamelevel; int deadtime; int maxprotocol; int security; int maxdisksize; int lpqcachetime; int syslog; int os_level; int max_ttl; int max_wins_ttl; int min_wins_ttl; int ReadSize; int lm_announce; int lm_interval; int shmem_size; int client_code_page; int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; int change_notify_timeout; int stat_cache_size; int map_to_guest; int min_passwd_length; int oplock_break_wait_time;#ifdef WITH_LDAP int ldap_port;#endif /* WITH_LDAP */#ifdef WITH_SSL int sslVersion; char *sslHostsRequire; char *sslHostsResign; char *sslCaCertDir; char *sslCaCertFile; char *sslCert; char *sslPrivKey; char *sslClientCert; char *sslClientPrivKey; char *sslCiphers; BOOL sslEnabled; BOOL sslReqClientCert; BOOL sslReqServerCert; BOOL sslCompatibility;#endif /* WITH_SSL */ BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; BOOL bLocalMaster; BOOL bPreferredMaster; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; BOOL bUpdateEncrypt; BOOL bStripDot; BOOL bNullPasswords; BOOL bLoadPrinters; BOOL bUseRhosts; BOOL bReadRaw; BOOL bWriteRaw; BOOL bReadPrediction; BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; BOOL bUnixRealname; BOOL bNISHomeMap; BOOL bTimeServer; BOOL bBindInterfacesOnly; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; BOOL bOleLockingCompat; BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; BOOL bNTAclSupport; BOOL bStatCache; BOOL bKernelOplocks; BOOL bAllowTrustedDomains; BOOL bRestrictAnonymous;} global;static global Globals;/* * This structure describes a single service. */typedef struct{ BOOL valid; char *szService; char *szPath; char *szUsername; char *szGuestaccount; char *szInvalidUsers; char *szValidUsers; char *szAdminUsers; char *szCopy; char *szInclude; char *szPreExec; char *szPostExec; char *szRootPreExec; char *szRootPostExec; char *szPrintcommand; char *szLpqcommand; char *szLprmcommand; char *szLppausecommand; char *szLpresumecommand; char *szQueuepausecommand; char *szQueueresumecommand; char *szPrintername; char *szPrinterDriver; char *szPrinterDriverLocation; char *szDontdescend; char *szHostsallow; char *szHostsdeny; char *szMagicScript; char *szMagicOutput; char *szMangledMap; char *szVetoFiles; char *szHideFiles; char *szVetoOplockFiles; char *comment; char *force_user; char *force_group; char *readlist; char *writelist; char *volume; char *fstype; int iMinPrintSpace; int iCreate_mask; int iCreate_force_mode;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -