char *szSocketOptions;
char *szRealm;
char *szAfsUsernameMap;
+ int iAfsTokenLifetime;
char *szUsernameMap;
char *szLogonScript;
char *szLogonPath;
char *szAddMachineScript;
char *szShutdownScript;
char *szAbortShutdownScript;
+ char *szCheckPasswordScript;
char *szWINSHook;
char *szWINSPartners;
char *szUtmpDir;
char *szWtmpDir;
BOOL bUtmp;
- char *szSourceEnv;
char *szIdmapUID;
char *szIdmapGID;
BOOL bEnableRidAlgorithm;
BOOL bWinbindEnumGroups;
BOOL bWinbindUseDefaultDomain;
BOOL bWinbindTrustedDomainsOnly;
+ BOOL bWinbindNestedGroups;
char *szWinbindBackend;
- char *szIdmapBackend;
+ char **szIdmapBackend;
char *szAddShareCommand;
char *szChangeShareCommand;
char *szDeleteShareCommand;
int lpqcachetime;
int iMaxSmbdProcesses;
BOOL bDisableSpoolss;
- int iTotalPrintJobs;
int syslog;
int os_level;
int enhanced_browsing;
int max_ttl;
int max_wins_ttl;
int min_wins_ttl;
- int ReadSize;
int lm_announce;
int lm_interval;
int announce_as; /* This is initialised in init_globals */
char *szLdapFilter;
char *szLdapAdminDn;
char *szAclCompat;
+ char *szCupsServer;
int ldap_passwd_sync;
int ldap_replication_sleep;
+ int ldap_timeout; /* This is initialised in init_globals */
BOOL ldap_delete_dn;
BOOL bMsAddPrinterWizard;
BOOL bDNSproxy;
BOOL bNullPasswords;
BOOL bObeyPamRestrictions;
BOOL bLoadPrinters;
+ int PrintcapCacheTime;
BOOL bLargeReadwrite;
BOOL bReadRaw;
BOOL bWriteRaw;
- BOOL bReadPrediction;
BOOL bReadbmpx;
BOOL bSyslogOnly;
BOOL bBrowseList;
BOOL bDebugPid;
BOOL bDebugUid;
BOOL bHostMSDfs;
- BOOL bUnicode;
BOOL bUseMmap;
BOOL bHostnameLookups;
BOOL bUnixExtensions;
BOOL bDisableNetbios;
BOOL bKernelChangeNotify;
+ BOOL bUseKerberosKeytab;
+ BOOL bDeferSharingViolations;
+ BOOL bEnablePrivileges;
int restrict_anonymous;
int name_cache_timeout;
int client_signing;
char *szPostExec;
char *szRootPreExec;
char *szRootPostExec;
+ char *szCupsOptions;
char *szPrintcommand;
char *szLpqcommand;
char *szLprmcommand;
int iBlock_size;
BOOL bPreexecClose;
BOOL bRootpreexecClose;
- BOOL bCaseSensitive;
+ int iCaseSensitive;
BOOL bCasePreserve;
BOOL bShortCasePreserve;
- BOOL bCaseMangle;
BOOL bHideDotFiles;
BOOL bHideSpecialFiles;
BOOL bHideUnReadable;
BOOL bMap_system;
BOOL bMap_hidden;
BOOL bMap_archive;
+ BOOL bStoreDosAttributes;
BOOL bLocking;
- BOOL bStrictLocking;
+ int iStrictLocking;
BOOL bPosixLocking;
BOOL bShareModes;
BOOL bOpLocks;
BOOL bMSDfsRoot;
BOOL bUseClientDriver;
BOOL bDefaultDevmode;
+ BOOL bForcePrintername;
BOOL bNTAclSupport;
+ BOOL bForceUnknownAclUser;
BOOL bUseSendfile;
BOOL bProfileAcls;
BOOL bMap_acl_inherit;
BOOL bAfs_Share;
+ BOOL bEASupport;
param_opt_struct *param_opt;
char dummy[3]; /* for alignment */
NULL, /* szPostExec */
NULL, /* szRootPreExec */
NULL, /* szRootPostExec */
+ NULL, /* szCupsOptions */
NULL, /* szPrintcommand */
NULL, /* szLpqcommand */
NULL, /* szLprmcommand */
1024, /* iBlock_size */
False, /* bPreexecClose */
False, /* bRootpreexecClose */
- False, /* case sensitive */
+ Auto, /* case sensitive */
True, /* case preserve */
True, /* short case preserve */
- False, /* case mangle */
True, /* bHideDotFiles */
False, /* bHideSpecialFiles */
False, /* bHideUnReadable */
False, /* bMap_system */
False, /* bMap_hidden */
True, /* bMap_archive */
+ False, /* bStoreDosAttributes */
True, /* bLocking */
- True, /* bStrictLocking */
+ True, /* iStrictLocking */
True, /* bPosixLocking */
True, /* bShareModes */
True, /* bOpLocks */
False, /* bMSDfsRoot */
False, /* bUseClientDriver */
False, /* bDefaultDevmode */
+ False, /* bForcePrintername */
True, /* bNTAclSupport */
+ False, /* bForceUnknownAclUser */
False, /* bUseSendfile */
False, /* bProfileAcls */
False, /* bMap_acl_inherit */
False, /* bAfs_Share */
+ False, /* bEASupport */
NULL, /* Parametric options */
#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
/* prototypes for the special type handlers */
-static BOOL handle_include(const char *pszParmValue, char **ptr);
-static BOOL handle_copy(const char *pszParmValue, char **ptr);
-static BOOL handle_source_env(const char *pszParmValue, char **ptr);
-static BOOL handle_netbios_name(const char *pszParmValue, char **ptr);
-static BOOL handle_idmap_uid(const char *pszParmValue, char **ptr);
-static BOOL handle_idmap_gid(const char *pszParmValue, char **ptr);
-static BOOL handle_debug_list( const char *pszParmValue, char **ptr );
-static BOOL handle_workgroup( const char *pszParmValue, char **ptr );
-static BOOL handle_netbios_aliases( const char *pszParmValue, char **ptr );
-static BOOL handle_netbios_scope( const char *pszParmValue, char **ptr );
-static BOOL handle_charset( const char *pszParmValue, char **ptr );
-
-static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr);
+static BOOL handle_include( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_copy( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_netbios_name( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_idmap_uid( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_idmap_gid( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_debug_list( int snum, const char *pszParmValue, char **ptr );
+static BOOL handle_workgroup( int snum, const char *pszParmValue, char **ptr );
+static BOOL handle_netbios_aliases( int snum, const char *pszParmValue, char **ptr );
+static BOOL handle_netbios_scope( int snum, const char *pszParmValue, char **ptr );
+static BOOL handle_charset( int snum, const char *pszParmValue, char **ptr );
+static BOOL handle_acl_compatibility( int snum, const char *pszParmValue, char **ptr);
+static BOOL handle_printing( int snum, const char *pszParmValue, char **ptr);
static void set_server_role(void);
static void set_default_server_announce_type(void);
{"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED},
{"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED},
{"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED},
- {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED},
- {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED},
+ {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_DEPRECATED},
+ {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_DEPRECATED},
{"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, FLAG_ADVANCED},
{"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, FLAG_ADVANCED},
{"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, FLAG_ADVANCED},
{"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE},
{"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE},
{"guest account", P_STRING, P_GLOBAL, &Globals.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED},
+ {"enable privileges", P_BOOL, P_GLOBAL, &Globals.bEnablePrivileges, NULL, NULL, FLAG_ADVANCED},
{"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, FLAG_ADVANCED},
{"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, FLAG_ADVANCED},
{"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED},
{"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED},
{"passwd chat timeout", P_INTEGER, P_GLOBAL, &Globals.iPasswdChatTimeout, NULL, NULL, FLAG_ADVANCED},
+ {"check password script", P_STRING, P_GLOBAL, &Globals.szCheckPasswordScript, NULL, NULL, FLAG_ADVANCED},
{"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED},
{"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED},
{"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, FLAG_ADVANCED},
{"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE},
{"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE},
{"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE},
+ {"force unknown acl user", P_BOOL, P_LOCAL, &sDefault.bForceUnknownAclUser, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE},
{"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"inherit acls", P_BOOL, P_LOCAL, &sDefault.bInheritACLS, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
{"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_HIDE},
- {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
+ {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED},
{"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
{"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_HIDE},
{"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
{"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_HIDE},
{"preload modules", P_LIST, P_GLOBAL, &Globals.szPreloadModules, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL},
+ {"use kerberos keytab", P_BOOL, P_GLOBAL, &Globals.bUseKerberosKeytab, NULL, NULL, FLAG_ADVANCED},
{N_("Logging Options"), P_SEP, P_SEPARATOR},
{"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, FLAG_ADVANCED},
{"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, FLAG_ADVANCED},
- {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_ADVANCED},
{"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_ADVANCED},
+ {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_ADVANCED},
{"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, FLAG_ADVANCED},
{"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, FLAG_ADVANCED},
{"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, FLAG_ADVANCED},
{N_("Protocol Options"), P_SEP, P_SEPARATOR},
{"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, FLAG_ADVANCED},
- {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_ADVANCED},
{"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, FLAG_ADVANCED},
{"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_ADVANCED},
+ {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_ADVANCED},
{"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, FLAG_ADVANCED},
- {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, FLAG_ADVANCED},
{"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, FLAG_ADVANCED},
{"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, FLAG_ADVANCED},
{"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_ADVANCED},
{"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED},
{"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
+ { "defer sharing violations", P_BOOL, P_GLOBAL, &Globals.bDeferSharingViolations, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL},
+ {"ea support", P_BOOL, P_LOCAL, &sDefault.bEASupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED},
{"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED},
{"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, FLAG_ADVANCED},
{"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, FLAG_ADVANCED},
{"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
- {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, FLAG_ADVANCED},
{"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED},
{"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"max reported print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxReportedPrintJobs, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
+ {"printcap cache time", P_INTEGER, P_GLOBAL, &Globals.PrintcapCacheTime, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_HIDE},
{"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE},
- {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
+ {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, handle_printing, enum_printing, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
+ {"cups options", P_STRING, P_LOCAL, &sDefault.szCupsOptions, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
+ {"cups server", P_STRING, P_GLOBAL, &Globals.szCupsServer, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_HIDE},
{"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
+ {"force printername", P_BOOL, P_LOCAL, &sDefault.bForcePrintername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT},
{N_("Filename Handling"), P_SEP, P_SEPARATOR},
{"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED},
{"mangle prefix", P_INTEGER, P_GLOBAL, &Globals.mangle_prefix, NULL, NULL, FLAG_ADVANCED},
{"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_ADVANCED | FLAG_SHARE},
- {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
- {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_HIDE},
+ {"case sensitive", P_ENUM, P_LOCAL, &sDefault.iCaseSensitive, NULL, enum_bool_auto, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
+ {"casesignames", P_ENUM, P_LOCAL, &sDefault.iCaseSensitive, NULL, enum_bool_auto, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL | FLAG_HIDE},
{"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
- {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"hide special files", P_BOOL, P_LOCAL, &sDefault.bHideSpecialFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL | FLAG_DEPRECATED },
{"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, FLAG_ADVANCED},
+ {"store dos attributes", P_BOOL, P_LOCAL, &sDefault.bStoreDosAttributes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{N_("Domain Options"), P_SEP, P_SEPARATOR},
{"oplock break wait time", P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL},
{"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
- {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
+ {"strict locking", P_ENUM, P_LOCAL, &sDefault.iStrictLocking, NULL, enum_bool_auto, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{N_("Ldap Options"), P_SEP, P_SEPARATOR},
{"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, FLAG_ADVANCED},
{"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, FLAG_ADVANCED},
#endif
- {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, FLAG_ADVANCED},
- {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, NULL, NULL, FLAG_ADVANCED},
- {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED},
+ {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED},
+ {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED},
+ {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, FLAG_ADVANCED},
{"ldap group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, NULL, NULL, FLAG_ADVANCED},
{"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, NULL, NULL, FLAG_ADVANCED},
- {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, FLAG_ADVANCED},
- {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED},
- {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED},
+ {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, NULL, NULL, FLAG_ADVANCED},
{"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED},
- {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED},
+ {"ldap password sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_HIDE},
{"ldap replication sleep", P_INTEGER, P_GLOBAL, &Globals.ldap_replication_sleep, NULL, NULL, FLAG_ADVANCED},
+ {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, FLAG_ADVANCED},
+ {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED},
+ {"ldap timeout", P_INTEGER, P_GLOBAL, &Globals.ldap_timeout, NULL, NULL, FLAG_ADVANCED},
+ {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED},
{N_("Miscellaneous Options"), P_SEP, P_SEPARATOR},
{"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED},
{"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, FLAG_ADVANCED},
{"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, FLAG_ADVANCED},
{"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, FLAG_ADVANCED},
- {"afs username map", P_USTRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_ADVANCED},
+ {"afs username map", P_STRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_ADVANCED},
+ {"afs token lifetime", P_INTEGER, P_GLOBAL, &Globals.iAfsTokenLifetime, NULL, NULL, FLAG_ADVANCED},
{"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, FLAG_ADVANCED},
{"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, FLAG_ADVANCED},
{"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE},
{"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL, FLAG_HIDE},
{"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE},
- {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
- {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED},
+ {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
+ {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED},
{"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT},
{"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE },
{"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
- {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, FLAG_ADVANCED},
{"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE},
{N_("Winbind options"), P_SEP, P_SEPARATOR},
{"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_DEPRECATED},
- {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED},
+ {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED},
{"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED},
{"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_HIDE},
{"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED},
{"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED},
{"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED},
{"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, FLAG_ADVANCED},
- {"winbind enable local accounts", P_BOOL, P_GLOBAL, &Globals.bWinbindEnableLocalAccounts, NULL, NULL, FLAG_ADVANCED},
+ {"winbind enable local accounts", P_BOOL, P_GLOBAL, &Globals.bWinbindEnableLocalAccounts, NULL, NULL, FLAG_ADVANCED|FLAG_DEPRECATED},
{"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED},
{"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED},
{"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED},
{"winbind trusted domains only", P_BOOL, P_GLOBAL, &Globals.bWinbindTrustedDomainsOnly, NULL, NULL, FLAG_ADVANCED},
+ {"winbind nested groups", P_BOOL, P_GLOBAL, &Globals.bWinbindNestedGroups, NULL, NULL, FLAG_ADVANCED},
{NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0}
};
Initialise the sDefault parameter structure for the printer values.
***************************************************************************/
-static void init_printer_values(void)
+static void init_printer_values(service *pService)
{
/* choose defaults depending on the type of printing */
- switch (sDefault.iPrinting) {
+ switch (pService->iPrinting) {
case PRINT_BSD:
case PRINT_AIX:
case PRINT_LPRNT:
case PRINT_LPROS2:
- string_set(&sDefault.szLpqcommand, "lpq -P'%p'");
- string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j");
- string_set(&sDefault.szPrintcommand,
- "lpr -r -P'%p' %s");
+ string_set(&pService->szLpqcommand, "lpq -P'%p'");
+ string_set(&pService->szLprmcommand, "lprm -P'%p' %j");
+ string_set(&pService->szPrintcommand, "lpr -r -P'%p' %s");
break;
case PRINT_LPRNG:
case PRINT_PLP:
- string_set(&sDefault.szLpqcommand, "lpq -P'%p'");
- string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j");
- string_set(&sDefault.szPrintcommand,
- "lpr -r -P'%p' %s");
- string_set(&sDefault.szQueuepausecommand,
- "lpc stop '%p'");
- string_set(&sDefault.szQueueresumecommand,
- "lpc start '%p'");
- string_set(&sDefault.szLppausecommand,
- "lpc hold '%p' %j");
- string_set(&sDefault.szLpresumecommand,
- "lpc release '%p' %j");
+ string_set(&pService->szLpqcommand, "lpq -P'%p'");
+ string_set(&pService->szLprmcommand, "lprm -P'%p' %j");
+ string_set(&pService->szPrintcommand, "lpr -r -P'%p' %s");
+ string_set(&pService->szQueuepausecommand, "lpc stop '%p'");
+ string_set(&pService->szQueueresumecommand, "lpc start '%p'");
+ string_set(&pService->szLppausecommand, "lpc hold '%p' %j");
+ string_set(&pService->szLpresumecommand, "lpc release '%p' %j");
break;
case PRINT_CUPS:
#ifdef HAVE_CUPS
- string_set(&sDefault.szLpqcommand, "");
- string_set(&sDefault.szLprmcommand, "");
- string_set(&sDefault.szPrintcommand, "");
- string_set(&sDefault.szLppausecommand, "");
- string_set(&sDefault.szLpresumecommand, "");
- string_set(&sDefault.szQueuepausecommand, "");
- string_set(&sDefault.szQueueresumecommand, "");
-
- string_set(&Globals.szPrintcapname, "cups");
+ string_set(&pService->szLpqcommand, "");
+ string_set(&pService->szLprmcommand, "");
+ string_set(&pService->szPrintcommand, "");
+ string_set(&pService->szLppausecommand, "");
+ string_set(&pService->szLpresumecommand, "");
+ string_set(&pService->szQueuepausecommand, "");
+ string_set(&pService->szQueueresumecommand, "");
#else
- string_set(&sDefault.szLpqcommand,
- "/usr/bin/lpstat -o '%p'");
- string_set(&sDefault.szLprmcommand,
- "/usr/bin/cancel '%p-%j'");
- string_set(&sDefault.szPrintcommand,
- "/usr/bin/lp -d '%p' %s; rm %s");
- string_set(&sDefault.szLppausecommand,
- "lp -i '%p-%j' -H hold");
- string_set(&sDefault.szLpresumecommand,
- "lp -i '%p-%j' -H resume");
- string_set(&sDefault.szQueuepausecommand,
- "/usr/bin/disable '%p'");
- string_set(&sDefault.szQueueresumecommand,
- "/usr/bin/enable '%p'");
- string_set(&Globals.szPrintcapname, "lpstat");
+ string_set(&pService->szLpqcommand, "/usr/bin/lpstat -o '%p'");
+ string_set(&pService->szLprmcommand, "/usr/bin/cancel '%p-%j'");
+ string_set(&pService->szPrintcommand, "/usr/bin/lp -d '%p' %s; rm %s");
+ string_set(&pService->szLppausecommand, "lp -i '%p-%j' -H hold");
+ string_set(&pService->szLpresumecommand, "lp -i '%p-%j' -H resume");
+ string_set(&pService->szQueuepausecommand, "/usr/bin/disable '%p'");
+ string_set(&pService->szQueueresumecommand, "/usr/bin/enable '%p'");
#endif /* HAVE_CUPS */
break;
case PRINT_SYSV:
case PRINT_HPUX:
- string_set(&sDefault.szLpqcommand, "lpstat -o%p");
- string_set(&sDefault.szLprmcommand, "cancel %p-%j");
- string_set(&sDefault.szPrintcommand,
- "lp -c -d%p %s; rm %s");
- string_set(&sDefault.szQueuepausecommand,
- "disable %p");
- string_set(&sDefault.szQueueresumecommand,
- "enable %p");
+ string_set(&pService->szLpqcommand, "lpstat -o%p");
+ string_set(&pService->szLprmcommand, "cancel %p-%j");
+ string_set(&pService->szPrintcommand, "lp -c -d%p %s; rm %s");
+ string_set(&pService->szQueuepausecommand, "disable %p");
+ string_set(&pService->szQueueresumecommand, "enable %p");
#ifndef HPUX
- string_set(&sDefault.szLppausecommand,
- "lp -i %p-%j -H hold");
- string_set(&sDefault.szLpresumecommand,
- "lp -i %p-%j -H resume");
+ string_set(&pService->szLppausecommand, "lp -i %p-%j -H hold");
+ string_set(&pService->szLpresumecommand, "lp -i %p-%j -H resume");
#endif /* HPUX */
break;
case PRINT_QNX:
- string_set(&sDefault.szLpqcommand, "lpq -P%p");
- string_set(&sDefault.szLprmcommand, "lprm -P%p %j");
- string_set(&sDefault.szPrintcommand, "lp -r -P%p %s");
+ string_set(&pService->szLpqcommand, "lpq -P%p");
+ string_set(&pService->szLprmcommand, "lprm -P%p %j");
+ string_set(&pService->szPrintcommand, "lp -r -P%p %s");
break;
#ifdef DEVELOPER
case PRINT_TEST:
case PRINT_VLP:
- string_set(&sDefault.szPrintcommand, "vlp print %p %s");
- string_set(&sDefault.szLpqcommand, "vlp lpq %p");
- string_set(&sDefault.szLprmcommand, "vlp lprm %p %j");
- string_set(&sDefault.szLppausecommand, "vlp lppause %p %j");
- string_set(&sDefault.szLpresumecommand, "vlp lpresum %p %j");
- string_set(&sDefault.szQueuepausecommand, "vlp queuepause %p");
- string_set(&sDefault.szQueueresumecommand, "vlp queueresume %p");
+ string_set(&pService->szPrintcommand, "vlp print %p %s");
+ string_set(&pService->szLpqcommand, "vlp lpq %p");
+ string_set(&pService->szLprmcommand, "vlp lprm %p %j");
+ string_set(&pService->szLppausecommand, "vlp lppause %p %j");
+ string_set(&pService->szLpresumecommand, "vlp lpresum %p %j");
+ string_set(&pService->szQueuepausecommand, "vlp queuepause %p");
+ string_set(&pService->szQueueresumecommand, "vlp queueresume %p");
break;
#endif /* DEVELOPER */
if (!done_init) {
int i;
+
+ /* The logfile can be set before this is invoked. Free it if so. */
+ if (Globals.szLogFile != NULL) {
+ string_free(&Globals.szLogFile);
+ Globals.szLogFile = NULL;
+ }
+
memset((void *)&Globals, '\0', sizeof(Globals));
for (i = 0; parm_table[i].label; i++)
string_set(&sDefault.fstype, FSTYPE_STRING);
- init_printer_values();
+ init_printer_values(&sDefault);
done_init = True;
}
string_set(&Globals.szWorkgroup, lp_workgroup());
string_set(&Globals.szPasswdProgram, "");
- string_set(&Globals.szPrintcapname, PRINTCAP_NAME);
string_set(&Globals.szPidDir, dyn_PIDDIR);
string_set(&Globals.szLockDir, dyn_LOCKDIR);
string_set(&Globals.szSocketAddress, "0.0.0.0");
Globals.AlgorithmicRidBase = BASE_RID;
Globals.bLoadPrinters = True;
+ Globals.PrintcapCacheTime = 0;
/* Was 65535 (0xFFFF). 0x4101 matches W2K and causes major speed improvements... */
/* Discovered by 2 days of pain by Don McCall @ HP :-). */
Globals.max_xmit = 0x4104;
Globals.max_mux = 50; /* This is *needed* for profile support. */
- Globals.lpqcachetime = 10;
+ Globals.lpqcachetime = 30; /* changed to handle large print servers better -- jerry */
Globals.bDisableSpoolss = False;
Globals.iMaxSmbdProcesses = 0;/* no limit specified */
- Globals.iTotalPrintJobs = 0; /* no limit specified */
Globals.pwordlevel = 0;
Globals.unamelevel = 0;
Globals.deadtime = 0;
Globals.serverSchannel = Auto;
Globals.bReadRaw = True;
Globals.bWriteRaw = True;
- Globals.bReadPrediction = False;
Globals.bReadbmpx = False;
Globals.bNullPasswords = False;
Globals.bObeyPamRestrictions = False;
Globals.machine_password_timeout = 60 * 60 * 24 * 7; /* 7 days default. */
Globals.change_notify_timeout = 60; /* 1 minute default. */
Globals.bKernelChangeNotify = True; /* On if we have it. */
- Globals.ReadSize = 16 * 1024;
Globals.lm_announce = 2; /* = Auto: send only if LM clients found */
Globals.lm_interval = 60;
Globals.announce_as = ANNOUNCE_AS_NT_SERVER;
Globals.bPamPasswordChange = False;
Globals.bPasswdChatDebug = False;
Globals.iPasswdChatTimeout = 2; /* 2 second default. */
- Globals.bUnicode = True; /* Do unicode on the wire by default */
Globals.bNTPipeSupport = True; /* Do NT pipes by default. */
Globals.bNTStatusSupport = True; /* Use NT status by default. */
Globals.bStatCache = True; /* use stat cache by default */
a large number of sites (tridge) */
Globals.bHostnameLookups = False;
+ str_list_free(&Globals.szPassdbBackend);
#ifdef WITH_LDAP_SAMCONFIG
string_set(&Globals.szLdapServer, "localhost");
Globals.ldap_port = 636;
Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF;
Globals.ldap_delete_dn = False;
Globals.ldap_replication_sleep = 1000; /* wait 1 sec for replication */
+ Globals.ldap_timeout = LDAP_CONNECT_DEFAULT_TIMEOUT;
+
+ /* This is what we tell the afs client. in reality we set the token
+ * to never expire, though, when this runs out the afs client will
+ * forget the token. Set to 0 to get NEVERDATE.*/
+ Globals.iAfsTokenLifetime = 604800;
/* these parameters are set to defaults that are more appropriate
for the increasing samba install base:
string_set(&Globals.szTemplatePrimaryGroup, "nobody");
string_set(&Globals.szWinbindSeparator, "\\");
string_set(&Globals.szAclCompat, "");
+ string_set(&Globals.szCupsServer, "");
Globals.winbind_cache_time = 300; /* 5 minutes */
- Globals.bWinbindEnableLocalAccounts = True;
+ Globals.bWinbindEnableLocalAccounts = False;
Globals.bWinbindEnumUsers = True;
Globals.bWinbindEnumGroups = True;
Globals.bWinbindUseDefaultDomain = False;
Globals.bWinbindTrustedDomainsOnly = False;
+ Globals.bWinbindNestedGroups = False;
Globals.bEnableRidAlgorithm = True;
Globals.client_signing = Auto;
Globals.server_signing = False;
+ Globals.bDeferSharingViolations = True;
string_set(&Globals.smb_ports, SMB_PORTS);
+
+ /* don't enable privileges by default since Domain
+ Admins can then assign thr rights to perform certain
+ operations as root */
+
+ Globals.bEnablePrivileges = False;
}
static TALLOC_CTX *lp_talloc;
if (!lp_talloc)
lp_talloc = talloc_init("lp_talloc");
- tmpstr = alloc_sub_basic(current_user_info.smb_name, s);
+ tmpstr = alloc_sub_basic(get_current_username(), s);
if (trim_char(tmpstr, '\"', '\"')) {
if (strchr(tmpstr,'\"') != NULL) {
SAFE_FREE(tmpstr);
- tmpstr = alloc_sub_basic(current_user_info.smb_name,s);
+ tmpstr = alloc_sub_basic(get_current_username(),s);
}
}
ret = talloc_strdup(lp_talloc, tmpstr);
FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile)
FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir)
FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString)
-FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname)
+FN_GLOBAL_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime)
FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand)
FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand)
FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand)
FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir)
FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp)
FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir)
-FN_GLOBAL_STRING(lp_source_environment, &Globals.szSourceEnv)
FN_GLOBAL_STRING(lp_defaultservice, &Globals.szDefaultService)
FN_GLOBAL_STRING(lp_msg_command, &Globals.szMsgCommand)
FN_GLOBAL_STRING(lp_dfree_command, &Globals.szDfree)
FN_GLOBAL_STRING(lp_passwordserver, &Globals.szPasswordServer)
FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder)
FN_GLOBAL_STRING(lp_realm, &Globals.szRealm)
-FN_GLOBAL_STRING(lp_afs_username_map, &Globals.szAfsUsernameMap)
+FN_GLOBAL_CONST_STRING(lp_afs_username_map, &Globals.szAfsUsernameMap)
+FN_GLOBAL_INTEGER(lp_afs_token_lifetime, &Globals.iAfsTokenLifetime)
FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap)
FN_GLOBAL_CONST_STRING(lp_logon_script, &Globals.szLogonScript)
FN_GLOBAL_CONST_STRING(lp_logon_path, &Globals.szLogonPath)
FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript)
FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript)
+FN_GLOBAL_STRING(lp_check_password_script, &Globals.szCheckPasswordScript)
+
FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook)
FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners)
FN_GLOBAL_STRING(lp_template_primary_group, &Globals.szTemplatePrimaryGroup)
FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups)
FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain)
FN_GLOBAL_BOOL(lp_winbind_trusted_domains_only, &Globals.bWinbindTrustedDomainsOnly)
+FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups)
-FN_GLOBAL_STRING(lp_idmap_backend, &Globals.szIdmapBackend)
+FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend)
FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm)
#ifdef WITH_LDAP_SAMCONFIG
FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync)
FN_GLOBAL_BOOL(lp_ldap_delete_dn, &Globals.ldap_delete_dn)
FN_GLOBAL_INTEGER(lp_ldap_replication_sleep, &Globals.ldap_replication_sleep)
+FN_GLOBAL_INTEGER(lp_ldap_timeout, &Globals.ldap_timeout)
FN_GLOBAL_STRING(lp_add_share_cmd, &Globals.szAddShareCommand)
FN_GLOBAL_STRING(lp_change_share_cmd, &Globals.szChangeShareCommand)
FN_GLOBAL_STRING(lp_delete_share_cmd, &Globals.szDeleteShareCommand)
FN_GLOBAL_BOOL(lp_local_master, &Globals.bLocalMaster)
FN_GLOBAL_BOOL(lp_domain_logons, &Globals.bDomainLogons)
FN_GLOBAL_BOOL(lp_load_printers, &Globals.bLoadPrinters)
-FN_GLOBAL_BOOL(lp_readprediction, &Globals.bReadPrediction)
FN_GLOBAL_BOOL(lp_readbmpx, &Globals.bReadbmpx)
FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw)
FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite)
FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync)
FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug)
FN_GLOBAL_INTEGER(lp_passwd_chat_timeout, &Globals.iPasswdChatTimeout)
-FN_GLOBAL_BOOL(lp_unicode, &Globals.bUnicode)
FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport)
FN_GLOBAL_BOOL(lp_nt_status_support, &Globals.bNTStatusSupport)
FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache)
FN_GLOBAL_BOOL(lp_client_use_spnego, &Globals.bClientUseSpnego)
FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups)
FN_GLOBAL_BOOL(lp_kernel_change_notify, &Globals.bKernelChangeNotify)
+FN_GLOBAL_BOOL(lp_use_kerberos_keytab, &Globals.bUseKerberosKeytab)
+FN_GLOBAL_BOOL(lp_defer_sharing_violations, &Globals.bDeferSharingViolations)
+FN_GLOBAL_BOOL(lp_enable_privileges, &Globals.bEnablePrivileges)
FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level)
FN_GLOBAL_INTEGER(lp_max_ttl, &Globals.max_ttl)
FN_GLOBAL_INTEGER(lp_max_wins_ttl, &Globals.max_wins_ttl)
FN_GLOBAL_INTEGER(lp_maxmux, &Globals.max_mux)
FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel)
FN_GLOBAL_INTEGER(lp_usernamelevel, &Globals.unamelevel)
-FN_GLOBAL_INTEGER(lp_readsize, &Globals.ReadSize)
FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime)
FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol)
FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol)
FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers)
FN_LOCAL_LIST(lp_valid_users, szValidUsers)
FN_LOCAL_LIST(lp_admin_users, szAdminUsers)
+FN_LOCAL_STRING(lp_cups_options, szCupsOptions)
+FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer)
FN_LOCAL_STRING(lp_printcommand, szPrintcommand)
FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand)
FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand)
FN_LOCAL_BOOL(lp_autoloaded, autoloaded)
FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose)
FN_LOCAL_BOOL(lp_rootpreexec_close, bRootpreexecClose)
-FN_LOCAL_BOOL(lp_casesensitive, bCaseSensitive)
+FN_LOCAL_INTEGER(lp_casesensitive, iCaseSensitive)
FN_LOCAL_BOOL(lp_preservecase, bCasePreserve)
FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve)
-FN_LOCAL_BOOL(lp_casemangle, bCaseMangle)
FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles)
FN_LOCAL_BOOL(lp_hide_special_files, bHideSpecialFiles)
FN_LOCAL_BOOL(lp_hideunreadable, bHideUnReadable)
FN_LOCAL_BOOL(lp_print_ok, bPrint_ok)
FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden)
FN_LOCAL_BOOL(lp_map_archive, bMap_archive)
+FN_LOCAL_BOOL(lp_store_dos_attributes, bStoreDosAttributes)
FN_LOCAL_BOOL(lp_locking, bLocking)
-FN_LOCAL_BOOL(lp_strict_locking, bStrictLocking)
+FN_LOCAL_INTEGER(lp_strict_locking, iStrictLocking)
FN_LOCAL_BOOL(lp_posix_locking, bPosixLocking)
FN_LOCAL_BOOL(lp_share_modes, bShareModes)
FN_LOCAL_BOOL(lp_oplocks, bOpLocks)
FN_LOCAL_BOOL(lp_inherit_acls, bInheritACLS)
FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver)
FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode)
+FN_LOCAL_BOOL(lp_force_printername, bForcePrintername)
FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport)
+FN_LOCAL_BOOL(lp_force_unknown_acl_user, bForceUnknownAclUser)
+FN_LOCAL_BOOL(lp_ea_support, bEASupport)
FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile)
FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls)
FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit)
if (i == iNumServices) {
service **tsp;
- tsp = (service **) Realloc(ServicePtrs,
- sizeof(service *) *
- num_to_alloc);
+ tsp = SMB_REALLOC_ARRAY(ServicePtrs, service *, num_to_alloc);
if (!tsp) {
DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
}
else {
ServicePtrs = tsp;
- ServicePtrs[iNumServices] =
- (service *) malloc(sizeof(service));
+ ServicePtrs[iNumServices] = SMB_MALLOC_P(service);
}
if (!ServicePtrs[iNumServices]) {
DEBUG(0,("add_a_service: out of memory!\n"));
copy_service(ServicePtrs[i], &tservice, NULL);
if (name)
string_set(&ServicePtrs[i]->szService, name);
+
+ DEBUG(8,("add_a_service: Creating snum = %d for %s\n",
+ i, ServicePtrs[i]->szService));
+
return (i);
}
ServicePtrs[i]->bBrowseable = sDefault.bBrowseable;
+ ServicePtrs[i]->autoloaded = True;
+
DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename,
- user, newHomedir));
+ user, ServicePtrs[i]->szPath ));
return (True);
}
ServicePtrs[i]->bOpLocks = False;
/* Printer services must be printable. */
ServicePtrs[i]->bPrint_ok = True;
-
+
DEBUG(3, ("adding printer service %s\n", pszPrintername));
- update_server_announce_as_printserver();
-
return (True);
}
strupper_m(*(char **)dest_ptr);
break;
case P_LIST:
+ str_list_free((char ***)dest_ptr);
str_list_copy((char ***)dest_ptr, *(const char ***)src_ptr);
break;
default:
if (strcmp(pdata->key, data->key) == 0) {
string_free(&pdata->value);
str_list_free(&data->list);
- pdata->value = strdup(data->value);
+ pdata->value = SMB_STRDUP(data->value);
not_added = False;
break;
}
pdata = pdata->next;
}
if (not_added) {
- paramo = smb_xmalloc(sizeof(param_opt_struct));
- paramo->key = strdup(data->key);
- paramo->value = strdup(data->value);
+ paramo = SMB_XMALLOC_P(param_opt_struct);
+ paramo->key = SMB_STRDUP(data->key);
+ paramo->value = SMB_STRDUP(data->value);
paramo->list = NULL;
DLIST_ADD(pserviceDest->param_opt, paramo);
}
}
if (!f) {
- f = (struct file_lists *)malloc(sizeof(file_lists[0]));
+ f = SMB_MALLOC_P(struct file_lists);
if (!f)
return;
f->next = file_lists;
- f->name = strdup(fname);
+ f->name = SMB_STRDUP(fname);
if (!f->name) {
SAFE_FREE(f);
return;
}
- f->subfname = strdup(subfname);
+ f->subfname = SMB_STRDUP(subfname);
if (!f->subfname) {
SAFE_FREE(f);
return;
BOOL lp_file_list_changed(void)
{
struct file_lists *f = file_lists;
- DEBUG(6, ("lp_file_list_changed()\n"));
+
+ DEBUG(6, ("lp_file_list_changed()\n"));
while (f) {
pstring n2;
time_t mod_time;
pstrcpy(n2, f->name);
- standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2));
+ standard_sub_basic( get_current_username(), n2, sizeof(n2) );
DEBUGADD(6, ("file %s -> %s last mod_time: %s\n",
f->name, n2, ctime(&f->modtime)));
ctime(&mod_time)));
f->modtime = mod_time;
SAFE_FREE(f->subfname);
- f->subfname = strdup(n2);
+ f->subfname = SMB_STRDUP(n2);
return (True);
}
f = f->next;
Note: We must *NOT* use string_set() here as ptr points to global_myname.
***************************************************************************/
-static BOOL handle_netbios_name(const char *pszParmValue, char **ptr)
+static BOOL handle_netbios_name(int snum, const char *pszParmValue, char **ptr)
{
BOOL ret;
pstring netbios_name;
pstrcpy(netbios_name, pszParmValue);
- standard_sub_basic(current_user_info.smb_name, netbios_name,sizeof(netbios_name));
+ standard_sub_basic(get_current_username(), netbios_name,sizeof(netbios_name));
ret = set_global_myname(netbios_name);
string_set(&Globals.szNetbiosName,global_myname());
return ret;
}
-static BOOL handle_charset(const char *pszParmValue, char **ptr)
+static BOOL handle_charset(int snum, const char *pszParmValue, char **ptr)
{
if (strcmp(*ptr, pszParmValue) != 0) {
string_set(ptr, pszParmValue);
return True;
}
-static BOOL handle_workgroup(const char *pszParmValue, char **ptr)
+static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr)
{
BOOL ret;
return ret;
}
-static BOOL handle_netbios_scope(const char *pszParmValue, char **ptr)
+static BOOL handle_netbios_scope(int snum, const char *pszParmValue, char **ptr)
{
BOOL ret;
return ret;
}
-static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr)
+static BOOL handle_netbios_aliases(int snum, const char *pszParmValue, char **ptr)
{
+ str_list_free(&Globals.szNetbiosAliases);
Globals.szNetbiosAliases = str_list_make(pszParmValue, NULL);
return set_netbios_aliases((const char **)Globals.szNetbiosAliases);
}
-/***************************************************************************
- Do the work of sourcing in environment variable/value pairs.
-***************************************************************************/
-
-static BOOL source_env(char **lines)
-{
- char *varval;
- size_t len;
- int i;
- char *p;
-
- for (i = 0; lines[i]; i++) {
- char *line = lines[i];
-
- if ((len = strlen(line)) == 0)
- continue;
-
- if (line[len - 1] == '\n')
- line[--len] = '\0';
-
- if ((varval = malloc(len + 1)) == NULL) {
- DEBUG(0, ("source_env: Not enough memory!\n"));
- return (False);
- }
-
- DEBUG(4, ("source_env: Adding to environment: %s\n", line));
- strncpy(varval, line, len);
- varval[len] = '\0';
-
- p = strchr_m(line, (int)'=');
- if (p == NULL) {
- DEBUG(4, ("source_env: missing '=': %s\n", line));
- continue;
- }
-
- if (putenv(varval)) {
- DEBUG(0, ("source_env: Failed to put environment variable %s\n",
- varval));
- continue;
- }
-
- *p = '\0';
- p++;
- DEBUG(4, ("source_env: getting var %s = %s\n", line, getenv(line)));
- }
-
- DEBUG(4, ("source_env: returning successfully\n"));
- return (True);
-}
-
-/***************************************************************************
- Handle the source environment operation.
-***************************************************************************/
-
-static BOOL handle_source_env(const char *pszParmValue, char **ptr)
-{
- pstring fname;
- char *p = fname;
- BOOL result;
- char **lines;
-
- pstrcpy(fname, pszParmValue);
-
- standard_sub_basic(current_user_info.smb_name, fname,sizeof(fname));
-
- string_set(ptr, pszParmValue);
-
- DEBUG(4, ("handle_source_env: checking env type\n"));
-
- /*
- * Filename starting with '|' means popen and read from stdin.
- */
-
- if (*p == '|')
- lines = file_lines_pload(p + 1, NULL);
- else
- lines = file_lines_load(fname, NULL);
-
- if (!lines) {
- DEBUG(0, ("handle_source_env: Failed to open file %s, Error was %s\n",
- fname, strerror(errno)));
- return (False);
- }
-
- result = source_env(lines);
- file_lines_free(lines);
-
- return (result);
-}
-
/***************************************************************************
Handle the include operation.
***************************************************************************/
-static BOOL handle_include(const char *pszParmValue, char **ptr)
+static BOOL handle_include(int snum, const char *pszParmValue, char **ptr)
{
pstring fname;
pstrcpy(fname, pszParmValue);
- standard_sub_basic(current_user_info.smb_name, fname,sizeof(fname));
+ standard_sub_basic(get_current_username(), fname,sizeof(fname));
add_to_file_list(pszParmValue, fname);
Handle the interpretation of the copy parameter.
***************************************************************************/
-static BOOL handle_copy(const char *pszParmValue, char **ptr)
+static BOOL handle_copy(int snum, const char *pszParmValue, char **ptr)
{
BOOL bRetval;
int iTemp;
/* Do some simple checks on "idmap [ug]id" parameter values */
-static BOOL handle_idmap_uid(const char *pszParmValue, char **ptr)
+static BOOL handle_idmap_uid(int snum, const char *pszParmValue, char **ptr)
{
uint32 low, high;
return True;
}
-static BOOL handle_idmap_gid(const char *pszParmValue, char **ptr)
+static BOOL handle_idmap_gid(int snum, const char *pszParmValue, char **ptr)
{
uint32 low, high;
Handle the DEBUG level list.
***************************************************************************/
-static BOOL handle_debug_list( const char *pszParmValueIn, char **ptr )
+static BOOL handle_debug_list( int snum, const char *pszParmValueIn, char **ptr )
{
pstring pszParmValue;
/***************************************************************************
***************************************************************************/
-static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr)
+static BOOL handle_acl_compatibility(int snum, const char *pszParmValue, char **ptr)
{
if (strequal(pszParmValue, "auto"))
string_set(ptr, "");
return True;
}
+/****************************************************************************
+ set the value for a P_ENUM
+ ***************************************************************************/
+
+static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue,
+ int *ptr )
+{
+ int i;
+
+ for (i = 0; parm->enum_list[i].name; i++) {
+ if ( strequal(pszParmValue, parm->enum_list[i].name)) {
+ *ptr = parm->enum_list[i].value;
+ break;
+ }
+ }
+}
+
+/***************************************************************************
+***************************************************************************/
+
+static BOOL handle_printing(int snum, const char *pszParmValue, char **ptr)
+{
+ static int parm_num = -1;
+ service *s;
+
+ if ( parm_num == -1 )
+ parm_num = map_parameter( "printing" );
+
+ lp_set_enum_parm( &parm_table[parm_num], pszParmValue, (int*)ptr );
+
+ if ( snum < 0 )
+ s = &sDefault;
+ else
+ s = ServicePtrs[snum];
+
+ init_printer_values( s );
+
+ return True;
+}
+
+
/***************************************************************************
Initialise a copymap.
***************************************************************************/
{
int i;
SAFE_FREE(pservice->copymap);
- pservice->copymap = (BOOL *)malloc(sizeof(BOOL) * NUMPARAMETERS);
+ pservice->copymap = SMB_MALLOC_ARRAY(BOOL,NUMPARAMETERS);
if (!pservice->copymap)
DEBUG(0,
("Couldn't allocate copymap!! (size %d)\n",
if (strcmp(data->key, param_key) == 0) {
string_free(&data->value);
str_list_free(&data->list);
- data->value = strdup(pszParmValue);
+ data->value = SMB_STRDUP(pszParmValue);
not_added = False;
break;
}
data = data->next;
}
if (not_added) {
- paramo = smb_xmalloc(sizeof(param_opt_struct));
- paramo->key = strdup(param_key);
- paramo->value = strdup(pszParmValue);
+ paramo = SMB_XMALLOC_P(param_opt_struct);
+ paramo->key = SMB_STRDUP(param_key);
+ paramo->value = SMB_STRDUP(pszParmValue);
paramo->list = NULL;
if (snum < 0) {
DLIST_ADD(Globals.param_opt, paramo);
/* if it is a special case then go ahead */
if (parm_table[parmnum].special) {
- parm_table[parmnum].special(pszParmValue, (char **)parm_ptr);
+ parm_table[parmnum].special(snum, pszParmValue, (char **)parm_ptr);
return (True);
}
break;
case P_ENUM:
- for (i = 0; parm_table[parmnum].enum_list[i].name; i++) {
- if (strequal
- (pszParmValue,
- parm_table[parmnum].enum_list[i].name)) {
- *(int *)parm_ptr =
- parm_table[parmnum].
- enum_list[i].value;
- break;
- }
- }
+ lp_set_enum_parm( &parm_table[parmnum], pszParmValue, (int*)parm_ptr );
break;
case P_SEP:
break;
char **list = *(char ***)ptr;
for (; *list; list++) {
- /* surround strings with whitespace in single quotes */
+ /* surround strings with whitespace in double quotes */
if ( strchr_m( *list, ' ' ) )
- fprintf(f, "\'%s\'%s", *list, ((*(list+1))?", ":""));
+ fprintf(f, "\"%s\"%s", *list, ((*(list+1))?", ":""));
else
fprintf(f, "%s%s", *list, ((*(list+1))?", ":""));
}
if (pService != &sDefault)
fprintf(f, "\n[%s]\n", pService->szService);
- for (i = 0; parm_table[i].label; i++)
+ for (i = 0; parm_table[i].label; i++) {
+
if (parm_table[i].class == P_LOCAL &&
parm_table[i].ptr &&
(*parm_table[i].label != '-') &&
- (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) {
+ (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr)))
+ {
+
int pdiff = PTR_DIFF(parm_table[i].ptr, &sDefault);
if (pService == &sDefault) {
print_parameter(&parm_table[i],
((char *)pService) + pdiff, f);
fprintf(f, "\n");
+ }
}
+
if (pService->param_opt != NULL) {
data = pService->param_opt;
while(data) {
fprintf(f, "\t%s = %s\n", data->key, data->value);
data = data->next;
}
- }
+ }
}
if (!str)
return;
- s = strdup(str);
+ s = SMB_STRDUP(str);
if (!s)
return;
}
}
-/***************************************************************************
- Announce ourselves as a print server.
-***************************************************************************/
-
-void update_server_announce_as_printserver(void)
-{
- default_server_announce |= SV_TYPE_PRINTQ_SERVER;
-}
-
/***************************************************************************
Have we loaded a services file yet?
***************************************************************************/
if (!VALID(i))
continue;
+ /* don't kill autoloaded services */
+ if ( ServicePtrs[i]->autoloaded )
+ continue;
+
if (!snumused || !snumused(i)) {
ServicePtrs[i]->valid = False;
free_service(ServicePtrs[i]);
case P_STRING:
case P_USTRING:
if (parm_table[i].ptr) {
- parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr);
+ parm_table[i].def.svalue = SMB_STRDUP(*(char **)parm_table[i].ptr);
} else {
parm_table[i].def.svalue = NULL;
}
case P_GSTRING:
case P_UGSTRING:
if (parm_table[i].ptr) {
- parm_table[i].def.svalue = strdup((char *)parm_table[i].ptr);
+ parm_table[i].def.svalue = SMB_STRDUP((char *)parm_table[i].ptr);
} else {
parm_table[i].def.svalue = NULL;
}
param_opt_struct *data, *pdata;
pstrcpy(n2, pszFname);
- standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2));
+
+ standard_sub_basic( get_current_username(), n2,sizeof(n2) );
add_to_file_list(pszFname, n2);
init_globals();
debug_init();
- if (save_defaults)
- {
+ if (save_defaults) {
init_locals();
lp_save_defaults();
}
* service names
*/
fstrcpy(serviceName, ServicePtrs[iService]->szService);
- standard_sub_basic(current_user_info.smb_name, serviceName,sizeof(serviceName));
+ standard_sub_basic(get_current_username(), serviceName,sizeof(serviceName));
if (strequal(serviceName, pszServiceName))
break;
}
default_server_announce |= SV_TYPE_SERVER;
default_server_announce |= SV_TYPE_SERVER_UNIX;
+ /* note that the flag should be set only if we have a
+ printer service but nmbd doesn't actually load the
+ services so we can't tell --jerry */
+
+ default_server_announce |= SV_TYPE_PRINTQ_SERVER;
+
switch (lp_announce_as()) {
case ANNOUNCE_AS_NT_SERVER:
default_server_announce |= SV_TYPE_SERVER_NT;
void lp_set_logfile(const char *name)
{
- extern pstring debugf;
string_set(&Globals.szLogFile, name);
pstrcpy(debugf, name);
}
-/*******************************************************************
- Return the NetBIOS called name, or my IP - but never global_myname().
-********************************************************************/
-
-const char *get_called_name(void)
-{
- extern fstring local_machine;
- static fstring called_name;
-
- if (!*local_machine) {
- fstrcpy(called_name, get_my_primary_ip());
- DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n",
- called_name));
- return called_name;
- }
-
- return local_machine;
-}
-
/*******************************************************************
Return the max print jobs per queue.
********************************************************************/
return maxjobs;
}
+const char *lp_printcapname(void)
+{
+ if ((Globals.szPrintcapname != NULL) &&
+ (Globals.szPrintcapname[0] != '\0'))
+ return Globals.szPrintcapname;
+
+ if (sDefault.iPrinting == PRINT_CUPS) {
+#ifdef HAVE_CUPS
+ return "cups";
+#else
+ return "lpstat";
+#endif
+ }
+
+ if (sDefault.iPrinting == PRINT_BSD)
+ return "/etc/printcap";
+
+ return PRINTCAP_NAME;
+}
+
/*******************************************************************
Ensure we don't use sendfile if server smb signing is active.
********************************************************************/
BOOL lp_use_sendfile(int snum)
{
- return (_lp_use_sendfile(snum) && !srv_is_signing_active());
+ extern enum protocol_types Protocol;
+ /* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
+ if (Protocol < PROTOCOL_NT1) {
+ return False;
+ }
+ return (_lp_use_sendfile(snum) && (get_remote_arch() != RA_WIN95) && !srv_is_signing_active());
+}
+
+/*******************************************************************
+ Turn off sendfile if we find the underlying OS doesn't support it.
+********************************************************************/
+
+void set_use_sendfile(int snum, BOOL val)
+{
+ if (LP_SNUM_OK(snum))
+ ServicePtrs[snum]->bUseSendfile = val;
+ else
+ sDefault.bUseSendfile = val;
+}
+
+/*******************************************************************
+ Turn off storing DOS attributes if this share doesn't support it.
+********************************************************************/
+
+void set_store_dos_attributes(int snum, BOOL val)
+{
+ if (!LP_SNUM_OK(snum))
+ return;
+ ServicePtrs[(snum)]->bStoreDosAttributes = val;
}