From 0e8fd3398771da2f016d72830179507f3edda51b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 4 May 1996 07:50:46 +0000 Subject: Initial version imported to CVS (This used to be commit 291551d80711daab7b7581720bcd9a08d6096517) --- source3/param/loadparm.c | 1891 ++++++++++++++++++++++++++++++++++++++++++++++ source3/param/params.c | 335 ++++++++ 2 files changed, 2226 insertions(+) create mode 100644 source3/param/loadparm.c create mode 100644 source3/param/params.c (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c new file mode 100644 index 0000000000..c61ab26781 --- /dev/null +++ b/source3/param/loadparm.c @@ -0,0 +1,1891 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + Parameter loading functions + Copyright (C) Karl Auer 1993,1994 + + 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" + +#include "params.h" +#include "loadparm.h" +#include "pcap.h" + +BOOL bLoaded = False; + +extern int DEBUGLEVEL; +extern int ReadSize; +extern pstring user_socket_options; +extern pstring smbrun_path; + +#ifndef GLOBAL_NAME +#define GLOBAL_NAME "global" +#endif + +#ifndef PRINTCAP_NAME +#ifdef AIX +#define PRINTCAP_NAME "/etc/qconfig" +#else +#define PRINTCAP_NAME "/etc/printcap" +#endif +#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).valid + +/* these are the types of parameter we have */ +typedef enum +{ + P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_STRING,P_GSTRING +} parm_type; + +typedef enum +{ + P_LOCAL,P_GLOBAL,P_NONE +} parm_class; + +int keepalive=0; +extern BOOL use_getwd_cache; + +extern int extra_time_offset; +#ifdef KANJI +extern int coding_system; +#endif + +/* + * 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 *szDomainController; + char *szUsernameMap; + char *szCharacterSet; + char *szLogonScript; + int max_log_size; + int mangled_stack; + int max_xmit; + int max_mux; + int max_packet; + int pwordlevel; + int deadtime; + int maxprotocol; + int security; + int printing; + int maxdisksize; + int lpqcachetime; + int syslog; + int os_level; + int max_ttl; + BOOL bPreferredMaster; + BOOL bDomainMaster; + BOOL bDomainLogons; + BOOL bEncryptPasswords; + BOOL bStripDot; + BOOL bNullPasswords; + BOOL bLoadPrinters; + BOOL bUseRhosts; + BOOL bReadRaw; + BOOL bWriteRaw; + BOOL bReadPrediction; + BOOL bReadbmpx; + BOOL bSyslogOnly; + BOOL bBrowseList; +} 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 *szPrintername; + char *szDontdescend; + char *szHostsallow; + char *szHostsdeny; + char *szMagicScript; + char *szMagicOutput; + char *szMangledMap; + char *comment; + char *force_user; + char *force_group; + char *readlist; + char *writelist; + char *volume; + int iMinPrintSpace; + int iCreate_mode; + int iMaxConnections; + int iDefaultCase; + BOOL bAlternatePerm; + BOOL bRevalidate; + BOOL bCaseSensitive; + BOOL bCasePreserve; + BOOL bShortCasePreserve; + BOOL bCaseMangle; + BOOL status; + BOOL bHideDotFiles; + BOOL bBrowseable; + BOOL bAvailable; + BOOL bRead_only; + BOOL bNo_set_dir; + BOOL bGuest_only; + BOOL bGuest_ok; + BOOL bPrint_ok; + BOOL bPostscript; + BOOL bMap_system; + BOOL bMap_hidden; + BOOL bMap_archive; + BOOL bLocking; + BOOL bStrictLocking; + BOOL bShareModes; + BOOL bOnlyUser; + BOOL bMangledNames; + BOOL bWidelinks; + BOOL bSyncAlways; + char magic_char; + BOOL *copymap; + char dummy[3]; /* for alignment */ +} service; + + +/* This is a default service used to prime a services structure */ +static service sDefault = +{ + True, /* valid */ + NULL, /* szService */ + NULL, /* szPath */ + NULL, /* szUsername */ + NULL, /* szGuestAccount */ + NULL, /* szInvalidUsers */ + NULL, /* szValidUsers */ + NULL, /* szAdminUsers */ + NULL, /* szCopy */ + NULL, /* szInclude */ + NULL, /* szPreExec */ + NULL, /* szPostExec */ + NULL, /* szRootPreExec */ + NULL, /* szRootPostExec */ + NULL, /* szPrintcommand */ + NULL, /* szLpqcommand */ + NULL, /* szLprmcommand */ + NULL, /* szLppausecommand */ + NULL, /* szLpresumecommand */ + NULL, /* szPrintername */ + NULL, /* szDontdescend */ + NULL, /* szHostsallow */ + NULL, /* szHostsdeny */ + NULL, /* szMagicScript */ + NULL, /* szMagicOutput */ + NULL, /* szMangledMap */ + NULL, /* comment */ + NULL, /* force user */ + NULL, /* force group */ + NULL, /* readlist */ + NULL, /* writelist */ + NULL, /* volume */ + 0, /* iMinPrintSpace */ + 0755, /* iCreate_mode */ + 0, /* iMaxConnections */ + CASE_LOWER, /* iDefaultCase */ + False, /* bAlternatePerm */ + False, /* revalidate */ + False, /* case sensitive */ + False, /* case preserve */ + False, /* short case preserve */ + False, /* case mangle */ + True, /* status */ + True, /* bHideDotFiles */ + True, /* bBrowseable */ + True, /* bAvailable */ + True, /* bRead_only */ + True, /* bNo_set_dir */ + False, /* bGuest_only */ + False, /* bGuest_ok */ + False, /* bPrint_ok */ + False, /* bPostscript */ + False, /* bMap_system */ + False, /* bMap_hidden */ + True, /* bMap_archive */ + True, /* bLocking */ + False, /* bStrictLocking */ + True, /* bShareModes */ + False, /* bOnlyUser */ + True, /* bMangledNames */ + True, /* bWidelinks */ + False, /* bSyncAlways */ + '~', /* magic char */ + NULL, /* copymap */ + "" /* dummy */ +}; + + + +/* local variables */ +static service **ServicePtrs = NULL; +static int iNumServices = 0; +static int iServiceIndex = 0; +static BOOL bInGlobalSection = True; +static BOOL bGlobalOnly = False; + + +#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) + +/* prototypes for the special type handlers */ +static BOOL handle_valid_chars(char *pszParmValue, char **ptr); +static BOOL handle_include(char *pszParmValue, char **ptr); +static BOOL handle_copy(char *pszParmValue, char **ptr); +static BOOL handle_protocol(char *pszParmValue,int *val); +static BOOL handle_security(char *pszParmValue,int *val); +static BOOL handle_case(char *pszParmValue,int *val); +static BOOL handle_printing(char *pszParmValue,int *val); +static BOOL handle_character_set(char *pszParmValue,int *val); +#ifdef KANJI +static BOOL handle_coding_system(char *pszParmValue,int *val); +#endif /* KANJI */ + +struct parm_struct +{ + char *label; + parm_type type; + parm_class class; + void *ptr; + BOOL (*special)(); +} parm_table[] = +{ + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL}, + {"protocol", P_INTEGER, P_GLOBAL, &Globals.maxprotocol,handle_protocol}, + {"security", P_INTEGER, P_GLOBAL, &Globals.security,handle_security}, + {"printing", P_INTEGER, P_GLOBAL, &Globals.printing,handle_printing}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL}, + {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, + {"smbrun", P_GSTRING, P_GLOBAL, smbrun_path, NULL}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, + {"workgroup", P_STRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, + {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, + {"read size", P_INTEGER, P_GLOBAL, &ReadSize, NULL}, +#ifdef KANJI + {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, +#endif /* KANJI */ + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, + {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, + + {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, + {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy}, + {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include}, + {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL}, + {"default case", P_INTEGER, P_LOCAL, &sDefault.iDefaultCase, handle_case}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, + + {NULL, P_BOOL, P_NONE, NULL, NULL} +}; + + + +/*************************************************************************** +Initialise the global parameter structure. +***************************************************************************/ +static void init_globals(void) +{ + static BOOL done_init = False; + pstring s; + + if (!done_init) + { + int i; + bzero((void *)&Globals,sizeof(Globals)); + + for (i = 0; parm_table[i].label; i++) + if (parm_table[i].type == P_STRING && + parm_table[i].ptr) + string_init(parm_table[i].ptr,""); + + string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); + + done_init = True; + } + + + DEBUG(3,("Initialising global parameters\n")); + +#ifdef SMB_PASSWD_FILE + string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); +#endif + string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); + string_set(&Globals.szWorkGroup, WORKGROUP); +#ifdef SMB_PASSWD + string_set(&Globals.szPasswdProgram, SMB_PASSWD); +#else + string_set(&Globals.szPasswdProgram, "/bin/passwd"); +#endif + string_set(&Globals.szPrintcapname, PRINTCAP_NAME); + string_set(&Globals.szLockDir, LOCKDIR); + string_set(&Globals.szRootdir, "/"); + sprintf(s,"Samba %s",VERSION); + string_set(&Globals.szServerString,s); + Globals.bLoadPrinters = True; + Globals.bUseRhosts = False; + Globals.max_packet = 65535; + Globals.mangled_stack = 50; + Globals.max_xmit = Globals.max_packet; + Globals.max_mux = 2; + Globals.lpqcachetime = 10; + Globals.pwordlevel = 0; + Globals.deadtime = 0; + Globals.max_log_size = 5000; + Globals.maxprotocol = PROTOCOL_NT1; + Globals.security = SEC_SHARE; + Globals.bEncryptPasswords = False; + Globals.printing = DEFAULT_PRINTING; + Globals.bReadRaw = True; + Globals.bWriteRaw = True; + Globals.bReadPrediction = False; + Globals.bReadbmpx = True; + Globals.bNullPasswords = False; + Globals.bStripDot = False; + Globals.syslog = 1; + Globals.bSyslogOnly = False; + Globals.os_level = 0; + Globals.max_ttl = 60*60*4; /* 2 hours default */ + Globals.bPreferredMaster = True; + Globals.bDomainMaster = False; + Globals.bDomainLogons = False; + Globals.bBrowseList = True; + +#ifdef KANJI + coding_system = interpret_coding_system (KANJI, SJIS_CODE); +#endif /* KANJI */ + +} + +/*************************************************************************** +check if a string is initialised and if not then initialise it +***************************************************************************/ +static void string_initial(char **s,char *v) +{ + if (!*s || !**s) + string_init(s,v); +} + + +/*************************************************************************** +Initialise the sDefault parameter structure. +***************************************************************************/ +static void init_locals(void) +{ + /* choose defaults depending on the type of printing */ + switch (Globals.printing) + { + case PRINT_BSD: + case PRINT_AIX: + string_initial(&sDefault.szLpqcommand,"lpq -P%p"); + string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); + break; + + case PRINT_SYSV: + case PRINT_HPUX: + string_initial(&sDefault.szLpqcommand,"lpstat -o%p"); + string_initial(&sDefault.szLprmcommand,"cancel %p-%j"); + string_initial(&sDefault.szPrintcommand,"lp -c -d%p %s; rm %s"); +#ifdef SVR4 + string_initial(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); + string_initial(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); +#endif + break; + + case PRINT_QNX: + string_initial(&sDefault.szLpqcommand,"lpq -P%p"); + string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_initial(&sDefault.szPrintcommand,"lp -r -P%p %s"); + break; + + + } +} + + +/******************************************************************* +a convenience rooutine to grab string parameters into a rotating +static buffer, and run standard_sub_basic on them. The buffers +can be written to by callers +********************************************************************/ +char *lp_string(char *s) +{ + static pstring bufs[10]; + static int next=0; + char *ret; + + ret = &bufs[next][0]; + next = (next+1)%10; + + if (!s) + *ret = 0; + else + StrnCpy(ret,s,sizeof(pstring)-1); + + standard_sub_basic(ret); + return(ret); +} + + +/* + In this section all the functions that are used to access the + parameters from the rest of the program are defined +*/ + +#define FN_GLOBAL_STRING(fn_name,ptr) \ + char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));} +#define FN_GLOBAL_BOOL(fn_name,ptr) \ + BOOL fn_name(void) {return(*(BOOL *)(ptr));} +#define FN_GLOBAL_CHAR(fn_name,ptr) \ + char fn_name(void) {return(*(char *)(ptr));} +#define FN_GLOBAL_INTEGER(fn_name,ptr) \ + int fn_name(void) {return(*(int *)(ptr));} + +#define FN_LOCAL_STRING(fn_name,val) \ + char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i)&&pSERVICE(i)->val)?pSERVICE(i)->val : sDefault.val));} +#define FN_LOCAL_BOOL(fn_name,val) \ + BOOL fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} +#define FN_LOCAL_CHAR(fn_name,val) \ + char fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} +#define FN_LOCAL_INTEGER(fn_name,val) \ + int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} + +FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) +FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) +FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) +FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) +FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) +FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) +FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) +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_hosts_equiv,&Globals.szHostsEquiv) +FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) +FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) +FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) +FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) +FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) +FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) +FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) +FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) +FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) + +FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) +FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) +FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) +FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) +FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) +FN_GLOBAL_BOOL(lp_getwdcache,&use_getwd_cache) +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_writeraw,&Globals.bWriteRaw) +FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) +FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) +FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) +FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) +FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) + +FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) +FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) +FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) +FN_GLOBAL_INTEGER(lp_mangledstack,&Globals.mangled_stack) +FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) +FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) +FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) +FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) +FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) +FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) +FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) +FN_GLOBAL_INTEGER(lp_security,&Globals.security) +FN_GLOBAL_INTEGER(lp_printing,&Globals.printing) +FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) +FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) +FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) + +FN_LOCAL_STRING(lp_preexec,szPreExec) +FN_LOCAL_STRING(lp_postexec,szPostExec) +FN_LOCAL_STRING(lp_rootpreexec,szRootPreExec) +FN_LOCAL_STRING(lp_rootpostexec,szRootPostExec) +FN_LOCAL_STRING(lp_servicename,szService) +FN_LOCAL_STRING(lp_pathname,szPath) +FN_LOCAL_STRING(lp_dontdescend,szDontdescend) +FN_LOCAL_STRING(lp_username,szUsername) +FN_LOCAL_STRING(lp_guestaccount,szGuestaccount) +FN_LOCAL_STRING(lp_invalid_users,szInvalidUsers) +FN_LOCAL_STRING(lp_valid_users,szValidUsers) +FN_LOCAL_STRING(lp_admin_users,szAdminUsers) +FN_LOCAL_STRING(lp_printcommand,szPrintcommand) +FN_LOCAL_STRING(lp_lpqcommand,szLpqcommand) +FN_LOCAL_STRING(lp_lprmcommand,szLprmcommand) +FN_LOCAL_STRING(lp_lppausecommand,szLppausecommand) +FN_LOCAL_STRING(lp_lpresumecommand,szLpresumecommand) +FN_LOCAL_STRING(lp_printername,szPrintername) +FN_LOCAL_STRING(lp_hostsallow,szHostsallow) +FN_LOCAL_STRING(lp_hostsdeny,szHostsdeny) +FN_LOCAL_STRING(lp_magicscript,szMagicScript) +FN_LOCAL_STRING(lp_magicoutput,szMagicOutput) +FN_LOCAL_STRING(lp_comment,comment) +FN_LOCAL_STRING(lp_force_user,force_user) +FN_LOCAL_STRING(lp_force_group,force_group) +FN_LOCAL_STRING(lp_readlist,readlist) +FN_LOCAL_STRING(lp_writelist,writelist) +FN_LOCAL_STRING(lp_volume,volume) +FN_LOCAL_STRING(lp_mangled_map,szMangledMap) + +FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) +FN_LOCAL_BOOL(lp_revalidate,bRevalidate) +FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive) +FN_LOCAL_BOOL(lp_preservecase,bCasePreserve) +FN_LOCAL_BOOL(lp_shortpreservecase,bShortCasePreserve) +FN_LOCAL_BOOL(lp_casemangle,bCaseMangle) +FN_LOCAL_BOOL(lp_status,status) +FN_LOCAL_BOOL(lp_hide_dot_files,bHideDotFiles) +FN_LOCAL_BOOL(lp_browseable,bBrowseable) +FN_LOCAL_BOOL(lp_readonly,bRead_only) +FN_LOCAL_BOOL(lp_no_set_dir,bNo_set_dir) +FN_LOCAL_BOOL(lp_guest_ok,bGuest_ok) +FN_LOCAL_BOOL(lp_guest_only,bGuest_only) +FN_LOCAL_BOOL(lp_print_ok,bPrint_ok) +FN_LOCAL_BOOL(lp_postscript,bPostscript) +FN_LOCAL_BOOL(lp_map_hidden,bMap_hidden) +FN_LOCAL_BOOL(lp_map_archive,bMap_archive) +FN_LOCAL_BOOL(lp_locking,bLocking) +FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) +FN_LOCAL_BOOL(lp_share_modes,bShareModes) +FN_LOCAL_BOOL(lp_onlyuser,bOnlyUser) +FN_LOCAL_BOOL(lp_manglednames,bMangledNames) +FN_LOCAL_BOOL(lp_widelinks,bWidelinks) +FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) +FN_LOCAL_BOOL(lp_map_system,bMap_system) + +FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) +FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) +FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) +FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) + +FN_LOCAL_CHAR(lp_magicchar,magic_char) + + + +/* local prototypes */ +static int strwicmp( char *psz1, char *psz2 ); +static int map_parameter( char *pszParmName); +static BOOL set_boolean( BOOL *pb, char *pszParmValue ); +static int getservicebyname(char *pszServiceName, service *pserviceDest); +static void copy_service( service *pserviceDest, + service *pserviceSource, + BOOL *pcopymapDest ); +static BOOL service_ok(int iService); +static BOOL do_parameter(char *pszParmName, char *pszParmValue); +static BOOL do_section(char *pszSectionName); +static void dump_globals(void); +static void dump_a_service(service *pService); +static void init_copymap(service *pservice); + + +/*************************************************************************** +initialise a service to the defaults +***************************************************************************/ +static void init_service(service *pservice) +{ + bzero((char *)pservice,sizeof(service)); + copy_service(pservice,&sDefault,NULL); +} + + +/*************************************************************************** +free the dynamically allocated parts of a service struct +***************************************************************************/ +static void free_service(service *pservice) +{ + int i; + if (!pservice) + return; + + for (i=0;parm_table[i].label;i++) + if (parm_table[i].type == P_STRING && parm_table[i].class == P_LOCAL) + string_free((char **)(((char *)pservice) + PTR_DIFF(parm_table[i].ptr,&sDefault))); +} + +/*************************************************************************** +add a new service to the services array initialising it with the given +service +***************************************************************************/ +static int add_a_service(service *pservice, char *name) +{ + int i; + service tservice; + int num_to_alloc = iNumServices+1; + + tservice = *pservice; + + /* it might already exist */ + if (name) + { + i = getservicebyname(name,NULL); + if (i >= 0) + return(i); + } + + /* find an invalid one */ + for (i=0;ivalid) + break; + + /* if not, then create one */ + if (i == iNumServices) + { + ServicePtrs = (service **)Realloc(ServicePtrs,sizeof(service *)*num_to_alloc); + if (ServicePtrs) + pSERVICE(iNumServices) = (service *)malloc(sizeof(service)); + + if (!ServicePtrs || !pSERVICE(iNumServices)) + return(-1); + + iNumServices++; + } + else + free_service(pSERVICE(i)); + + pSERVICE(i)->valid = True; + + init_service(pSERVICE(i)); + copy_service(pSERVICE(i),&tservice,NULL); + if (name) + string_set(&iSERVICE(i).szService,name); + + return(i); +} + +/*************************************************************************** +add a new home service, with the specified home directory, defaults coming +from service ifrom +***************************************************************************/ +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) +{ + int i = add_a_service(pSERVICE(iDefaultService),pszHomename); + + if (i < 0) + return(False); + + if (!(*(iSERVICE(i).szPath)) || strequal(iSERVICE(i).szPath,lp_pathname(-1))) + string_set(&iSERVICE(i).szPath,pszHomedir); + if (!(*(iSERVICE(i).comment))) + { + pstring comment; + sprintf(comment,"Home directory of %s",pszHomename); + string_set(&iSERVICE(i).comment,comment); + } + iSERVICE(i).bAvailable = sDefault.bAvailable; + iSERVICE(i).bBrowseable = sDefault.bBrowseable; + + DEBUG(3,("adding home directory %s at %s\n", pszHomename, pszHomedir)); + + return(True); +} + +/*************************************************************************** +add a new service, based on an old one +***************************************************************************/ +int lp_add_service(char *pszService, int iDefaultService) +{ + return(add_a_service(pSERVICE(iDefaultService),pszService)); +} + + +/*************************************************************************** +add the IPC service +***************************************************************************/ +static BOOL lp_add_ipc(void) +{ + pstring comment; + int i = add_a_service(&sDefault,"IPC$"); + + if (i < 0) + return(False); + + sprintf(comment,"IPC Service (%s)",lp_serverstring()); + + string_set(&iSERVICE(i).szPath,"/tmp"); + string_set(&iSERVICE(i).szUsername,""); + string_set(&iSERVICE(i).comment,comment); + iSERVICE(i).status = False; + iSERVICE(i).iMaxConnections = 0; + iSERVICE(i).bAvailable = True; + iSERVICE(i).bRead_only = True; + iSERVICE(i).bGuest_only = False; + iSERVICE(i).bGuest_ok = True; + iSERVICE(i).bPrint_ok = False; + iSERVICE(i).bBrowseable = sDefault.bBrowseable; + + DEBUG(3,("adding IPC service\n")); + + return(True); +} + + +/*************************************************************************** +add a new printer service, with defaults coming from service iFrom +***************************************************************************/ +BOOL lp_add_printer(char *pszPrintername, int iDefaultService) +{ + char *comment = "From Printcap"; + int i = add_a_service(pSERVICE(iDefaultService),pszPrintername); + + if (i < 0) + return(False); + + /* note that we do NOT default the availability flag to True - */ + /* we take it from the default service passed. This allows all */ + /* dynamic printers to be disabled by disabling the [printers] */ + /* entry (if/when the 'available' keyword is implemented!). */ + + /* the printer name is set to the service name. */ + string_set(&iSERVICE(i).szPrintername,pszPrintername); + string_set(&iSERVICE(i).comment,comment); + iSERVICE(i).bBrowseable = sDefault.bBrowseable; + + DEBUG(3,("adding printer service %s\n",pszPrintername)); + + return(True); +} + + +/*************************************************************************** +Do a case-insensitive, whitespace-ignoring string compare. +***************************************************************************/ +static int strwicmp(char *psz1, char *psz2) +{ + /* if BOTH strings are NULL, return TRUE, if ONE is NULL return */ + /* appropriate value. */ + if (psz1 == psz2) + return (0); + else + if (psz1 == NULL) + return (-1); + else + if (psz2 == NULL) + return (1); + + /* sync the strings on first non-whitespace */ + while (1) + { + while (isspace(*psz1)) + psz1++; + while (isspace(*psz2)) + psz2++; + if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0' || *psz2 == '\0') + break; + psz1++; + psz2++; + } + return (*psz1 - *psz2); +} + +/*************************************************************************** +Map a parameter's string representation to something we can use. +Returns False if the parameter string is not recognised, else TRUE. +***************************************************************************/ +static int map_parameter(char *pszParmName) +{ + int iIndex; + + if (*pszParmName == '-') + return(-1); + + for (iIndex = 0; parm_table[iIndex].label; iIndex++) + if (strwicmp(parm_table[iIndex].label, pszParmName) == 0) + return(iIndex); + + DEBUG(0,( "Unknown parameter encountered: \"%s\"\n", pszParmName)); + return(-1); +} + + +/*************************************************************************** +Set a boolean variable from the text value stored in the passed string. +Returns True in success, False if the passed string does not correctly +represent a boolean. +***************************************************************************/ +static BOOL set_boolean(BOOL *pb, char *pszParmValue) +{ + BOOL bRetval; + + bRetval = True; + if (strwicmp(pszParmValue, "yes") == 0 || + strwicmp(pszParmValue, "true") == 0 || + strwicmp(pszParmValue, "1") == 0) + *pb = True; + else + if (strwicmp(pszParmValue, "no") == 0 || + strwicmp(pszParmValue, "False") == 0 || + strwicmp(pszParmValue, "0") == 0) + *pb = False; + else + { + DEBUG(0,( "Badly formed boolean in configuration file: \"%s\".\n", + pszParmValue)); + bRetval = False; + } + return (bRetval); +} + +/*************************************************************************** +Find a service by name. Otherwise works like get_service. +***************************************************************************/ +static int getservicebyname(char *pszServiceName, service *pserviceDest) +{ + int iService; + + for (iService = iNumServices - 1; iService >= 0; iService--) + if (VALID(iService) && + strwicmp(iSERVICE(iService).szService, pszServiceName) == 0) + { + if (pserviceDest != NULL) + copy_service(pserviceDest, pSERVICE(iService), NULL); + break; + } + + return (iService); +} + + + +/*************************************************************************** +Copy a service structure to another + +If pcopymapDest is NULL then copy all fields +***************************************************************************/ +static void copy_service(service *pserviceDest, + service *pserviceSource, + BOOL *pcopymapDest) +{ + int i; + BOOL bcopyall = (pcopymapDest == NULL); + + for (i=0;parm_table[i].label;i++) + if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && + (bcopyall || pcopymapDest[i])) + { + void *def_ptr = parm_table[i].ptr; + void *src_ptr = + ((char *)pserviceSource) + PTR_DIFF(def_ptr,&sDefault); + void *dest_ptr = + ((char *)pserviceDest) + PTR_DIFF(def_ptr,&sDefault); + + switch (parm_table[i].type) + { + case P_BOOL: + case P_BOOLREV: + *(BOOL *)dest_ptr = *(BOOL *)src_ptr; + break; + + case P_INTEGER: + case P_OCTAL: + *(int *)dest_ptr = *(int *)src_ptr; + break; + + case P_CHAR: + *(char *)dest_ptr = *(char *)src_ptr; + break; + + case P_STRING: + string_set(dest_ptr,*(char **)src_ptr); + break; + default: + break; + } + } + + if (bcopyall) + { + init_copymap(pserviceDest); + if (pserviceSource->copymap) + memcpy((void *)pserviceDest->copymap, + (void *)pserviceSource->copymap,sizeof(BOOL)*NUMPARAMETERS); + } +} + +/*************************************************************************** +Check a service for consistency. Return False if the service is in any way +incomplete or faulty, else True. +***************************************************************************/ +static BOOL service_ok(int iService) +{ + BOOL bRetval; + + bRetval = True; + if (iSERVICE(iService).szService[0] == '\0') + { + DEBUG(0,( "The following message indicates an internal error:\n")); + DEBUG(0,( "No service name in service entry.\n")); + bRetval = False; + } + + /* The [printers] entry MUST be printable. I'm all for flexibility, but */ + /* I can't see why you'd want a non-printable printer service... */ + if (strwicmp(iSERVICE(iService).szService,PRINTERS_NAME) == 0) + if (!iSERVICE(iService).bPrint_ok) + { + DEBUG(0,( "WARNING: [%s] service MUST be printable!\n", + iSERVICE(iService).szService)); + iSERVICE(iService).bPrint_ok = True; + } + + if (iSERVICE(iService).szPath[0] == '\0' && + strwicmp(iSERVICE(iService).szService,HOMES_NAME) != 0) + { + DEBUG(0,("No path in service %s - using /tmp\n",iSERVICE(iService).szService)); + string_set(&iSERVICE(iService).szPath,"/tmp"); + } + + /* If a service is flagged unavailable, log the fact at level 0. */ + if (!iSERVICE(iService).bAvailable) + DEBUG(1,( "NOTE: Service %s is flagged unavailable.\n", + iSERVICE(iService).szService)); + + return (bRetval); +} + +static struct file_lists { + struct file_lists *next; + char *name; + time_t modtime; +} *file_lists = NULL; + +/******************************************************************* +keep a linked list of all config files so we know when one has changed +it's date and needs to be reloaded +********************************************************************/ +static void add_to_file_list(char *fname) +{ + struct file_lists *f=file_lists; + + while (f) { + if (f->name && !strcmp(f->name,fname)) break; + f = f->next; + } + + if (!f) { + f = (struct file_lists *)malloc(sizeof(file_lists[0])); + if (!f) return; + f->next = file_lists; + f->name = strdup(fname); + if (!f->name) { + free(f); + return; + } + file_lists = f; + } + + { + pstring n2; + strcpy(n2,fname); + standard_sub_basic(n2); + f->modtime = file_modtime(n2); + } + +} + +/******************************************************************* +check if a config file has changed date +********************************************************************/ +BOOL lp_file_list_changed(void) +{ + struct file_lists *f = file_lists; + while (f) { + pstring n2; + strcpy(n2,f->name); + standard_sub_basic(n2); + if (f->modtime != file_modtime(n2)) return(True); + f = f->next; + } + return(False); +} + +#ifdef KANJI +/*************************************************************************** + handle the interpretation of the coding system parameter + *************************************************************************/ +static BOOL handle_coding_system(char *pszParmValue,int *val) +{ + *val = interpret_coding_system(pszParmValue,*val); + return(True); +} +#endif /* KANJI */ + +/*************************************************************************** +handle the interpretation of the character set system parameter +***************************************************************************/ +static BOOL handle_character_set(char *pszParmValue,int *val) +{ + string_set(&Globals.szCharacterSet,pszParmValue); + *val = interpret_character_set(pszParmValue,*val); + return(True); +} + + +/*************************************************************************** +handle the interpretation of the protocol parameter +***************************************************************************/ +static BOOL handle_protocol(char *pszParmValue,int *val) +{ + *val = interpret_protocol(pszParmValue,*val); + return(True); +} + +/*************************************************************************** +handle the interpretation of the security parameter +***************************************************************************/ +static BOOL handle_security(char *pszParmValue,int *val) +{ + *val = interpret_security(pszParmValue,*val); + return(True); +} + +/*************************************************************************** +handle the interpretation of the default case +***************************************************************************/ +static BOOL handle_case(char *pszParmValue,int *val) +{ + if (strequal(pszParmValue,"LOWER")) + *val = CASE_LOWER; + else if (strequal(pszParmValue,"UPPER")) + *val = CASE_UPPER; + return(True); +} + +/*************************************************************************** +handle the interpretation of the printing system +***************************************************************************/ +static BOOL handle_printing(char *pszParmValue,int *val) +{ + if (strequal(pszParmValue,"sysv")) + *val = PRINT_SYSV; + else if (strequal(pszParmValue,"aix")) + *val = PRINT_AIX; + else if (strequal(pszParmValue,"hpux")) + *val = PRINT_HPUX; + else if (strequal(pszParmValue,"bsd")) + *val = PRINT_BSD; + else if (strequal(pszParmValue,"qnx")) + *val = PRINT_QNX; + return(True); +} + +/*************************************************************************** +handle the valid chars lines +***************************************************************************/ +static BOOL handle_valid_chars(char *pszParmValue,char **ptr) +{ + string_set(ptr,pszParmValue); + + add_char_string(pszParmValue); + return(True); +} + + +/*************************************************************************** +handle the include operation +***************************************************************************/ +static BOOL handle_include(char *pszParmValue,char **ptr) +{ + pstring fname; + strcpy(fname,pszParmValue); + + add_to_file_list(fname); + + standard_sub_basic(fname); + + string_set(ptr,fname); + + if (file_exist(fname,NULL)) + return(pm_process(fname, do_section, do_parameter)); + + DEBUG(2,("Can't find include file %s\n",fname)); + + return(False); +} + + +/*************************************************************************** +handle the interpretation of the copy parameter +***************************************************************************/ +static BOOL handle_copy(char *pszParmValue,char **ptr) +{ + BOOL bRetval; + int iTemp; + service serviceTemp; + + string_set(ptr,pszParmValue); + + init_service(&serviceTemp); + + bRetval = False; + + DEBUG(3,("Copying service from service %s\n",pszParmValue)); + + if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) + { + if (iTemp == iServiceIndex) + { + DEBUG(0,("Can't copy service %s - unable to copy self!\n", + pszParmValue)); + } + else + { + copy_service(pSERVICE(iServiceIndex), + &serviceTemp, + iSERVICE(iServiceIndex).copymap); + bRetval = True; + } + } + else + { + DEBUG(0,( "Unable to copy service - source not found: %s\n", + pszParmValue)); + bRetval = False; + } + + free_service(&serviceTemp); + return (bRetval); +} + + +/*************************************************************************** +initialise a copymap +***************************************************************************/ +static void init_copymap(service *pservice) +{ + int i; + if (pservice->copymap) free(pservice->copymap); + pservice->copymap = (BOOL *)malloc(sizeof(BOOL)*NUMPARAMETERS); + if (!pservice->copymap) + DEBUG(0,("Couldn't allocate copymap!! (size %d)\n",NUMPARAMETERS)); + + for (i=0;icopymap[i] = True; +} + + +/*************************************************************************** +Process a parameter. +***************************************************************************/ +static BOOL do_parameter(char *pszParmName, char *pszParmValue) +{ + int parmnum; + void *parm_ptr=NULL; /* where we are going to store the result */ + void *def_ptr=NULL; + + if (!bInGlobalSection && bGlobalOnly) return(True); + + DEBUG(3,("doing parameter %s = %s\n",pszParmName,pszParmValue)); + + parmnum = map_parameter(pszParmName); + + if (parmnum < 0) + { + DEBUG(0,( "Ignoring unknown parameter \"%s\"\n", pszParmName)); + return(True); + } + + def_ptr = parm_table[parmnum].ptr; + + /* we might point at a service, the default service or a global */ + if (bInGlobalSection) + parm_ptr = def_ptr; + else + { + if (parm_table[parmnum].class == P_GLOBAL) + { + DEBUG(0,( "Global parameter %s found in service section!\n",pszParmName)); + return(True); + } + parm_ptr = ((char *)pSERVICE(iServiceIndex)) + PTR_DIFF(def_ptr,&sDefault); + } + + if (!bInGlobalSection) + { + int i; + if (!iSERVICE(iServiceIndex).copymap) + init_copymap(pSERVICE(iServiceIndex)); + + /* this handles the aliases - set the copymap for other entries with + the same data pointer */ + for (i=0;parm_table[i].label;i++) + if (parm_table[i].ptr == parm_table[parmnum].ptr) + iSERVICE(iServiceIndex).copymap[i] = False; + } + + /* if it is a special case then go ahead */ + if (parm_table[parmnum].special) + { + parm_table[parmnum].special(pszParmValue,parm_ptr); + return(True); + } + + /* now switch on the type of variable it is */ + switch (parm_table[parmnum].type) + { + case P_BOOL: + set_boolean(parm_ptr,pszParmValue); + break; + + case P_BOOLREV: + set_boolean(parm_ptr,pszParmValue); + *(BOOL *)parm_ptr = ! *(BOOL *)parm_ptr; + break; + + case P_INTEGER: + *(int *)parm_ptr = atoi(pszParmValue); + break; + + case P_CHAR: + *(char *)parm_ptr = *pszParmValue; + break; + + case P_OCTAL: + sscanf(pszParmValue,"%o",(int *)parm_ptr); + break; + + case P_STRING: + string_set(parm_ptr,pszParmValue); + break; + + case P_GSTRING: + strcpy((char *)parm_ptr,pszParmValue); + break; + } + + return(True); +} + +/*************************************************************************** +print a parameter of the specified type +***************************************************************************/ +static void print_parameter(parm_type type,void *ptr) +{ + switch (type) + { + case P_BOOL: + printf("%s",BOOLSTR(*(BOOL *)ptr)); + break; + + case P_BOOLREV: + printf("%s",BOOLSTR(! *(BOOL *)ptr)); + break; + + case P_INTEGER: + printf("%d",*(int *)ptr); + break; + + case P_CHAR: + printf("%c",*(char *)ptr); + break; + + case P_OCTAL: + printf("0%o",*(int *)ptr); + break; + + case P_GSTRING: + if ((char *)ptr) + printf("%s",(char *)ptr); + break; + + case P_STRING: + if (*(char **)ptr) + printf("%s",*(char **)ptr); + break; + } +} + + +/*************************************************************************** +check if two parameters are equal +***************************************************************************/ +static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) +{ + switch (type) + { + case P_BOOL: + case P_BOOLREV: + return(*((BOOL *)ptr1) == *((BOOL *)ptr2)); + + case P_INTEGER: + case P_OCTAL: + return(*((int *)ptr1) == *((int *)ptr2)); + + case P_CHAR: + return(*((char *)ptr1) == *((char *)ptr2)); + + case P_GSTRING: + { + char *p1 = (char *)ptr1, *p2 = (char *)ptr2; + if (p1 && !*p1) p1 = NULL; + if (p2 && !*p2) p2 = NULL; + return(p1==p2 || strequal(p1,p2)); + } + case P_STRING: + { + char *p1 = *(char **)ptr1, *p2 = *(char **)ptr2; + if (p1 && !*p1) p1 = NULL; + if (p2 && !*p2) p2 = NULL; + return(p1==p2 || strequal(p1,p2)); + } + } + return(False); +} + +/*************************************************************************** +Process a new section (service). At this stage all sections are services. +Later we'll have special sections that permit server parameters to be set. +Returns True on success, False on failure. +***************************************************************************/ +static BOOL do_section(char *pszSectionName) +{ + BOOL bRetval; + BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || + (strwicmp(pszSectionName, GLOBAL_NAME2) == 0)); + bRetval = False; + + /* if we were in a global section then do the local inits */ + if (bInGlobalSection && !isglobal) + init_locals(); + + /* if we've just struck a global section, note the fact. */ + bInGlobalSection = isglobal; + + /* check for multiple global sections */ + if (bInGlobalSection) + { + DEBUG(3,( "Processing section \"[%s]\"\n", pszSectionName)); + return(True); + } + + if (!bInGlobalSection && bGlobalOnly) return(True); + + /* if we have a current service, tidy it up before moving on */ + bRetval = True; + + if (iServiceIndex >= 0) + bRetval = service_ok(iServiceIndex); + + /* if all is still well, move to the next record in the services array */ + if (bRetval) + { + /* We put this here to avoid an odd message order if messages are */ + /* issued by the post-processing of a previous section. */ + DEBUG(2,( "Processing section \"[%s]\"\n", pszSectionName)); + + if ((iServiceIndex=add_a_service(&sDefault,pszSectionName)) < 0) + { + DEBUG(0,("Failed to add a new service\n")); + return(False); + } + } + + return (bRetval); +} + +/*************************************************************************** +Display the contents of the global structure. +***************************************************************************/ +static void dump_globals(void) +{ + int i; + printf("Global parameters:\n"); + + for (i=0;parm_table[i].label;i++) + if (parm_table[i].class == P_GLOBAL && + parm_table[i].ptr && + (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) + { + printf("\t%s: ",parm_table[i].label); + print_parameter(parm_table[i].type,parm_table[i].ptr); + printf("\n"); + } +} + +/*************************************************************************** +Display the contents of a single services record. +***************************************************************************/ +static void dump_a_service(service *pService) +{ + int i; + if (pService == &sDefault) + printf("\nDefault service parameters:\n"); + else + printf("\nService parameters [%s]:\n",pService->szService); + + 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))) + { + int pdiff = PTR_DIFF(parm_table[i].ptr,&sDefault); + + if (pService == &sDefault || !equal_parameter(parm_table[i].type, + ((char *)pService) + pdiff, + ((char *)&sDefault) + pdiff)) + { + printf("\t%s: ",parm_table[i].label); + print_parameter(parm_table[i].type, + ((char *)pService) + pdiff); + printf("\n"); + } + } +} + +#if 0 +/*************************************************************************** +Display the contents of a single copy structure. +***************************************************************************/ +static void dump_copy_map(BOOL *pcopymap) +{ + int i; + if (!pcopymap) return; + + printf("\n\tNon-Copied parameters:\n"); + + for (i=0;parm_table[i].label;i++) + if (parm_table[i].class == P_LOCAL && + parm_table[i].ptr && !pcopymap[i] && + (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) + { + printf("\t\t%s\n",parm_table[i].label); + } +} +#endif + +/*************************************************************************** +Return TRUE if the passed service number is within range. +***************************************************************************/ +BOOL lp_snum_ok(int iService) +{ + return (LP_SNUM_OK(iService) && iSERVICE(iService).bAvailable); +} + + +/*************************************************************************** +auto-load some homes and printer services +***************************************************************************/ +static void lp_add_auto_services(char *str) +{ + char *s; + char *p; + int homes = lp_servicenumber(HOMES_NAME); + int printers = lp_servicenumber(PRINTERS_NAME); + + if (!str) + return; + + s = strdup(str); + if (!s) return; + + for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) + { + char *home = get_home_dir(p); + + if (lp_servicenumber(p) >= 0) continue; + + if (home && homes >= 0) + { + lp_add_home(p,homes,home); + continue; + } + + if (printers >= 0 && pcap_printername_ok(p,NULL)) + lp_add_printer(p,printers); + } + free(s); +} + +/*************************************************************************** +auto-load one printer +***************************************************************************/ +static void lp_add_one_printer(char *name,char *comment) +{ + int printers = lp_servicenumber(PRINTERS_NAME); + int i; + + if (lp_servicenumber(name) < 0) + { + lp_add_printer(name,printers); + if ((i=lp_servicenumber(name)) >= 0) + string_set(&iSERVICE(i).comment,comment); + } +} + + +/*************************************************************************** +auto-load printer services +***************************************************************************/ +static void lp_add_all_printers(void) +{ + int printers = lp_servicenumber(PRINTERS_NAME); + + if (printers < 0) return; + + pcap_printer_fn(lp_add_one_printer); +} + +/*************************************************************************** +have we loaded a services file yet? +***************************************************************************/ +BOOL lp_loaded(void) +{ + return(bLoaded); +} + +/*************************************************************************** +unload unused services +***************************************************************************/ +void lp_killunused(BOOL (*snumused)(int )) +{ + int i; + for (i=0;i= 0) + bRetval = service_ok(iServiceIndex); + + lp_add_auto_services(lp_auto_services()); + if (lp_load_printers()) + lp_add_all_printers(); + + lp_add_ipc(); + + bLoaded = True; + + return (bRetval); +} + + +/*************************************************************************** +return the max number of services +***************************************************************************/ +int lp_numservices(void) +{ + return(iNumServices); +} + +/*************************************************************************** +Display the contents of the services array in human-readable form. +***************************************************************************/ +void lp_dump(void) +{ + int iService; + + dump_globals(); + + dump_a_service(&sDefault); + + for (iService = 0; iService < iNumServices; iService++) + { + if (VALID(iService)) + { + if (iSERVICE(iService).szService[0] == '\0') + break; + dump_a_service(pSERVICE(iService)); + } + } +} + +/*************************************************************************** +Return the number of the service with the given name, or -1 if it doesn't +exist. Note that this is a DIFFERENT ANIMAL from the internal function +getservicebyname()! This works ONLY if all services have been loaded, and +does not copy the found service. +***************************************************************************/ +int lp_servicenumber(char *pszServiceName) +{ + int iService; + + for (iService = iNumServices - 1; iService >= 0; iService--) + if (VALID(iService) && + strwicmp(iSERVICE(iService).szService, pszServiceName) == 0) + break; + + if (iService < 0) + DEBUG(7,("lp_servicenumber: couldn't find %s\n",pszServiceName)); + + return (iService); +} + + + + +/******************************************************************* + get a workgroup - but map to standalone if '*' + ******************************************************************/ +char *my_workgroup(void) +{ + char *res = lp_workgroup(); + if (*res == '*') return("STANDALONE"); + return(res); +} + +/******************************************************************* + a useful volume label function + ******************************************************************/ +char *volume_label(int snum) +{ + char *ret = lp_volume(snum); + if (!*ret) return(lp_servicename(snum)); + return(ret); +} diff --git a/source3/param/params.c b/source3/param/params.c new file mode 100644 index 0000000000..b9d61382a1 --- /dev/null +++ b/source3/param/params.c @@ -0,0 +1,335 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + Parameter loading utlities + Copyright (C) Karl Auer 1993,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. +*/ + +/************************************************************************** +PARAMS.C + +Copyright (C) 1990, 1991, 1992, 1993, 1994 Karl Auer + +This module provides for streamlines retrieval of information from a +Windows-like parameter files. There is a function which will search for +all sections in the file and call a specified function with each. There is +a similar function which will call a specified function for all parameters +in a section. The idea is that you pass the addresses of suitable functions +to a single function in this module which will then enumerate all sections, +and within each section all parameters, to your program. + +Parameter files contain text lines (newline delimited) which consist of +either a section name in square brackets or a parameter name, delimited +from the parameter value by an equals sign. Blank lines or lines where the +first non-whitespace character is a colon are ignored. All whitespace in +section names and parameter names is compressed to single spaces. Leading +and trailing whitespace on parameter names and parameter values is stripped. + +Only the first equals sign in a parameter line is significant - parameter +values may contain equals signs, square brackets and semicolons. Internal +whitespace is retained in parameter values. Parameter names may not start +with a square bracket, an equals sign or a semicolon, for obvious reasons. + +A sample parameter file might look like this: + +[things] +this=1 +that=2 +[other things] +the other = 3 + +**************************************************************************/ + +#include "includes.h" + +#include "smb.h" +#include "params.h" + +/* local variable pointing to passed filename */ +static char *pszParmFile = NULL; +extern int DEBUGLEVEL; + +/* local prototypes */ +static BOOL enumerate_parameters(FILE *infile, PM_PARMFUNC pfunc); +static BOOL enumerate_sections(FILE *infile, + PM_SECFUNC sfunc, PM_PARMFUNC pfunc); + +/* prototypes for local toolbox functions */ +static void trimleft(char *psz); +static void trimright(char *psz); +static void collapse_spaces(char *psz); +static int firstnonwhite(char *psz); + +/************************************************************************** +Identifies all parameters in the current section, calls the parameter +function for each. Ignores comment lines, stops and backs up in file when +a section is encountered. Returns True on success, False on error. +**************************************************************************/ +static BOOL enumerate_parameters(FILE *fileIn, PM_PARMFUNC pfunc) +{ + pstring szBuf; + char *pszTemp; + BOOL bRetval; + long lFileOffset; + int cTemp; + BOOL bParmFound; + + bRetval = False; + bParmFound = False; + while (True) + { + /* first remember where we are */ + if ((lFileOffset = ftell(fileIn)) >= 0L) + { + /* then get and check a line */ + if (fgets_slash(szBuf, sizeof(szBuf)-1, fileIn) == NULL) + { + /* stop - return OK unless file error */ + bRetval = !ferror(fileIn); + if (!bRetval) + DEBUG(0,( "Read error on configuration file (enumerating parameters)!\n")); + break; + } + else + /* if first non-white is a '[', stop (new section) */ + if ((cTemp = firstnonwhite(szBuf)) == '[') + { + /* restore position to start of new section */ + if (fseek(fileIn, lFileOffset, SEEK_SET) < 0L) + { + DEBUG(0,( "Seek error on configuration file!\n")); + break; + } + + /* return success */ + bRetval = True; + break; + } + else + /* if it's a semicolon or line is blank, ignore the line */ + if (!cTemp || strchr(";#",cTemp)) + { + continue; + } + else + /* if no equals sign and line contains non-whitespace */ + /* then line is badly formed */ + if ((pszTemp = strchr(szBuf, '=')) == NULL) + { + DEBUG(0,( "Ignoring badly formed line: %s", szBuf)); + } + else + { + /* Note that we have found a parameter */ + bParmFound = True; + /* cut line at the equals sign */ + *pszTemp++ = '\0'; + /* trim leading and trailing space from both halves */ + trimright(szBuf); + trimleft(szBuf); + trimright(pszTemp); + trimleft(pszTemp); + /* process the parameter iff passed pointer not NULL */ + if (pfunc != NULL) + if (!pfunc(szBuf, pszTemp)) + break; + } + } + } + return (bRetval); +} + + +/*********************************************************************** +Close up s by n chars, at offset start. +***********************************************************************/ +static void closestr(char *s, int start, int n) +{ + char *src; + char *dest; + int len; + + if (n > 0) + if ((src = dest = s) != NULL) + { + len = strlen(s); + if (start >= 0 && start < len - n) + { + src += start + n; + dest += start; + + while (*src) + *dest++ = *src++; + *dest = '\0'; + } + } +} + +/************************************************************************** +Identifies all sections in the parameter file, calls passed section_func() +for each, passing the section name, then calls enumerate_parameters(). +Returns True on success, False on failure. Note that the section and +parameter names will have all internal whitespace areas collapsed to a +single space for processing. +**************************************************************************/ +static BOOL enumerate_sections(FILE *fileIn, + PM_SECFUNC sfunc, PM_PARMFUNC pfunc) +{ + pstring szBuf; + BOOL bRetval; + BOOL bSectionFound; + + /* this makes sure we get include lines right */ + enumerate_parameters(fileIn, pfunc); + + bRetval = False; + bSectionFound = False; + while (True) + { + if (fgets_slash(szBuf, sizeof(szBuf)-1, fileIn) == NULL) + { + /* stop - return OK unless file error */ + bRetval = !ferror(fileIn); + if (!bRetval) + DEBUG(0,( "Read error on configuration file (enumerating sections)!\n")); + break; + } + else + { + trimleft(szBuf); + trimright(szBuf); + if (szBuf[0] == '[') + { + closestr(szBuf, 0, 1); + if (strlen(szBuf) > 1) + if (szBuf[strlen(szBuf) - 1] == ']') + { + /* found a section - note the fact */ + bSectionFound = True; + /* remove trailing metabracket */ + szBuf[strlen(szBuf) - 1] = '\0'; + /* remove leading and trailing whitespace from name */ + trimleft(szBuf); + trimright(szBuf); + /* reduce all internal whitespace to one space */ + collapse_spaces(szBuf); + /* process it - stop if the processing fails */ + if (sfunc != NULL) + if (!sfunc(szBuf)) + break; + if (!enumerate_parameters(fileIn, pfunc)) + break; + } + } + } + } + + return (bRetval); +} + +/************************************************************************** +Process the passed parameter file. + +Returns True if successful, else False. +**************************************************************************/ +BOOL pm_process(char *pszFileName, PM_SECFUNC sfunc, PM_PARMFUNC pfunc) +{ + FILE *fileIn; + BOOL bRetval; + + bRetval = False; + + /* record the filename for use in error messages one day... */ + pszParmFile = pszFileName; + + if (pszParmFile == NULL || strlen(pszParmFile) < 1) + DEBUG(0,( "No configuration filename specified!\n")); + else + if ((fileIn = fopen(pszParmFile, "r")) == NULL) + DEBUG(0,( "Unable to open configuration file \"%s\"!\n", pszParmFile)); + else + { + DEBUG(2,( "Processing configuration file \"%s\"\n", pszParmFile)); + bRetval = enumerate_sections(fileIn, sfunc, pfunc); + fclose(fileIn); + } + + if (!bRetval) + DEBUG(0,("pm_process retuned false\n")); + return (bRetval); +} + + +/************************************************************************** +Strip all leading whitespace from a string. +**************************************************************************/ +static void trimleft(char *psz) +{ + char *pszDest; + + pszDest = psz; + if (psz != NULL) + { + while (*psz != '\0' && isspace(*psz)) + psz++; + while (*psz != '\0') + *pszDest++ = *psz++; + *pszDest = '\0'; + } +} + +/************************************************************************** +Strip all trailing whitespace from a string. +**************************************************************************/ +static void trimright(char *psz) +{ + char *pszTemp; + + if (psz != NULL && psz[0] != '\0') + { + pszTemp = psz + strlen(psz) - 1; + while (isspace(*pszTemp)) + *pszTemp-- = '\0'; + } +} + +/*********************************************************************** +Collapse each whitespace area in a string to a single space. +***********************************************************************/ +static void collapse_spaces(char *psz) +{ + while (*psz) + if (isspace(*psz)) + { + *psz++ = ' '; + trimleft(psz); + } + else + psz++; +} + +/************************************************************************** +Return the value of the first non-white character in the specified string. +The terminating NUL counts as non-white for the purposes of this function. +Note - no check for a NULL string! What would we return? +**************************************************************************/ +static int firstnonwhite(char *psz) +{ + while (isspace(*psz) && (*psz != '\0')) + psz++; + return (*psz); +} -- cgit From 58734631b4233ec08b7a262587e400792f31f185 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 May 1996 15:13:29 +0000 Subject: Lots of changes! - add faq info on NT printer handling - add "delete readonly" option to help rcs users - add stuff to man pages on new printer options - add "proxy name resolution" option - add "command string" -c option to smbclient (thanks Ken) - split time functions into time.c - rearrange the quotas stuff a bit and fix some bugs - complete rehash of the time handling code thanks to Paul Eggert - fix nmblookup output a bit - add plp print queue parsing from Bertrand Wallrich (This used to be commit 635b56f19c817527c52e9bbde31faa6a8a47777b) --- source3/param/loadparm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c61ab26781..e7b9d2d9b8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -161,6 +161,7 @@ typedef struct BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; + BOOL bProxyNameResolution; } global; static global Globals; @@ -236,6 +237,7 @@ typedef struct BOOL bSyncAlways; char magic_char; BOOL *copymap; + BOOL bDeleteReadonly; char dummy[3]; /* for alignment */ } service; @@ -307,6 +309,7 @@ static service sDefault = False, /* bSyncAlways */ '~', /* magic char */ NULL, /* copymap */ + False, /* bDeleteReadonly */ "" /* dummy */ }; @@ -413,6 +416,7 @@ struct parm_struct {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, + {"proxy name resolution",P_BOOL,P_GLOBAL,&Globals.bProxyNameResolution,NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, @@ -493,6 +497,7 @@ struct parm_struct {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL}, {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL}, {NULL, P_BOOL, P_NONE, NULL, NULL} }; @@ -568,6 +573,7 @@ static void init_globals(void) Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; + Globals.bProxyNameResolution = True; #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); @@ -595,6 +601,7 @@ static void init_locals(void) { case PRINT_BSD: case PRINT_AIX: + case PRINT_PLP: string_initial(&sDefault.szLpqcommand,"lpq -P%p"); string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); @@ -705,6 +712,7 @@ FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) +FN_GLOBAL_BOOL(lp_proxy_name_resolution,&Globals.bProxyNameResolution) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -778,6 +786,7 @@ FN_LOCAL_BOOL(lp_manglednames,bMangledNames) FN_LOCAL_BOOL(lp_widelinks,bWidelinks) FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) FN_LOCAL_BOOL(lp_map_system,bMap_system) +FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) @@ -1291,6 +1300,8 @@ static BOOL handle_printing(char *pszParmValue,int *val) *val = PRINT_BSD; else if (strequal(pszParmValue,"qnx")) *val = PRINT_QNX; + else if (strequal(pszParmValue,"plp")) + *val = PRINT_PLP; return(True); } -- cgit From 81e398963dbaed9c6661c336fe98329098576b94 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Jun 1996 15:25:30 +0000 Subject: - moved the uid handling to uid.c - added setfsuid() support (for Linux) - started adding some of Lukes changes, just the loadparm and ipc ones so far (This used to be commit 72543810ce3eb5ea7b141f957edf38b4c46b1ea4) --- source3/param/loadparm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e7b9d2d9b8..3426a4022c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -58,7 +58,6 @@ BOOL bLoaded = False; extern int DEBUGLEVEL; extern int ReadSize; extern pstring user_socket_options; -extern pstring smbrun_path; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -132,6 +131,8 @@ typedef struct char *szUsernameMap; char *szCharacterSet; char *szLogonScript; + char *szWINSserver; + char *szSmbrun; int max_log_size; int mangled_stack; int max_xmit; @@ -368,7 +369,7 @@ struct parm_struct {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, - {"smbrun", P_GSTRING, P_GLOBAL, smbrun_path, NULL}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -395,6 +396,7 @@ struct parm_struct {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -543,6 +545,7 @@ static void init_globals(void) string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); + string_set(&Globals.szSmbrun, SMBRUN); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); Globals.bLoadPrinters = True; @@ -677,6 +680,7 @@ char *lp_string(char *s) int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) +FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) @@ -696,6 +700,7 @@ FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) +FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) -- cgit From a2c1623827406667a4f2f058c24f1d971f6627f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jun 1996 06:42:03 +0000 Subject: a huge pile of changes :-) The biggest thing is the integration of Lukes new nmbd. Its still largely untested, so we will really need some feedback I've also added auto prototype generation and cleaned up a lot of minor things as a result (This used to be commit 0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c) --- source3/param/loadparm.c | 8 ++- source3/param/params.c | 136 ++++++++++++++++++++++------------------------- 2 files changed, 70 insertions(+), 74 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3426a4022c..1e488ec90d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -131,8 +131,8 @@ typedef struct char *szUsernameMap; char *szCharacterSet; char *szLogonScript; - char *szWINSserver; char *szSmbrun; + char *szWINSserver; int max_log_size; int mangled_stack; int max_xmit; @@ -148,6 +148,7 @@ typedef struct int syslog; int os_level; int max_ttl; + BOOL bWINSsupport; BOOL bPreferredMaster; BOOL bDomainMaster; BOOL bDomainLogons; @@ -396,7 +397,6 @@ struct parm_struct {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -413,6 +413,8 @@ struct parm_struct #endif /* KANJI */ {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, @@ -577,6 +579,7 @@ static void init_globals(void) Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bProxyNameResolution = True; + Globals.bWINSsupport = True; #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); @@ -702,6 +705,7 @@ FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) +FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) diff --git a/source3/param/params.c b/source3/param/params.c index b9d61382a1..d5d841dceb 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -63,23 +63,74 @@ the other = 3 static char *pszParmFile = NULL; extern int DEBUGLEVEL; -/* local prototypes */ -static BOOL enumerate_parameters(FILE *infile, PM_PARMFUNC pfunc); -static BOOL enumerate_sections(FILE *infile, - PM_SECFUNC sfunc, PM_PARMFUNC pfunc); -/* prototypes for local toolbox functions */ -static void trimleft(char *psz); -static void trimright(char *psz); -static void collapse_spaces(char *psz); -static int firstnonwhite(char *psz); +/************************************************************************** +Strip all leading whitespace from a string. +**************************************************************************/ +static void trimleft(char *psz) +{ + char *pszDest; + + pszDest = psz; + if (psz != NULL) + { + while (*psz != '\0' && isspace(*psz)) + psz++; + while (*psz != '\0') + *pszDest++ = *psz++; + *pszDest = '\0'; + } +} + +/************************************************************************** +Strip all trailing whitespace from a string. +**************************************************************************/ +static void trimright(char *psz) +{ + char *pszTemp; + + if (psz != NULL && psz[0] != '\0') + { + pszTemp = psz + strlen(psz) - 1; + while (isspace(*pszTemp)) + *pszTemp-- = '\0'; + } +} + +/*********************************************************************** +Collapse each whitespace area in a string to a single space. +***********************************************************************/ +static void collapse_spaces(char *psz) +{ + while (*psz) + if (isspace(*psz)) + { + *psz++ = ' '; + trimleft(psz); + } + else + psz++; +} + +/************************************************************************** +Return the value of the first non-white character in the specified string. +The terminating NUL counts as non-white for the purposes of this function. +Note - no check for a NULL string! What would we return? +**************************************************************************/ +static int firstnonwhite(char *psz) +{ + while (isspace(*psz) && (*psz != '\0')) + psz++; + return (*psz); +} + /************************************************************************** Identifies all parameters in the current section, calls the parameter function for each. Ignores comment lines, stops and backs up in file when a section is encountered. Returns True on success, False on error. **************************************************************************/ -static BOOL enumerate_parameters(FILE *fileIn, PM_PARMFUNC pfunc) +static BOOL enumerate_parameters(FILE *fileIn, BOOL (*pfunc)(char *,char *)) { pstring szBuf; char *pszTemp; @@ -186,8 +237,8 @@ Returns True on success, False on failure. Note that the section and parameter names will have all internal whitespace areas collapsed to a single space for processing. **************************************************************************/ -static BOOL enumerate_sections(FILE *fileIn, - PM_SECFUNC sfunc, PM_PARMFUNC pfunc) +static BOOL enumerate_sections(FILE *fileIn, + BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)) { pstring szBuf; BOOL bRetval; @@ -246,7 +297,7 @@ Process the passed parameter file. Returns True if successful, else False. **************************************************************************/ -BOOL pm_process(char *pszFileName, PM_SECFUNC sfunc, PM_PARMFUNC pfunc) +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)) { FILE *fileIn; BOOL bRetval; @@ -274,62 +325,3 @@ BOOL pm_process(char *pszFileName, PM_SECFUNC sfunc, PM_PARMFUNC pfunc) } -/************************************************************************** -Strip all leading whitespace from a string. -**************************************************************************/ -static void trimleft(char *psz) -{ - char *pszDest; - - pszDest = psz; - if (psz != NULL) - { - while (*psz != '\0' && isspace(*psz)) - psz++; - while (*psz != '\0') - *pszDest++ = *psz++; - *pszDest = '\0'; - } -} - -/************************************************************************** -Strip all trailing whitespace from a string. -**************************************************************************/ -static void trimright(char *psz) -{ - char *pszTemp; - - if (psz != NULL && psz[0] != '\0') - { - pszTemp = psz + strlen(psz) - 1; - while (isspace(*pszTemp)) - *pszTemp-- = '\0'; - } -} - -/*********************************************************************** -Collapse each whitespace area in a string to a single space. -***********************************************************************/ -static void collapse_spaces(char *psz) -{ - while (*psz) - if (isspace(*psz)) - { - *psz++ = ' '; - trimleft(psz); - } - else - psz++; -} - -/************************************************************************** -Return the value of the first non-white character in the specified string. -The terminating NUL counts as non-white for the purposes of this function. -Note - no check for a NULL string! What would we return? -**************************************************************************/ -static int firstnonwhite(char *psz) -{ - while (isspace(*psz) && (*psz != '\0')) - psz++; - return (*psz); -} -- cgit From a2641cfe00b7857056fd8fd1e020aae7ea817690 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jun 1996 15:14:47 +0000 Subject: Did more integration of Lukes code ready for the first release. I've now got WINS registration working, and refresh working. Its looking pretty good so far, but needs lots of testing. (This used to be commit 045014aa57721b9701ca379bcab055b908773184) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1e488ec90d..bbeb4801d5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -149,6 +149,7 @@ typedef struct int os_level; int max_ttl; BOOL bWINSsupport; + BOOL bWINSproxy; BOOL bPreferredMaster; BOOL bDomainMaster; BOOL bDomainLogons; @@ -163,7 +164,6 @@ typedef struct BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; - BOOL bProxyNameResolution; } global; static global Globals; @@ -414,13 +414,13 @@ struct parm_struct {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL}, {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, - {"proxy name resolution",P_BOOL,P_GLOBAL,&Globals.bProxyNameResolution,NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, @@ -578,8 +578,8 @@ static void init_globals(void) Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; - Globals.bProxyNameResolution = True; Globals.bWINSsupport = True; + Globals.bWINSproxy = False; #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); @@ -706,6 +706,7 @@ FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) +FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) @@ -721,7 +722,6 @@ FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) -FN_GLOBAL_BOOL(lp_proxy_name_resolution,&Globals.bProxyNameResolution) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From b9ae225b28f4707609e6436dad4be7ebdd7e181f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jun 1996 11:43:09 +0000 Subject: - added interface.c and removed all the references to myip, bcast_ip and Netmask, instead replacing them with calls to routines in interface.c - got rid of old MAXINT define - added code to ensure we only return one entry for each name in the ipc enum routines - added new_only option to add_netbios_entry() to prevent overwriting of important names - minor time handling fixup (This used to be commit 7ed71b73ae745da099072eee36fc2700d1d91407) --- source3/param/loadparm.c | 113 ++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 55 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bbeb4801d5..876385ab18 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -109,61 +109,62 @@ extern int coding_system; */ 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 *szDomainController; - char *szUsernameMap; - char *szCharacterSet; - char *szLogonScript; - char *szSmbrun; - char *szWINSserver; - int max_log_size; - int mangled_stack; - int max_xmit; - int max_mux; - int max_packet; - int pwordlevel; - int deadtime; - int maxprotocol; - int security; - int printing; - int maxdisksize; - int lpqcachetime; - int syslog; - int os_level; - int max_ttl; - BOOL bWINSsupport; - BOOL bWINSproxy; - BOOL bPreferredMaster; - BOOL bDomainMaster; - BOOL bDomainLogons; - BOOL bEncryptPasswords; - BOOL bStripDot; - BOOL bNullPasswords; - BOOL bLoadPrinters; - BOOL bUseRhosts; - BOOL bReadRaw; - BOOL bWriteRaw; - BOOL bReadPrediction; - BOOL bReadbmpx; - BOOL bSyslogOnly; - BOOL bBrowseList; + 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 *szDomainController; + char *szUsernameMap; + char *szCharacterSet; + char *szLogonScript; + char *szSmbrun; + char *szWINSserver; + char *szInterfaces; + int max_log_size; + int mangled_stack; + int max_xmit; + int max_mux; + int max_packet; + int pwordlevel; + int deadtime; + int maxprotocol; + int security; + int printing; + int maxdisksize; + int lpqcachetime; + int syslog; + int os_level; + int max_ttl; + BOOL bWINSsupport; + BOOL bWINSproxy; + BOOL bPreferredMaster; + BOOL bDomainMaster; + BOOL bDomainLogons; + BOOL bEncryptPasswords; + BOOL bStripDot; + BOOL bNullPasswords; + BOOL bLoadPrinters; + BOOL bUseRhosts; + BOOL bReadRaw; + BOOL bWriteRaw; + BOOL bReadPrediction; + BOOL bReadbmpx; + BOOL bSyslogOnly; + BOOL bBrowseList; } global; static global Globals; @@ -368,6 +369,7 @@ struct parm_struct {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, @@ -704,6 +706,7 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) +FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -- cgit From d160d93d8fad563400aa1e1274437df1fbd4ecbf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jun 1996 03:34:22 +0000 Subject: - added predict.c, moving the routines from util.c - added iface_count() and iface_n_ip() routines so its easy to loop over the local interface list - made readsize a normal loadparm global - check for null w in add_domain_entry() - set the deathtime to time()-1 for doamin entries with servertype==0 This allows servers that are shutting down to be removed - add the 0x1c name at startup if we are a WINS server. Previously we added it only if we were a master - loop over interfaces in add_my_domains(), so people don't have to have a lmhosts file to get lp_workgroup() on all interfaces - set add to True for find_workgroupstruct() in nmbsync, and check for null return - remove some ugly "errno = EBADF" bits. they just confused things. (This used to be commit 88b191b48836eeb7937f25b37d0bdd4a2276e5a7) --- source3/param/loadparm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 876385ab18..fcd70b4b75 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -56,7 +56,6 @@ BOOL bLoaded = False; extern int DEBUGLEVEL; -extern int ReadSize; extern pstring user_socket_options; #ifndef GLOBAL_NAME @@ -149,6 +148,7 @@ typedef struct int syslog; int os_level; int max_ttl; + int ReadSize; BOOL bWINSsupport; BOOL bWINSproxy; BOOL bPreferredMaster; @@ -409,7 +409,7 @@ struct parm_struct {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL}, {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, - {"read size", P_INTEGER, P_GLOBAL, &ReadSize, NULL}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL}, #ifdef KANJI {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, #endif /* KANJI */ @@ -582,6 +582,7 @@ static void init_globals(void) Globals.bBrowseList = True; Globals.bWINSsupport = True; Globals.bWINSproxy = False; + Globals.ReadSize = 16*1024; #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); @@ -735,6 +736,7 @@ FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) +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_security,&Globals.security) -- cgit From 7e3b4a1c0df1434eb3d02f93c736ce065f9898d8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jun 1996 04:38:24 +0000 Subject: got rid of a lot of redundent header files as we now globally generate prototypes automatically using "make proto". This is much less prone to error than the old method of manually adding prototypes (This used to be commit b551dc98f7cc194a5fc2e67a4ebae7fd67a01bbc) --- source3/param/loadparm.c | 4 ---- source3/param/params.c | 1 - 2 files changed, 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fcd70b4b75..f4aaa16e6a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -49,10 +49,6 @@ #include "includes.h" -#include "params.h" -#include "loadparm.h" -#include "pcap.h" - BOOL bLoaded = False; extern int DEBUGLEVEL; diff --git a/source3/param/params.c b/source3/param/params.c index d5d841dceb..8ff3d59d28 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -57,7 +57,6 @@ the other = 3 #include "includes.h" #include "smb.h" -#include "params.h" /* local variable pointing to passed filename */ static char *pszParmFile = NULL; -- cgit From ed2639ebe21dde49af816a96ec6ea1e40f76e768 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 29 Jun 1996 18:49:20 +0000 Subject: luke's first attempt at using cvs accidentally updated the Makefile updated the name database structure (again!). this time, there is one name database per local interface. there is also a pseudo-interface on ip 255.255.255.255. its purpose is to store WINS name entries. all the local interface name databases store SELF names only. the WINS name database stores non-special browser names. added wins.dat file: records WINS entries in ascii format. this is reloaded when nmbd restarts. added repeating code for response packets. timer is in seconds only at the moment. updated the response queue code to deal with samba registering with a WINS server a bit better (added more cases when a response isn't received). tidied up the response packet processing code and expire_response_queue() code. added cross references between response received and await-response expired code. added over-zealous code that checks all machines that register with samba as a WINS server (every 10 minutes i think): to see whether they are still alive or not (see rfc1001.txt) bug reported by terry@ren.pc.athabascau.ca: DNSFAILed names _stay_ as DNSFAIL, even though the machine may come back up and REGISTER. removed update_from_reg() function. it's not necessary, and it does too much. added code that announces on each local interface samba's ttl as zero and servertype as zero when nmbd is kill -TERMed first attempt at putting the first functionality of samba browsing back in (remote subnets should have samba appear in a workgroup specified through the lmhosts file) lots of other miscellaneous tidying up / chopping about. (This used to be commit 7e8c60cfe54060860e5ce20b1c3b8ec6aa5c54da) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f4aaa16e6a..48b9d062e8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,6 +129,7 @@ typedef struct char *szSmbrun; char *szWINSserver; char *szInterfaces; + char *szRemoteInterfaces; int max_log_size; int mangled_stack; int max_xmit; @@ -366,6 +367,7 @@ struct parm_struct {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, + {"remote interfaces",P_STRING, P_GLOBAL, &Globals.szRemoteInterfaces,NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, @@ -704,6 +706,7 @@ FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) +FN_GLOBAL_STRING(lp_remote_interfaces,&Globals.szRemoteInterfaces) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -- cgit From 234b8c602209d966c5b82148b521d9711e08c4b3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 22 Jul 1996 14:32:38 +0000 Subject: removed the remote interfaces stuff. (This used to be commit 51e5a1a546adf6ba36c7e4c3298c651cff7e15b9) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 48b9d062e8..f4aaa16e6a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,7 +129,6 @@ typedef struct char *szSmbrun; char *szWINSserver; char *szInterfaces; - char *szRemoteInterfaces; int max_log_size; int mangled_stack; int max_xmit; @@ -367,7 +366,6 @@ struct parm_struct {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, - {"remote interfaces",P_STRING, P_GLOBAL, &Globals.szRemoteInterfaces,NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, @@ -706,7 +704,6 @@ FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -FN_GLOBAL_STRING(lp_remote_interfaces,&Globals.szRemoteInterfaces) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -- cgit From 6b680bb89c05f4c67e78b927cab4231b647406d7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Jul 1996 06:14:51 +0000 Subject: minor cleanups (This used to be commit 7c8fd43b4e78f439406c3bb4478adf99ae17172f) --- source3/param/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 8ff3d59d28..8030e4ab58 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -313,7 +313,7 @@ BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,cha DEBUG(0,( "Unable to open configuration file \"%s\"!\n", pszParmFile)); else { - DEBUG(2,( "Processing configuration file \"%s\"\n", pszParmFile)); + DEBUG(3,("Processing configuration file \"%s\"\n", pszParmFile)); bRetval = enumerate_sections(fileIn, sfunc, pfunc); fclose(fileIn); } -- cgit From 396311075cc808278e6dd8469e3ac7eb7e7498c7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 13 Aug 1996 08:57:55 +0000 Subject: - sequent-ptx support from bressler@iftccu.ca.boeing.com (Rick Bressler) - machten support from Trevor Strohman (trev@figment.tenon.com) - added qinfo command to client as part of drag-and-drop printer support for win95 from David Chappell He also added the "printer driver" option - use sigblock() on more systems and use sigsetmask(0) instead of sigunblock() as its more portable. This beats a problem with zombies on heavilily loaded systems. - added internals.doc written by David Chappell into the source tree - get rid of PRINT_COMMAND options from local.h as they are no longer relevent - new kanji code from Fujita - don't set the recursion_available flag on queries in nmbd - fix a potential bug with pointer subtraction in printing.c - got rid of error_count code as the real fix (the EOF problem) is now in (This used to be commit aa6f8b04d125b5bc00f267abf72b800228aabf7d) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f4aaa16e6a..7877f2eb99 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -192,6 +192,7 @@ typedef struct char *szLppausecommand; char *szLpresumecommand; char *szPrintername; + char *szPrinterDriver; char *szDontdescend; char *szHostsallow; char *szHostsdeny; @@ -264,6 +265,7 @@ static service sDefault = NULL, /* szLppausecommand */ NULL, /* szLpresumecommand */ NULL, /* szPrintername */ + NULL, /* szPrinterDriver */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -491,6 +493,7 @@ struct parm_struct {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL}, {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, @@ -759,6 +762,7 @@ FN_LOCAL_STRING(lp_lprmcommand,szLprmcommand) FN_LOCAL_STRING(lp_lppausecommand,szLppausecommand) FN_LOCAL_STRING(lp_lpresumecommand,szLpresumecommand) FN_LOCAL_STRING(lp_printername,szPrintername) +FN_LOCAL_STRING(lp_printerdriver,szPrinterDriver) FN_LOCAL_STRING(lp_hostsallow,szHostsallow) FN_LOCAL_STRING(lp_hostsdeny,szHostsdeny) FN_LOCAL_STRING(lp_magicscript,szMagicScript) -- cgit From f63d4c830aa88d20ababe4c3543bff7becc3a506 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Aug 1996 13:03:26 +0000 Subject: - added the "remote announce" option - made the lp_string() code able to handle any length string - got rid of the obsolete lmhosts code, instead users should use "interfaces" and "remote announce". lmhosts now is just used as a IP to netbios name map - cleanup the inet_address() code (This used to be commit be2b67940302b2e63890cb865fe3948c2206ea91) --- source3/param/loadparm.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7877f2eb99..d0df198a67 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,6 +129,7 @@ typedef struct char *szSmbrun; char *szWINSserver; char *szInterfaces; + char *szRemoteAnnounce; int max_log_size; int mangled_stack; int max_xmit; @@ -397,6 +398,7 @@ struct parm_struct {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -637,24 +639,49 @@ static void init_locals(void) } -/******************************************************************* -a convenience rooutine to grab string parameters into a rotating -static buffer, and run standard_sub_basic on them. The buffers -can be written to by callers +/******************************************************************* a +convenience routine to grab string parameters into a rotating buffer, +and run standard_sub_basic on them. The buffers can be written to by +callers without affecting the source string. ********************************************************************/ char *lp_string(char *s) { - static pstring bufs[10]; - static int next=0; + static char *bufs[10]; + static int buflen[10]; + static int next = -1; char *ret; - + int i; + int len = s?strlen(s):0; + + if (next == -1) { + /* initialisation */ + for (i=0;i<10;i++) { + bufs[i] = NULL; + buflen[i] = 0; + } + next = 0; + } + + len = MAX(len+100,sizeof(pstring)); /* the +100 is for some + substitution room */ + + if (buflen[next] != len) { + buflen[next] = len; + if (bufs[next]) free(bufs[next]); + bufs[next] = (char *)malloc(len); + if (!bufs[next]) { + DEBUG(0,("out of memory in lp_string()")); + exit(1); + } + } + ret = &bufs[next][0]; next = (next+1)%10; if (!s) *ret = 0; else - StrnCpy(ret,s,sizeof(pstring)-1); + StrCpy(ret,s); standard_sub_basic(ret); return(ret); @@ -705,6 +732,7 @@ FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) +FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -- cgit From 28177ca73bdbe3f8fb17a608db3df1a39e0e37a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Aug 1996 11:37:44 +0000 Subject: - added support for Amiga-unix (based on BSD I think) - changed the order of PROGS and SPROGS in Makefile (SPROGS first) - another 64 bit cleanup (for INADDR_NONE) - added paranoia code in DirCacheAdd() to detect looping - fixed important DirCache flush bug - rewrote the NetServerEnum code after I found it could return servers from multiple workgroups at once, and this could cause browsing havoc. Now a null workgroup query is equivalent to a query for the servers primary workgroup - got rid of my_workgroup() - got rid of "workgroup = *" comment in Makefile. We no longer support a workgroup of *, users must set the workgroup explicitly - the wins.dat file was being stored in a different format to what it was being loaded in - this could cause havoc. fixed. - uppercase our netbios name and the workgroup name at startup - if accept fails in main loop when running as a daemon then continue, don't just exit! - don't use ./ on smbclient in smbtar - better code to detect if a process exists (This used to be commit ec3d53963064b50ff33e8eff47812aac82f164ba) --- source3/param/loadparm.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d0df198a67..953613fd74 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1920,19 +1920,6 @@ int lp_servicenumber(char *pszServiceName) return (iService); } - - - -/******************************************************************* - get a workgroup - but map to standalone if '*' - ******************************************************************/ -char *my_workgroup(void) -{ - char *res = lp_workgroup(); - if (*res == '*') return("STANDALONE"); - return(res); -} - /******************************************************************* a useful volume label function ******************************************************************/ -- cgit From 0c33046a0aa0461a5e932dd7b0b6e38ab9708867 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Aug 1996 11:17:29 +0000 Subject: - added "netbios name" option in smb.conf to make controlling the name that samba uses possible - added "socket address" option to allow virtual SMB servers (on systems with IP aliasing line Linux) - disabled FAST_SHARE_MODES by default in Linux as older Linux boxes can't do shared writeable mappings. We really need autoconf ... - added new option types in loadparm so a string type can be specified ot be uppercase only, this is used for the workgroup and netbios name options - auto-create the lock directory if it doesn't exist in shared mem startup - get rid of announce_backup() - change a few comments in nmbd code - rewrote the chaining code completely. Hopefully it will handle any depth chains now. - added LPRng support (This used to be commit e9eac6cd49c352349580ddb13d720cb201aecc48) --- source3/param/loadparm.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 953613fd74..87209d1bb7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -53,6 +53,7 @@ BOOL bLoaded = False; extern int DEBUGLEVEL; extern pstring user_socket_options; +extern pstring myname; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -83,7 +84,8 @@ extern pstring user_socket_options; /* these are the types of parameter we have */ typedef enum { - P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_STRING,P_GSTRING + P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, + P_STRING,P_USTRING,P_GSTRING,P_UGSTRING } parm_type; typedef enum @@ -130,6 +132,7 @@ typedef struct char *szWINSserver; char *szInterfaces; char *szRemoteAnnounce; + char *szSocketAddress; int max_log_size; int mangled_stack; int max_xmit; @@ -371,6 +374,7 @@ struct parm_struct {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, + {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, @@ -393,12 +397,13 @@ struct parm_struct {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL}, {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL}, {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, - {"workgroup", P_STRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -525,7 +530,8 @@ static void init_globals(void) bzero((void *)&Globals,sizeof(Globals)); for (i = 0; parm_table[i].label; i++) - if (parm_table[i].type == P_STRING && + if ((parm_table[i].type == P_STRING || + parm_table[i].type == P_USTRING) && parm_table[i].ptr) string_init(parm_table[i].ptr,""); @@ -551,6 +557,7 @@ static void init_globals(void) string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); string_set(&Globals.szSmbrun, SMBRUN); + string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); Globals.bLoadPrinters = True; @@ -611,6 +618,7 @@ static void init_locals(void) { case PRINT_BSD: case PRINT_AIX: + case PRINT_LPRNG: case PRINT_PLP: string_initial(&sDefault.szLpqcommand,"lpq -P%p"); string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); @@ -735,6 +743,7 @@ FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) +FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) @@ -875,7 +884,9 @@ static void free_service(service *pservice) return; for (i=0;parm_table[i].label;i++) - if (parm_table[i].type == P_STRING && parm_table[i].class == P_LOCAL) + if ((parm_table[i].type == P_STRING || + parm_table[i].type == P_STRING) && + parm_table[i].class == P_LOCAL) string_free((char **)(((char *)pservice) + PTR_DIFF(parm_table[i].ptr,&sDefault))); } @@ -1164,6 +1175,11 @@ static void copy_service(service *pserviceDest, case P_STRING: string_set(dest_ptr,*(char **)src_ptr); break; + + case P_USTRING: + string_set(dest_ptr,*(char **)src_ptr); + strupper(*(char **)dest_ptr); + break; default: break; } @@ -1344,6 +1360,8 @@ static BOOL handle_printing(char *pszParmValue,int *val) *val = PRINT_QNX; else if (strequal(pszParmValue,"plp")) *val = PRINT_PLP; + else if (strequal(pszParmValue,"lprng")) + *val = PRINT_LPRNG; return(True); } @@ -1526,9 +1544,19 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) string_set(parm_ptr,pszParmValue); break; + case P_USTRING: + string_set(parm_ptr,pszParmValue); + strupper(*(char **)parm_ptr); + break; + case P_GSTRING: strcpy((char *)parm_ptr,pszParmValue); break; + + case P_UGSTRING: + strcpy((char *)parm_ptr,pszParmValue); + strupper((char *)parm_ptr); + break; } return(True); @@ -1562,11 +1590,13 @@ static void print_parameter(parm_type type,void *ptr) break; case P_GSTRING: + case P_UGSTRING: if ((char *)ptr) printf("%s",(char *)ptr); break; case P_STRING: + case P_USTRING: if (*(char **)ptr) printf("%s",*(char **)ptr); break; @@ -1593,6 +1623,7 @@ static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) return(*((char *)ptr1) == *((char *)ptr2)); case P_GSTRING: + case P_UGSTRING: { char *p1 = (char *)ptr1, *p2 = (char *)ptr2; if (p1 && !*p1) p1 = NULL; @@ -1600,6 +1631,7 @@ static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) return(p1==p2 || strequal(p1,p2)); } case P_STRING: + case P_USTRING: { char *p1 = *(char **)ptr1, *p2 = *(char **)ptr2; if (p1 && !*p1) p1 = NULL; -- cgit From 5945be9718b8ea56c8dde99729c0ec0e56080fee Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 23 Aug 1996 10:17:30 +0000 Subject: - fixed bugs in nmb response packet checking. - added multiple workgroup code - samba can register under different (unique) NetBIOS aliases, one per workgroup it joins. lkcl (This used to be commit f24e341e7e4d8726b98d3a0f83b24f61817fe536) --- source3/param/loadparm.c | 52 +++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 87209d1bb7..2a76ce70f7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -106,33 +106,34 @@ extern int coding_system; */ typedef struct { - char *szPrintcapname; - char *szLockDir; - char *szRootdir; + char *szAutoServices; + char *szCharacterSet; + char *szConfigFile; char *szDefaultService; char *szDfree; - char *szMsgCommand; + char *szDomainController; char *szHostsEquiv; - char *szServerString; - char *szAutoServices; - char *szPasswdProgram; - char *szPasswdChat; + char *szInterfaces; + char *szLockDir; char *szLogFile; - char *szConfigFile; - char *szSMBPasswdFile; + char *szLogonScript; + char *szMsgCommand; + char *szPasswdChat; + char *szPasswdProgram; char *szPasswordServer; + char *szPrintcapname; + char *szRemoteAnnounce; + char *szRootdir; + char *szServerComment; + char *szServerString; + char *szSmbrun; + char *szSMBPasswdFile; + char *szSocketAddress; char *szSocketOptions; - char *szValidChars; - char *szWorkGroup; - char *szDomainController; char *szUsernameMap; - char *szCharacterSet; - char *szLogonScript; - char *szSmbrun; + char *szValidChars; char *szWINSserver; - char *szInterfaces; - char *szRemoteAnnounce; - char *szSocketAddress; + char *szWorkGroup; int max_log_size; int mangled_stack; int max_xmit; @@ -152,6 +153,7 @@ typedef struct BOOL bWINSsupport; BOOL bWINSproxy; BOOL bPreferredMaster; + BOOL bLocalMaster; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -382,6 +384,7 @@ struct parm_struct {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, + {"server comment", P_STRING, P_GLOBAL, &Globals.szServerComment, NULL}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, @@ -425,6 +428,7 @@ struct parm_struct {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, @@ -560,6 +564,9 @@ static void init_globals(void) string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); + strcpy(s,"Samba %v"); /* samba comment */ + string_sub(s,"%v",VERSION); + string_set(&Globals.szServerComment,s); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -584,8 +591,9 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.os_level = 0; Globals.max_ttl = 60*60*4; /* 2 hours default */ - Globals.bPreferredMaster = True; - Globals.bDomainMaster = False; + Globals.bPreferredMaster = True; /* force election on startup */ + Globals.bLocalMaster = True; /* master browser on local subnet */ + Globals.bDomainMaster = False; /* maintain wide area network browse list */ Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = True; @@ -724,6 +732,7 @@ FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) +FN_GLOBAL_STRING(lp_server_comment,&Globals.szServerComment) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) @@ -747,6 +756,7 @@ FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) +FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -- cgit From 9ad5a3fe36ac2b32bcb7a50c608ec586629f2125 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 24 Aug 1996 01:41:46 +0000 Subject: removed all of lukes recent changes. I need to do a p2 release but can't test the multi group changes. I also found that some of lukes changes wiped out some recent bug fixes. Is your CVS tree ok luke? (This used to be commit 8b7fe224bce64803d55ae279fa61ef3ebbbb0241) --- source3/param/loadparm.c | 52 +++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2a76ce70f7..87209d1bb7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -106,34 +106,33 @@ extern int coding_system; */ typedef struct { - char *szAutoServices; - char *szCharacterSet; - char *szConfigFile; + char *szPrintcapname; + char *szLockDir; + char *szRootdir; char *szDefaultService; char *szDfree; - char *szDomainController; - char *szHostsEquiv; - char *szInterfaces; - char *szLockDir; - char *szLogFile; - char *szLogonScript; char *szMsgCommand; - char *szPasswdChat; - char *szPasswdProgram; - char *szPasswordServer; - char *szPrintcapname; - char *szRemoteAnnounce; - char *szRootdir; - char *szServerComment; + char *szHostsEquiv; char *szServerString; - char *szSmbrun; + char *szAutoServices; + char *szPasswdProgram; + char *szPasswdChat; + char *szLogFile; + char *szConfigFile; char *szSMBPasswdFile; - char *szSocketAddress; + char *szPasswordServer; char *szSocketOptions; - char *szUsernameMap; char *szValidChars; - char *szWINSserver; char *szWorkGroup; + char *szDomainController; + char *szUsernameMap; + char *szCharacterSet; + char *szLogonScript; + char *szSmbrun; + char *szWINSserver; + char *szInterfaces; + char *szRemoteAnnounce; + char *szSocketAddress; int max_log_size; int mangled_stack; int max_xmit; @@ -153,7 +152,6 @@ typedef struct BOOL bWINSsupport; BOOL bWINSproxy; BOOL bPreferredMaster; - BOOL bLocalMaster; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -384,7 +382,6 @@ struct parm_struct {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, - {"server comment", P_STRING, P_GLOBAL, &Globals.szServerComment, NULL}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, @@ -428,7 +425,6 @@ struct parm_struct {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, @@ -564,9 +560,6 @@ static void init_globals(void) string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); - strcpy(s,"Samba %v"); /* samba comment */ - string_sub(s,"%v",VERSION); - string_set(&Globals.szServerComment,s); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -591,9 +584,8 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.os_level = 0; Globals.max_ttl = 60*60*4; /* 2 hours default */ - Globals.bPreferredMaster = True; /* force election on startup */ - Globals.bLocalMaster = True; /* master browser on local subnet */ - Globals.bDomainMaster = False; /* maintain wide area network browse list */ + Globals.bPreferredMaster = True; + Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = True; @@ -732,7 +724,6 @@ FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) -FN_GLOBAL_STRING(lp_server_comment,&Globals.szServerComment) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) @@ -756,7 +747,6 @@ FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -- cgit From 5a2f52b79e28530c454cb488a44588147640f061 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Oct 1996 14:09:22 +0000 Subject: - a huge pile of changes from Luke which implement the browse.conf stuff and also fix a pile of nmbd bugs. Unfortunately I found it very hard to disentangle the new features from the bug fixes so I am putting in the new code. I hope this is the last big pile of changes to the 1.9.16 series! (This used to be commit 20b6203dac4bbb43e4e7bea0b214496d76d679d9) --- source3/param/loadparm.c | 52 +++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 87209d1bb7..2a76ce70f7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -106,33 +106,34 @@ extern int coding_system; */ typedef struct { - char *szPrintcapname; - char *szLockDir; - char *szRootdir; + char *szAutoServices; + char *szCharacterSet; + char *szConfigFile; char *szDefaultService; char *szDfree; - char *szMsgCommand; + char *szDomainController; char *szHostsEquiv; - char *szServerString; - char *szAutoServices; - char *szPasswdProgram; - char *szPasswdChat; + char *szInterfaces; + char *szLockDir; char *szLogFile; - char *szConfigFile; - char *szSMBPasswdFile; + char *szLogonScript; + char *szMsgCommand; + char *szPasswdChat; + char *szPasswdProgram; char *szPasswordServer; + char *szPrintcapname; + char *szRemoteAnnounce; + char *szRootdir; + char *szServerComment; + char *szServerString; + char *szSmbrun; + char *szSMBPasswdFile; + char *szSocketAddress; char *szSocketOptions; - char *szValidChars; - char *szWorkGroup; - char *szDomainController; char *szUsernameMap; - char *szCharacterSet; - char *szLogonScript; - char *szSmbrun; + char *szValidChars; char *szWINSserver; - char *szInterfaces; - char *szRemoteAnnounce; - char *szSocketAddress; + char *szWorkGroup; int max_log_size; int mangled_stack; int max_xmit; @@ -152,6 +153,7 @@ typedef struct BOOL bWINSsupport; BOOL bWINSproxy; BOOL bPreferredMaster; + BOOL bLocalMaster; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -382,6 +384,7 @@ struct parm_struct {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, + {"server comment", P_STRING, P_GLOBAL, &Globals.szServerComment, NULL}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, @@ -425,6 +428,7 @@ struct parm_struct {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, @@ -560,6 +564,9 @@ static void init_globals(void) string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); + strcpy(s,"Samba %v"); /* samba comment */ + string_sub(s,"%v",VERSION); + string_set(&Globals.szServerComment,s); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -584,8 +591,9 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.os_level = 0; Globals.max_ttl = 60*60*4; /* 2 hours default */ - Globals.bPreferredMaster = True; - Globals.bDomainMaster = False; + Globals.bPreferredMaster = True; /* force election on startup */ + Globals.bLocalMaster = True; /* master browser on local subnet */ + Globals.bDomainMaster = False; /* maintain wide area network browse list */ Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = True; @@ -724,6 +732,7 @@ FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) +FN_GLOBAL_STRING(lp_server_comment,&Globals.szServerComment) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) @@ -747,6 +756,7 @@ FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) +FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -- cgit From afd08462ad5ff6b3c4bf621e39c55853a608175e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Oct 1996 15:41:30 +0000 Subject: backout all the changes to nmbd. The 1.9.16 tree is now back to 1.9.16p2 as far as nmbd is concerned apart from a small change that fixes the announce type in two places. (This used to be commit 45e66a69d320024877c8b13f12b21bf895e04410) --- source3/param/loadparm.c | 52 +++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2a76ce70f7..87209d1bb7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -106,34 +106,33 @@ extern int coding_system; */ typedef struct { - char *szAutoServices; - char *szCharacterSet; - char *szConfigFile; + char *szPrintcapname; + char *szLockDir; + char *szRootdir; char *szDefaultService; char *szDfree; - char *szDomainController; - char *szHostsEquiv; - char *szInterfaces; - char *szLockDir; - char *szLogFile; - char *szLogonScript; char *szMsgCommand; - char *szPasswdChat; - char *szPasswdProgram; - char *szPasswordServer; - char *szPrintcapname; - char *szRemoteAnnounce; - char *szRootdir; - char *szServerComment; + char *szHostsEquiv; char *szServerString; - char *szSmbrun; + char *szAutoServices; + char *szPasswdProgram; + char *szPasswdChat; + char *szLogFile; + char *szConfigFile; char *szSMBPasswdFile; - char *szSocketAddress; + char *szPasswordServer; char *szSocketOptions; - char *szUsernameMap; char *szValidChars; - char *szWINSserver; char *szWorkGroup; + char *szDomainController; + char *szUsernameMap; + char *szCharacterSet; + char *szLogonScript; + char *szSmbrun; + char *szWINSserver; + char *szInterfaces; + char *szRemoteAnnounce; + char *szSocketAddress; int max_log_size; int mangled_stack; int max_xmit; @@ -153,7 +152,6 @@ typedef struct BOOL bWINSsupport; BOOL bWINSproxy; BOOL bPreferredMaster; - BOOL bLocalMaster; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -384,7 +382,6 @@ struct parm_struct {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, - {"server comment", P_STRING, P_GLOBAL, &Globals.szServerComment, NULL}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, @@ -428,7 +425,6 @@ struct parm_struct {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, @@ -564,9 +560,6 @@ static void init_globals(void) string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); - strcpy(s,"Samba %v"); /* samba comment */ - string_sub(s,"%v",VERSION); - string_set(&Globals.szServerComment,s); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -591,9 +584,8 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.os_level = 0; Globals.max_ttl = 60*60*4; /* 2 hours default */ - Globals.bPreferredMaster = True; /* force election on startup */ - Globals.bLocalMaster = True; /* master browser on local subnet */ - Globals.bDomainMaster = False; /* maintain wide area network browse list */ + Globals.bPreferredMaster = True; + Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = True; @@ -732,7 +724,6 @@ FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) -FN_GLOBAL_STRING(lp_server_comment,&Globals.szServerComment) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) @@ -756,7 +747,6 @@ FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -- cgit From e5893bdfbef0ac16772199d7ec6fac7d3e4f8431 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Oct 1996 10:41:13 +0000 Subject: I have fixed quite a few important bugs in this commit. Luke, can you take special note of the bug fixes to nmbd so you can propogate them to your new code. - rewrote the code that used to use fromhost(). We now call gethostbyaddr() only if necessary and a maximum of once per connection. Calling gethostbyaddr() causes problems on some systems so avoiding it if possible is a good thing :-) - added the "fake oplocks" option. See the docs in smb.conf(5) and Speed.txt - fixed a serious bug in nmbd where it would try a DNS lookup on FIND_SELF queries. This caused a lot of unnecessary (and incorrect) DNS lookups to happen. FIND_SELF queries should only go to the internal name tables. - don't set FIND_SELF for name queries if we are a wins proxy, as we are supposed to be answering queries for other hosts. - fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of "if (search & FIND_LOCAL)". Luke, this was in nameservreply.c - the above 3 bugs together meant that DNS queries were being cached, but the cache wasn't being used, so every query was going to DNS, no wonder nmbd has been chewing so much CPU time! Another side effect was that queries on names in lmhosts weren't being answered for bcast queries with "wins proxy" set. - ignore the maxxmit for seconday session setups (see CIFS spec) - close user opened files in a uLogoffX for user level security (see CIFS spec) - added uid into the files struct to support the above change (This used to be commit ea472b7217b7693627a13a7b1e428a0a6a3d8755) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 87209d1bb7..8b2806f075 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -242,6 +242,7 @@ typedef struct char magic_char; BOOL *copymap; BOOL bDeleteReadonly; + BOOL bFakeOplocks; char dummy[3]; /* for alignment */ } service; @@ -315,6 +316,7 @@ static service sDefault = '~', /* magic char */ NULL, /* copymap */ False, /* bDeleteReadonly */ + False, /* bFakeOplocks */ "" /* dummy */ }; @@ -493,6 +495,7 @@ struct parm_struct {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL}, @@ -838,6 +841,7 @@ FN_LOCAL_BOOL(lp_widelinks,bWidelinks) FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) +FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) -- cgit From c71c1ff55f60f317039e3399f786e961dfac9e0b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Oct 1996 05:49:42 +0000 Subject: - set default printer driver string to "NULL" - fixed debug levels for name status parsing (This used to be commit f2c5f1eab1f3de7a9ae2b7ec4770a5c455dc04e4) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b2806f075..34c9f27129 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -539,6 +539,7 @@ static void init_globals(void) string_init(parm_table[i].ptr,""); string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); + string_set(&sDefault.szPrinterDriver, "NULL"); done_init = True; } -- cgit From 08d00eb68ee93eaead0f3bbaabc3d89540e0818e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 24 Oct 1996 00:09:08 +0000 Subject: - added support for TMPDIR env variable - fixed fault.c for linux 2.1 - put back in the FIND_SELF failing code - cleaned up casts in encryption (This used to be commit 3af04f1580b2569c0a4f2549bf6352c7a25afa0d) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 34c9f27129..b65aead773 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -994,7 +994,7 @@ static BOOL lp_add_ipc(void) sprintf(comment,"IPC Service (%s)",lp_serverstring()); - string_set(&iSERVICE(i).szPath,"/tmp"); + string_set(&iSERVICE(i).szPath,tmpdir()); string_set(&iSERVICE(i).szUsername,""); string_set(&iSERVICE(i).comment,comment); iSERVICE(i).status = False; @@ -1228,8 +1228,8 @@ static BOOL service_ok(int iService) if (iSERVICE(iService).szPath[0] == '\0' && strwicmp(iSERVICE(iService).szService,HOMES_NAME) != 0) { - DEBUG(0,("No path in service %s - using /tmp\n",iSERVICE(iService).szService)); - string_set(&iSERVICE(iService).szPath,"/tmp"); + DEBUG(0,("No path in service %s - using %s\n",iSERVICE(iService).szService,tmpdir())); + string_set(&iSERVICE(iService).szPath,tmpdir()); } /* If a service is flagged unavailable, log the fact at level 0. */ -- cgit From 5b6f1e347e0f018243d57a38e5a3b885810d56d7 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 10 Dec 1996 17:51:42 +0000 Subject: Added in veto files parameter created by Whistle. jra@cygnus.com (This used to be commit 09aa77766c01fc172260cca217583331f93dc2db) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b65aead773..16ef84e38a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -128,6 +128,7 @@ typedef struct char *szUsernameMap; char *szCharacterSet; char *szLogonScript; + char *szVetoFiles; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -378,6 +379,7 @@ struct parm_struct {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, + {"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -744,6 +746,7 @@ FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) +FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -- cgit From 98bf10bc5df6eb1c3b71d51cc60ef4bf25f57d97 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 2 Feb 1997 18:12:36 +0000 Subject: util.c: StrCaseCmp and StrnCaseCmp terminated incorrectly, giving false answers when a string was partially identical. this issue is still outstanding, and needs to be investigated further. loadparm.c: added lp_logon_path() parameter. ipc.c: in NetUserGetInfo, lp_logon_path() can be returned instead of always specifying \\SAMBA_SERVER\HOMES (which may not necessarily exist). it is now possible to specify lp_logon_path() as \\ARBITRARY_SERVER\%U, just like NT server can. the default is \\SAMBA_SERVER\HOMES, just like it used to be. lkcl (This used to be commit d5b6ad7cb87d6b1a9342f027ac4f57ffdb54b4f3) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 16ef84e38a..67e799a84d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -128,6 +128,7 @@ typedef struct char *szUsernameMap; char *szCharacterSet; char *szLogonScript; + char *szLogonPath; char *szVetoFiles; char *szSmbrun; char *szWINSserver; @@ -406,6 +407,7 @@ struct parm_struct {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, @@ -746,6 +748,7 @@ FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) +FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) -- cgit From df42b0a7bcdaae96035ecb1d434a66735358fd95 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 23 Feb 1997 05:18:09 +0000 Subject: Makefile: Added cleandir target. chgpasswd.c: Added patch from Roland Haag to allow password changes to be done more than once. loadparm.c: Added entries for the "directory mode/directory mask parameters". Changed default file mode to 644. proto.h: Added sys_gethostbyname. server.c: Added directory mode changes. system.c: Added sys_gethostbyname. trans2.c: Added NT_FILE_ATTRIBUTE_NORMAL patch from Roger Orr trans2.h: Defined NT_FILE_ATTRIBUTE_NORMAL for above patch. util.c: Changes calls to gethostbyname to sys_gethostbyname. jra@cygnus.com (This used to be commit d8d8a7ee00971fca7a8d079bfb547af107df35a4) --- source3/param/loadparm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 67e799a84d..672f1fe548 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -213,6 +213,7 @@ typedef struct char *volume; int iMinPrintSpace; int iCreate_mode; + int iDir_mode; int iMaxConnections; int iDefaultCase; BOOL bAlternatePerm; @@ -286,7 +287,8 @@ static service sDefault = NULL, /* writelist */ NULL, /* volume */ 0, /* iMinPrintSpace */ - 0755, /* iCreate_mode */ + 0644, /* iCreate_mode */ + 0755, /* iDir_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ False, /* bAlternatePerm */ @@ -479,6 +481,8 @@ struct parm_struct {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, @@ -851,6 +855,7 @@ FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) +FN_LOCAL_INTEGER(lp_dir_mode,iDir_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) -- cgit From 20b5dea237916902437ce3dcdb7c253fd1ad3585 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 9 Apr 1997 01:19:25 +0000 Subject: Large changes from jra@cygnus.com. Mainly browser updates. access.c: Fixed crash if yp domain unavailable. includes.h: Moved ifdefs for minor platform. interface.c: Changed name of ipgrp to wins_ip to make it clearer. loadparm.c: Changed default of wins support to 'no'. nameannounce.c: Many changes to fix cross subnet browsing. namebrowse.c: Many changes to fix cross subnet browsing. namedbname.c: Many changes to fix cross subnet browsing. namedbresp.c: Many changes to fix cross subnet browsing. namedbsubnet.c: Many changes to fix cross subnet browsing. namedbwork.c: Many changes to fix cross subnet browsing. nameelect.c: Many changes to fix cross subnet browsing. namelogon.c: Many changes to fix cross subnet browsing. namepacket.c: Many changes to fix cross subnet browsing. nameresp.c: Many changes to fix cross subnet browsing. nameserv.c: Many changes to fix cross subnet browsing. nameserv.h: Many changes to fix cross subnet browsing. nameservreply.c: Many changes to fix cross subnet browsing. nameservresp.c: Many changes to fix cross subnet browsing. namework.c: Many changes to fix cross subnet browsing. nmbd.c: Change to search wins subnet. nmbsync.c: Change to check if we are any master before proceeding. proto.h: Added find_subnet_all() and check_work_servertype(). util.c: Moved 'done' settings on name resolution. (This used to be commit a82476eee2c521e5eed092bc367da0a7cef23de1) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 672f1fe548..64dd01eeaf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -600,7 +600,7 @@ static void init_globals(void) Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; - Globals.bWINSsupport = True; + Globals.bWINSsupport = False; Globals.bWINSproxy = False; Globals.ReadSize = 16*1024; -- cgit From 121c81e3d68f1748f114a2530a9eb67f7f658fda Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 7 May 1997 17:56:46 +0000 Subject: added automount home directory support. contributed by simeon@bangor.co.uk and a mini bug-fix by rob.nacarrato@sheridanc.on.ca reads in an entry from the auto.home file for the user when they log in, and mounts their home directory as the default path for the [homes] service. i might add this as to the %substitution system, so that you can specify subdirectories for the user profiles, mainly. lkcl (This used to be commit 0bb6acc358243c49e19de9d5cc95f5124ac11b7c) --- source3/param/loadparm.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 64dd01eeaf..961aaa9c98 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -135,6 +135,7 @@ typedef struct char *szInterfaces; char *szRemoteAnnounce; char *szSocketAddress; + char *szNISHomeMapName; int max_log_size; int mangled_stack; int max_xmit; @@ -167,6 +168,8 @@ typedef struct BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; + BOOL bUnixRealname; + BOOL bNISHomeMap; } global; static global Globals; @@ -412,6 +415,7 @@ struct parm_struct {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -436,7 +440,8 @@ struct parm_struct {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, - + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy}, @@ -603,7 +608,11 @@ static void init_globals(void) Globals.bWINSsupport = False; Globals.bWINSproxy = False; Globals.ReadSize = 16*1024; - + Globals.bUnixRealname = False; +#ifdef NETGROUP + Globals.bNISHomeMap = False; + string_set(&Globals.szNISHomeMapName, "auto.home"); +#endif #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); #endif /* KANJI */ @@ -758,6 +767,7 @@ FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) +FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) @@ -776,6 +786,8 @@ FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) +FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) +FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 0f1f0ceb9519368188f695e18e2341ccfd1b2d15 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 8 May 1997 01:14:17 +0000 Subject: 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com) Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1. (This used to be commit cf23a155a1315f50d488794a2caf88402bf3e3e6) --- source3/param/loadparm.c | 2 +- source3/param/params.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 961aaa9c98..40611e4c3a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Parameter loading functions - Copyright (C) Karl Auer 1993,1994 + Copyright (C) Karl Auer 1993,1997 Largely re-written by Andrew Tridgell, September 1994 diff --git a/source3/param/params.c b/source3/param/params.c index 8030e4ab58..0fdde0348f 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Parameter loading utlities - Copyright (C) Karl Auer 1993,1994 + Copyright (C) Karl Auer 1993,1994,1997 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 -- cgit From aa864415c5183c948fe9ae221023d40265c38013 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 20 May 1997 00:32:51 +0000 Subject: dir.c: Fixed double slash issue. includes.h: Changed to ifdef FAST_SHARE_MODES. ipc.c: Changed lp_workgroup() to myworkgroup. loadparm.c: Added new shared mem parameters. Added Luke's fix. locking.c: Rewrite to do share modes better (both fast and slow modes). nameannounce.c: Changed lp_workgroup() to myworkgroup. Added Luke's fix. nameconf.c: Changed lp_workgroup() to myworkgroup. namedbname.c: Improved debug. namedbserver.c: Changed lp_workgroup() to myworkgroup. namedbsubnet.c: Added Luke's fix - rewritten somewhat. namedbwork.c: Changed lp_workgroup() to myworkgroup. nameelect.c: Added Luke's fix - rewritten somewhat. nameresp.c: Stoped shadowing global. nameserv.c: Added Luke's fix - Improved debug. nameservreply.c: Improved debug. namework.c: Changed lp_workgroup() to myworkgroup. nmbd.c: Added Luke's fix - Changed lp_workgroup() to myworkgroup. pipes.c: Changed lp_workgroup() to myworkgroup. proto.h: Added Luke's fix, added smb_shm_ proto's. reply.c: Changed lp_workgroup() to myworkgroup. server.c: Rewrite to do share modes better (both fast and slow modes). shmem.c: Rewrite to do share modes better (both fast and slow modes). smb.h: Rewrite to do share modes better (both fast and slow modes). status.c: Rewrite to do share modes better (both fast and slow modes). trans2.c: Fixed double slash issue. util.c: Tidied up, created myworkgroup. Jeremy Allison (jallison@whistle.com). (This used to be commit 2a1711eaaf08bb6776770cd3c96b3010f431a677) --- source3/param/loadparm.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 40611e4c3a..af0b05bb5d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -152,8 +152,11 @@ typedef struct int os_level; int max_ttl; int ReadSize; + int shmem_size; + int shmem_hash_size; BOOL bWINSsupport; BOOL bWINSproxy; + BOOL bLocalMaster; BOOL bPreferredMaster; BOOL bDomainMaster; BOOL bDomainLogons; @@ -427,6 +430,8 @@ struct parm_struct {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL}, {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL}, + {"shared file entries", P_INTEGER, P_GLOBAL, &Globals.shmem_hash_size, NULL}, #ifdef KANJI {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, #endif /* KANJI */ @@ -437,6 +442,7 @@ struct parm_struct {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, @@ -601,15 +607,11 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.os_level = 0; Globals.max_ttl = 60*60*4; /* 2 hours default */ - Globals.bPreferredMaster = True; - Globals.bDomainMaster = False; - Globals.bDomainLogons = False; - Globals.bBrowseList = True; - Globals.bWINSsupport = False; - Globals.bWINSproxy = False; Globals.ReadSize = 16*1024; + Globals.shmem_size = SHMEM_SIZE; + Globals.shmem_hash_size = SHMEM_HASH_SIZE; Globals.bUnixRealname = False; -#ifdef NETGROUP +#if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); #endif @@ -617,6 +619,25 @@ static void init_globals(void) coding_system = interpret_coding_system (KANJI, SJIS_CODE); #endif /* KANJI */ +/* these parameters are set to defaults that are more appropriate + for the increasing samba install base: + + as a member of the workgroup, that will possibly become a + _local_ master browser (lm = True). this is opposed to a forced + local master browser startup (pm = True). + + doesn't provide WINS server service by default (wsupp = False), + and doesn't provide domain master browser services by default, either. + +*/ + + Globals.bPreferredMaster = False; + Globals.bLocalMaster = True; + Globals.bDomainMaster = False; + Globals.bDomainLogons = False; + Globals.bBrowseList = True; + Globals.bWINSsupport = False; + Globals.bWINSproxy = False; } /*************************************************************************** @@ -771,6 +792,7 @@ FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) +FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) @@ -799,6 +821,8 @@ FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) FN_GLOBAL_INTEGER(lp_readsize,&Globals.ReadSize) +FN_GLOBAL_INTEGER(lp_shmem_size,&Globals.shmem_size) +FN_GLOBAL_INTEGER(lp_shmem_hash_size,&Globals.shmem_hash_size) FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security,&Globals.security) -- cgit From ccf4314fe73fb035f6941f00ce952ba3a308c2da Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 27 May 1997 20:28:45 +0000 Subject: loadparm.c: Ensure printer services cannot be read only and don't use share mode locking. locking.c: Changed aborts to returns so not so drastic on PANIC errors. proto.h: Removed definition of open_file as this is now never externally called. reply.c: Changed reply_mknew, reply_ctemp, reply_printopen to go through open_file_shared. server.c: Modified open_file_shared to be more robust and be useful for printer & temp files. Removed truncate option from open_file (now all truncates are done in open_file_shared). util.c: Added EAGAIN to errors checked in open_socket_out(). version.h: Updated to 1.9.17alpha2. jallison@whistle.com (This used to be commit d8471909b79fd591be2b789485b65d2e636d4745) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af0b05bb5d..ddd8cc90ba 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1079,6 +1079,10 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) string_set(&iSERVICE(i).szPrintername,pszPrintername); string_set(&iSERVICE(i).comment,comment); iSERVICE(i).bBrowseable = sDefault.bBrowseable; + /* Printers cannot be read_only. */ + iSERVICE(i).bRead_only = False; + /* No share modes on printer services. */ + iSERVICE(i).bShareModes = False; DEBUG(3,("adding printer service %s\n",pszPrintername)); -- cgit From 548196362bf5f81de823a075e86bb9ac10e6b14b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 6 Jun 1997 16:14:17 +0000 Subject: loadparm.c: Made explicit max packet now ignored. namedbwork.c: Don't announce potential browser if local master = False. nameelect.c: Raise debug level of comment to 2. proto.h: Added reset_globals_after_fork(). server.c: Call reset_globals_after_fork() after forking child. util.c: Added reset_globals_after_fork() - should stop problems with % substitutions in children. (This used to be commit 77be0f710cc96441d966ab7b026a0d591b01ffb0) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ddd8cc90ba..b368d3b2fa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -587,7 +587,7 @@ static void init_globals(void) Globals.bUseRhosts = False; Globals.max_packet = 65535; Globals.mangled_stack = 50; - Globals.max_xmit = Globals.max_packet; + Globals.max_xmit = 65535; Globals.max_mux = 2; Globals.lpqcachetime = 10; Globals.pwordlevel = 0; -- cgit From c6e63aa896a10656f6205828e744b722fc72f8ac Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 11 Jun 1997 01:03:06 +0000 Subject: Makefile: Added quoata changes for Linux from Thorvald Natvig Makefile.RPM: Added quoata changes for Linux from Thorvald Natvig charset.c: Large changes to add multiple client code pages. charset.h: Changed charset_initialise() proto. client.c: Fixed message sending bug. Changed charset_initialise(). ipc.c: Fixed #ifdef compile problems. loadparm.c: Added "client code page" option. nmbd.c: Changed charset_initialise(). Fixed lmhosts read. nmblookup.c: Changed charset_initialise(). proto.h: Added lp_client_code_page(void). quotas.c: Added quoata changes for Linux from Thorvald Natvig reply.c: Changed debug level. Made SMBecho ignore tid. server.c: Changed charset_initialise(). smb.h: Added DEFAULT_CLIENT_CODE_PAGE as 850. smbpasswd.c: Changed charset_initialise(). status.c: Changed charset_initialise(). testparm.c: Changed charset_initialise(). testprns.c: Changed charset_initialise(). Jeremy Allison (jallison@whistle.com) (This used to be commit 957025bace1bcff34d21a6caeca498e85abccb23) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b368d3b2fa..b1e2834ca8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -154,6 +154,7 @@ typedef struct int ReadSize; int shmem_size; int shmem_hash_size; + int client_code_page; BOOL bWINSsupport; BOOL bWINSproxy; BOOL bLocalMaster; @@ -435,6 +436,7 @@ struct parm_struct #ifdef KANJI {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, #endif /* KANJI */ + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL}, @@ -618,6 +620,7 @@ static void init_globals(void) #ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); #endif /* KANJI */ + Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -830,6 +833,7 @@ FN_GLOBAL_INTEGER(lp_printing,&Globals.printing) FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) +FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) -- cgit From 2a33e58d18f400a05aeef00ba27f2b3c12ac315c Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 16 Jun 1997 20:49:15 +0000 Subject: charset.c: Dropped debug message to level 6. loadparm.c: Added "time server" parameter. nameserv.h: Added "time server" parameter. proto.h: Added lp_time_server(). server.c: Removed incorrect | 0700 - this was a whistle specific change. Jeremy (jallison@whistle.com). (This used to be commit 54dcca1240ec0a7f107f8a77e0893855015f9d29) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b1e2834ca8..8f0108cc12 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -174,6 +174,7 @@ typedef struct BOOL bBrowseList; BOOL bUnixRealname; BOOL bNISHomeMap; + BOOL bTimeServer; } global; static global Globals; @@ -450,6 +451,7 @@ struct parm_struct {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy}, @@ -621,6 +623,7 @@ static void init_globals(void) coding_system = interpret_coding_system (KANJI, SJIS_CODE); #endif /* KANJI */ Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; + Globals.bTimeServer = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -813,6 +816,7 @@ FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) +FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 434d26acfe3bea62217b5ceaafc8b7b9cbe6e914 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 19 Jun 1997 00:18:23 +0000 Subject: loadparm.c: Added "force create mode" and "force directory mode" params. proto.h: Added lp_force_create_mode() and lp_force_dir_mode(). server.c: Fixed application of mode bits to be regular across files and directories. smb.h: Removed unused CREATE_MODE macro. Jeremy (jallison@whistle.com) (This used to be commit 2c928212500e1de27550d9fccb0939fd2e450515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8f0108cc12..8c2dd2776c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -221,7 +221,9 @@ typedef struct char *volume; int iMinPrintSpace; int iCreate_mode; + int iCreate_force_mode; int iDir_mode; + int iDir_force_mode; int iMaxConnections; int iDefaultCase; BOOL bAlternatePerm; @@ -296,7 +298,9 @@ static service sDefault = NULL, /* volume */ 0, /* iMinPrintSpace */ 0644, /* iCreate_mode */ + 0700, /* iCreate_force_mode */ 0755, /* iDir_mode */ + 0000, /* iDir_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ False, /* bAlternatePerm */ @@ -496,8 +500,10 @@ struct parm_struct {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL}, {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, @@ -899,7 +905,9 @@ FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) +FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) FN_LOCAL_INTEGER(lp_dir_mode,iDir_mode) +FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) -- cgit From fb1429c1970bc123e191f0cb7cc764faf4b86998 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 01:19:13 +0000 Subject: client.c: New print queue query code from Jeff C. Foster " ipc.c: Added code for returning restricted lists of servers. loadparm.c: Changed default for force create mode to 000. Changed default maxmux to 50 to comply with NT. locking.c: Fixed silly crash bug with slow share mode code. nameannounce.c: Added code for returning restricted lists of servers. namedbserver.c: Added code for returning restricted lists of servers. nameelect.c: Added code for returning restricted lists of servers. namework.c: Added code for returning restricted lists of servers. nmbsync.c: Added code for returning restricted lists of servers. server.c: Added quota fix Albrecht Gebhardt smb.h: Added define for COPYBUF_SIZE. system.c: Rename across filesystems Patch from Warren Birnbaum util.c: Minor fix for warning. (This used to be commit 1c6e433caa22813a699c9766847886eb59755f8b) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8c2dd2776c..9d3850b242 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -298,7 +298,7 @@ static service sDefault = NULL, /* volume */ 0, /* iMinPrintSpace */ 0644, /* iCreate_mode */ - 0700, /* iCreate_force_mode */ + 0000, /* iCreate_force_mode */ 0755, /* iDir_mode */ 0000, /* iDir_force_mode */ 0, /* iMaxConnections */ @@ -598,7 +598,7 @@ static void init_globals(void) Globals.max_packet = 65535; Globals.mangled_stack = 50; Globals.max_xmit = 65535; - Globals.max_mux = 2; + Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; Globals.pwordlevel = 0; Globals.deadtime = 0; -- cgit From 738d29667f9cd1ce312ec011f5e37ce584d7173d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 19:02:43 +0000 Subject: added "hide files" option. lkcl (This used to be commit 6e594ce0e5a3af5e7311380d18ff0d19ba9698a7) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9d3850b242..9947aca5ea 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -130,6 +130,7 @@ typedef struct char *szLogonScript; char *szLogonPath; char *szVetoFiles; + char *szHideFiles; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -395,6 +396,7 @@ struct parm_struct {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, {"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL}, + {"hide files", P_STRING, P_GLOBAL, &Globals.szHideFiles, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -621,6 +623,7 @@ static void init_globals(void) Globals.shmem_size = SHMEM_SIZE; Globals.shmem_hash_size = SHMEM_HASH_SIZE; Globals.bUnixRealname = False; + Globals.szHideFiles = DEFAULT_FILES_TO_HIDE; #if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); @@ -796,6 +799,7 @@ FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) +FN_GLOBAL_STRING(lp_hide_files,&Globals.szHideFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -- cgit From ce9baa3bac6eba5f7a468557572f342d3ba918ec Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 19:42:42 +0000 Subject: made "hide files" and "veto files" into per-service parameter sections, instead of just [global]. this makes it easier to decide whether to remove the "hide dot files" per-service parameter, and supercede it with a default "hide files" value of ".*". lkcl (This used to be commit f3ee4620ea7b93e4a00e77f9d787a118fd11ccaa) --- source3/param/loadparm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9947aca5ea..0e095c44bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,8 +129,6 @@ typedef struct char *szCharacterSet; char *szLogonScript; char *szLogonPath; - char *szVetoFiles; - char *szHideFiles; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -214,6 +212,8 @@ typedef struct char *szMagicScript; char *szMagicOutput; char *szMangledMap; + char *szVetoFiles; + char *szHideFiles; char *comment; char *force_user; char *force_group; @@ -291,6 +291,8 @@ static service sDefault = NULL, /* szMagicScript */ NULL, /* szMagicOutput */ NULL, /* szMangledMap */ + NULL, /* szVetoFiles */ + DEFAULT_FILES_TO_HIDE, /* szHideFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ @@ -395,8 +397,6 @@ struct parm_struct {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, - {"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL}, - {"hide files", P_STRING, P_GLOBAL, &Globals.szHideFiles, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -509,6 +509,8 @@ struct parm_struct {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, @@ -623,7 +625,6 @@ static void init_globals(void) Globals.shmem_size = SHMEM_SIZE; Globals.shmem_hash_size = SHMEM_HASH_SIZE; Globals.bUnixRealname = False; - Globals.szHideFiles = DEFAULT_FILES_TO_HIDE; #if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); @@ -798,8 +799,6 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) -FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) -FN_GLOBAL_STRING(lp_hide_files,&Globals.szHideFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) @@ -879,6 +878,8 @@ FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) +FN_LOCAL_STRING(lp_veto_files,szVetoFiles) +FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) -- cgit From 1599e41ec42998fdf05a3b22c3f3a93f8b4832ed Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 20:50:57 +0000 Subject: Rolled back Lukes changes. Not quite ready for prime time. Jeremy (jallison@whistle.com) (This used to be commit ed04ec7ab8b8e73b5442bdef03d5a3c994247b4e) --- source3/param/loadparm.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0e095c44bf..9d3850b242 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,6 +129,7 @@ typedef struct char *szCharacterSet; char *szLogonScript; char *szLogonPath; + char *szVetoFiles; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -212,8 +213,6 @@ typedef struct char *szMagicScript; char *szMagicOutput; char *szMangledMap; - char *szVetoFiles; - char *szHideFiles; char *comment; char *force_user; char *force_group; @@ -291,8 +290,6 @@ static service sDefault = NULL, /* szMagicScript */ NULL, /* szMagicOutput */ NULL, /* szMangledMap */ - NULL, /* szVetoFiles */ - DEFAULT_FILES_TO_HIDE, /* szHideFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ @@ -397,6 +394,7 @@ struct parm_struct {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, + {"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -509,8 +507,6 @@ struct parm_struct {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, @@ -799,6 +795,7 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) +FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) @@ -878,8 +875,6 @@ FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) -FN_LOCAL_STRING(lp_veto_files,szVetoFiles) -FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) -- cgit From b4863b07f4d659fe37531f04621a80180c014e0a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 6 Jul 1997 12:06:23 +0000 Subject: replaced the "wins proxy" to treat NetBIOS names as DNS names with new "dns proxy" option. the "wins proxy" option should be used for broadcast only hosts, and isn't properly implemented anyway. the new "dns proxy" option can be disabled if the (blocking) dns resolution takes up a significant amount of time. this _will_ occur if gethostbyname does external DNS lookups, instead of just (immediately) returning entries in /etc/hosts. lkcl (This used to be commit 350dfc57dd3001ba27519000a2ab9dd541a66ac7) --- source3/param/loadparm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9d3850b242..4c6ce30b19 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -155,6 +155,7 @@ typedef struct int shmem_size; int shmem_hash_size; int client_code_page; + BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; BOOL bLocalMaster; @@ -444,6 +445,7 @@ struct parm_struct {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL}, {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, @@ -650,6 +652,19 @@ static void init_globals(void) Globals.bBrowseList = True; Globals.bWINSsupport = False; Globals.bWINSproxy = False; + +/* this parameter is currently set to the default functionality + in samba. given that w95 and NT is starting to use DNS for + server resolution, i expect that at some point it would be + sensible to default this to False. + + this parameter is added because nmbd is a single process, and + gethostbyname is a blocking call, which can take out nmbd for + several seconds while a dns lookup is performed. + + */ + + Globals.bDNSproxy = True; } /*************************************************************************** @@ -802,6 +817,7 @@ FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) +FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) -- cgit From 1fe89d0b716ccd9fca4abe4daf89df063b38f4b3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 6 Jul 1997 13:48:10 +0000 Subject: added, tested and debugged new "hide files" option. lkcl (This used to be commit 60af320a436c3a26230fd7ac71856e67ef64e819) --- source3/param/loadparm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4c6ce30b19..dbe711eac6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -129,7 +129,6 @@ typedef struct char *szCharacterSet; char *szLogonScript; char *szLogonPath; - char *szVetoFiles; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -214,6 +213,8 @@ typedef struct char *szMagicScript; char *szMagicOutput; char *szMangledMap; + char *szVetoFiles; + char *szHideFiles; char *comment; char *force_user; char *force_group; @@ -291,6 +292,8 @@ static service sDefault = NULL, /* szMagicScript */ NULL, /* szMagicOutput */ NULL, /* szMangledMap */ + NULL, /* szVetoFiles */ + DEFAULT_FILES_TO_HIDE, /* szVetoFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ @@ -395,7 +398,6 @@ struct parm_struct {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, - {"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, @@ -509,6 +511,8 @@ struct parm_struct {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, @@ -810,7 +814,6 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) -FN_GLOBAL_STRING(lp_veto_files,&Globals.szVetoFiles) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) @@ -891,6 +894,8 @@ FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) +FN_LOCAL_STRING(lp_veto_files,szVetoFiles) +FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) -- cgit From 25eae02948b40667495fbb021dd130180180a05e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 8 Jul 1997 16:54:44 +0000 Subject: Makefile: Added AIX targets from Ole Holm Nielsen chgpasswd.c: Added Samba/GPL notice (for obvious reasons). clitar.c: Updated Copyright date to include 1997 (for obvious reasons). getsmbpass.c: Updated Copyright date to include 1997 (for obvious reasons). includes.h: Added stropts for solaris. loadparm.c: Changed comment for hide files option. nameconf.c: Updated Copyright date to include 1997 (for obvious reasons). nmbd.c: Updated Copyright date to include 1997 (for obvious reasons). pcap.c: Updated Copyright date to include 1997 (for obvious reasons). proto.h: Re-added accidentaly deleted smb_shm_ calls. quotas.c: Added AIX quota patch from Ole Holm Nielsen server.c: Optimization on calling is_hidden_path. Updated Copyrights. smb.h: Changed DEFAULT_FILES_TO_HIDE from "*/.*" to ".*". smbpass.c: Updated Copyright date to include 1997 (for obvious reasons). ufc.c: Updated Copyright date to include 1997 (for obvious reasons). util.c: Added last component code to is_in_path(). Jeremy (jallison@whistle.com) (This used to be commit 9385ae1005f13c8ed51f1319e3949b5c8571e62d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dbe711eac6..af6c4657bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -293,7 +293,7 @@ static service sDefault = NULL, /* szMagicOutput */ NULL, /* szMangledMap */ NULL, /* szVetoFiles */ - DEFAULT_FILES_TO_HIDE, /* szVetoFiles */ + DEFAULT_FILES_TO_HIDE, /* szHideFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ -- cgit From 612111c7a1a048d19e24b5e2e4d426247d320d1e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 18 Jul 1997 20:21:32 +0000 Subject: charset.c: Split charset_initialise() into 2 - a charset_initialise() and a codepage_initialise(). Fixes problem with initialising dos map twice. charset.h: Changes to support charset changes. client.c: Changes to support charset changes. loadparm.c: follow symlinks parameter from David Clerc nmbd.c: Changes to support charset changes. nmblookup.c:Changes to support charset changes. proto.h: Changes to support charset changes. reply.c: Don't call security=server with no user/no password guest. Fix from Stefaan A Eeckels server.c: follow symlinks code from David Clerc smbpasswd.c:Changes to support charset changes. status.c: Changes to support charset changes. testparm.c: Changes to support charset changes. testprns.c: Changes to support charset changes. uid.c: Fixed log message with no \n. Jeremy (jallison@whistle.com) (This used to be commit 2a28a6e5e461aca7fe6c19cd01d287010056cffb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af6c4657bf..89595caa0d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -253,6 +253,7 @@ typedef struct BOOL bOnlyUser; BOOL bMangledNames; BOOL bWidelinks; + BOOL bSymlinks; BOOL bSyncAlways; char magic_char; BOOL *copymap; @@ -332,6 +333,7 @@ static service sDefault = False, /* bOnlyUser */ True, /* bMangledNames */ True, /* bWidelinks */ + True, /* bSymlinks */ False, /* bSyncAlways */ '~', /* magic char */ NULL, /* copymap */ @@ -528,6 +530,7 @@ struct parm_struct {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL}, {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL}, @@ -920,6 +923,7 @@ FN_LOCAL_BOOL(lp_share_modes,bShareModes) FN_LOCAL_BOOL(lp_onlyuser,bOnlyUser) FN_LOCAL_BOOL(lp_manglednames,bMangledNames) FN_LOCAL_BOOL(lp_widelinks,bWidelinks) +FN_LOCAL_BOOL(lp_symlinks,bSymlinks) FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) -- cgit From 15ae50ca5203bc4c04567e400ba041a4d1757b2b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 17:25:11 +0000 Subject: Makefile: Added UNIXWARE 2.x with shadow passwords from fja@extratech.com client.c: Made prompt appear at debug level 0. Fixed strcasecmp redefinition. Caused client to use set_blocking rather than making fcntl calls itself. dir.c: Removed redundent snum parameters. includes.h: Added SCO fixes. loadparm.c: Made default 'files to hide' a null string. nmbd.c: Removed O_NONBLOCK from pid file open for platforms that dont have it. proto.h: Changed snum to cnum where needed. Changed is_xx_path to is_in_path (now called via MACRO). quotas.c: Swapped setuid/seteuid calls when restoring uid. reply.c: Removed redundent snum parameters. server.c: Changed snum to cnum where needed. Setup new veto_list, hide_list namelists. Added standard_sub changes from Stefaan A Eeckels and Paul Rippin shmem.c: Changed cast for sizeof to be int before negating. smb.h: Added new veto_list, hide_list entries to connections. Added IS_PRINT, IS_HIDDEN_PATH, IS_VETO_PATH macros. trans2.c: Removed redundent snum parameters. util.c: Added standard_sub_basic changes from Stefaan A Eeckels and Paul Rippin Fixed up veto/hidden path processing so the paths are pres-parsed and checked for wildcards (for speed). Jeremy (jallison@whistle.com) (This used to be commit 9afa36f7874cfd527aa6ef1e7965c1d35d46ab1f) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 89595caa0d..ede1f12dec 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -270,7 +270,7 @@ static service sDefault = NULL, /* szService */ NULL, /* szPath */ NULL, /* szUsername */ - NULL, /* szGuestAccount */ + NULL, /* szGuestAccount - this is set in init_globals() */ NULL, /* szInvalidUsers */ NULL, /* szValidUsers */ NULL, /* szAdminUsers */ @@ -286,7 +286,7 @@ static service sDefault = NULL, /* szLppausecommand */ NULL, /* szLpresumecommand */ NULL, /* szPrintername */ - NULL, /* szPrinterDriver */ + NULL, /* szPrinterDriver - this is set in init_globals() */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -294,7 +294,7 @@ static service sDefault = NULL, /* szMagicOutput */ NULL, /* szMangledMap */ NULL, /* szVetoFiles */ - DEFAULT_FILES_TO_HIDE, /* szHideFiles */ + NULL, /* szHideFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ -- cgit From 834518eddd66c926b8aac7aa2b7024639417d6a2 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 22:42:16 +0000 Subject: loadparm.c: Changed default create mask to 755 to support MAP_ARCHIVE. server.c: Added check for MAP_ARCHIVE before we set archive bit. Jeremy (jallison@whistle.com) (This used to be commit d21a166277776f6750b7bcc3c4f9073cce17eacb) --- source3/param/loadparm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ede1f12dec..fd2797aadb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -222,9 +222,9 @@ typedef struct char *writelist; char *volume; int iMinPrintSpace; - int iCreate_mode; + int iCreate_mask; int iCreate_force_mode; - int iDir_mode; + int iDir_mask; int iDir_force_mode; int iMaxConnections; int iDefaultCase; @@ -302,9 +302,9 @@ static service sDefault = NULL, /* writelist */ NULL, /* volume */ 0, /* iMinPrintSpace */ - 0644, /* iCreate_mode */ + 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ - 0755, /* iDir_mode */ + 0755, /* iDir_mask */ 0000, /* iDir_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ @@ -504,11 +504,11 @@ struct parm_struct {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mode, NULL}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL}, {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mode, NULL}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL}, {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, @@ -929,9 +929,9 @@ FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) -FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode) +FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -FN_LOCAL_INTEGER(lp_dir_mode,iDir_mode) +FN_LOCAL_INTEGER(lp_dir_mode,iDir_mask) FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) -- cgit From 75bbf35a8626ea30ac31546d0ceb9e2801ab7eae Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 30 Jul 1997 19:17:51 +0000 Subject: client.c: Minor change to cast parameters for DEC unix. clientutil.c: Minor change to cast parameters for DEC unix. ipc.c: Fixes to parameterise the stuff John wants. loadparm.c: Fixes to parameterise the stuff John wants. nameannounce.c: Fixes to parameterise the stuff John wants. namedbwork.c: Fixes to parameterise the stuff John wants. nameserv.h: Fixes to parameterise the stuff John wants. proto.h: Fixes to parameterise the stuff John wants. smb.h: Fixes to parameterise the stuff John wants. util.c: tidy. Jeremy (jallison@whistle.com) (This used to be commit 9fbca2594ba775450d5dca13cbce257b4362ca66) --- source3/param/loadparm.c | 152 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 141 insertions(+), 11 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fd2797aadb..df6aff6f9c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -135,6 +135,7 @@ typedef struct char *szRemoteAnnounce; char *szSocketAddress; char *szNISHomeMapName; + char *szAnnounceVersion; /* This is initialised in init_globals */ int max_log_size; int mangled_stack; int max_xmit; @@ -154,6 +155,7 @@ typedef struct int shmem_size; int shmem_hash_size; int client_code_page; + int announce_as; /* This is initialised in init_globals */ BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -350,7 +352,7 @@ static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; - +static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) @@ -363,6 +365,7 @@ static BOOL handle_security(char *pszParmValue,int *val); static BOOL handle_case(char *pszParmValue,int *val); static BOOL handle_printing(char *pszParmValue,int *val); static BOOL handle_character_set(char *pszParmValue,int *val); +static BOOL handle_announce_as(char *pszParmValue, int *val); #ifdef KANJI static BOOL handle_coding_system(char *pszParmValue,int *val); #endif /* KANJI */ @@ -385,6 +388,7 @@ struct parm_struct {"printing", P_INTEGER, P_GLOBAL, &Globals.printing,handle_printing}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL}, + {"announce as", P_INTEGER, P_GLOBAL, &Globals.announce_as, handle_announce_as}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL}, {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL}, @@ -430,6 +434,7 @@ struct parm_struct {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, @@ -602,6 +607,8 @@ static void init_globals(void) string_set(&Globals.szSocketAddress, "0.0.0.0"); sprintf(s,"Samba %s",VERSION); string_set(&Globals.szServerString,s); + sprintf(s,"%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); + string_set(&Globals.szAnnounceVersion,s); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -629,6 +636,7 @@ static void init_globals(void) Globals.ReadSize = 16*1024; Globals.shmem_size = SHMEM_SIZE; Globals.shmem_hash_size = SHMEM_HASH_SIZE; + Globals.announce_as = ANNOUNCE_AS_NT; Globals.bUnixRealname = False; #if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; @@ -822,6 +830,7 @@ FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) +FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) @@ -866,6 +875,7 @@ FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) +FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) @@ -1124,6 +1134,8 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) iSERVICE(i).bRead_only = False; /* No share modes on printer services. */ iSERVICE(i).bShareModes = False; + /* Printer services must be printable. */ + iSERVICE(i).bPrint_ok = True; DEBUG(3,("adding printer service %s\n",pszPrintername)); @@ -1433,9 +1445,9 @@ handle the interpretation of the default case ***************************************************************************/ static BOOL handle_case(char *pszParmValue,int *val) { - if (strequal(pszParmValue,"LOWER")) + if (strnequal(pszParmValue,"LOWER", 5)) *val = CASE_LOWER; - else if (strequal(pszParmValue,"UPPER")) + else if (strnequal(pszParmValue,"UPPER", 5)) *val = CASE_UPPER; return(True); } @@ -1445,23 +1457,37 @@ handle the interpretation of the printing system ***************************************************************************/ static BOOL handle_printing(char *pszParmValue,int *val) { - if (strequal(pszParmValue,"sysv")) + if (strnequal(pszParmValue,"sysv", 4)) *val = PRINT_SYSV; - else if (strequal(pszParmValue,"aix")) + else if (strnequal(pszParmValue,"aix", 3)) *val = PRINT_AIX; - else if (strequal(pszParmValue,"hpux")) + else if (strnequal(pszParmValue,"hpux", 4)) *val = PRINT_HPUX; - else if (strequal(pszParmValue,"bsd")) + else if (strnequal(pszParmValue,"bsd", 3)) *val = PRINT_BSD; - else if (strequal(pszParmValue,"qnx")) + else if (strnequal(pszParmValue,"qnx",3)) *val = PRINT_QNX; - else if (strequal(pszParmValue,"plp")) + else if (strnequal(pszParmValue,"plp", 3)) *val = PRINT_PLP; - else if (strequal(pszParmValue,"lprng")) + else if (strnequal(pszParmValue,"lprng", 5)) *val = PRINT_LPRNG; return(True); } +/*************************************************************************** +handle the announce as parameter +***************************************************************************/ +static BOOL handle_announce_as(char *pszParmValue,int *val) +{ + if (strnequal(pszParmValue,"NT", 2)) + *val = ANNOUNCE_AS_NT; + else if (strnequal(pszParmValue,"win95", 5)) + *val = ANNOUNCE_AS_WIN95; + else if (strnequal(pszParmValue,"WfW", 3)) + *val = ANNOUNCE_AS_WFW; + return True; +} + /*************************************************************************** handle the valid chars lines ***************************************************************************/ @@ -1963,7 +1989,8 @@ BOOL lp_load(char *pszFname,BOOL global_only) { pstring n2; BOOL bRetval; - + static void set_default_server_announce_type(void); + add_to_file_list(pszFname); bRetval = False; @@ -1992,6 +2019,8 @@ BOOL lp_load(char *pszFname,BOOL global_only) lp_add_ipc(); + set_default_server_announce_type(); + bLoaded = True; return (bRetval); @@ -2058,3 +2087,104 @@ char *volume_label(int snum) if (!*ret) return(lp_servicename(snum)); return(ret); } + +#if 0 +/* + * nmbd only loads the global section. There seems to be no way to + * determine exactly is a service is printable by only looking at the + * [global] section so for now always announce as a print server. This + * will need looking at in the future. Jeremy (jallison@whistle.com). + */ +/******************************************************************* + Return true if any printer services are defined. + ******************************************************************/ +static BOOL lp_printer_services(void) +{ + int iService; + + for (iService = iNumServices - 1; iService >= 0; iService--) + if (VALID(iService) && iSERVICE(iService).bPrint_ok) + return True; + return False; +} +#endif + +/******************************************************************* + Set the server type we will announce as via nmbd. +********************************************************************/ +static void set_default_server_announce_type() +{ + default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | + SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); + if(lp_announce_as() == ANNOUNCE_AS_NT) + default_server_announce |= (SV_TYPE_SERVER_NT | SV_TYPE_NT); + else if(lp_announce_as() == ANNOUNCE_AS_WIN95) + default_server_announce |= SV_TYPE_WIN95_PLUS; + else if(lp_announce_as() == ANNOUNCE_AS_WFW) + default_server_announce |= SV_TYPE_WFW; + default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); +/* + * nmbd only loads the [global] section. There seems to be no way to + * determine exactly if any service is printable by only looking at the + * [global] section so for now always announce as a print server. This + * will need looking at in the future. Jeremy (jallison@whistle.com). + */ +#if 0 + default_server_announce |= (lp_printer_services() ? SV_TYPE_PRINTQ_SERVER : 0); +#endif +} + +/******************************************************************* + Get the default server type we will announce as via nmbd. +********************************************************************/ +int lp_default_server_announce(void) +{ + return default_server_announce; +} + +/******************************************************************* + Split the announce version into major and minor numbers. +********************************************************************/ +int lp_major_announce_version(void) +{ + static BOOL got_major = False; + static int major_version = DEFAULT_MAJOR_VERSION; + char *vers; + char *p; + + if(got_major) + return major_version; + + got_major = True; + if((vers = lp_announce_version()) == NULL) + return major_version; + + if((p = strchr(vers, '.')) == 0) + return major_version; + + *p = '\0'; + major_version = atoi(vers); + return major_version; +} + +int lp_minor_announce_version(void) +{ + static BOOL got_minor = False; + static int minor_version = DEFAULT_MINOR_VERSION; + char *vers; + char *p; + + if(got_minor) + return minor_version; + + got_minor = True; + if((vers = lp_announce_version()) == NULL) + return minor_version; + + if((p = strchr(vers, '.')) == 0) + return minor_version; + + p++; + minor_version = atoi(p); + return minor_version; +} -- cgit From 363b9a2739e9e39d1f69625e6647c6c9047a901a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 31 Jul 1997 18:47:26 +0000 Subject: loadparm.c: Added new netbios aliases parameter (code from Cisco) nameannounce.c: Code to announce aliases as well as our own names. namedbsubnet.c: Code to add the aliases to the server list. nameserv.c: Code to defend our aliases on the namelist. namework.c: Code to check it's one of our aliases. nmbd.c: Code to initialise the aliases. proto.h: Fixup protos. util.c: Code to check it's one of our aliases. All above code based on code for 1.9.16p11 donated by Cisco from Ben Woodard Jeremy (jallison@whistle.com) (This used to be commit a2ce1c0cb1331551ff728dcfe3260fab4cd827e5) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index df6aff6f9c..69204cc13f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -136,6 +136,7 @@ typedef struct char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ + char *szNetbiosAliases; int max_log_size; int mangled_stack; int max_xmit; @@ -403,6 +404,7 @@ struct parm_struct {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, @@ -831,6 +833,7 @@ FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) +FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From b5114b41f574c5a5341e07d6f16877a48c6b874d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 5 Aug 1997 01:31:55 +0000 Subject: Makefile: Added IRIX 6 target. loadparm.c: Fixed stupid static warnings with set_default_server_announce_type. password.c: Fixed char -> uchar cast warnings. nameservreply.c: Fixed group fade out code. Jeremy (jallison@whistle.com) (This used to be commit a2dd5c5a551547e83c707e63c0696c7724035501) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 69204cc13f..df4d72cf20 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -371,6 +371,8 @@ static BOOL handle_announce_as(char *pszParmValue, int *val); static BOOL handle_coding_system(char *pszParmValue,int *val); #endif /* KANJI */ +static void set_default_server_announce_type(void); + struct parm_struct { char *label; @@ -1992,7 +1994,6 @@ BOOL lp_load(char *pszFname,BOOL global_only) { pstring n2; BOOL bRetval; - static void set_default_server_announce_type(void); add_to_file_list(pszFname); -- cgit From 9b41ada7c8f5eb77a1acf0eaf29a7d6f8cbaea36 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 12 Aug 1997 23:02:45 +0000 Subject: charset.c: Fixed bug with 'valid chars' param. loadparm.c: Fixed bug with 'valid chars' param. nameelect.c:Unregister the 1b name from the WINS server when unbecoming master. nameservresp.c: Fix nasty browse bug where we were sending the query to the wrong ip address. Jeremy (jallison@whistle.com) (This used to be commit 927d1875f0c09fe7b2e1c1bc4b1af2c0b8de0f7c) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index df4d72cf20..8c048ad079 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1500,6 +1500,12 @@ static BOOL handle_valid_chars(char *pszParmValue,char **ptr) { string_set(ptr,pszParmValue); + /* A dependency here is that the parameter client code page must be + set before this is called - as calling codepage_initialise() + would overwrite the valid char lines. + */ + codepage_initialise(lp_client_code_page()); + add_char_string(pszParmValue); return(True); } -- cgit From 72af2c1831beedc3c04bce6fc3c295accd8326b5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 5 Sep 1997 17:16:21 +0000 Subject: added debug reporting to file listing / mod_time() checking routine. lp_file_list_changed(). (This used to be commit 727fcfae1b62bb509f0a9f5304dad363ef38345a) --- source3/param/loadparm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8c048ad079..ad9bf83886 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1395,11 +1395,26 @@ check if a config file has changed date BOOL lp_file_list_changed(void) { struct file_lists *f = file_lists; - while (f) { + DEBUG(6,("lp_file_list_changed()\n")); + + while (f) + { pstring n2; + time_t mod_time; + strcpy(n2,f->name); standard_sub_basic(n2); - if (f->modtime != file_modtime(n2)) return(True); + + DEBUG(6,("file %s -> %s last mod_time: %s\n", + f->name, n2, ctime(&f->modtime))); + + mod_time = file_modtime(n2); + + if (f->modtime != mod_time) + { + DEBUG(6,("file %s modified: %s\n", n2, ctime(&mod_time))); + return(True); + } f = f->next; } return(False); -- cgit From c6d44776282c042efb6c18f350da952933263765 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Sep 1997 02:19:04 +0000 Subject: some minor modifications to loadparm.c to support the necessary functions for wsmbconf. In particular added some more support routines (like lp_rename_service()) and make the dump routines take a FILE pointer rather than assuming stdout (This used to be commit 6d165016068f6c4e9eed8fae83a9f7ca0b34f85a) --- source3/param/loadparm.c | 249 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 193 insertions(+), 56 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ad9bf83886..c3a7581255 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -967,8 +967,6 @@ static void copy_service( service *pserviceDest, static BOOL service_ok(int iService); static BOOL do_parameter(char *pszParmName, char *pszParmValue); static BOOL do_section(char *pszSectionName); -static void dump_globals(void); -static void dump_a_service(service *pService); static void init_copymap(service *pservice); @@ -1610,18 +1608,15 @@ static void init_copymap(service *pservice) /*************************************************************************** -Process a parameter. +Process a parameter for a particular service number. If snum < 0 +then assume we are in the globals ***************************************************************************/ -static BOOL do_parameter(char *pszParmName, char *pszParmValue) +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) { int parmnum; void *parm_ptr=NULL; /* where we are going to store the result */ void *def_ptr=NULL; - if (!bInGlobalSection && bGlobalOnly) return(True); - - DEBUG(3,("doing parameter %s = %s\n",pszParmName,pszParmValue)); - parmnum = map_parameter(pszParmName); if (parmnum < 0) @@ -1633,37 +1628,33 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) def_ptr = parm_table[parmnum].ptr; /* we might point at a service, the default service or a global */ - if (bInGlobalSection) + if (snum < 0) { parm_ptr = def_ptr; - else - { - if (parm_table[parmnum].class == P_GLOBAL) - { + } else { + if (parm_table[parmnum].class == P_GLOBAL) { DEBUG(0,( "Global parameter %s found in service section!\n",pszParmName)); return(True); } - parm_ptr = ((char *)pSERVICE(iServiceIndex)) + PTR_DIFF(def_ptr,&sDefault); - } + parm_ptr = ((char *)pSERVICE(snum)) + PTR_DIFF(def_ptr,&sDefault); + } - if (!bInGlobalSection) - { - int i; - if (!iSERVICE(iServiceIndex).copymap) - init_copymap(pSERVICE(iServiceIndex)); - - /* this handles the aliases - set the copymap for other entries with - the same data pointer */ - for (i=0;parm_table[i].label;i++) - if (parm_table[i].ptr == parm_table[parmnum].ptr) - iSERVICE(iServiceIndex).copymap[i] = False; - } + if (snum >= 0) { + int i; + if (!iSERVICE(snum).copymap) + init_copymap(pSERVICE(snum)); + + /* this handles the aliases - set the copymap for other entries with + the same data pointer */ + for (i=0;parm_table[i].label;i++) + if (parm_table[i].ptr == parm_table[parmnum].ptr) + iSERVICE(snum).copymap[i] = False; + } /* if it is a special case then go ahead */ - if (parm_table[parmnum].special) - { - parm_table[parmnum].special(pszParmValue,parm_ptr); - return(True); - } + if (parm_table[parmnum].special) { + parm_table[parmnum].special(pszParmValue,parm_ptr); + return(True); + } /* now switch on the type of variable it is */ switch (parm_table[parmnum].type) @@ -1711,48 +1702,105 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) return(True); } +/*************************************************************************** +Process a parameter. +***************************************************************************/ +static BOOL do_parameter(char *pszParmName, char *pszParmValue) +{ + if (!bInGlobalSection && bGlobalOnly) return(True); + + DEBUG(3,("doing parameter %s = %s\n",pszParmName,pszParmValue)); + + return lp_do_parameter(bInGlobalSection?-2:iServiceIndex, pszParmName, pszParmValue); +} + + /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void print_parameter(parm_type type,void *ptr) +static void print_parameter(parm_type type,void *ptr, FILE *f) { switch (type) { case P_BOOL: - printf("%s",BOOLSTR(*(BOOL *)ptr)); + fprintf(f,"%s",BOOLSTR(*(BOOL *)ptr)); break; case P_BOOLREV: - printf("%s",BOOLSTR(! *(BOOL *)ptr)); + fprintf(f,"%s",BOOLSTR(! *(BOOL *)ptr)); break; case P_INTEGER: - printf("%d",*(int *)ptr); + fprintf(f,"%d",*(int *)ptr); break; case P_CHAR: - printf("%c",*(char *)ptr); + fprintf(f,"%c",*(char *)ptr); break; case P_OCTAL: - printf("0%o",*(int *)ptr); + fprintf(f,"0%o",*(int *)ptr); break; case P_GSTRING: case P_UGSTRING: if ((char *)ptr) - printf("%s",(char *)ptr); + fprintf(f,"%s",(char *)ptr); break; case P_STRING: case P_USTRING: if (*(char **)ptr) - printf("%s",*(char **)ptr); + fprintf(f,"%s",*(char **)ptr); break; } } +/*************************************************************************** +print a parameter of the specified type +***************************************************************************/ +static void parameter_string(parm_type type,void *ptr,char *s) +{ + s[0] = 0; + + switch (type) + { + case P_BOOL: + sprintf(s, "%s",BOOLSTR(*(BOOL *)ptr)); + break; + + case P_BOOLREV: + sprintf(s, "%s",BOOLSTR(! *(BOOL *)ptr)); + break; + + case P_INTEGER: + sprintf(s, "%d",*(int *)ptr); + break; + + case P_CHAR: + sprintf(s, "%c",*(char *)ptr); + break; + + case P_OCTAL: + sprintf(s, "0%o",*(int *)ptr); + break; + + case P_GSTRING: + case P_UGSTRING: + if ((char *)ptr) + sprintf(s, "%s",(char *)ptr); + break; + + case P_STRING: + case P_USTRING: + if (*(char **)ptr) + sprintf(s, "%s",*(char **)ptr); + break; + } +} + + /*************************************************************************** check if two parameters are equal ***************************************************************************/ @@ -1845,32 +1893,32 @@ static BOOL do_section(char *pszSectionName) /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ -static void dump_globals(void) +static void dump_globals(FILE *f) { int i; - printf("Global parameters:\n"); + fprintf(f, "# Global parameters\n"); for (i=0;parm_table[i].label;i++) if (parm_table[i].class == P_GLOBAL && parm_table[i].ptr && (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) { - printf("\t%s: ",parm_table[i].label); - print_parameter(parm_table[i].type,parm_table[i].ptr); - printf("\n"); + fprintf(f,"\t%s = ",parm_table[i].label); + print_parameter(parm_table[i].type,parm_table[i].ptr, f); + fprintf(f,"\n"); } } /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ -static void dump_a_service(service *pService) +static void dump_a_service(service *pService, FILE *f) { int i; if (pService == &sDefault) - printf("\nDefault service parameters:\n"); + fprintf(f,"\n\n# Default service parameters\n"); else - printf("\nService parameters [%s]:\n",pService->szService); + fprintf(f,"\n[%s]\n",pService->szService); for (i=0;parm_table[i].label;i++) if (parm_table[i].class == P_LOCAL && @@ -1884,14 +1932,69 @@ static void dump_a_service(service *pService) ((char *)pService) + pdiff, ((char *)&sDefault) + pdiff)) { - printf("\t%s: ",parm_table[i].label); + fprintf(f,"\t%s = ",parm_table[i].label); print_parameter(parm_table[i].type, - ((char *)pService) + pdiff); - printf("\n"); + ((char *)pService) + pdiff, f); + fprintf(f,"\n"); } } } + +/*************************************************************************** +return info about the next service in a service. snum==-1 gives the default +serice and snum==-2 gives the globals + +return 0 when out of parameters +***************************************************************************/ +int lp_next_parameter(int snum, int *i, char *label, + char *value, int allparameters) +{ + if (snum == -2) { + /* do the globals */ + for (;parm_table[*i].label;(*i)++) + if (parm_table[*i].class == P_GLOBAL && + parm_table[*i].ptr && + (*parm_table[*i].label != '-') && + ((*i) == 0 || + (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { + strcpy(label, parm_table[*i].label); + parameter_string(parm_table[*i].type, + parm_table[*i].ptr, + value); + (*i)++; + return 1; + } + return 0; + } else { + service *pService = (snum==-1?&sDefault:pSERVICE(snum)); + + for (;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))) { + int pdiff = PTR_DIFF(parm_table[*i].ptr,&sDefault); + + if (snum == -1 || allparameters || + !equal_parameter(parm_table[*i].type, + ((char *)pService) + pdiff, + ((char *)&sDefault) + pdiff)) { + strcpy(label, parm_table[*i].label); + parameter_string(parm_table[*i].type, + ((char *)pService) + pdiff, + value); + (*i)++; + return 1; + } + } + } + + return 0; +} + + #if 0 /*************************************************************************** Display the contents of a single copy structure. @@ -2000,7 +2103,7 @@ void lp_killunused(BOOL (*snumused)(int )) { int i; for (i=0;iszService, new_name); +} + +/******************************************************************* +remove a service +********************************************************************/ +void lp_remove_service(int snum) +{ + pSERVICE(snum)->valid = False; +} + +/******************************************************************* +copy a service +********************************************************************/ +void lp_copy_service(int snum, char *new_name) +{ + char *oldname = lp_servicename(snum); + do_section(new_name); + if (snum >= 0) { + snum = lp_servicenumber(new_name); + if (snum >= 0) + lp_do_parameter(snum, "copy", oldname); + } +} + + /******************************************************************* Get the default server type we will announce as via nmbd. ********************************************************************/ @@ -2213,3 +2349,4 @@ int lp_minor_announce_version(void) minor_version = atoi(p); return minor_version; } + -- cgit From 30416c0b8a0f54f6cc1179c2e00860eaf5f58401 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Sep 1997 20:17:32 +0000 Subject: charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c mangle.c smb.h util.c: Big merge to allow KANJI support to be in the main binary without explicitly compiling with it. locking.c: Fix for smbstatus not being able to read files. namepacket.c: Removed unneccesary debug statement. trans2.c: Added Luke's proposed fix (ifdefed out until further testing). nmblookup.c: Fixed bug where query fails and status is done on bogus IP. Jeremy (jallison@whistle.com) (This used to be commit 9196255022ae8c51b527412747b324819bea2c13) --- source3/param/loadparm.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c3a7581255..047334e143 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -49,6 +49,11 @@ #include "includes.h" +/* Set default coding system for KANJI if none specified in Makefile. */ +#ifndef KANJI +#define KANJI "sjis" +#endif /* KANJI */ + BOOL bLoaded = False; extern int DEBUGLEVEL; @@ -97,9 +102,7 @@ int keepalive=0; extern BOOL use_getwd_cache; extern int extra_time_offset; -#ifdef KANJI extern int coding_system; -#endif /* * This structure describes global (ie., server-wide) parameters. @@ -367,9 +370,7 @@ static BOOL handle_case(char *pszParmValue,int *val); static BOOL handle_printing(char *pszParmValue,int *val); static BOOL handle_character_set(char *pszParmValue,int *val); static BOOL handle_announce_as(char *pszParmValue, int *val); -#ifdef KANJI static BOOL handle_coding_system(char *pszParmValue,int *val); -#endif /* KANJI */ static void set_default_server_announce_type(void); @@ -452,9 +453,7 @@ struct parm_struct {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL}, {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL}, {"shared file entries", P_INTEGER, P_GLOBAL, &Globals.shmem_hash_size, NULL}, -#ifdef KANJI {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, -#endif /* KANJI */ {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, @@ -646,9 +645,7 @@ static void init_globals(void) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); #endif -#ifdef KANJI coding_system = interpret_coding_system (KANJI, SJIS_CODE); -#endif /* KANJI */ Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; @@ -1418,7 +1415,6 @@ BOOL lp_file_list_changed(void) return(False); } -#ifdef KANJI /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ @@ -1427,7 +1423,6 @@ static BOOL handle_coding_system(char *pszParmValue,int *val) *val = interpret_coding_system(pszParmValue,*val); return(True); } -#endif /* KANJI */ /*************************************************************************** handle the interpretation of the character set system parameter -- cgit From 33a003de4056532be0c9a199d4857b9da1b18034 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Sep 1997 16:37:18 +0000 Subject: This commit does 3 main things: 1) put the encryption code in by default, with no #ifdef. It is still disabled by default so you need to add "encrypt passwords = yes" in smb.conf but at least all binaries will have it. 2) cleanup the kanji code so it compiles with no warnings 3) get rid of lots of uses of ugly non-portable C code. The main offender being things like "register" but also remove uses of the "const" keyword as there are compilers out there that don't support it and even those that do often complain about its usage. Users don't like warnings :-( There is still some work to do. We need to replace the md4 code with our own implementation. The current code (from rfc1186) is PD but is not very portable. The new RFC (rfc1320) is more portable but adds copyright restrictions. I'll do a from-scratch MD4 soon. We also need to test that what I've implemented is portable. It should be, but I'm too tired right now to test it on anything other than intel linux. (This used to be commit db917c62c14315afe6f0745a8097c1bca25cbf07) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 047334e143..b6eabcd727 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -598,11 +598,7 @@ static void init_globals(void) #endif string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); string_set(&Globals.szWorkGroup, WORKGROUP); -#ifdef SMB_PASSWD string_set(&Globals.szPasswdProgram, SMB_PASSWD); -#else - string_set(&Globals.szPasswdProgram, "/bin/passwd"); -#endif string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); -- cgit From 1590983eb0849130962cb0a08198cf8ad3d49380 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Sep 1997 01:29:53 +0000 Subject: Added 'delete veto files' paremeter. Ugly - but the only way to allow Samba client users to delete directories containing Mac metafile information (.AppleDouble directories). Needed for clean integration with netatalk. Jeremy (jallison@whistle.com) (This used to be commit 29c6c037dc62e44784e9d127d1e7ef3dd1506733) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b6eabcd727..7172eb2b0a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -265,6 +265,7 @@ typedef struct BOOL *copymap; BOOL bDeleteReadonly; BOOL bFakeOplocks; + BOOL bDeleteVetoFiles; char dummy[3]; /* for alignment */ } service; @@ -345,6 +346,7 @@ static service sDefault = NULL, /* copymap */ False, /* bDeleteReadonly */ False, /* bFakeOplocks */ + False, /* bDeleteVetoFiles */ "" /* dummy */ }; @@ -521,6 +523,7 @@ struct parm_struct {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL}, {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, @@ -936,6 +939,7 @@ FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) +FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -- cgit From a2d2206cc941f39df8713d9cee26099f603af82f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Sep 1997 17:12:08 +0000 Subject: Makefile: Changed proto: target to not include c files not used currently. Caused proto.h to be from a sorted list of C files. arcfour.h: Added prototypes. client.c: Added username%password in environment patch from John Blair loadparm.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] username.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] mkproto.awk: Added arc4_key type. proto.h: Updated & sorted. Jeremy (jallison@whistle.com) (This used to be commit 97ed4fea67095dfb83227e7b5fffc236ff277e02) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7172eb2b0a..9eb6bfab68 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -146,6 +146,7 @@ typedef struct int max_mux; int max_packet; int pwordlevel; + int unamelevel; int deadtime; int maxprotocol; int security; @@ -449,6 +450,7 @@ struct parm_struct {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL}, {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, @@ -619,6 +621,7 @@ static void init_globals(void) Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; Globals.pwordlevel = 0; + Globals.unamelevel = 0; Globals.deadtime = 0; Globals.max_log_size = 5000; Globals.maxprotocol = PROTOCOL_NT1; @@ -865,6 +868,7 @@ FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) 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_shmem_size,&Globals.shmem_size) FN_GLOBAL_INTEGER(lp_shmem_hash_size,&Globals.shmem_hash_size) -- cgit From cef59090bb2fd3f8a9efd1a453cb90264b891d58 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 26 Sep 1997 18:55:29 +0000 Subject: Adding Andrews buffer overflow fixes into the main branch. Jeremy (jallison@whistle.com) (This used to be commit e7eb1f044d3101679dc7a118820ea5efe0cd837c) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9eb6bfab68..1a9771df22 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1381,7 +1381,7 @@ static void add_to_file_list(char *fname) { pstring n2; - strcpy(n2,fname); + pstrcpy(n2,fname); standard_sub_basic(n2); f->modtime = file_modtime(n2); } @@ -1401,7 +1401,7 @@ BOOL lp_file_list_changed(void) pstring n2; time_t mod_time; - strcpy(n2,f->name); + pstrcpy(n2,f->name); standard_sub_basic(n2); DEBUG(6,("file %s -> %s last mod_time: %s\n", @@ -1529,7 +1529,7 @@ handle the include operation static BOOL handle_include(char *pszParmValue,char **ptr) { pstring fname; - strcpy(fname,pszParmValue); + pstrcpy(fname,pszParmValue); add_to_file_list(fname); @@ -2127,7 +2127,7 @@ BOOL lp_load(char *pszFname,BOOL global_only) init_globals(); - strcpy(n2,pszFname); + pstrcpy(n2,pszFname); standard_sub_basic(n2); /* We get sections first, so have to start 'behind' to make up */ -- cgit From 85097a7c177977c3e0cb9b2ad41642dba5f917ac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Oct 1997 03:14:32 +0000 Subject: change the semantics of hosts allow/hosts deny so that a global setting applies to all shares regardless of any settings on other shares. This allows us to immediately drop a connection if it does not come from a allowed host, without even parsing the first SMB packet. The next time we get a nasty security hole we can offer people the option of just setting their hosts allow line. If we drop a connection in this way we generate a "Not listening for calling name" response and then exit. add a per share "oplocks" option in smb.conf. I think its important to be able to disable oplocks on a per-share basis as there are occasions then they are definately not wanted, for example when sharing data between a windows box and a unix application. This also allows us to tell people "try disabling oplocks" when diagnosing problems. fix a bug in process_smb(). It was taking the length of the packet from outbuf, not inbuf (this bug was introduced with the oplocks code). Jeremy, I assume this wasn't deliberate? (This used to be commit 44bc9f239aa0b3cdf6cf9ad8d3911e397eba7335) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1a9771df22..fb656aa627 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -257,6 +257,7 @@ typedef struct BOOL bLocking; BOOL bStrictLocking; BOOL bShareModes; + BOOL bOpLocks; BOOL bOnlyUser; BOOL bMangledNames; BOOL bWidelinks; @@ -338,6 +339,7 @@ static service sDefault = True, /* bLocking */ False, /* bStrictLocking */ True, /* bShareModes */ + True, /* bOpLocks */ False, /* bOnlyUser */ True, /* bMangledNames */ True, /* bWidelinks */ @@ -541,6 +543,7 @@ struct parm_struct {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL}, {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL}, {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL}, {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL}, @@ -935,6 +938,7 @@ FN_LOCAL_BOOL(lp_map_archive,bMap_archive) FN_LOCAL_BOOL(lp_locking,bLocking) FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) FN_LOCAL_BOOL(lp_share_modes,bShareModes) +FN_LOCAL_BOOL(lp_oplocks,bOpLocks) FN_LOCAL_BOOL(lp_onlyuser,bOnlyUser) FN_LOCAL_BOOL(lp_manglednames,bMangledNames) FN_LOCAL_BOOL(lp_widelinks,bWidelinks) @@ -1138,6 +1142,8 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) iSERVICE(i).bRead_only = False; /* No share modes on printer services. */ iSERVICE(i).bShareModes = False; + /* No oplocks on printer services. */ + iSERVICE(i).bOpLocks = False; /* Printer services must be printable. */ iSERVICE(i).bPrint_ok = True; -- cgit From e722d7077695242a7d6c0749b9a63741f660382a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Sat, 4 Oct 1997 01:07:47 +0000 Subject: nmblookup.c: I've added a -r option. When specified, nmblookup will attempt to bind to port 137. In order for this to work, the user must be root and the port must be available (i.e., nmbd not running). If either condition is not met, nmblookup will default to normal behavior; it will try to bind to a free port above 7999. I also removed an artifact. The -p option was being accepted but falling through to the default, which was the usage message. I removed "p:" from the getopt() list. params.c: Rewritten. The scanning is much more linear, and I found and fixed a few bugs. I don't like the way that the scratch buffer is handled, but I believe that it is an improvement over the previous version. Chris -)----- (This used to be commit 09dc951f2acd67da9d895e8e00c01e7abbbe0960) --- source3/param/params.c | 855 +++++++++++++++++++++++++++++++------------------ 1 file changed, 548 insertions(+), 307 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 0fdde0348f..8c41eef789 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -1,326 +1,567 @@ -/* - Unix SMB/Netbios implementation. - Version 1.9. - Parameter loading utlities - Copyright (C) Karl Auer 1993,1994,1997 - - 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. -*/ - -/************************************************************************** -PARAMS.C - -Copyright (C) 1990, 1991, 1992, 1993, 1994 Karl Auer - -This module provides for streamlines retrieval of information from a -Windows-like parameter files. There is a function which will search for -all sections in the file and call a specified function with each. There is -a similar function which will call a specified function for all parameters -in a section. The idea is that you pass the addresses of suitable functions -to a single function in this module which will then enumerate all sections, -and within each section all parameters, to your program. - -Parameter files contain text lines (newline delimited) which consist of -either a section name in square brackets or a parameter name, delimited -from the parameter value by an equals sign. Blank lines or lines where the -first non-whitespace character is a colon are ignored. All whitespace in -section names and parameter names is compressed to single spaces. Leading -and trailing whitespace on parameter names and parameter values is stripped. - -Only the first equals sign in a parameter line is significant - parameter -values may contain equals signs, square brackets and semicolons. Internal -whitespace is retained in parameter values. Parameter names may not start -with a square bracket, an equals sign or a semicolon, for obvious reasons. - -A sample parameter file might look like this: - -[things] -this=1 -that=2 -[other things] -the other = 3 - -**************************************************************************/ +/* -------------------------------------------------------------------------- ** + * Microsoft Network Services for Unix, AKA., Andrew Tridgell's SAMBA. + * + * This module Copyright (C) 1990, 1991, 1992, 1993, 1994 Karl Auer + * + * Rewritten almost completely by Christopher R. Hertel + * at the University of Minnesota, September, 1997. + * This module Copyright (C) 1997 by the University of Minnesota + * -------------------------------------------------------------------------- ** + * + * 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. + * + * -------------------------------------------------------------------------- ** + * + * Module name: params + * + * -------------------------------------------------------------------------- ** + * + * This module performs lexical analysis and initial parsing of a + * Windows-like parameter file. It recognizes and handles four token + * types: section-name, parameter-name, parameter-value, and + * end-of-file. Comments and line continuation are handled + * internally. + * + * The entry point to the module is function pm_process(). This + * function opens the source file, calls the Parse() function to parse + * the input, and then closes the file when either the EOF is reached + * or a fatal error is encountered. + * + * A sample parameter file might look like this: + * + * [section one] + * parameter one = value string + * parameter two = another value + * [section two] + * new parameter = some value or t'other + * + * The parameter file is divided into sections by section headers: + * section names enclosed in square brackets (eg. [section one]). + * Each section contains parameter lines, each of which consist of a + * parameter name and value delimited by an equal sign. Roughly, the + * syntax is: + * + * :== {
} EOF + * + *
:==
{ } + * + *
:== '[' NAME ']' + * + * :== NAME '=' VALUE '\n' + * + * Blank lines and comment lines are ignored. Comment lines are lines + * beginning with either a semicolon (';') or a pound sign ('#'). + * + * All whitespace in section names and parameter names is compressed + * to single spaces. Leading and trailing whitespace is stipped from + * both names and values. + * + * Only the first equals sign in a parameter line is significant. + * Parameter values may contain equals signs, square brackets and + * semicolons. Internal whitespace is retained in parameter values, + * with the exception of the '\r' character, which is stripped for + * historic reasons. Parameter names may not start with a left square + * bracket, an equal sign, a pound sign, or a semicolon, because these + * are used to identify other tokens. + * + * -------------------------------------------------------------------------- ** + */ #include "includes.h" -#include "smb.h" +/* -------------------------------------------------------------------------- ** + * Constants... + */ -/* local variable pointing to passed filename */ -static char *pszParmFile = NULL; -extern int DEBUGLEVEL; +#define BUFR_INC 1024 -/************************************************************************** -Strip all leading whitespace from a string. -**************************************************************************/ -static void trimleft(char *psz) -{ - char *pszDest; - - pszDest = psz; - if (psz != NULL) - { - while (*psz != '\0' && isspace(*psz)) - psz++; - while (*psz != '\0') - *pszDest++ = *psz++; - *pszDest = '\0'; - } -} - -/************************************************************************** -Strip all trailing whitespace from a string. -**************************************************************************/ -static void trimright(char *psz) -{ - char *pszTemp; - - if (psz != NULL && psz[0] != '\0') - { - pszTemp = psz + strlen(psz) - 1; - while (isspace(*pszTemp)) - *pszTemp-- = '\0'; - } -} - -/*********************************************************************** -Collapse each whitespace area in a string to a single space. -***********************************************************************/ -static void collapse_spaces(char *psz) -{ - while (*psz) - if (isspace(*psz)) - { - *psz++ = ' '; - trimleft(psz); - } - else - psz++; -} - -/************************************************************************** -Return the value of the first non-white character in the specified string. -The terminating NUL counts as non-white for the purposes of this function. -Note - no check for a NULL string! What would we return? -**************************************************************************/ -static int firstnonwhite(char *psz) -{ - while (isspace(*psz) && (*psz != '\0')) - psz++; - return (*psz); -} - - -/************************************************************************** -Identifies all parameters in the current section, calls the parameter -function for each. Ignores comment lines, stops and backs up in file when -a section is encountered. Returns True on success, False on error. -**************************************************************************/ -static BOOL enumerate_parameters(FILE *fileIn, BOOL (*pfunc)(char *,char *)) -{ - pstring szBuf; - char *pszTemp; - BOOL bRetval; - long lFileOffset; - int cTemp; - BOOL bParmFound; - - bRetval = False; - bParmFound = False; - while (True) - { - /* first remember where we are */ - if ((lFileOffset = ftell(fileIn)) >= 0L) +/* -------------------------------------------------------------------------- ** + * Variables... + * + * DEBUGLEVEL - The ubiquitous DEBUGLEVEL. This determines which DEBUG() + * messages will be produced. + * bufr - pointer to a global buffer. This is probably a kludge, + * but it was the nicest kludge I could think of (for now). + * bSize - The size of the global buffer . + */ + +extern int DEBUGLEVEL; + +static char *bufr = NULL; +static int bSize = 0; + +/* -------------------------------------------------------------------------- ** + * Functions... + */ + +static int EatWhitespace( FILE *InFile ) + /* ------------------------------------------------------------------------ ** + * Scan past whitespace (see ctype(3C)) and return the first non-whitespace + * character, or newline, or EOF. + * + * Input: InFile - Input source. + * + * Output: The next non-whitespace character in the input stream. + * + * Notes: Because the config files use a line-oriented grammar, we + * explicitly exclude the newline character from the list of + * whitespace characters. + * - Note that both EOF (-1) and the nul character ('\0') are + * considered end-of-file markers. + * + * ------------------------------------------------------------------------ ** + */ + { + int c; + + for( c = getc( InFile ); isspace( c ) && ('\n' != c); c = getc( InFile ) ) + ; + return( c ); + } /* EatWhitespace */ + +static int EatComment( FILE *InFile ) + /* ------------------------------------------------------------------------ ** + * Scan to the end of a comment. + * + * Input: InFile - Input source. + * + * Output: The character that marks the end of the comment. Normally, + * this will be a newline, but it *might* be an EOF. + * + * Notes: Because the config files use a line-oriented grammar, we + * explicitly exclude the newline character from the list of + * whitespace characters. + * - Note that both EOF (-1) and the nul character ('\0') are + * considered end-of-file markers. + * + * ------------------------------------------------------------------------ ** + */ + { + int c; + + for( c = getc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = getc( InFile ) ) + ; + return( c ); + } /* EatComment */ + +static int Continuation( char *line, int pos ) + /* ------------------------------------------------------------------------ ** + * Scan backards within a string to discover if the last non-whitespace + * character is a line-continuation character ('\\'). + * + * Input: line - A pointer to a buffer containing the string to be + * scanned. + * pos - This is taken to be the offset of the end of the + * string. This position is *not* scanned. + * + * Output: The offset of the '\\' character if it was found, or -1 to + * indicate that it was not. + * + * ------------------------------------------------------------------------ ** + */ + { + pos--; + while( (pos >= 0) && isspace(line[pos]) ) + pos--; + + return( ((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); + } /* Continuation */ + + +static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) + /* ------------------------------------------------------------------------ ** + * Scan a section name, and pass the name to function sfunc(). + * + * Input: InFile - Input source. + * sfunc - Pointer to the function to be called if the section + * name is successfully read. + * + * Output: True if the section name was read and True was returned from + * . False if failed or if a lexical error was + * encountered. + * + * ------------------------------------------------------------------------ ** + */ + { + int c; + int i; + int end; + char *func = "params.c:Section() -"; + + i = 0; /* is the offset of the next free byte in bufr[] and */ + end = 0; /* is the current "end of string" offset. In most */ + /* cases these will be the same, but if the last */ + /* character written to bufr[] is a space, then */ + /* will be one less than . */ + + c = EatWhitespace( InFile ); /* We've already got the '['. Scan */ + /* past initial white space. */ + + while( (EOF != c) && (c > 0) ) + { + + /* Check that the buffer is big enough for the next character. */ + if( i > (bSize - 2) ) { - /* then get and check a line */ - if (fgets_slash(szBuf, sizeof(szBuf)-1, fileIn) == NULL) - { - /* stop - return OK unless file error */ - bRetval = !ferror(fileIn); - if (!bRetval) - DEBUG(0,( "Read error on configuration file (enumerating parameters)!\n")); - break; - } - else - /* if first non-white is a '[', stop (new section) */ - if ((cTemp = firstnonwhite(szBuf)) == '[') - { - /* restore position to start of new section */ - if (fseek(fileIn, lFileOffset, SEEK_SET) < 0L) - { - DEBUG(0,( "Seek error on configuration file!\n")); - break; - } - - /* return success */ - bRetval = True; - break; - } - else - /* if it's a semicolon or line is blank, ignore the line */ - if (!cTemp || strchr(";#",cTemp)) - { - continue; - } - else - /* if no equals sign and line contains non-whitespace */ - /* then line is badly formed */ - if ((pszTemp = strchr(szBuf, '=')) == NULL) - { - DEBUG(0,( "Ignoring badly formed line: %s", szBuf)); - } - else - { - /* Note that we have found a parameter */ - bParmFound = True; - /* cut line at the equals sign */ - *pszTemp++ = '\0'; - /* trim leading and trailing space from both halves */ - trimright(szBuf); - trimleft(szBuf); - trimright(pszTemp); - trimleft(pszTemp); - /* process the parameter iff passed pointer not NULL */ - if (pfunc != NULL) - if (!pfunc(szBuf, pszTemp)) - break; - } + bSize += BUFR_INC; + bufr = Realloc( bufr, bSize ); + if( NULL == bufr ) + { + DEBUG(0, ("%s Memory re-allocation failure.", func) ); + return( False ); + } } - } - return (bRetval); -} - - -/*********************************************************************** -Close up s by n chars, at offset start. -***********************************************************************/ -static void closestr(char *s, int start, int n) -{ - char *src; - char *dest; - int len; - - if (n > 0) - if ((src = dest = s) != NULL) + + /* Handle a single character. */ + switch( c ) { - len = strlen(s); - if (start >= 0 && start < len - n) - { - src += start + n; - dest += start; - - while (*src) - *dest++ = *src++; - *dest = '\0'; - } + case ']': /* Found the closing bracket. */ + bufr[end] = '\0'; + if( 0 == end ) /* Don't allow an empty name. */ + { + DEBUG(0, ("%s Empty section name in configuration file.\n", func )); + return( False ); + } + if( !sfunc( bufr ) ) /* Got a valid name. Deal with it. */ + return( False ); + (void)EatComment( InFile ); /* Finish off the line. */ + return( True ); + + case '\n': /* Got newline before closing ']'. */ + i = Continuation( bufr, i ); /* Check for line continuation. */ + if( i < 0 ) + { + bufr[end] = '\0'; + DEBUG(0, ("%s Badly formed line in configuration file: %s\n", + func, bufr )); + return( False ); + } + end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + c = getc( InFile ); /* Continue with next line. */ + break; + + default: /* All else are a valid name chars. */ + if( isspace( c ) ) /* One space per whitespace region. */ + { + bufr[end] = ' '; + i = end + 1; + c = EatWhitespace( InFile ); + } + else /* All others copy verbatim. */ + { + bufr[i++] = c; + end = i; + c = getc( InFile ); + } } -} - -/************************************************************************** -Identifies all sections in the parameter file, calls passed section_func() -for each, passing the section name, then calls enumerate_parameters(). -Returns True on success, False on failure. Note that the section and -parameter names will have all internal whitespace areas collapsed to a -single space for processing. -**************************************************************************/ -static BOOL enumerate_sections(FILE *fileIn, - BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)) -{ - pstring szBuf; - BOOL bRetval; - BOOL bSectionFound; - - /* this makes sure we get include lines right */ - enumerate_parameters(fileIn, pfunc); - - bRetval = False; - bSectionFound = False; - while (True) - { - if (fgets_slash(szBuf, sizeof(szBuf)-1, fileIn) == NULL) + } + + /* We arrive here if we've met the EOF before the closing bracket. */ + DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, bufr )); + return( False ); + } /* Section */ + +static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) + /* ------------------------------------------------------------------------ ** + * Scan a parameter name and value, and pass these two fields to pfunc(). + * + * Input: InFile - The input source. + * pfunc - A pointer to the function that will be called to + * process the parameter, once it has been scanned. + * c - The first character of the parameter name, which + * would have been read by Parse(). Unlike a comment + * line or a section header, there is no lead-in + * character that can be discarded. + * + * Output: True if the parameter name and value were scanned and processed + * successfully, else False. + * + * Notes: This function is in two parts. The first loop scans the + * parameter name. Internal whitespace is compressed, and an + * equal sign (=) terminates the token. Leading and trailing + * whitespace is discarded. The second loop scans the parameter + * value. When both have been successfully identified, they are + * passed to pfunc() for processing. + * + * ------------------------------------------------------------------------ ** + */ + { + int i = 0; /* Position within bufr. */ + int end = 0; /* bufr[end] is current end-of-string. */ + int vstart = 0; /* Starting position of the parameter value. */ + char *func = "params.c:Parameter() -"; + + /* Read the parameter name. */ + while( 0 == vstart ) /* Loop until we've found the start of the value. */ + { + + if( i > (bSize - 2) ) /* Ensure there's space for next char. */ { - /* stop - return OK unless file error */ - bRetval = !ferror(fileIn); - if (!bRetval) - DEBUG(0,( "Read error on configuration file (enumerating sections)!\n")); - break; + bSize += BUFR_INC; + bufr = Realloc( bufr, bSize ); + if( NULL == bufr ) + { + DEBUG(0, ("%s Memory re-allocation failure.", func) ); + return( False ); + } } - else + + switch( c ) { - trimleft(szBuf); - trimright(szBuf); - if (szBuf[0] == '[') - { - closestr(szBuf, 0, 1); - if (strlen(szBuf) > 1) - if (szBuf[strlen(szBuf) - 1] == ']') - { - /* found a section - note the fact */ - bSectionFound = True; - /* remove trailing metabracket */ - szBuf[strlen(szBuf) - 1] = '\0'; - /* remove leading and trailing whitespace from name */ - trimleft(szBuf); - trimright(szBuf); - /* reduce all internal whitespace to one space */ - collapse_spaces(szBuf); - /* process it - stop if the processing fails */ - if (sfunc != NULL) - if (!sfunc(szBuf)) - break; - if (!enumerate_parameters(fileIn, pfunc)) - break; - } - } + case '=': /* Equal sign marks end of param name. */ + if( 0 == end ) /* Don't allow an empty name. */ + { + DEBUG(0, ("%s Invalid parameter name in config. file.\n", func )); + return( False ); + } + bufr[end++] = '\0'; /* Mark end of string & advance. */ + i = end; /* New string starts here. */ + vstart = end; /* New string is parameter value. */ + bufr[i] = '\0'; /* New string is nul, for now. */ + break; + + case '\n': /* Find continuation char, else error. */ + i = Continuation( bufr, i ); + if( i < 0 ) + { + bufr[end] = '\0'; + DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", + func, bufr )); + return( True ); + } + end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + c = getc( InFile ); /* Read past eoln. */ + break; + + case '\0': /* Shouldn't have EOF within param name. */ + case EOF: + bufr[i] = '\0'; + DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, bufr )); + return( True ); + + default: + if( isspace( c ) ) /* One ' ' per whitespace region. */ + { + bufr[end] = ' '; + i = end + 1; + c = EatWhitespace( InFile ); + } + else /* All others verbatim. */ + { + bufr[i++] = c; + end = i; + c = getc( InFile ); + } } - } - - return (bRetval); -} - -/************************************************************************** -Process the passed parameter file. + } -Returns True if successful, else False. -**************************************************************************/ -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)) -{ - FILE *fileIn; - BOOL bRetval; + /* Now parse the value. */ + c = EatWhitespace( InFile ); /* Again, trim leading whitespace. */ + while( (EOF !=c) && (c > 0) ) + { - bRetval = False; - - /* record the filename for use in error messages one day... */ - pszParmFile = pszFileName; - - if (pszParmFile == NULL || strlen(pszParmFile) < 1) - DEBUG(0,( "No configuration filename specified!\n")); - else - if ((fileIn = fopen(pszParmFile, "r")) == NULL) - DEBUG(0,( "Unable to open configuration file \"%s\"!\n", pszParmFile)); - else + if( i > (bSize - 2) ) /* Make sure there's enough room. */ { - DEBUG(3,("Processing configuration file \"%s\"\n", pszParmFile)); - bRetval = enumerate_sections(fileIn, sfunc, pfunc); - fclose(fileIn); + bSize += BUFR_INC; + bufr = Realloc( bufr, bSize ); + if( NULL == bufr ) + { + DEBUG(0, ("%s Memory re-allocation failure.", func) ); + return( False ); + } } - if (!bRetval) - DEBUG(0,("pm_process retuned false\n")); - return (bRetval); -} - - + switch( c ) + { + case '\r': /* Explicitly remove '\r' because the older */ + c = getc( InFile ); /* version called fgets_slash() which also */ + break; /* removes them. */ + + case '\n': /* Marks end of value unless there's a '\'. */ + i = Continuation( bufr, i ); + if( i < 0 ) + c = 0; + else + { + for( end = i; (end >= 0) && isspace(bufr[end]); end-- ) + ; + c = getc( InFile ); + } + break; + + default: /* All others verbatim. Note that spaces do */ + bufr[i++] = c; /* not advance . This allows trimming */ + if( !isspace( c ) ) /* of whitespace at the end of the line. */ + end = i; + c = getc( InFile ); + break; + } + } + bufr[end] = '\0'; /* End of value. */ + + return( pfunc( bufr, &bufr[vstart] ) ); /* Pass name & value to pfunc(). */ + } /* Parameter */ + +static BOOL Parse( FILE *InFile, + BOOL (*sfunc)(char *), + BOOL (*pfunc)(char *, char *) ) + /* ------------------------------------------------------------------------ ** + * Scan & parse the input. + * + * Input: InFile - Input source. + * sfunc - Function to be called when a section name is scanned. + * See Section(). + * pfunc - Function to be called when a parameter is scanned. + * See Parameter(). + * + * Output: True if the file was successfully scanned, else False. + * + * Notes: The input can be viewed in terms of 'lines'. There are four + * types of lines: + * Blank - May contain whitespace, otherwise empty. + * Comment - First non-whitespace character is a ';' or '#'. + * The remainder of the line is ignored. + * Section - First non-whitespace character is a '['. + * Parameter - The default case. + * + * ------------------------------------------------------------------------ ** + */ + { + int c; + char *func = "params.c:Parse() -"; + + c = EatWhitespace( InFile ); + while( (EOF != c) && (c > 0) ) + { + switch( c ) + { + case '\n': /* Blank line. */ + c = EatWhitespace( InFile ); + break; + + case ';': /* Comment line. */ + case '#': + c = EatComment( InFile ); + break; + + case '[': /* Section Header. */ + if( !Section( InFile, sfunc ) ) + return( False ); + c = EatWhitespace( InFile ); + break; + + case '\\': /* Bogus backslash. */ + c = EatWhitespace( InFile ); + break; + + default: /* Parameter line. */ + if( !Parameter( InFile, pfunc, c ) ) + return( False ); + c = EatWhitespace( InFile ); + break; + } + } + return( True ); + } /* Parse */ + +static FILE *OpenConfFile( char *FileName ) + /* ------------------------------------------------------------------------ ** + * Open a configuration file. + * + * Input: FileName - The pathname of the config file to be opened. + * + * Output: A pointer of type (FILE *) to the opened file, or NULL if the + * file could not be opened. + * + * ------------------------------------------------------------------------ ** + */ + { + FILE *OpenedFile; + char *func = "params.c:OpenConfFile() -"; + + if( NULL == FileName || 0 == *FileName ) + { + DEBUG( 0, ("%s No configuration filename specified.\n", func) ); + return( NULL ); + } + + OpenedFile = fopen( FileName, "r" ); + if( NULL == OpenedFile ) + { + DEBUG( 0, + ("%s Unable to open configuration file \"%s\":\n\t%s\n", + func, FileName, strerror(errno)) ); + } + + return( OpenedFile ); + } /* OpenConfFile */ + +BOOL pm_process( char *FileName, + BOOL (*sfunc)(char *), + BOOL (*pfunc)(char *, char *) ) + /* ------------------------------------------------------------------------ ** + * Process the named parameter file. + * + * Input: FileName - The pathname of the parameter file to be opened. + * sfunc - A pointer to a function that will be called when + * a section name is discovered. + * pfunc - A pointer to a function that will be called when + * a parameter name and value are discovered. + * + * Output: TRUE if the file was successfully parsed, else FALSE. + * + * ------------------------------------------------------------------------ ** + */ + { + int result; + FILE *InFile; + char *func = "params.c:pm_process() -"; + + InFile = OpenConfFile( FileName ); /* Open the config file. */ + if( NULL == InFile ) + return( False ); + + DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) ); + + if( NULL != bufr ) /* If we already have a buffer */ + result = Parse( InFile, sfunc, pfunc ); /* (recursive call), then just */ + /* use it. */ + + else /* If we don't have a buffer */ + { /* allocate one, then parse, */ + bSize = BUFR_INC; /* then free. */ + bufr = (char *)malloc( bSize ); + if( NULL == bufr ) + { + DEBUG(0,("%s memory allocation failure.\n", func)); + return( False ); + } + result = Parse( InFile, sfunc, pfunc ); + free( bufr ); + bufr = NULL; + bSize = 0; + } + + if( !result ) /* Generic failure. */ + { + DEBUG(0,("%s Failed. Error returned from params.c:parse().\n", func)); + return( False ); + } + + return( True ); /* Generic success. */ + } /* pm_process */ + +/* -------------------------------------------------------------------------- */ -- cgit From 2e92be3aaf01c574d32d1a10e1359888638b68bc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 Oct 1997 17:52:25 +0000 Subject: client.c: Changed shadowed variable. locking.c: Removed USE_OPLOCKS - now the default. params.c: Removed unused variable. proto.h: Updated. reply.c: Removed USE_OPLOCKS - now the default. server.c: Removed USE_OPLOCKS - now the default. smb.h: Removed USE_OPLOCKS - now the default. smbparse.c: Changed shadowed variable. status.c: Removed USE_OPLOCKS - now the default. util.c: Removed USE_OPLOCKS - now the default. Jeremy (jallison@whistle.com) (This used to be commit b93509846d6291771787af457500eec8984ee6bd) --- source3/param/params.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 8c41eef789..4d1c191b47 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -441,7 +441,6 @@ static BOOL Parse( FILE *InFile, */ { int c; - char *func = "params.c:Parse() -"; c = EatWhitespace( InFile ); while( (EOF != c) && (c > 0) ) -- cgit From 8871297885050911aaa802c4e90e282c44e49b84 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 8 Oct 1997 17:12:07 +0000 Subject: loadparm.c proto.h: added lp_domainsid() lsaparse.c smb.h: debugging structures and parsing functions pipes.c: finally got to the functions that will go into the RPC switch statement. (This used to be commit d15aed8a9c58a7cc90befaee2d5a2752708f9327) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fb656aa627..edc2d2b65f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -140,6 +140,7 @@ typedef struct char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; + char *szDomainSID; int max_log_size; int mangled_stack; int max_xmit; @@ -436,6 +437,7 @@ struct parm_struct {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL}, {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, + {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, @@ -839,6 +841,8 @@ FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) +FN_GLOBAL_STRING(lp_domainsid,&Globals.szDomainSID) + FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -- cgit From 69eea4fcf818ce976060e31432a6a415ab191d64 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Oct 1997 03:53:07 +0000 Subject: fixed the problem that browsing breaks if you put quote marks around the server string option. I fixed it by adding: trim_string(ret, "\"", "\"") to lp_string() which means that it removes leading and trailing quotes from _all_ strings in smb.conf. I think this is what we want as I can't actually think of any case where quoted strings are needed. I suspect that this fix will actually fix browsing at quite a few sites. It's not uncommon to see people putting "" marks around the workgroup name or other essential strings. The real reason it was causing browsing to fail is that the browse.dat file uses " to delimit fields, which means that it wasn't being parsed correctly. It would be nice to use a proper database format in browse.dat sometime. In fact, we really need a generic database type subsystem in Samba to replace the mish-mash we currrently use (browse.dat, wins.dat, smbpasswd etc) (This used to be commit ac50a88e1181bd4954f03e5450dedce87ed781ad) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index edc2d2b65f..b877650078 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -783,6 +783,8 @@ char *lp_string(char *s) else StrCpy(ret,s); + trim_string(ret, "\"", "\""); + standard_sub_basic(ret); return(ret); } -- cgit From 07c507728b6d3f5521e74aa14aedd5b37dea8c57 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 18 Oct 1997 00:22:04 +0000 Subject: After talking with Andrew added "interfaces only" parameter that turns off the filtering on the broadcast socket by default. Jeremy (jallison@whistle.com) (This used to be commit db9aad07481f48c0fe2108d4ab0b2bc9b632816c) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b877650078..1568e3abf5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -183,6 +183,7 @@ typedef struct BOOL bUnixRealname; BOOL bNISHomeMap; BOOL bTimeServer; + BOOL bInterfacesOnly; } global; static global Globals; @@ -410,6 +411,7 @@ struct parm_struct {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, + {"interfaces only", P_BOOL, P_GLOBAL, &Globals.bInterfacesOnly, NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, @@ -655,6 +657,7 @@ static void init_globals(void) coding_system = interpret_coding_system (KANJI, SJIS_CODE); Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; + Globals.bInterfacesOnly = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -867,6 +870,7 @@ FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) +FN_GLOBAL_BOOL(lp_interfaces_only,&Globals.bInterfacesOnly) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 02674ea801a4fa1e9032d612d20d6370e53c066c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 19 Oct 1997 23:22:03 +0000 Subject: update the timestamp on config files in our linked list when we notice they have changed, otherwise we keep reading them again and again (This used to be commit 38c07fa932488542dbb687f8e0eca192d5f38a8e) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1568e3abf5..9f47f14be5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1425,10 +1425,10 @@ BOOL lp_file_list_changed(void) mod_time = file_modtime(n2); - if (f->modtime != mod_time) - { - DEBUG(6,("file %s modified: %s\n", n2, ctime(&mod_time))); - return(True); + if (f->modtime != mod_time) { + DEBUG(6,("file %s modified: %s\n", n2, ctime(&mod_time))); + f->modtime = mod_time; + return(True); } f = f->next; } -- cgit From 423a7c417136af3f6d09b3c1763336dd0a401d4f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 12:10:58 +0000 Subject: util.c password.c : added automount_server() function which, if -DAUTOMOUNT is in use, returns the server name of the NIS auto.map entry. otherwise, it returns local_server. added use of automount_server() for a new substitution %N for NIS home server. this defaults, via automount_server(), to the same functionality as %L if -DAUTOMOUNT is not used. removed vuser->home_share. moved code that grabbed the servername into the separate function automount_server(). loadparm.c : created "logon drive" (default of "") created "logon home" (default of "\\%N\%U") changed default of "logon path" from NULL to "\\%N\%U\profile". ipc.c pipenetlog.c : use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their now easier-to-use form (don't have to check if *lp_logon_path() and manually substitute a default of \\%L\%U and do a standard_sub_basic() on the result, because the default automatically does this. (This used to be commit c6c28a4c3c9010ff9d5eac4bad091189a786d5a0) --- source3/param/loadparm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9f47f14be5..9a26819397 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -132,6 +132,8 @@ typedef struct char *szCharacterSet; char *szLogonScript; char *szLogonPath; + char *szLogonDrive; + char *szLogonHome; char *szSmbrun; char *szWINSserver; char *szInterfaces; @@ -445,6 +447,8 @@ struct parm_struct {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, @@ -620,6 +624,11 @@ static void init_globals(void) string_set(&Globals.szServerString,s); sprintf(s,"%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); string_set(&Globals.szAnnounceVersion,s); + + string_set(&Globals.szLogonDrive, ""); + /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ + string_set(&Globals.szLogonHome, "\\\\%N\\%U"); + string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -838,6 +847,8 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) +FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) +FN_GLOBAL_STRING(lp_logon_home,&Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -- cgit From 77a93855259fe29c8b37575aba5f07dbb70d3510 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 16:25:19 +0000 Subject: added "domain groups" parameter, allowing you to specify the groups that the user belongs to. it would be nice to know exactly what the domain groups _are_.... (This used to be commit c6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9a26819397..32fc538886 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -143,6 +143,7 @@ typedef struct char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainSID; + char *szDomainGroups; int max_log_size; int mangled_stack; int max_xmit; @@ -442,6 +443,7 @@ struct parm_struct {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, + {"domain groups", P_USTRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, @@ -629,6 +631,7 @@ static void init_globals(void) /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); + string_set(&Globals.szDomainGroups, "776/7"); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -858,6 +861,7 @@ FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_domainsid,&Globals.szDomainSID) +FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From 79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Oct 1997 18:52:04 +0000 Subject: loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. Added 'dos filetimes' parameter for UTIME fix. locking_shm.c: Fixed typo (sorry Andrew :-). namepacket.c: Changed lp_interfaces_only() to lp_bind_interfaces_only(). proto.h: The usual. reply.c: Made filetime calls use new file_utime call (wrapper for sys_utime). server.c: Made filetime calls use new file_utime call (wrapper for sys_utime). system.c: Added Andrew's sanity checks to times in sys_utime(). time.c: Moved set_filetime() to server.c. Made null_mtime() global. trans2.c: Made filetime calls use new file_utime call (wrapper for sys_utime). Jeremy (jallison@whistle.com) (This used to be commit 41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/param/loadparm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 32fc538886..d0dfe4ace7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -186,7 +186,7 @@ typedef struct BOOL bUnixRealname; BOOL bNISHomeMap; BOOL bTimeServer; - BOOL bInterfacesOnly; + BOOL bBindInterfacesOnly; } global; static global Globals; @@ -273,6 +273,7 @@ typedef struct BOOL bDeleteReadonly; BOOL bFakeOplocks; BOOL bDeleteVetoFiles; + BOOL bDosFiletimes; char dummy[3]; /* for alignment */ } service; @@ -355,6 +356,7 @@ static service sDefault = False, /* bDeleteReadonly */ False, /* bFakeOplocks */ False, /* bDeleteVetoFiles */ + False, /* bDosFiletimes */ "" /* dummy */ }; @@ -414,7 +416,7 @@ struct parm_struct {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, - {"interfaces only", P_BOOL, P_GLOBAL, &Globals.bInterfacesOnly, NULL}, + {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, @@ -577,6 +579,7 @@ struct parm_struct {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL}, {NULL, P_BOOL, P_NONE, NULL, NULL} }; @@ -669,7 +672,7 @@ static void init_globals(void) coding_system = interpret_coding_system (KANJI, SJIS_CODE); Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; - Globals.bInterfacesOnly = False; + Globals.bBindInterfacesOnly = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -885,7 +888,7 @@ FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) -FN_GLOBAL_BOOL(lp_interfaces_only,&Globals.bInterfacesOnly) +FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -973,6 +976,7 @@ FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) +FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -- cgit From efe9b26a7b08cc9ea02cad32a847f71773a6edc4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 21 Oct 1997 18:25:14 +0000 Subject: loadparm.c : added "domain admin users" parameter added "domain guest users" parameter these two complement the "domain groups" parameter. the "domain groups" parameter should be for your own groups, and well-known aliases. util.c : added ability to do "domain groups = power_users admin_users backup_ops" which are well-known RID aliases, not well-known RID groups. pipenetlog.c : combine the "domain admin users"; "domain guest users" and "domain groups" parameters to give an array of RID groups to include in the SAM Logon response. ipc.c smb.h : moved REALLOC() into smb.h added RID #defines. proto.h: usual. (This used to be commit f2554f231d1f59f30224adcc02b2b3ca4c24e0dd) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d0dfe4ace7..a72471c5a9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -128,6 +128,8 @@ typedef struct char *szValidChars; char *szWorkGroup; char *szDomainController; + char *szDomainAdminUsers; + char *szDomainGuestUsers; char *szUsernameMap; char *szCharacterSet; char *szLogonScript; @@ -447,6 +449,8 @@ struct parm_struct {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, {"domain groups", P_USTRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, @@ -865,6 +869,8 @@ FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_domainsid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) +FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) +FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From 2e8cedba6480d0c1f89d3490888cadac769d09ca Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 22 Oct 1997 11:31:37 +0000 Subject: loadparm.c : added "domain other sids" parameter pipenetlog.c : using "domain other sids" parameter in SAM Logon response. using new name_to_rid() function for r_uid and r_gid. pipentlsa.c : minor mods to do with new name_to_rid() function. pipesrvsvc.c : in the "net share enum" response, allocate some more space for the buffer. there can be only 32 share entries in the response anyway. this needs to be dealt with. pipeutil.c : modified name_to_rid() function to use new parameters "domain admin users" and "domain guest users", but will otherwise do unix uid + 1000. moved make_dom_gids() here. proto.h: the usual. smb.h smbparse.c : renamed sid_no to sid_rev_num in DOM_SID, and gid to r_gid in DOM_GID. util.c : moved make_dom_gids() from here. created char *unistrn2(uint16* uni_buffer, int max_len) (This used to be commit ec60e48d7982240b7755d246b2f1e8989467f66f) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a72471c5a9..122e2f6649 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -145,6 +145,7 @@ typedef struct char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainSID; + char *szDomainOtherSIDs; char *szDomainGroups; int max_log_size; int mangled_stack; @@ -447,6 +448,7 @@ struct parm_struct {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, + {"domain other sids", P_USTRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL}, {"domain groups", P_USTRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, @@ -638,7 +640,7 @@ static void init_globals(void) /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); - string_set(&Globals.szDomainGroups, "776/7"); + Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -867,7 +869,8 @@ FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) -FN_GLOBAL_STRING(lp_domainsid,&Globals.szDomainSID) +FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) +FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) -- cgit From 8f0316bdbcba996d40ac152a9ac076a18b5dd7ec Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Oct 1997 19:32:59 +0000 Subject: Adding Windows 95 printer driver code donated by Jean-Francois.Micouleau@utc.fr. New program, make_printerdef, plus two new parameters : [global] "printer driver file" [local] "printer driver location" Jeremy. (This used to be commit 9a5b42e6b3e7a35d56f81e9428fc747246e2fc5c) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 122e2f6649..db494711b6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -147,6 +147,7 @@ typedef struct char *szDomainSID; char *szDomainOtherSIDs; char *szDomainGroups; + char *szDriverFile; int max_log_size; int mangled_stack; int max_xmit; @@ -222,6 +223,7 @@ typedef struct char *szLpresumecommand; char *szPrintername; char *szPrinterDriver; + char *szPrinterDriverLocation; char *szDontdescend; char *szHostsallow; char *szHostsdeny; @@ -305,6 +307,7 @@ static service sDefault = NULL, /* szLpresumecommand */ NULL, /* szPrintername */ NULL, /* szPrinterDriver - this is set in init_globals() */ + NULL, /* szPrinterDriverLocation */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -494,6 +497,7 @@ struct parm_struct {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL}, {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy}, @@ -576,6 +580,7 @@ struct parm_struct {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL}, {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, @@ -627,6 +632,7 @@ static void init_globals(void) string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, SMB_PASSWD); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); + string_set(&Globals.szDriverFile, DRIVERFILE); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); string_set(&Globals.szSmbrun, SMBRUN); @@ -868,6 +874,7 @@ FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) +FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) @@ -954,6 +961,7 @@ FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) +FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) -- cgit From 4fd96fddd2b13f60c4eb13263bac2a62a2795dcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Oct 1997 01:59:54 +0000 Subject: clean up the hash entry code a bit. Got rid of lp_shmem_hash_size() and made it private to the 2 shmem implementations. Added new shmops->hash_size() function. Added code to handle the IPC system limits by looping decreasing the size of the resources (semaphores and shared memory) that we request until we get under the system limits, which can be quite low on some systems! Added checks that the creator of the IPC objects is root. Otherwise we would be open to a security hole where someone pre-creates the shared memory segment and attaches. (This used to be commit 6b6f624b63137d4750200e8cb4961b1402513632) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index db494711b6..6c88168b82 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -166,7 +166,6 @@ typedef struct int max_ttl; int ReadSize; int shmem_size; - int shmem_hash_size; int client_code_page; int announce_as; /* This is initialised in init_globals */ BOOL bDNSproxy; @@ -479,7 +478,6 @@ struct parm_struct {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL}, {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL}, - {"shared file entries", P_INTEGER, P_GLOBAL, &Globals.shmem_hash_size, NULL}, {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, @@ -674,7 +672,6 @@ static void init_globals(void) Globals.max_ttl = 60*60*4; /* 2 hours default */ Globals.ReadSize = 16*1024; Globals.shmem_size = SHMEM_SIZE; - Globals.shmem_hash_size = SHMEM_HASH_SIZE; Globals.announce_as = ANNOUNCE_AS_NT; Globals.bUnixRealname = False; #if (defined(NETGROUP) && defined(AUTOMOUNT)) @@ -918,7 +915,6 @@ 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_shmem_size,&Globals.shmem_size) -FN_GLOBAL_INTEGER(lp_shmem_hash_size,&Globals.shmem_hash_size) FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security,&Globals.security) -- cgit From 23c68038b9cc7817e3d90d2b4ae3b97b16f2fa63 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Oct 1997 04:27:55 +0000 Subject: pm_process() never closed the file (a memory and file descriptor leak) (This used to be commit 0d9b0d0fffc2b11fe4897b8b99f321fc7d9a143c) --- source3/param/params.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 4d1c191b47..a0a259c007 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -546,6 +546,7 @@ BOOL pm_process( char *FileName, if( NULL == bufr ) { DEBUG(0,("%s memory allocation failure.\n", func)); + fclose(InFile); return( False ); } result = Parse( InFile, sfunc, pfunc ); @@ -554,6 +555,8 @@ BOOL pm_process( char *FileName, bSize = 0; } + fclose(InFile); + if( !result ) /* Generic failure. */ { DEBUG(0,("%s Failed. Error returned from params.c:parse().\n", func)); -- cgit From eebb68b92e76c24262128a2d83113d7827198fd5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 2 Nov 1997 19:27:26 +0000 Subject: loadparm.c : added "domain hosts allow" and "domain hosts deny". these are to be used to specify which workstations can log in to a samba PDC from. it is also used to check whether to add an initial machine password into the smbpasswd database or not smbpass.c : added capability to add a machine password to the smbpasswd database. ***** the default uid is zero ***** rpc_pipes/pipenetlog.c : use of "domain hosts allow/deny" parameters to allow login access. proto.h : usual. (This used to be commit 2e7d3410306640aa6402e0506430a53988cc583e) --- source3/param/loadparm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6c88168b82..2fe616f709 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -130,6 +130,8 @@ typedef struct char *szDomainController; char *szDomainAdminUsers; char *szDomainGuestUsers; + char *szDomainHostsallow; + char *szDomainHostsdeny; char *szUsernameMap; char *szCharacterSet; char *szLogonScript; @@ -450,11 +452,15 @@ struct parm_struct {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, - {"domain other sids", P_USTRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL}, - {"domain groups", P_USTRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, + {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL}, + {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL}, + {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL}, + {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL}, + {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, @@ -878,6 +884,9 @@ FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) +FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) +FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) + FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From b26623bc3a8ff5191763c83564453e77edee836a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 2 Nov 1997 20:35:20 +0000 Subject: Christian Lademann's contribution: new capabilities in smb.conf. '<' and '|' characters indicate read file and execute command respectively, and feed the output into the parameter (!!!). '<$' and '|$' means run standard_sub_basic() on them. this is going to be fun to document in smb.conf.5.... also, Christian created a new "online" service parameter. services can be taken "off-line".... (This used to be commit 15f44d28916cdc1432bffdbb999c7cf7efd8fb86) --- source3/param/loadparm.c | 154 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 112 insertions(+), 42 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2fe616f709..a798444676 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -278,6 +278,7 @@ typedef struct BOOL *copymap; BOOL bDeleteReadonly; BOOL bFakeOplocks; + BOOL bOnline; BOOL bDeleteVetoFiles; BOOL bDosFiletimes; char dummy[3]; /* for alignment */ @@ -362,6 +363,7 @@ static service sDefault = NULL, /* copymap */ False, /* bDeleteReadonly */ False, /* bFakeOplocks */ + True, /* bOnline */ False, /* bDeleteVetoFiles */ False, /* bDosFiletimes */ "" /* dummy */ @@ -594,6 +596,7 @@ struct parm_struct {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL}, + {"online", P_BOOL, P_LOCAL, &sDefault.bOnline, NULL}, {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL}, {NULL, P_BOOL, P_NONE, NULL, NULL} @@ -772,57 +775,108 @@ static void init_locals(void) } -/******************************************************************* a -convenience routine to grab string parameters into a rotating buffer, -and run standard_sub_basic on them. The buffers can be written to by -callers without affecting the source string. -********************************************************************/ -char *lp_string(char *s) + +/* chomp() strips off trailing linefeed- and carriage-return-characters */ +char *chomp(char *s) { - static char *bufs[10]; - static int buflen[10]; - static int next = -1; - char *ret; - int i; - int len = s?strlen(s):0; + if(!s || s == NULL) +return(NULL); - if (next == -1) { - /* initialisation */ - for (i=0;i<10;i++) { - bufs[i] = NULL; - buflen[i] = 0; - } - next = 0; - } + while(strlen(s) > 0) { + int i = strlen(s) - 1; - len = MAX(len+100,sizeof(pstring)); /* the +100 is for some - substitution room */ + if(s [i] == '\n' || s [i] == '\r') + s [i] = '\0'; + else + break; + } - if (buflen[next] != len) { - buflen[next] = len; - if (bufs[next]) free(bufs[next]); - bufs[next] = (char *)malloc(len); - if (!bufs[next]) { - DEBUG(0,("out of memory in lp_string()")); - exit(1); - } - } + return(s); +} - ret = &bufs[next][0]; - next = (next+1)%10; - if (!s) - *ret = 0; - else - StrCpy(ret,s); +/* +read_string_external(fname): depending on the first character in fname either +reads the first line of a file or of the output of a command. If the second +character is a '$' execute standard-substitutions on the string to be returned. + +examples: read_string_external(" Date: Mon, 3 Nov 1997 19:24:45 +0000 Subject: Rolling back the files loadparm.c : to equivalent to version 1.67 reply.c : to equivalent to version 1.69 server.c : to equivalent to version 1.122 util.c : to equivalent to version 1.98 to remove the incorrect changes. proto.h: The usual. rpc_pipes/smbparse.c : Backeting stuff that SHOULD NOT BE IN THE none-NTDOMAIN build ! Jeremy. (This used to be commit 6064c9d80fd9fcc3ceec528494ba5e2591610098) --- source3/param/loadparm.c | 154 +++++++++++++---------------------------------- 1 file changed, 42 insertions(+), 112 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a798444676..2fe616f709 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -278,7 +278,6 @@ typedef struct BOOL *copymap; BOOL bDeleteReadonly; BOOL bFakeOplocks; - BOOL bOnline; BOOL bDeleteVetoFiles; BOOL bDosFiletimes; char dummy[3]; /* for alignment */ @@ -363,7 +362,6 @@ static service sDefault = NULL, /* copymap */ False, /* bDeleteReadonly */ False, /* bFakeOplocks */ - True, /* bOnline */ False, /* bDeleteVetoFiles */ False, /* bDosFiletimes */ "" /* dummy */ @@ -596,7 +594,6 @@ struct parm_struct {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL}, - {"online", P_BOOL, P_LOCAL, &sDefault.bOnline, NULL}, {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL}, {NULL, P_BOOL, P_NONE, NULL, NULL} @@ -775,108 +772,57 @@ static void init_locals(void) } - -/* chomp() strips off trailing linefeed- and carriage-return-characters */ -char *chomp(char *s) -{ - if(!s || s == NULL) -return(NULL); - - while(strlen(s) > 0) { - int i = strlen(s) - 1; - - if(s [i] == '\n' || s [i] == '\r') - s [i] = '\0'; - else - break; - } - - return(s); -} - - -/* -read_string_external(fname): depending on the first character in fname either -reads the first line of a file or of the output of a command. If the second -character is a '$' execute standard-substitutions on the string to be returned. - -examples: read_string_external(" Date: Thu, 6 Nov 1997 23:03:58 +0000 Subject: following a cvs error, i am rewriting this monster-commit. with bad grace. Modified Files: --------------- Makefile: adding extra files ipc.c : send_trans_reply() - alignment issue. this makes the alignment the same as that in NT. this should be looked at by people who understand the SMB stuff better than i. api_fd_commands[] - added samr and wkssvc pipes. loadparm.c : lp_domain_controller() changed to mean "samba is a domain controller". it's a "yes/no" parameter, now. no, it isn't used _anywhere_. namedbwork.c nameelect.c : if "domain controller = yes" then add SV_TYPE_DOMAIN_CTRL to the host _and_ workgroup announcements. yes, you must do both: nt does. namelogon.c : important NETLOGON bug in SAMLOGON request parsing, which may be the source of some people's problems with logging on to the Samba PDC. password.c : get_smbpwnam() renamed to get_smbpwd_entry(). pipes.c : added samr and wkssvc pipes. proto.h : usual. can we actually _remove_ proto.h from the cvs tree, and have it as one of the Makefile dependencies, or something? reply.c : get_smbpwnam() renamed to get_smbpwd_entry() - also changed response error code when logging in from a WORKSTATION$ account. yes, paul is right: we need to know when to return the right error code, and why. server.c : added call to reset_chain_pnum(). #ifdef NTDOMAIN added call to init_lsa_policy_hnd() #endif. jeremy, you'd be proud: i did a compile without NTDOMAIN, and caught a link error for this function. smb.h : defines and structures for samr and wkssvc pipes. smbpass.c : modified get_smbpwnam() to get_smbpwd_entry() and it now takes two arguments. one for the name; if this is null, it looks up by smb_userid instead. oh, by the way, smb_userids are actually domain relative ids (RIDs). concatenate a RID with the domain SID, and you have an internet globally unique way of identifying a user. we're using RIDs in the wrong way.... added mod_smbpwnam() function. this was based on code in smbpasswd.c rpc_pipes/lsaparse.c : added enum trusted domain parsing. this is incomplete: i need a packet trace to write it properly. rpc_pipes/pipe_hnd.c : added reset_chain_pnum() function. rpc_pipes/pipenetlog.c : get_smbpwnam() function renamed to get_smbpwd_entry(). arcfour() issues. removed capability of get_md4pw() function to automatically add workstation accounts. this should either be done using smbpasswd -add MACHINE$, or by using \PIPE\samr. rpc_pipes/pipe_util.c : create_pol_hnd() - creates a unique LSA Policy Handle. overkill function: uses a 64 bit sequence number; current unix time and the smbd pid. rpc_pipes/smbparse.c : arcfour() issues. smb_io_unistr2() should advance by uni_str_len not uni_max_len. smb_io_smb_hdr_rb() - request bind uses uint16 for the context id, and uint8 for the num_syntaxes. oops, i put these both as uint32s. Added Files: ------------ rpc_pipes/lsa_hnd.c : on the samr pipe, allocate and associate an LSA Policy Handle with a SID. you receive queries with the LSA Policy Handle, and have to turn this back into a SID in order to answer the query... rpc_pipes/pipesamr.c rpc_pipes/samrparse.c \PIPE\samr processing. samr i presume is the SAM Replication pipe. rpc_pipes/pipewkssvc.c rpc_pipes/wksparse.c \PIPE\wkssvc processing. the Workstation Service pipe? holy cow. (This used to be commit 1bd084b3e690eb26a1006d616075e53d711ecd2f) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2fe616f709..69c5fbd5c2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -127,7 +127,6 @@ typedef struct char *szSocketOptions; char *szValidChars; char *szWorkGroup; - char *szDomainController; char *szDomainAdminUsers; char *szDomainGuestUsers; char *szDomainHostsallow; @@ -175,6 +174,7 @@ typedef struct BOOL bWINSproxy; BOOL bLocalMaster; BOOL bPreferredMaster; + BOOL bDomainController; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -454,7 +454,7 @@ struct parm_struct {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, - {"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL}, + {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL}, {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL}, @@ -863,7 +863,6 @@ FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) -FN_GLOBAL_STRING(lp_domain_controller,&Globals.szDomainController) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) @@ -892,6 +891,7 @@ FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) +FN_GLOBAL_BOOL(lp_domain_controller,&Globals.bDomainController) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -- cgit From 9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Nov 1997 19:16:38 +0000 Subject: loadparm.c : Added "veto oplock files" parameter. make_printerdef.c: Fixed warning. quotas.c: Fixed irix root errors. server.c: Fixed oplock reference count bug. smb.h: Added IS_VETO_OPLOCK_PATH(). Jeremy. (This used to be commit c28487df63e29bc0f8d2ece876a07a2a076d4c73) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 69c5fbd5c2..3b8a06f02e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -233,6 +233,7 @@ typedef struct char *szMangledMap; char *szVetoFiles; char *szHideFiles; + char *szVetoOplockFiles; char *comment; char *force_user; char *force_group; @@ -317,6 +318,7 @@ static service sDefault = NULL, /* szMangledMap */ NULL, /* szVetoFiles */ NULL, /* szHideFiles */ + NULL, /* szVetoOplockFiles */ NULL, /* comment */ NULL, /* force user */ NULL, /* force group */ @@ -556,6 +558,7 @@ struct parm_struct {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL}, {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, @@ -966,6 +969,7 @@ FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) +FN_LOCAL_STRING(lp_veto_oplocks,szVetoFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) -- cgit From 4e92c7d1a3b543e48c2b09f8b78352a702c915aa Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Fri, 21 Nov 1997 14:01:23 +0000 Subject: Added in mods for new smb.conf "remote browse sync" option as posted to the samba-1.9.17 tree moments ago. (This used to be commit 2ee25cd117a116d0304960780d6c197f39d25a3d) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3b8a06f02e..43f0fe9208 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -141,6 +141,7 @@ typedef struct char *szWINSserver; char *szInterfaces; char *szRemoteAnnounce; + char *szRemoteBrowseSync; char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ @@ -470,6 +471,7 @@ struct parm_struct {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL}, {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, + {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL}, @@ -873,6 +875,7 @@ FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) FN_GLOBAL_STRING(lp_logon_home,&Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) +FN_GLOBAL_STRING(lp_remote_browse_sync,&Globals.szRemoteBrowseSync) FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) -- cgit From 51f20adc6b964bad6e5bfbf69da68e1e6f45b13e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Nov 1997 07:09:12 +0000 Subject: added true enumerated types in loadparm.c. Now we don't need all those "interpret_security" and similar functions. This also means that testparm produces string values for these enumerated types rather than an integer. This was done to make the web interface much cleaner. While I was doing this I found a couple of very nasty bugs in the parm_table code. Someone had added a handle_character_set() function that treated the char** pointer for a P_STRING as an integer! This would have caused memory corruption for anyone using the "character set" option. The loadparm code is delicate - please be careful about using it's more esoteric features! I've also removed the "coding system" global and made it a P_STRING. The integer value was never used anywhere in Samba. (This used to be commit bac6b0daa288e879330e3d585582122bb93a1ffb) --- source3/param/loadparm.c | 707 +++++++++++++++++++++++------------------------ 1 file changed, 339 insertions(+), 368 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 43f0fe9208..8858455f6a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -90,7 +90,7 @@ extern pstring myname; typedef enum { P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, - P_STRING,P_USTRING,P_GSTRING,P_UGSTRING + P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM } parm_type; typedef enum @@ -102,7 +102,6 @@ int keepalive=0; extern BOOL use_getwd_cache; extern int extra_time_offset; -extern int coding_system; /* * This structure describes global (ie., server-wide) parameters. @@ -139,6 +138,7 @@ typedef struct char *szLogonHome; char *szSmbrun; char *szWINSserver; + char *szCodingSystem; char *szInterfaces; char *szRemoteAnnounce; char *szRemoteBrowseSync; @@ -386,222 +386,241 @@ static int default_server_announce; static BOOL handle_valid_chars(char *pszParmValue, char **ptr); static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_protocol(char *pszParmValue,int *val); -static BOOL handle_security(char *pszParmValue,int *val); -static BOOL handle_case(char *pszParmValue,int *val); -static BOOL handle_printing(char *pszParmValue,int *val); -static BOOL handle_character_set(char *pszParmValue,int *val); -static BOOL handle_announce_as(char *pszParmValue, int *val); -static BOOL handle_coding_system(char *pszParmValue,int *val); +static BOOL handle_character_set(char *pszParmValue,char **ptr); +static BOOL handle_coding_system(char *pszParmValue,char **ptr); static void set_default_server_announce_type(void); -struct parm_struct +struct enum_list { + int value; + char *name; +}; + +static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, + {PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE,"CORE"}, + {PROTOCOL_COREPLUS, "COREPLUS"}, + {PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL}}; + +static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, + {SEC_SERVER, "SERVER"}, {-1, NULL}}; + +static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, + {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, + {PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, + {PRINT_LPRNG, "lprng"}, {-1, NULL}}; + +static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_AS_WIN95, "win95"}, + {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL}}; + +static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; + +static struct parm_struct { - char *label; - parm_type type; - parm_class class; - void *ptr; - BOOL (*special)(); + char *label; + parm_type type; + parm_class class; + void *ptr; + BOOL (*special)(); + struct enum_list *enum_list; } parm_table[] = { - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL}, - {"protocol", P_INTEGER, P_GLOBAL, &Globals.maxprotocol,handle_protocol}, - {"security", P_INTEGER, P_GLOBAL, &Globals.security,handle_security}, - {"printing", P_INTEGER, P_GLOBAL, &Globals.printing,handle_printing}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL}, - {"announce as", P_INTEGER, P_GLOBAL, &Globals.announce_as, handle_announce_as}, - {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL}, - {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL}, - {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL}, - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL}, - {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL}, - {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL}, - {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL}, - {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL}, - {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL}, - {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL}, - {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL}, - {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL}, - {"coding system", P_INTEGER, P_GLOBAL, &coding_system, handle_coding_system}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, - {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL}, - {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL}, - {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy}, - {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include}, - {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL}, - {"default case", P_INTEGER, P_LOCAL, &sDefault.iDefaultCase, handle_case}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL}, - - {NULL, P_BOOL, P_NONE, NULL, NULL} + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security}, + {"printing", P_ENUM, P_GLOBAL, &Globals.printing, NULL, enum_printing}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as}, + {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL}, + {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL}, + {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL}, + {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL}, + {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL}, + {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL}, + {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, + {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, + {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, + {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL}, + {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, + {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL}, + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL}, + {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL}, + {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL}, + {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL}, + {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL}, + + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL} }; @@ -689,7 +708,7 @@ static void init_globals(void) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); #endif - coding_system = interpret_coding_system (KANJI, SJIS_CODE); + interpret_coding_system(KANJI); Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; @@ -714,17 +733,6 @@ static void init_globals(void) Globals.bWINSsupport = False; Globals.bWINSproxy = False; -/* this parameter is currently set to the default functionality - in samba. given that w95 and NT is starting to use DNS for - server resolution, i expect that at some point it would be - sensible to default this to False. - - this parameter is added because nmbd is a single process, and - gethostbyname is a blocking call, which can take out nmbd for - several seconds while a dns lookup is performed. - - */ - Globals.bDNSproxy = True; } @@ -1341,6 +1349,7 @@ static void copy_service(service *pserviceDest, break; case P_INTEGER: + case P_ENUM: case P_OCTAL: *(int *)dest_ptr = *(int *)src_ptr; break; @@ -1486,89 +1495,24 @@ BOOL lp_file_list_changed(void) /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ -static BOOL handle_coding_system(char *pszParmValue,int *val) +static BOOL handle_coding_system(char *pszParmValue,char **ptr) { - *val = interpret_coding_system(pszParmValue,*val); - return(True); + string_set(ptr,pszParmValue); + interpret_coding_system(pszParmValue); + return(True); } /*************************************************************************** handle the interpretation of the character set system parameter ***************************************************************************/ -static BOOL handle_character_set(char *pszParmValue,int *val) +static BOOL handle_character_set(char *pszParmValue,char **ptr) { - string_set(&Globals.szCharacterSet,pszParmValue); - *val = interpret_character_set(pszParmValue,*val); - return(True); + string_set(ptr,pszParmValue); + interpret_character_set(pszParmValue); + return(True); } -/*************************************************************************** -handle the interpretation of the protocol parameter -***************************************************************************/ -static BOOL handle_protocol(char *pszParmValue,int *val) -{ - *val = interpret_protocol(pszParmValue,*val); - return(True); -} - -/*************************************************************************** -handle the interpretation of the security parameter -***************************************************************************/ -static BOOL handle_security(char *pszParmValue,int *val) -{ - *val = interpret_security(pszParmValue,*val); - return(True); -} - -/*************************************************************************** -handle the interpretation of the default case -***************************************************************************/ -static BOOL handle_case(char *pszParmValue,int *val) -{ - if (strnequal(pszParmValue,"LOWER", 5)) - *val = CASE_LOWER; - else if (strnequal(pszParmValue,"UPPER", 5)) - *val = CASE_UPPER; - return(True); -} - -/*************************************************************************** -handle the interpretation of the printing system -***************************************************************************/ -static BOOL handle_printing(char *pszParmValue,int *val) -{ - if (strnequal(pszParmValue,"sysv", 4)) - *val = PRINT_SYSV; - else if (strnequal(pszParmValue,"aix", 3)) - *val = PRINT_AIX; - else if (strnequal(pszParmValue,"hpux", 4)) - *val = PRINT_HPUX; - else if (strnequal(pszParmValue,"bsd", 3)) - *val = PRINT_BSD; - else if (strnequal(pszParmValue,"qnx",3)) - *val = PRINT_QNX; - else if (strnequal(pszParmValue,"plp", 3)) - *val = PRINT_PLP; - else if (strnequal(pszParmValue,"lprng", 5)) - *val = PRINT_LPRNG; - return(True); -} - -/*************************************************************************** -handle the announce as parameter -***************************************************************************/ -static BOOL handle_announce_as(char *pszParmValue,int *val) -{ - if (strnequal(pszParmValue,"NT", 2)) - *val = ANNOUNCE_AS_NT; - else if (strnequal(pszParmValue,"win95", 5)) - *val = ANNOUNCE_AS_WIN95; - else if (strnequal(pszParmValue,"WfW", 3)) - *val = ANNOUNCE_AS_WFW; - return True; -} - /*************************************************************************** handle the valid chars lines ***************************************************************************/ @@ -1676,7 +1620,7 @@ then assume we are in the globals ***************************************************************************/ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) { - int parmnum; + int parmnum, i; void *parm_ptr=NULL; /* where we are going to store the result */ void *def_ptr=NULL; @@ -1702,7 +1646,6 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) } if (snum >= 0) { - int i; if (!iSERVICE(snum).copymap) init_copymap(pSERVICE(snum)); @@ -1760,6 +1703,15 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) strcpy((char *)parm_ptr,pszParmValue); strupper((char *)parm_ptr); 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; + } + } + break; } return(True); @@ -1781,86 +1733,104 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void print_parameter(parm_type type,void *ptr, FILE *f) -{ - switch (type) - { - case P_BOOL: - fprintf(f,"%s",BOOLSTR(*(BOOL *)ptr)); - break; +static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) +{ + int i; + switch (p->type) { + case P_ENUM: + for (i=0;p->enum_list[i].name;i++) { + if (*(int *)ptr == p->enum_list[i].value) { + fprintf(f,"%s",p->enum_list[i].name); + break; + } + } + break; + + case P_BOOL: + fprintf(f,"%s",BOOLSTR(*(BOOL *)ptr)); + break; - case P_BOOLREV: - fprintf(f,"%s",BOOLSTR(! *(BOOL *)ptr)); - break; + case P_BOOLREV: + fprintf(f,"%s",BOOLSTR(! *(BOOL *)ptr)); + break; - case P_INTEGER: - fprintf(f,"%d",*(int *)ptr); - break; + case P_INTEGER: + fprintf(f,"%d",*(int *)ptr); + break; - case P_CHAR: - fprintf(f,"%c",*(char *)ptr); - break; + case P_CHAR: + fprintf(f,"%c",*(char *)ptr); + break; - case P_OCTAL: - fprintf(f,"0%o",*(int *)ptr); - break; + case P_OCTAL: + fprintf(f,"0%o",*(int *)ptr); + break; - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) - fprintf(f,"%s",(char *)ptr); - break; - - case P_STRING: - case P_USTRING: - if (*(char **)ptr) - fprintf(f,"%s",*(char **)ptr); - break; - } + case P_GSTRING: + case P_UGSTRING: + if ((char *)ptr) + fprintf(f,"%s",(char *)ptr); + break; + + case P_STRING: + case P_USTRING: + if (*(char **)ptr) + fprintf(f,"%s",*(char **)ptr); + break; + } } /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void parameter_string(parm_type type,void *ptr,char *s) +static void parameter_string(struct parm_struct *p,void *ptr,char *s) { + int i; s[0] = 0; - switch (type) - { - case P_BOOL: - sprintf(s, "%s",BOOLSTR(*(BOOL *)ptr)); - break; - - case P_BOOLREV: - sprintf(s, "%s",BOOLSTR(! *(BOOL *)ptr)); - break; - - case P_INTEGER: - sprintf(s, "%d",*(int *)ptr); - break; - - case P_CHAR: - sprintf(s, "%c",*(char *)ptr); - break; - - case P_OCTAL: - sprintf(s, "0%o",*(int *)ptr); - break; - - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) - sprintf(s, "%s",(char *)ptr); - break; - - case P_STRING: - case P_USTRING: - if (*(char **)ptr) - sprintf(s, "%s",*(char **)ptr); - break; + switch (p->type) { + case P_ENUM: + for (i=0;p->enum_list[i].name;i++) { + if (*(int *)ptr == p->enum_list[i].value) { + sprintf(s,"%s",p->enum_list[i].name); + break; + } } + break; + + case P_BOOL: + sprintf(s, "%s",BOOLSTR(*(BOOL *)ptr)); + break; + + case P_BOOLREV: + sprintf(s, "%s",BOOLSTR(! *(BOOL *)ptr)); + break; + + case P_INTEGER: + sprintf(s, "%d",*(int *)ptr); + break; + + case P_CHAR: + sprintf(s, "%c",*(char *)ptr); + break; + + case P_OCTAL: + sprintf(s, "0%o",*(int *)ptr); + break; + + case P_GSTRING: + case P_UGSTRING: + if ((char *)ptr) + sprintf(s, "%s",(char *)ptr); + break; + + case P_STRING: + case P_USTRING: + if (*(char **)ptr) + sprintf(s, "%s",*(char **)ptr); + break; + } } @@ -1876,6 +1846,7 @@ static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) return(*((BOOL *)ptr1) == *((BOOL *)ptr2)); case P_INTEGER: + case P_ENUM: case P_OCTAL: return(*((int *)ptr1) == *((int *)ptr2)); @@ -1967,7 +1938,7 @@ static void dump_globals(FILE *f) (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) { fprintf(f,"\t%s = ",parm_table[i].label); - print_parameter(parm_table[i].type,parm_table[i].ptr, f); + print_parameter(&parm_table[i],parm_table[i].ptr, f); fprintf(f,"\n"); } } @@ -1996,7 +1967,7 @@ static void dump_a_service(service *pService, FILE *f) ((char *)&sDefault) + pdiff)) { fprintf(f,"\t%s = ",parm_table[i].label); - print_parameter(parm_table[i].type, + print_parameter(&parm_table[i], ((char *)pService) + pdiff, f); fprintf(f,"\n"); } @@ -2022,7 +1993,7 @@ int lp_next_parameter(int snum, int *i, char *label, ((*i) == 0 || (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { strcpy(label, parm_table[*i].label); - parameter_string(parm_table[*i].type, + parameter_string(&parm_table[*i], parm_table[*i].ptr, value); (*i)++; @@ -2045,7 +2016,7 @@ int lp_next_parameter(int snum, int *i, char *label, ((char *)pService) + pdiff, ((char *)&sDefault) + pdiff)) { strcpy(label, parm_table[*i].label); - parameter_string(parm_table[*i].type, + parameter_string(&parm_table[*i], ((char *)pService) + pdiff, value); (*i)++; -- cgit From 6c158adf25dae3a71203d0dffc6a6018ba02da0d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Nov 1997 23:43:06 +0000 Subject: oh no! my favourite hack is broken. You can't do: [%U] path = %H to get a new homes area. I wonder when it broke? Anyway, I've fixed it. We can all rest easy now, knowing that you really can produce an incomprehensible smb.conf and get it to work. (This used to be commit 2245da4ad6674aa373e3057c661f5bc0315e191f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8858455f6a..92b8f58ec9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2232,7 +2232,7 @@ int lp_servicenumber(char *pszServiceName) for (iService = iNumServices - 1; iService >= 0; iService--) if (VALID(iService) && - strwicmp(iSERVICE(iService).szService, pszServiceName) == 0) + strequal(lp_servicename(iService), pszServiceName)) break; if (iService < 0) -- cgit From 11d7f4a2aa01d5bd010fd18934c2516f39a41e3c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 03:37:02 +0000 Subject: make the "printing" option a per share option rather than global. When printing to lots of different sorts of remote printers this is useful (This used to be commit 7a88bed4a5ca8afe1f2836f7f9a019db01bf998e) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 92b8f58ec9..46b9be1635 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -160,7 +160,6 @@ typedef struct int deadtime; int maxprotocol; int security; - int printing; int maxdisksize; int lpqcachetime; int syslog; @@ -248,6 +247,7 @@ typedef struct int iDir_force_mode; int iMaxConnections; int iDefaultCase; + int iPrinting; BOOL bAlternatePerm; BOOL bRevalidate; BOOL bCaseSensitive; @@ -333,6 +333,7 @@ static service sDefault = 0000, /* iDir_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ + DEFAULT_PRINTING, /* iPrinting */ False, /* bAlternatePerm */ False, /* revalidate */ False, /* case sensitive */ @@ -430,7 +431,6 @@ static struct parm_struct {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security}, - {"printing", P_ENUM, P_GLOBAL, &Globals.printing, NULL, enum_printing}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as}, @@ -600,6 +600,7 @@ static struct parm_struct {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL}, @@ -689,7 +690,6 @@ static void init_globals(void) Globals.maxprotocol = PROTOCOL_NT1; Globals.security = SEC_SHARE; Globals.bEncryptPasswords = False; - Globals.printing = DEFAULT_PRINTING; Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; @@ -752,7 +752,7 @@ Initialise the sDefault parameter structure. static void init_locals(void) { /* choose defaults depending on the type of printing */ - switch (Globals.printing) + switch (sDefault.iPrinting) { case PRINT_BSD: case PRINT_AIX: @@ -941,7 +941,6 @@ FN_GLOBAL_INTEGER(lp_shmem_size,&Globals.shmem_size) FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security,&Globals.security) -FN_GLOBAL_INTEGER(lp_printing,&Globals.printing) FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) @@ -1022,6 +1021,7 @@ FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) +FN_LOCAL_INTEGER(lp_printing,iPrinting) FN_LOCAL_CHAR(lp_magicchar,magic_char) -- cgit From 0aa493cc0303aa4177f289b9e4c797c8fa180672 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Dec 1997 03:50:05 +0000 Subject: loadparm.c: Added lp_we_are_a_wins_server as an alias for lp_wins_support. Used by the new nmbd and just makes more sense :-). Jeremy. (This used to be commit 7a2a45eae2e9a930d3243498d4e66cc2f5e4d370) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 46b9be1635..abb3496f4e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -903,6 +903,7 @@ FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) +FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_controller,&Globals.bDomainController) -- cgit From 7a668a7641cd747455b7a9854dbc208a3e4bc7ef Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 05:08:07 +0000 Subject: applied a patch from Norm Jacobs to allow "printcap name = lpstat" to use lpstat to obtain the printer list on systemV systems. I've now made this the default on all SYSV systems. Jeremy, you were a little worried about the security of this patch. I believe it's OK as the user has no control over the options given to popen() and the pipe is only open for reading. (This used to be commit 6a83de0ae954bb18d3f15382f2b0b3259fedff09) --- source3/param/loadparm.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index abb3496f4e..a8e70717b6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -64,14 +64,6 @@ extern pstring myname; #define GLOBAL_NAME "global" #endif -#ifndef PRINTCAP_NAME -#ifdef AIX -#define PRINTCAP_NAME "/etc/qconfig" -#else -#define PRINTCAP_NAME "/etc/printcap" -#endif -#endif - #ifndef PRINTERS_NAME #define PRINTERS_NAME "printers" #endif -- cgit From 64f0348a3f994334abe64a4d4896109c3c8c9039 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Dec 1997 14:16:07 +0000 Subject: This is it ! The mega-merge of the JRA_NMBD_REWRITE branch back into the main tree. For the cvs logs of all the files starting nmbd_*.c, look in the JRA_NMBD_REWRITE branch. That branch has now been discontinued. Jeremy. (This used to be commit d80b0cb645f81d16734929a0b27a91c6650499bb) --- source3/param/loadparm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a8e70717b6..76618e9a79 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -157,6 +157,8 @@ typedef struct int syslog; int os_level; int max_ttl; + int max_wins_ttl; + int min_wins_ttl; int ReadSize; int shmem_size; int client_code_page; @@ -503,6 +505,8 @@ static struct parm_struct {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL}, @@ -691,7 +695,9 @@ static void init_globals(void) Globals.syslog = 1; Globals.bSyslogOnly = False; Globals.os_level = 0; - Globals.max_ttl = 60*60*4; /* 2 hours default */ + Globals.max_ttl = 60*60*4; /* 4 hours default */ + Globals.max_wins_ttl = 60*60*24*3; /* 3 days default */ + Globals.min_wins_ttl = 60*60*6; /* 6 hours default */ Globals.ReadSize = 16*1024; Globals.shmem_size = SHMEM_SIZE; Globals.announce_as = ANNOUNCE_AS_NT; @@ -921,6 +927,8 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) 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_min_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) FN_GLOBAL_INTEGER(lp_mangledstack,&Globals.mangled_stack) FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) -- cgit From 16bf14adf1b78f7ec4d3d267d500258fdf399627 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Dec 1997 09:20:34 +0000 Subject: Added Lanman announce patch from Jacco de Leeuw . Also added code to stop old Samba servers that announce the workgroup name as master browser name when they are a local master browser. Jeremy. (This used to be commit 3605da055737e2cc0fbfffe7772721943a5be8bd) --- source3/param/loadparm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 76618e9a79..277430ecc4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -160,6 +160,8 @@ typedef struct 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 */ @@ -409,6 +411,8 @@ static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; +static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}}; + static struct parm_struct { char *label; @@ -507,6 +511,8 @@ static struct parm_struct {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL}, {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL}, {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL}, @@ -699,6 +705,8 @@ static void init_globals(void) Globals.max_wins_ttl = 60*60*24*3; /* 3 days default */ Globals.min_wins_ttl = 60*60*6; /* 6 hours default */ Globals.ReadSize = 16*1024; + Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ + Globals.lm_interval = 60; Globals.shmem_size = SHMEM_SIZE; Globals.announce_as = ANNOUNCE_AS_NT; Globals.bUnixRealname = False; @@ -947,6 +955,8 @@ FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) +FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) +FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) -- cgit From e9ef2a5a5e9bbec686429f00366b6d72cba83d03 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Dec 1997 12:21:39 +0000 Subject: WHATSNEW.txt - updated for 1.9.18alpha13. docs/smb.conf.5: Removed unused NTDOMAIN params. Added new params. source/loadparm.c: Put #ifdef NTDOMAIN around unused params. source/nmbd_become_lmb.c: Removed check for workgroup name in lmb name. Jeremy. (This used to be commit 5136c5ec119968b39e2cf9d7f3e6836d9286a51f) --- source3/param/loadparm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 277430ecc4..47faefc571 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -471,6 +471,7 @@ static struct parm_struct {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL}, {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL}, +#ifdef NTDOMAIN {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL}, {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL}, @@ -481,6 +482,7 @@ static struct parm_struct {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, +#endif /* NTDOMAIN */ {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL}, @@ -898,6 +900,7 @@ FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) +#ifdef NTDOMAIN FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) @@ -905,7 +908,7 @@ FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) - +#endif /* NTDOMAIN */ FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From efa661cb17d0a474403fc3589f716dc7d98502ff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Dec 1997 04:56:55 +0000 Subject: Missed terminating {-1,NULL} in an enum parameter list. Jeremy. (This used to be commit 5ea3633445d49da7a71be51e008128b3bbfaef9c) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 47faefc571..b2a016d8a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -411,7 +411,7 @@ static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; -static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}}; +static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; static struct parm_struct { -- cgit From d57c055478a34b9c4a0fc7ba90d20f510d0df797 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 20 Dec 1997 10:52:00 +0000 Subject: loadparm.c: Added fix for veto oplock files bug from Charles Hoch server.c, util.c: Added fix for oplock break requests blocking due to server being blocked in read call. Bug found by Charles Hoch . Jeremy. (This used to be commit 209f894fdbcfbf7a7952b6228342b86e088a9582) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b2a016d8a5..61a14c9249 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -993,7 +993,7 @@ FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) -FN_LOCAL_STRING(lp_veto_oplocks,szVetoFiles) +FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) -- cgit From 55f400bd84f26027f5ec9b7fa06b22895de7557c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Jan 1998 13:27:43 +0000 Subject: This is *not* a big change (although it looks like one). This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy. (This used to be commit b9c16977231efb274e08856f7f3f4408dad6d96c) --- source3/param/loadparm.c | 2 +- source3/param/params.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 61a14c9249..ac0f932fae 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Parameter loading functions - Copyright (C) Karl Auer 1993,1997 + Copyright (C) Karl Auer 1993-1998 Largely re-written by Andrew Tridgell, September 1994 diff --git a/source3/param/params.c b/source3/param/params.c index a0a259c007..2a0a253f20 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -1,11 +1,11 @@ /* -------------------------------------------------------------------------- ** * Microsoft Network Services for Unix, AKA., Andrew Tridgell's SAMBA. * - * This module Copyright (C) 1990, 1991, 1992, 1993, 1994 Karl Auer + * This module Copyright (C) 1990-1998 Karl Auer * * Rewritten almost completely by Christopher R. Hertel * at the University of Minnesota, September, 1997. - * This module Copyright (C) 1997 by the University of Minnesota + * This module Copyright (C) 1997-1998 by the University of Minnesota * -------------------------------------------------------------------------- ** * * This program is free software; you can redistribute it and/or modify -- cgit From 0c376c3ee726ba0c61f5537738041b5fe3d6e805 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 24 Jan 1998 12:26:17 +0000 Subject: Fix for memory leak in loadparm.c - donated by Branko Cibej I checked this out and it looks ok - the bzero() in init_service() was overwriting the pointers pservice->szService and pservice->copymap that should have been freed in copy_service() the line later. This fix frees pservice->szService and pservice->copymap inside free_service() and sets them to zero so they won't be freed again. Jeremy. (This used to be commit 0bcb00e2bad999df859fdff59ce720d34de9b1ad) --- source3/param/loadparm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ac0f932fae..ad05b756aa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1074,9 +1074,16 @@ static void free_service(service *pservice) if (!pservice) return; + string_free(&pservice->szService); + if (pservice->copymap) + { + free(pservice->copymap); + pservice->copymap = NULL; + } + for (i=0;parm_table[i].label;i++) if ((parm_table[i].type == P_STRING || - parm_table[i].type == P_STRING) && + parm_table[i].type == P_USTRING) && parm_table[i].class == P_LOCAL) string_free((char **)(((char *)pservice) + PTR_DIFF(parm_table[i].ptr,&sDefault))); } -- cgit From 40dfc7e6de4423a1b66f68ccb39f8d74b0257682 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 24 Jan 1998 12:34:16 +0000 Subject: Added log message so we can tell when free_service is called. Just in case of problems. Jeremy. (This used to be commit ee307df9ad1f03d7f8e515549902abd96dae72fc) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ad05b756aa..d2db90fd67 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1074,6 +1074,9 @@ static void free_service(service *pservice) if (!pservice) return; + if(pservice->szService) + DEBUG(5,("free_service: Freeing service %s\n", pservice->szService)); + string_free(&pservice->szService); if (pservice->copymap) { -- cgit From 5546e28e69b1a43dbb48e024e233d8ebf7fa667a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Feb 1998 12:15:20 +0000 Subject: A small raft of changes, I will sync up with 1.9.18 also. chgpasswd.c: Fixed typo in debug message. includes.h: Fix include for aix. kanji.c: Added cap_to_sj as inverse of sj_to_cap. loadparm.c: local.h: password.c: Added code for "networkstation user login" parameter. - patch from Rob Nielsen . printing.c: Added further aix printing fixes. reply.c: Changed access time fetch to a function. trans2.c: Changed access time fetch to a function. time.c: Changed access time fetch to a function. server.c: Made NT redirector workaround final. util.c: Added debug for write_socket failing. Jeremy. (This used to be commit a031404623c22d62f8de035be2239f609af08112) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d2db90fd67..0e55bc4ac1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -188,6 +188,7 @@ typedef struct BOOL bNISHomeMap; BOOL bTimeServer; BOOL bBindInterfacesOnly; + BOOL bNetWkstaUserLogon; } global; static global Globals; @@ -444,6 +445,7 @@ static struct parm_struct {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL}, {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL}, + {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL}, {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL}, @@ -720,6 +722,7 @@ static void init_globals(void) Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; + Globals.bNetWkstaUserLogon = True; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -935,6 +938,7 @@ FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) +FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 99e11e171e40703271ad2a7934708cee66b0bb82 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Feb 1998 11:07:14 +0000 Subject: Makefile: Added AIX 3.2.5. loadparm.c: Added "win95 bug compatibility" parameter. local.h: Replaced MAX_OPEN_FILES back to 100 from 10 (oops). reply.c: Fixed ulogoff check against uid - changed to vuid. server.c: Changed file struct save of uid - changed to vuid. smb.h: Changed id in struct current_user to vuid. Changed file struct uid to vuid. time.c: Added "win95 bug compatibility" atime -> mtime return. trans2.c: Added "win95 bug compatibility" fixes. uid.c: Changed id in struct current_user to vuid - added checks to set/reset it. util.c: Added code to expand environment variables. version.h : still at 1.9.18 (head branch doesn't matter too much at present). Jeremy. (This used to be commit adc903bcf59ad1664babd7f1d43675d3a75bfbc9) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0e55bc4ac1..82a4851444 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -189,6 +189,7 @@ typedef struct BOOL bTimeServer; BOOL bBindInterfacesOnly; BOOL bNetWkstaUserLogon; + BOOL bWin95BugCompatibility; } global; static global Globals; @@ -530,6 +531,7 @@ static struct parm_struct {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL}, {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL}, + {"win95 bug compatibility", P_BOOL, P_GLOBAL, &Globals.bWin95BugCompatibility,NULL, NULL}, {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL}, @@ -723,6 +725,7 @@ static void init_globals(void) Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bNetWkstaUserLogon = True; + Globals.bWin95BugCompatibility = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -939,6 +942,7 @@ FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) +FN_GLOBAL_BOOL(lp_win95_bug_compatibility,&Globals.bWin95BugCompatibility) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 2beada804a238534628398f62fe4ed9e8d2c3efd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 13 Feb 1998 07:11:58 +0000 Subject: Ding-dong the witch is dead, the witch is dead...... This is the checkin that fixes the infamous Visual C++ 'file has changed' bug. I feel *SO* good about that :-). charset.c: Added (void) to fix Herb's fussy compiler. loadparm.c: Removed "win95 bug compatibility" (didn't like it much anyway :-). Added "dos filetime resolution" instead. reply.c: Added the 2 second timestamp resolution fix that the song above is about. time.c: Removed unneeded get_access_time() function. trans2.c : Removed unneeded "win95 bug compatibility" code. Jeremy. (This used to be commit 10d628e4aeaecc573de27e251fec7b91844cba40) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 82a4851444..0bb2056745 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -189,7 +189,6 @@ typedef struct BOOL bTimeServer; BOOL bBindInterfacesOnly; BOOL bNetWkstaUserLogon; - BOOL bWin95BugCompatibility; } global; static global Globals; @@ -280,6 +279,7 @@ typedef struct BOOL bFakeOplocks; BOOL bDeleteVetoFiles; BOOL bDosFiletimes; + BOOL bDosFiletimeResolution; char dummy[3]; /* for alignment */ } service; @@ -366,6 +366,7 @@ static service sDefault = False, /* bFakeOplocks */ False, /* bDeleteVetoFiles */ False, /* bDosFiletimes */ + False, /* bDosFiletimeResolution */ "" /* dummy */ }; @@ -531,7 +532,6 @@ static struct parm_struct {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL}, {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL}, - {"win95 bug compatibility", P_BOOL, P_GLOBAL, &Globals.bWin95BugCompatibility,NULL, NULL}, {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL}, @@ -628,6 +628,7 @@ static struct parm_struct {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL}, {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL}, {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL} }; @@ -725,7 +726,6 @@ static void init_globals(void) Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bNetWkstaUserLogon = True; - Globals.bWin95BugCompatibility = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -942,7 +942,6 @@ FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) -FN_GLOBAL_BOOL(lp_win95_bug_compatibility,&Globals.bWin95BugCompatibility) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -1035,6 +1034,7 @@ FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) +FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -- cgit From b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Mar 1998 20:19:14 +0000 Subject: Change the multibyte character set support so that Kanji support is one case of multibyte character support, rather than being a specific case in single byte character support. This allows us to add Big5 Chinese support (code page 950) and Korean Hangul support (code page 949) at very little cost. Also allows us to easily add future multibyte code pages. Makefile: Added codepages 949, 950 as we now support more multibyte codepages. asyncdns.c: Fixed problem with child being re-spawned when parent killed. charcnv.c charset.c client.c clitar.c kanji.c kanji.h smb.h util.c loadparm.c: Generic multibyte codepage support (adding Big5 Chinese and Korean Hangul). nmbd.c: Fixed problem with child being re-spawned when parent killed. mangle.c: Modified str_checksum so that first 15 characters have more effect on outcome. This helps with short name mangling as most 'long' names are still shorter than 15 chars (bug was foobar_mng and foobar_sum would hash to the same value, with the modified code they hash differently. Jeremy. (This used to be commit 299016338cfb47f0c585875ef9b468121fcee97d) --- source3/param/loadparm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0bb2056745..c0f54860c1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -50,6 +50,17 @@ #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 "sjis" #endif /* KANJI */ @@ -721,7 +732,6 @@ static void init_globals(void) Globals.bNISHomeMap = False; string_set(&Globals.szNISHomeMapName, "auto.home"); #endif - interpret_coding_system(KANJI); Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; @@ -748,6 +758,13 @@ static void init_globals(void) Globals.bWINSproxy = False; Globals.bDNSproxy = True; + + /* + * This must be done last as it checks the value in + * client_code_page. + */ + + interpret_coding_system(KANJI); } /*************************************************************************** -- cgit From 35d67dd80aa3ba72b75683cb1f35c81066e21223 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 8 Mar 1998 14:14:49 +0000 Subject: Jeremy is going to hate me ... These are some hacks on SWAT. Maybe users will actually be able to work out how to use it now. Unfortunately these changes required some editing in loadparm.c and smb.h which will make Jeremys merge job harder. Sorry! (This used to be commit 674c88a6bf4c8009769a482c53f105efdc54bbc8) --- source3/param/loadparm.c | 512 ++++++++++++++++++++--------------------------- 1 file changed, 216 insertions(+), 296 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c0f54860c1..39f6de0e1e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -89,18 +89,6 @@ extern pstring myname; #define LP_SNUM_OK(iService) (((iService) >= 0) && ((iService) < iNumServices) && iSERVICE(iService).valid) #define VALID(i) iSERVICE(i).valid -/* these are the types of parameter we have */ -typedef enum -{ - P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, - P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM -} parm_type; - -typedef enum -{ - P_LOCAL,P_GLOBAL,P_NONE -} parm_class; - int keepalive=0; extern BOOL use_getwd_cache; @@ -402,11 +390,6 @@ static BOOL handle_coding_system(char *pszParmValue,char **ptr); static void set_default_server_announce_type(void); -struct enum_list { - int value; - char *name; -}; - static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, {PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE,"CORE"}, {PROTOCOL_COREPLUS, "COREPLUS"}, @@ -427,221 +410,213 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; -static struct parm_struct -{ - char *label; - parm_type type; - parm_class class; - void *ptr; - BOOL (*special)(); - struct enum_list *enum_list; -} parm_table[] = +static struct parm_struct parm_table[] = { - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as}, - {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL}, - {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL}, - {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL}, - {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL}, - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, + {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, + {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL, FLAG_BASIC}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, 0}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, #ifdef NTDOMAIN - {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL}, - {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL}, - {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL}, - {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, - {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL}, - {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, - {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL}, + {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, + {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, + {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, + {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, + {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, + {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, + {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, #endif /* NTDOMAIN */ - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL}, - {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, - {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL}, - {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL}, - {"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL}, - {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL}, - {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL}, - - {NULL, P_BOOL, P_NONE, NULL, NULL, NULL} + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL, 0}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, 0}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, 0}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, 0}, + {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"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, 0}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, 0}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, 0}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, 0}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, 0}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, 0}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, 0}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, 0}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, 0}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, 0}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, 0}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, 0}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, 0}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, 0}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, 0}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, 0}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, 0}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, 0}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, 0}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, 0}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, 0}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, 0}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, 0}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, 0}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, 0}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, 0}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, 0}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, 0}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, 0}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, 0}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, 0}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, 0}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, 0}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, 0}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, 0}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, 0}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, 0}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, 0}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, 0}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, 0}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, 0}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, 0}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, 0}, + + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1663,6 +1638,15 @@ static void init_copymap(service *pservice) } +/*************************************************************************** + return the local pointer to a parameter given the service number and the + pointer into the default structure +***************************************************************************/ +void *lp_local_ptr(int snum, void *ptr) +{ + return (void *)(((char *)pSERVICE(snum)) + PTR_DIFF(ptr,&sDefault)); +} + /*************************************************************************** Process a parameter for a particular service number. If snum < 0 then assume we are in the globals @@ -1830,59 +1814,6 @@ static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) } -/*************************************************************************** -print a parameter of the specified type -***************************************************************************/ -static void parameter_string(struct parm_struct *p,void *ptr,char *s) -{ - int i; - s[0] = 0; - - switch (p->type) { - case P_ENUM: - for (i=0;p->enum_list[i].name;i++) { - if (*(int *)ptr == p->enum_list[i].value) { - sprintf(s,"%s",p->enum_list[i].name); - break; - } - } - break; - - case P_BOOL: - sprintf(s, "%s",BOOLSTR(*(BOOL *)ptr)); - break; - - case P_BOOLREV: - sprintf(s, "%s",BOOLSTR(! *(BOOL *)ptr)); - break; - - case P_INTEGER: - sprintf(s, "%d",*(int *)ptr); - break; - - case P_CHAR: - sprintf(s, "%c",*(char *)ptr); - break; - - case P_OCTAL: - sprintf(s, "0%o",*(int *)ptr); - break; - - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) - sprintf(s, "%s",(char *)ptr); - break; - - case P_STRING: - case P_USTRING: - if (*(char **)ptr) - sprintf(s, "%s",*(char **)ptr); - break; - } -} - - /*************************************************************************** check if two parameters are equal ***************************************************************************/ @@ -2030,8 +1961,7 @@ serice and snum==-2 gives the globals return 0 when out of parameters ***************************************************************************/ -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters) +struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { if (snum == -2) { /* do the globals */ @@ -2041,12 +1971,7 @@ int lp_next_parameter(int snum, int *i, char *label, (*parm_table[*i].label != '-') && ((*i) == 0 || (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { - strcpy(label, parm_table[*i].label); - parameter_string(&parm_table[*i], - parm_table[*i].ptr, - value); - (*i)++; - return 1; + return &parm_table[(*i)++]; } return 0; } else { @@ -2064,12 +1989,7 @@ int lp_next_parameter(int snum, int *i, char *label, !equal_parameter(parm_table[*i].type, ((char *)pService) + pdiff, ((char *)&sDefault) + pdiff)) { - strcpy(label, parm_table[*i].label); - parameter_string(&parm_table[*i], - ((char *)pService) + pdiff, - value); - (*i)++; - return 1; + return &parm_table[(*i)++]; } } } -- cgit From fdeea341ed1bae670382e45eb731db1b5838ad21 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Mar 1998 21:11:04 +0000 Subject: "For I have laboured mightily on Luke's code, and hath broken all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy. (This used to be commit 118ba4d77a33248e762a2cf843fb7cbc906ee6e7) --- source3/param/loadparm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 39f6de0e1e..2768a9da72 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -461,7 +461,7 @@ static struct parm_struct parm_table[] = {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, -#ifdef NTDOMAIN + {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, @@ -472,7 +472,7 @@ static struct parm_struct parm_table[] = {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, -#endif /* NTDOMAIN */ + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, @@ -898,7 +898,6 @@ FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) -#ifdef NTDOMAIN FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) @@ -906,7 +905,6 @@ FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) -#endif /* NTDOMAIN */ FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -- cgit From e8abdf4ac450de8512d71b20798a0e8733d7626a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Mar 1998 02:16:23 +0000 Subject: add FLAG_HIDE to "config file" option (so it can't be set in swat) (This used to be commit f9f9fe67c7570f7585099a14c36bb3ff0291cdf4) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2768a9da72..c59b872d06 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -440,7 +440,7 @@ static struct parm_struct parm_table[] = {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, -- cgit From 2207cdd60ca22b60f0ba90bc8312fc76e715fb42 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 00:48:40 +0000 Subject: remove an unnecessary #ifdef (This used to be commit dfaa576d7e661b772daae602152239d8a1adce88) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c59b872d06..3f34d61faa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -649,9 +649,7 @@ static void init_globals(void) DEBUG(3,("Initialising global parameters\n")); -#ifdef SMB_PASSWD_FILE string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); -#endif string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, SMB_PASSWD); -- cgit From b85346942e7d785af718b68d61b208cb457a2b27 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 08:27:41 +0000 Subject: another makeover of loadparm to support new stuff in swat and testparm. In particular I added: - ability to optionally save default values of all parameters when calling lp_load(). This can then be used to save only non-default parameters in lp_dump(). This makes the saved smb.conf (and viewed parameters in testparm) much shorter - ability to not load ipc share in lp_load() - separators in parm_table[] so parameters can be grouped logically. - flag to mark parameters that are local but which should be also viewed as global as far as parameters editing is concerned (This used to be commit f9af35da26e58fb0b644b5f0169f1c212230047a) --- source3/param/loadparm.c | 524 +++++++++++++++++++++++++++++------------------ 1 file changed, 320 insertions(+), 204 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3f34d61faa..4bd167798c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -94,6 +94,8 @@ extern BOOL use_getwd_cache; extern int extra_time_offset; +static BOOL defaults_saved=False; + /* * This structure describes global (ie., server-wide) parameters. */ @@ -410,58 +412,155 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; +/* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"Base Options", P_SEP, P_SEPARATOR}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL, FLAG_BASIC}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, + + {"Security Options", P_SEP, P_SEPARATOR}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, - {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, - {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, - {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL, FLAG_BASIC}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_PRINT|FLAG_GLOBAL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, 0}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, 0}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"Logging Options", P_SEP, P_SEPARATOR}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL}, + + {"Protocol Options", P_SEP, P_SEPARATOR}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + + {"Tuning Options", P_SEP, P_SEPARATOR}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + + {"Printing Options", P_SEP, P_SEPARATOR}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, 0}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT|FLAG_GLOBAL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, FLAG_GLOBAL}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_GLOBAL}, + + + {"Filename Handling", P_SEP, P_SEPARATOR}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, 0}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_GLOBAL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_GLOBAL}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, FLAG_GLOBAL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_GLOBAL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_GLOBAL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_GLOBAL}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_GLOBAL}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_GLOBAL}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, FLAG_GLOBAL}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_GLOBAL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_GLOBAL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_GLOBAL}, + + {"Domain Options", P_SEP, P_SEPARATOR}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, @@ -473,54 +572,58 @@ static struct parm_struct parm_table[] = {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, + {"Logon Options", P_SEP, P_SEPARATOR}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, - {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL, 0}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL, 0}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + + {"Browse Options", P_SEP, P_SEPARATOR}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, 0}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, 0}, {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, 0}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + + {"WINS Options", P_SEP, P_SEPARATOR}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + + {"Locking Options", P_SEP, P_SEPARATOR}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_GLOBAL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_GLOBAL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + + {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, 0}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, {"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, 0}, @@ -528,93 +631,17 @@ static struct parm_struct parm_table[] = {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, 0}, {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, 0}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, 0}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, 0}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, 0}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, 0}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, 0}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, 0}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, 0}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, 0}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, 0}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, 0}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, 0}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, 0}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, 0}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, 0}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, 0}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, 0}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, 0}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, 0}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, 0}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, 0}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, 0}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, 0}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, 0}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, 0}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, 0}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, 0}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, 0}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, 0}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, 0}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, 0}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, 0}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, 0}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, 0}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, 0}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, 0}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, 0}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, 0}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_GLOBAL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_GLOBAL}, {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, 0}, {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, 0}, {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, 0}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, 0}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, 0}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, 0}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, 0}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_GLOBAL}, + {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_GLOBAL}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1741,6 +1768,8 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) } } break; + case P_SEP: + break; } return(True); @@ -1806,6 +1835,8 @@ static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) if (*(char **)ptr) fprintf(f,"%s",*(char **)ptr); break; + case P_SEP: + break; } } @@ -1845,6 +1876,8 @@ static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) if (p2 && !*p2) p2 = NULL; return(p1==p2 || strequal(p1,p2)); } + case P_SEP: + break; } return(False); } @@ -1900,23 +1933,53 @@ static BOOL do_section(char *pszSectionName) return (bRetval); } + +/*************************************************************************** +determine if a partcular base parameter is currently set to the default value. +***************************************************************************/ +static BOOL is_default(int i) +{ + if (!defaults_saved) return False; + switch (parm_table[i].type) { + case P_STRING: + case P_USTRING: + return strequal(parm_table[i].def.svalue,*(char **)parm_table[i].ptr); + case P_GSTRING: + case P_UGSTRING: + return strequal(parm_table[i].def.svalue,(char *)parm_table[i].ptr); + case P_BOOL: + case P_BOOLREV: + return parm_table[i].def.bvalue == *(BOOL *)parm_table[i].ptr; + case P_CHAR: + return parm_table[i].def.cvalue == *(char *)parm_table[i].ptr; + case P_INTEGER: + case P_OCTAL: + case P_ENUM: + return parm_table[i].def.ivalue == *(int *)parm_table[i].ptr; + case P_SEP: + break; + } + return False; +} + + /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ static void dump_globals(FILE *f) { - int i; - fprintf(f, "# Global parameters\n"); - - for (i=0;parm_table[i].label;i++) - if (parm_table[i].class == P_GLOBAL && - parm_table[i].ptr && - (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) - { - fprintf(f,"\t%s = ",parm_table[i].label); - print_parameter(&parm_table[i],parm_table[i].ptr, f); - fprintf(f,"\n"); - } + int i; + fprintf(f, "# Global parameters\n"); + + for (i=0;parm_table[i].label;i++) + if (parm_table[i].class == P_GLOBAL && + parm_table[i].ptr && + (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) { + if (defaults_saved && is_default(i)) continue; + fprintf(f,"\t%s = ",parm_table[i].label); + print_parameter(&parm_table[i],parm_table[i].ptr, f); + fprintf(f,"\n"); + } } /*************************************************************************** @@ -1924,56 +1987,62 @@ Display the contents of a single services record. ***************************************************************************/ static void dump_a_service(service *pService, FILE *f) { - int i; - if (pService == &sDefault) - fprintf(f,"\n\n# Default service parameters\n"); - else - fprintf(f,"\n[%s]\n",pService->szService); - - 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))) - { - int pdiff = PTR_DIFF(parm_table[i].ptr,&sDefault); + int i; + if (pService != &sDefault) + fprintf(f,"\n[%s]\n",pService->szService); + + 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))) { + int pdiff = PTR_DIFF(parm_table[i].ptr,&sDefault); + + if (pService == &sDefault) { + if (defaults_saved && is_default(i)) continue; + } else { + if (equal_parameter(parm_table[i].type, + ((char *)pService) + pdiff, + ((char *)&sDefault) + pdiff)) + continue; + } - if (pService == &sDefault || !equal_parameter(parm_table[i].type, - ((char *)pService) + pdiff, - ((char *)&sDefault) + pdiff)) - { - fprintf(f,"\t%s = ",parm_table[i].label); - print_parameter(&parm_table[i], - ((char *)pService) + pdiff, f); - fprintf(f,"\n"); - } - } + fprintf(f,"\t%s = ",parm_table[i].label); + print_parameter(&parm_table[i], + ((char *)pService) + pdiff, f); + fprintf(f,"\n"); + } } /*************************************************************************** -return info about the next service in a service. snum==-1 gives the default -serice and snum==-2 gives the globals +return info about the next service in a service. snum==-1 gives the globals -return 0 when out of parameters +return NULL when out of parameters ***************************************************************************/ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { - if (snum == -2) { + if (snum == -1) { /* do the globals */ - for (;parm_table[*i].label;(*i)++) - if (parm_table[*i].class == P_GLOBAL && - parm_table[*i].ptr && - (*parm_table[*i].label != '-') && - ((*i) == 0 || - (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { + for (;parm_table[*i].label;(*i)++) { + if (parm_table[*i].class == P_SEPARATOR) return &parm_table[(*i)++]; - } - return 0; + + if (!parm_table[*i].ptr || (*parm_table[*i].label == '-')) + continue; + + if ((*i) > 0 && (parm_table[*i].ptr == parm_table[(*i)-1].ptr)) + continue; + + return &parm_table[(*i)++]; + } } else { - service *pService = (snum==-1?&sDefault:pSERVICE(snum)); + service *pService = pSERVICE(snum); + + for (;parm_table[*i].label;(*i)++) { + if (parm_table[*i].class == P_SEPARATOR) + return &parm_table[(*i)++]; - for (;parm_table[*i].label;(*i)++) if (parm_table[*i].class == P_LOCAL && parm_table[*i].ptr && (*parm_table[*i].label != '-') && @@ -1981,16 +2050,17 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { int pdiff = PTR_DIFF(parm_table[*i].ptr,&sDefault); - if (snum == -1 || allparameters || + if (allparameters || !equal_parameter(parm_table[*i].type, ((char *)pService) + pdiff, ((char *)&sDefault) + pdiff)) { return &parm_table[(*i)++]; } } + } } - return 0; + return NULL; } @@ -2109,11 +2179,51 @@ void lp_killunused(BOOL (*snumused)(int )) } } + +/*************************************************************************** +save the curent values of all global and sDefault parameters into the +defaults union. This allows swat and testparm to show only the +changed (ie. non-default) parameters. +***************************************************************************/ +static void lp_save_defaults(void) +{ + int i; + for (i = 0; parm_table[i].label; i++) { + if (i>0 && parm_table[i].ptr == parm_table[i-1].ptr) continue; + switch (parm_table[i].type) { + case P_STRING: + case P_USTRING: + parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr); + break; + case P_GSTRING: + case P_UGSTRING: + parm_table[i].def.svalue = strdup((char *)parm_table[i].ptr); + break; + case P_BOOL: + case P_BOOLREV: + parm_table[i].def.bvalue = *(BOOL *)parm_table[i].ptr; + break; + case P_CHAR: + parm_table[i].def.cvalue = *(char *)parm_table[i].ptr; + break; + case P_INTEGER: + case P_OCTAL: + case P_ENUM: + parm_table[i].def.ivalue = *(int *)parm_table[i].ptr; + break; + case P_SEP: + break; + } + } + defaults_saved = True; +} + + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. ***************************************************************************/ -BOOL lp_load(char *pszFname,BOOL global_only) +BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) { pstring n2; BOOL bRetval; @@ -2126,6 +2236,11 @@ BOOL lp_load(char *pszFname,BOOL global_only) bGlobalOnly = global_only; init_globals(); + + if (save_defaults) { + init_locals(); + lp_save_defaults(); + } pstrcpy(n2,pszFname); standard_sub_basic(n2); @@ -2144,7 +2259,8 @@ BOOL lp_load(char *pszFname,BOOL global_only) if (lp_load_printers()) lp_add_all_printers(); - lp_add_ipc(); + if (add_ipc) + lp_add_ipc(); set_default_server_announce_type(); -- cgit From e2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 11:24:01 +0000 Subject: if a local parameter is changed at the global level then propogate the change to all shares that are currently set to the default value. (This used to be commit b0e1183b2cbeb7a3150b7250cd19d14c9e5508b6) --- source3/param/loadparm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4bd167798c..27cbc8c8dd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1982,6 +1982,19 @@ static void dump_globals(FILE *f) } } +/*************************************************************************** +return True if a local parameter is currently set to the global default +***************************************************************************/ +BOOL lp_is_default(int snum, struct parm_struct *parm) +{ + int pdiff = PTR_DIFF(parm->ptr,&sDefault); + + return equal_parameter(parm->type, + ((char *)pSERVICE(snum)) + pdiff, + ((char *)&sDefault) + pdiff); +} + + /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ -- cgit From c4855a8e028914281f179bd3bce8fc7cb249eaf7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 16 Mar 1998 07:23:51 +0000 Subject: changed the default "keepalive" value to 300 seconds. This is more important now that oplocks are being used. (This used to be commit 7bccd2c360a270df227c140aeecb943d8d187855) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 27cbc8c8dd..52914ffd5d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -89,7 +89,7 @@ extern pstring myname; #define LP_SNUM_OK(iService) (((iService) >= 0) && ((iService) < iNumServices) && iSERVICE(iService).valid) #define VALID(i) iSERVICE(i).valid -int keepalive=0; +int keepalive=DEFAULT_KEEPALIVE; extern BOOL use_getwd_cache; extern int extra_time_offset; -- cgit From c54af0f8b20e3f93c59da6a817920e1de6c4a870 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Mar 1998 20:59:47 +0000 Subject: Adding the same change as was added to 1.9.18 branch to add the "name resolve order" parameter. source/Makefile: Re-ordered link for name resolve order code. source/clientgen.c: source/clientutil.c: Added calls to resolve_name(). source/includes.h: Added HPUX zombie fix. source/loadparm.c: Added new name resolve order parameter. source/namequery.c: Re-wrote to include parsing of lmhosts file, new resolve_name() function requested by John. source/nmbd.c: Tell resolve_name not to do WINS lookups if we are the WINS server. source/nmbd_lmhosts.c: Call lmhosts parsing functions in namequery.c source/password.c: Call resolve_name() to lookup security=server name. source/reply.c: source/time.c: source/trans2.c: "fake directory create times" fix from Jim Hague - hague@research.canon.com.au. source/util.c: Removed isalnum() test in Get_Hostname() that seems to cause problems on many systems. Jeremy. (This used to be commit 7f118970da7c43eaddcf92dc056d3e849f1e7d5c) --- source3/param/loadparm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 52914ffd5d..1d65030869 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -143,6 +143,7 @@ typedef struct char *szDomainOtherSIDs; char *szDomainGroups; char *szDriverFile; + char *szNameResolveOrder; int max_log_size; int mangled_stack; int max_xmit; @@ -281,6 +282,7 @@ typedef struct BOOL bDeleteVetoFiles; BOOL bDosFiletimes; BOOL bDosFiletimeResolution; + BOOL bFakeDirCreateTimes; char dummy[3]; /* for alignment */ } service; @@ -368,6 +370,7 @@ static service sDefault = False, /* bDeleteVetoFiles */ False, /* bDosFiletimes */ False, /* bDosFiletimeResolution */ + False, /* bFakeDirCreateTimes */ "" /* dummy */ }; @@ -495,6 +498,7 @@ static struct parm_struct parm_table[] = {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, @@ -642,7 +646,8 @@ static struct parm_struct parm_table[] = {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_GLOBAL}, {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_GLOBAL}, {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_GLOBAL}, - + + {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_GLOBAL}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -696,6 +701,8 @@ static void init_globals(void) string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); + string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); + Globals.bLoadPrinters = True; Globals.bUseRhosts = False; Globals.max_packet = 65535; @@ -906,6 +913,7 @@ FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) +FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) @@ -1050,6 +1058,7 @@ FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) +FN_LOCAL_BOOL(lp_fake_dir_create_times,bFakeDirCreateTimes) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) @@ -2478,3 +2487,11 @@ int lp_minor_announce_version(void) return minor_version; } +/*********************************************************** + Set the global name resolution order (used in smbclient). +************************************************************/ + +void lp_set_name_resolve_order(char *new_order) +{ + Globals.szNameResolveOrder = new_order; +} -- cgit From 59d7006b05bb301e36f786b047b90ab9ef5be122 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 11:44:16 +0000 Subject: - added "Full View"/"Normal View" on the "view config" page - added the ability to auto-refresh the status page. There is a problem with this (it can kill inetd!). Hopefully we can fix that. (This used to be commit 4488d8932fa072bf8a3ae236ab666618051b5e83) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1d65030869..c67bdd3cf8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2303,10 +2303,14 @@ int lp_numservices(void) /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE *f) +void lp_dump(FILE *f, BOOL show_defaults) { int iService; + if (!show_defaults) { + defaults_saved = False; + } + dump_globals(f); dump_a_service(&sDefault, f); -- cgit From e12cb8b6107272b625c8f34f3346b8314404f567 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 14:46:17 +0000 Subject: oops, I got the sense of the show_defaults parameter to lp_dump() wrong. (This used to be commit b92c3b13d74acb39cdbd2c70eab2ef081c344d5a) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c67bdd3cf8..da7958b6a0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2307,7 +2307,7 @@ void lp_dump(FILE *f, BOOL show_defaults) { int iService; - if (!show_defaults) { + if (show_defaults) { defaults_saved = False; } -- cgit From a4156f9b50c81fe40823cd8e32ec990690d3884c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 27 Mar 1998 19:59:14 +0000 Subject: chgpasswd.c, ipc.c, loadparm.c: Added boolean "unix password sync" parameter which allows the new change password code to change the unix password also. Defaults to OFF. includes.h: Added termios.h to FreeBSD to allow password changing. namequery.c: Fixed missing name parameters to debug statements. Jeremy. (This used to be commit 4ac50c0f0aa5af084ddad89b1f9baf6c2c1ddcb8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da7958b6a0..70f06065a3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -191,6 +191,7 @@ typedef struct BOOL bTimeServer; BOOL bBindInterfacesOnly; BOOL bNetWkstaUserLogon; + BOOL bUnixPasswdSync; } global; static global Globals; @@ -445,6 +446,7 @@ static struct parm_struct parm_table[] = {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL}, {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL}, @@ -743,6 +745,7 @@ static void init_globals(void) Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bNetWkstaUserLogon = True; + Globals.bUnixPasswdSync = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -965,6 +968,7 @@ FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) +FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 612cbb6a6039c2cafb3de5e644f23a2a26d6c645 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Apr 1998 01:01:24 +0000 Subject: Patch from Chris Maltby . His comments follow: + improvement to smbtar to allow exclusion/inclusion of system and hidden files, and to generate a listing of what has been archived in a format useful for automated backup systems. + add the "Softq" spooling system to samba's printing capabilities. + I have "fixed" the intrusion of US style dates into samba reporting as well. The format yyyy/mm/dd is not only uunambiguous, but also has the benefit of making lexicographic sorts work correctly. Jeremy. (This used to be commit f9dacd1d8b89fccad859c0c6bc7a492823eb4b06) --- source3/param/loadparm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 70f06065a3..2527692bc5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -407,7 +407,8 @@ static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "US static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, {PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, - {PRINT_LPRNG, "lprng"}, {-1, NULL}}; + {PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, + {-1, NULL}}; static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_AS_WIN95, "win95"}, {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL}}; @@ -821,6 +822,13 @@ static void init_locals(void) string_initial(&sDefault.szPrintcommand,"lp -r -P%p %s"); break; + case PRINT_SOFTQ: + string_initial(&sDefault.szLpqcommand,"qstat -l -d%p"); + string_initial(&sDefault.szLprmcommand,"qstat -s -j%j -c"); + string_initial(&sDefault.szPrintcommand,"lp -d%p -s %s; rm %s"); + string_initial(&sDefault.szLppausecommand,"qstat -s -j%j -h"); + string_initial(&sDefault.szLpresumecommand,"qstat -s -j%j -r"); + break; } } -- cgit From f9c698b5eb6cd979591473bfab9ce1b9b71bb3fe Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 3 Apr 1998 01:04:34 +0000 Subject: Fix from Josef Hinteregger for using character set = iso8859-1 with the new multibyte char code. Was always using sj_to_sj conversion in error. Jeremy. (This used to be commit e6a083451f8785fa1c00314a958007fe96fcc039) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2527692bc5..20479bf96d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -62,7 +62,7 @@ * and 'coding system'. */ #ifndef KANJI -#define KANJI "sjis" +#define KANJI "sbcs" #endif /* KANJI */ BOOL bLoaded = False; -- cgit From 724cab4d08d631c0afaac5e77356ca5336562eb0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 Apr 1998 18:14:56 +0000 Subject: loadparm.c: Cause IPC$ comment to be evaluated at runtime, rather than load time (patch from "Marty Leisner" . server.c: Patch from Josef Hinteregger - string could be overwritten when find_service() called recursively. Jeremy. (This used to be commit cf15b3bd74a262e7af3d739a83ef7b43df4935e5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 20479bf96d..837632788e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1232,7 +1232,7 @@ static BOOL lp_add_ipc(void) if (i < 0) return(False); - sprintf(comment,"IPC Service (%s)",lp_serverstring()); + sprintf(comment,"IPC Service (%s)", Globals.szServerString ); string_set(&iSERVICE(i).szPath,tmpdir()); string_set(&iSERVICE(i).szUsername,""); -- cgit From af80d8e98f2f74939d680c6abc21e3f40b927f31 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Apr 1998 20:48:48 +0000 Subject: Makefile, loadparm.c, server.c, smb.h, util.c: Patch from stn@techfak.uni-kiel.de (Stefan Nehlsen) to get homes from the NIS+ map. smbpasswd.c: Tidy up of cli_state structure. Jeremy. (This used to be commit fc2295e0f5729585fdb3ee47edb290851d4071c5) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 837632788e..da9d2f77a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -740,7 +740,11 @@ static void init_globals(void) Globals.bUnixRealname = False; #if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; +#ifdef NISPLUS + string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); +#else string_set(&Globals.szNISHomeMapName, "auto.home"); +#endif #endif Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; -- cgit From cac6a060af598bf94e6414b06e7365ec51ca360e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 13 Apr 1998 19:24:06 +0000 Subject: Changes to allow Samba to be compiled with -Wstrict-prototypes with gcc. (Not a big change although it looks like it :-). Jeremy. (This used to be commit cd2613c57261456485fe4eeecfda209ada70de8e) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da9d2f77a5..da75b58d55 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1739,7 +1739,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) /* if it is a special case then go ahead */ if (parm_table[parmnum].special) { - parm_table[parmnum].special(pszParmValue,parm_ptr); + parm_table[parmnum].special(pszParmValue,(char **)parm_ptr); return(True); } -- cgit From 6babe8da07b6a803d15deed70dd7e6aaae93ed4a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Apr 1998 23:07:28 +0000 Subject: Added 'passwd chat debug' parameter to allow admins to debug their Samba passwd chat scripts. Jeremy. (This used to be commit 5a995f4f75ffb0d55d6ceaa63a1209d230001991) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da75b58d55..ce9b816e81 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -192,6 +192,7 @@ typedef struct BOOL bBindInterfacesOnly; BOOL bNetWkstaUserLogon; BOOL bUnixPasswdSync; + BOOL bPasswdChatDebug; } global; static global Globals; @@ -444,6 +445,7 @@ static struct parm_struct parm_table[] = {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {"passwd chat debug",P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, @@ -751,6 +753,7 @@ static void init_globals(void) Globals.bBindInterfacesOnly = False; Globals.bNetWkstaUserLogon = True; Globals.bUnixPasswdSync = False; + Globals.bPasswdChatDebug = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -981,6 +984,7 @@ FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) +FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 8584c6bd6621eefb49aff69581caf28e38b4ceda Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Apr 1998 00:56:38 +0000 Subject: genrand.c: Improved generation of random values, more secure. loadparm.c: Started add of 'security=domain' code. password.c: Fix for security=server NT bugs. reply.c: Started add of 'security=domain' code. server.c: Started add of 'security=domain' code. smb.h: Started add of 'security=domain' code. Jeremy. (This used to be commit e6bda112ebe0d41f54c4249b5c2e1f24011347e1) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ce9b816e81..661ca901fa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -402,8 +402,14 @@ static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANM {PROTOCOL_COREPLUS, "COREPLUS"}, {PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL}}; +#ifdef DOMAIN_CLIENT +static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, + {SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, + {-1, NULL}}; +#else /* DOMAIN_CLIENT */ static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, {-1, NULL}}; +#endif /* DOMAIN_CLIENT */ static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, -- cgit From e7ac86607c80912e55ac7179b100cea22749c16f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 25 Apr 1998 01:12:08 +0000 Subject: This looks like a big change but really isn't. It is changing the global variables "myname" and "myworkgroup" to "global_myname" and "global_myworkgroup" respectively. This is to make it very explicit when we are messing with a global (don't ask - it makes the domain client code much clearer :-). Jeremy. (This used to be commit 866406bfe399cf757c8275093dacd5ce4843afa0) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 661ca901fa..c96669dba4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -69,7 +69,7 @@ BOOL bLoaded = False; extern int DEBUGLEVEL; extern pstring user_socket_options; -extern pstring myname; +extern pstring global_myname; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -432,7 +432,7 @@ static struct parm_struct parm_table[] = {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, - {"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL, NULL, FLAG_BASIC}, + {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, -- cgit From d3832506b2583130c4f4ba4b3edeabca987b7cbb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 00:02:57 +0000 Subject: This is the checkin that adds the security=domain functionality. WARNING - so far this has only been tested against a Samba PDC (still waiting for IS to add me the machine accounts :-). Still missing is the code in smbpasswd that will add a machine account password and change it on the domain controller, but this is not hard, and I will check it in soon. Jeremy. (This used to be commit 17b94a7084621b3f0106dd4d3386f05cdfc56d19) --- source3/param/loadparm.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c96669dba4..2249c8b473 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -402,14 +402,9 @@ static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANM {PROTOCOL_COREPLUS, "COREPLUS"}, {PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL}}; -#ifdef DOMAIN_CLIENT static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, {-1, NULL}}; -#else /* DOMAIN_CLIENT */ -static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, - {SEC_SERVER, "SERVER"}, {-1, NULL}}; -#endif /* DOMAIN_CLIENT */ static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, -- cgit From 90177708aaf5bf17d689979701b5f0156b8a2fa4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 22:27:26 +0000 Subject: Makefile: Added files to smbpasswd.c. loadparm.c: Patch from tim@quiknet.com for static string problems. server.c: Setup global_myname. smbpass.c: Fix up locking. Add machine_password_delete() call. smbpasswd.c: Added provisional code to add to a domain. lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password. lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password. Jeremy. (This used to be commit 6a7164233e3bf9d6bb57c44a53204068e454ae5c) --- source3/param/loadparm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2249c8b473..dda31f3efe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2144,8 +2144,7 @@ static void lp_add_auto_services(char *str) { char *s; char *p; - int homes = lp_servicenumber(HOMES_NAME); - int printers = lp_servicenumber(PRINTERS_NAME); + int homes, printers; if (!str) return; @@ -2153,6 +2152,9 @@ static void lp_add_auto_services(char *str) s = strdup(str); if (!s) return; + homes = lp_servicenumber(HOMES_NAME); + printers = lp_servicenumber(PRINTERS_NAME); + for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { char *home = get_home_dir(p); -- cgit From 3eae1e3f8e53c51f638b1b381085f29feea1c517 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 1998 01:39:22 +0000 Subject: Added patch from Bruce Tenison to allow encrypted passwords to be stored over time, allowing a smbpasswd file migration. Adds new parameter "update encrypted". Will also add to 1.9.18 branch. Docs update to follow. Jeremy. (This used to be commit 5d3e874d780d595415cc27a7f5945fc2e694c3ac) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dda31f3efe..e4d27f1f64 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -176,6 +176,7 @@ typedef struct BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; + BOOL bUpdateEncrypt; BOOL bStripDot; BOOL bNullPasswords; BOOL bLoadPrinters; @@ -436,6 +437,7 @@ static struct parm_struct parm_table[] = {"Security Options", P_SEP, P_SEPARATOR}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, @@ -723,6 +725,7 @@ static void init_globals(void) Globals.maxprotocol = PROTOCOL_NT1; Globals.security = SEC_SHARE; Globals.bEncryptPasswords = False; + Globals.bUpdateEncrypt = False; Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; @@ -977,6 +980,7 @@ FN_GLOBAL_BOOL(lp_writeraw,&Globals.bWriteRaw) FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) +FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) -- cgit From 19f76f391b97b405879fd8574e711a6d59e4e60c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 5 May 1998 19:24:32 +0000 Subject: genrand.c: SGI compile warning fix. ipc.c: Fix for duplicate printer names being long. loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c protects us. nmbd_logonnames.c: nmbd_namequery.c: nmbd_namerelease.c: Debug messages fix. password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call. reply.c: SGI compile warning fix. server.c Debug messages fix. smbpass.c: Fix for incorrect pointer. Jeremy. (This used to be commit 567d3f838988cafab4770fce1cf68b73085e6c71) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e4d27f1f64..cbb17adc95 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -755,7 +755,8 @@ static void init_globals(void) Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; - Globals.bNetWkstaUserLogon = True; + Globals.bNetWkstaUserLogon = False; /* This is now set to false by default as + the code in password.c protects us from this bug. */ Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; -- cgit From 5fa8775d9758254f6f4784a0e34c9b5b8bf18bdb Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 6 May 1998 17:43:44 +0000 Subject: jean-francois micouleau's well-alpha code for ldap password database stuff! he's going to hate me for checking this in so early, but... (This used to be commit ad9ba0a1cbac5c4e6cbcbcadefe8f1df72231f74) --- source3/param/loadparm.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cbb17adc95..7483af54a4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -144,6 +144,11 @@ typedef struct char *szDomainGroups; char *szDriverFile; char *szNameResolveOrder; + char *szLdapServer; + char *szLdapSuffix; + char *szLdapFilter; + char *szLdapRoot; + char *szLdapRootPassword; int max_log_size; int mangled_stack; int max_xmit; @@ -167,6 +172,7 @@ typedef struct int shmem_size; int client_code_page; int announce_as; /* This is initialised in init_globals */ + int ldap_port; BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -616,6 +622,16 @@ static struct parm_struct parm_table[] = {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"Ldap Options", P_SEP, P_SEPARATOR}, + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, + {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, + {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, + {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, + + + {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, @@ -760,6 +776,11 @@ static void init_globals(void) Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; + /* default values for ldap */ + string_set(&Globals.szLdapServer, "localhost"); + Globals.ldap_port=389; + + /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -962,6 +983,12 @@ FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) +FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); +FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); +FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); +FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); +FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); + FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) @@ -1017,6 +1044,8 @@ FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) +FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) + FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) FN_LOCAL_STRING(lp_rootpreexec,szRootPreExec) -- cgit From b54509045d7186fc0526d91bcf429659cba8be1d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 May 1998 18:14:02 +0000 Subject: loadparm.c: Added #ifdef USE_LDAP around ldap code. server.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic() as only smbd knows about usernames. Also fixes problem with calling standard_sub_basic() from loadparm.c. smbpass.c: Partial tidyup of machine_password_lock() code - not finished yet. util.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic() as only smbd knows about usernames. Also fixes problem with calling standard_sub_basic() from loadparm.c. lib/rpc/server/srv_ldap_helpers.c: Added #ifdef USE_LDAP around ldap code. lib/rpc/server/srv_samr.c: Added #ifdef USE_LDAP around ldap code. Jeremy. (This used to be commit 446b98ca071170fc950bad86ad96b58308a5b75c) --- source3/param/loadparm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7483af54a4..9ae845486a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -172,7 +172,9 @@ typedef struct int shmem_size; int client_code_page; int announce_as; /* This is initialised in init_globals */ +#ifdef USE_LDAP int ldap_port; +#endif /* USE_LDAP */ BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -622,6 +624,7 @@ static struct parm_struct parm_table[] = {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, +#ifdef USE_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, @@ -629,7 +632,7 @@ static struct parm_struct parm_table[] = {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, - +#endif /* USE_LDAP */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, @@ -776,10 +779,11 @@ static void init_globals(void) Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; +#ifdef USE_LDAP /* default values for ldap */ string_set(&Globals.szLdapServer, "localhost"); Globals.ldap_port=389; - +#endif /* USE_LDAP */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -983,11 +987,13 @@ FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) +#ifdef USE_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); +#endif /* USE_LDAP */ FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) @@ -1044,7 +1050,9 @@ FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) +#ifdef USE_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) +#endif /* USE_LDAP */ FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) -- cgit From 01df1ed95f880a671ead7bc92b3bcff01a2e2dc0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 May 1998 19:04:14 +0000 Subject: This should (hopefully :-) be the final fix for the %U %G substitution problem.... smbpass.c: Removed Luke's dire warning - as some of the functions in here *need* to be called externally :-). Jeremy. (This used to be commit 1fd8d12ca414066acec71b33eb8a13e16c2acd3a) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9ae845486a..ddc5cf3ab1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -754,8 +754,8 @@ static void init_globals(void) Globals.syslog = 1; Globals.bSyslogOnly = False; Globals.os_level = 0; - Globals.max_ttl = 60*60*4; /* 4 hours default */ - Globals.max_wins_ttl = 60*60*24*3; /* 3 days default */ + Globals.max_ttl = 60*60*24*3; /* 3 days default */ + Globals.max_wins_ttl = 60*60*24*6; /* 6 days default */ Globals.min_wins_ttl = 60*60*6; /* 6 hours default */ Globals.ReadSize = 16*1024; Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ -- cgit From 4c136581dcdc177ccf00762db167f3fa17ec4be5 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 8 May 1998 01:41:27 +0000 Subject: added FLAG_BASIC to some browse options for swat. (This used to be commit ce1af10ab44d5d16557ddfd28c58f1669c04e0b3) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ddc5cf3ab1..1958986f0b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -600,13 +600,13 @@ static struct parm_struct parm_table[] = {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"Browse Options", P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, 0}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, FLAG_BASIC}, {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, 0}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, 0}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, FLAG_BASIC}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, -- cgit From 3dfc0c847240ac7e12c39f4ed9c31a888949ade1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 May 1998 06:38:36 +0000 Subject: changed to use slprintf() instead of sprintf() just about everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes. (This used to be commit ee09e9dadb69aaba5a751dd20ccc6d587d841bd6) --- source3/param/loadparm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1958986f0b..1b95005c6c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1252,7 +1252,8 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) if (!(*(iSERVICE(i).comment))) { pstring comment; - sprintf(comment,"Home directory of %s",pszHomename); + slprintf(comment,sizeof(comment), + "Home directory of %s",pszHomename); string_set(&iSERVICE(i).comment,comment); } iSERVICE(i).bAvailable = sDefault.bAvailable; @@ -1283,7 +1284,8 @@ static BOOL lp_add_ipc(void) if (i < 0) return(False); - sprintf(comment,"IPC Service (%s)", Globals.szServerString ); + slprintf(comment,sizeof(comment), + "IPC Service (%s)", Globals.szServerString ); string_set(&iSERVICE(i).szPath,tmpdir()); string_set(&iSERVICE(i).szUsername,""); -- cgit From 0518067c6e5ca3ebd7743a2a4f5ce6d63eec6812 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 11 May 1998 17:34:39 +0000 Subject: add lp_domain_workstations() parameter. this is a list of workstation names from which an NT user can log in from. empty (default) indicates no restrictions. exactly how this is enforced is unknown. from past experience it's likely that the enforcement is left to the client to carry out... (This used to be commit 6b2f9ea68f5754ca6caaf685a9538ab404e1bab4) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1b95005c6c..95c2d09ede 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -123,6 +123,7 @@ typedef struct char *szDomainGuestUsers; char *szDomainHostsallow; char *szDomainHostsdeny; + char *szDomainWorkstations; char *szUsernameMap; char *szCharacterSet; char *szLogonScript; @@ -585,6 +586,7 @@ static struct parm_struct parm_table[] = {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, + {"domain workstations", P_STRING, P_GLOBAL, &Globals.szDomainWorkstations, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, @@ -982,6 +984,7 @@ FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) +FN_GLOBAL_STRING(lp_domain_workstations,&Globals.szDomainWorkstations) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) -- cgit From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: This is a security audit change of the main source. It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 95c2d09ede..a73b9536c8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -720,9 +720,10 @@ static void init_globals(void) string_set(&Globals.szRootdir, "/"); string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); - sprintf(s,"Samba %s",VERSION); + pstrcpy(s, "Samba "); + pstrcat(s, VERSION); string_set(&Globals.szServerString,s); - sprintf(s,"%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); + slprintf(s,sizeof(s)-1, "%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); string_set(&Globals.szAnnounceVersion,s); string_set(&Globals.szLogonDrive, ""); @@ -1829,11 +1830,11 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) break; case P_GSTRING: - strcpy((char *)parm_ptr,pszParmValue); + pstrcpy((char *)parm_ptr,pszParmValue); break; case P_UGSTRING: - strcpy((char *)parm_ptr,pszParmValue); + pstrcpy((char *)parm_ptr,pszParmValue); strupper((char *)parm_ptr); break; -- cgit From d48e8376f116cc6f23d090359442ed579e5b5228 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 12 May 1998 14:04:46 +0000 Subject: removed lp_domain_workstation() parameter (This used to be commit 80d6a3bb0cf3853aa51594cce888e6c0a6e6f634) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a73b9536c8..0b05f4506b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -123,7 +123,6 @@ typedef struct char *szDomainGuestUsers; char *szDomainHostsallow; char *szDomainHostsdeny; - char *szDomainWorkstations; char *szUsernameMap; char *szCharacterSet; char *szLogonScript; @@ -586,7 +585,6 @@ static struct parm_struct parm_table[] = {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, - {"domain workstations", P_STRING, P_GLOBAL, &Globals.szDomainWorkstations, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, @@ -985,7 +983,6 @@ FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) -FN_GLOBAL_STRING(lp_domain_workstations,&Globals.szDomainWorkstations) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) -- cgit From 32954eb9e9eb1e3613ad55cb1afd5e19e81b5da8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 11:54:00 +0000 Subject: Makefile: - added nisppass.c and NISPLUS_FLAGS includes.h: - renamed USE_LDAP to USE_LDAP_DB. renamed NISPLUS to USE_NISPLUS_DB. added default define of USE_SMBPASS_DB. - removed ldap headers: they are local only to ldap.c ldap.c : - made all ldap-specific functions static. - added dummy sam21 functions loadparm.c : - renamed NISPLUS to NISPLUS_HOME mkproto.awk - commented out ldap-specific #ifdef generation code: it's not needed now that ldap-specific functions in ldap.c are static nisppass.c : - first attempt at an add function from (This used to be commit f215d375f0f1e12894c2a9e86bd28d4776d337c1) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0b05f4506b..51c37c2342 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -766,7 +766,7 @@ static void init_globals(void) Globals.bUnixRealname = False; #if (defined(NETGROUP) && defined(AUTOMOUNT)) Globals.bNISHomeMap = False; -#ifdef NISPLUS +#ifdef NISPLUS_HOME string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); #else string_set(&Globals.szNISHomeMapName, "auto.home"); -- cgit From ffab54750f0eec202895670dd9293ee4aa3eb475 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 May 1998 21:30:57 +0000 Subject: chgpasswd.c: Changed back to getsmb... from getsam... ldap.c: Stoped dummy_function being prototyped. loadparm.c: Fixed slprintf sizes. nisppass.c: Fixed safe_strcpy sizes. nmbd_processlogon.c: Changed back to getsmb... from getsam... nttrans.c: Just a dump of new code. passdb.c: Moved stuff around a lot - stopped any lookups by rid. This needs to be indirected through a function table (soon). password.c: Changed back to getsmb... from getsam... reply.c: Changed back to getsmb... from getsam... slprintf.c: Fixed prototype problems. smb.h: Fixed prototype problems. smbpass.c: Changed to getsmbfile.... smbpasswd.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup. lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam... Jeremy. (This used to be commit 7d332b2493d2089d09521250fc9b72d8953307c0) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 51c37c2342..b17ca83d4d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1253,7 +1253,7 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) if (!(*(iSERVICE(i).comment))) { pstring comment; - slprintf(comment,sizeof(comment), + slprintf(comment,sizeof(comment)-1, "Home directory of %s",pszHomename); string_set(&iSERVICE(i).comment,comment); } @@ -1285,7 +1285,7 @@ static BOOL lp_add_ipc(void) if (i < 0) return(False); - slprintf(comment,sizeof(comment), + slprintf(comment,sizeof(comment)-1, "IPC Service (%s)", Globals.szServerString ); string_set(&iSERVICE(i).szPath,tmpdir()); -- cgit From 9bd7e1e8870da87ea6f3c9e78933beeb08b65a0c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 May 1998 00:30:52 +0000 Subject: loadparm.c: Added machine password timeout parameter - set to 7 days be default. password.c: Added code to tell server.c when machine password needs changing. server.c: Change machine password in idle cycles if it needs it. smbpassfile.c: Fixed up length calculations for machine password file. smbpasswd.c: Moved domain joining code/machine password changing code. lib/rpc/client/cli_netlogon.c: And this is where it now lives. Jeremy. (This used to be commit b8fedca6191de96159df0d1d17082d82e8e44773) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b17ca83d4d..83aa2666a7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -172,6 +172,7 @@ typedef struct int shmem_size; int client_code_page; int announce_as; /* This is initialised in init_globals */ + int machine_password_timeout; #ifdef USE_LDAP int ldap_port; #endif /* USE_LDAP */ @@ -591,6 +592,7 @@ static struct parm_struct parm_table[] = {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, + {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, @@ -758,6 +760,7 @@ static void init_globals(void) Globals.max_ttl = 60*60*24*3; /* 3 days default */ Globals.max_wins_ttl = 60*60*24*6; /* 6 days default */ Globals.min_wins_ttl = 60*60*6; /* 6 hours default */ + Globals.machine_password_timeout = 60*60*24*7; /* 7 days default */ Globals.ReadSize = 16*1024; Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; @@ -1050,6 +1053,7 @@ FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) +FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) #ifdef USE_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -- cgit From 59e2992139774762456826f6667e73f2b39828d8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 4 Jun 1998 15:24:20 +0000 Subject: added "domain admin group" and "domain guest group" parameters. this is because "domain admin users" and "domain guest users" was overloaded. incorrectly. (This used to be commit 04b824007263ac4879c7282a2d230deaac7d2c7b) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 83aa2666a7..436a43240b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,6 +119,8 @@ typedef struct char *szSocketOptions; char *szValidChars; char *szWorkGroup; + char *szDomainAdminGroup; + char *szDomainGuestGroup; char *szDomainAdminUsers; char *szDomainGuestUsers; char *szDomainHostsallow; @@ -586,6 +588,8 @@ static struct parm_struct parm_table[] = {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, + {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, @@ -986,6 +990,8 @@ FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) +FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) +FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) -- cgit From 88d88f5d0d23c8c849739b9441872734c0431c99 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 5 Jun 1998 20:46:05 +0000 Subject: loadparm.c: Did it ! Changed defaults for 'case preserve' and 'short case preserve'. Also removed 'domain allow/deny' parameters. shmem_sysv.c: Added strerror code so I can see why sysV calls are failing. lib/rpc/server/srv_netlog.c: Removed code that used 'domain allow/deny' parameters - replaced with a comment so I will remember to fix this later. Jeremy. (This used to be commit 5f46c7c4b11a75f1ffbd806cde915b4bf28232db) --- source3/param/loadparm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 436a43240b..8bd051567a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -352,8 +352,8 @@ static service sDefault = False, /* bAlternatePerm */ False, /* revalidate */ False, /* case sensitive */ - False, /* case preserve */ - False, /* short case preserve */ + True, /* case preserve */ + True, /* short case preserve */ False, /* case mangle */ True, /* status */ True, /* bHideDotFiles */ @@ -592,10 +592,6 @@ static struct parm_struct parm_table[] = {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, - {"domain hosts allow",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, - {"domain allow hosts",P_STRING, P_GLOBAL, &Globals.szDomainHostsallow, NULL, NULL, 0}, - {"domain hosts deny", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, - {"domain deny hosts", P_STRING, P_GLOBAL, &Globals.szDomainHostsdeny, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, -- cgit From e85295d9241bcdad3723898ab8ad88d8f11d5f28 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jun 1998 02:26:26 +0000 Subject: loadparm.c: Removed 'domain other sids' parameter. lib/rpc/include/rpc_lsa.h: Changed #defines for RPC calls - moved some, made LSA_LOOKUPNAMES correct. lib/rpc/include/rpc_misc.h: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Changed bitmasks for uid to rid to be 1 bit. lib/rpc/parse/parse_misc.c: Changed make_unistr2 to put length as given, max length as one more. lib/rpc/server/srv_netlog.c: Removed 'domain other sids' parameter. lib/rpc/server/srv_samr.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. lib/rpc/server/srv_util.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Jeremy. (This used to be commit 34c91840a3d8c252715dc2f749b7a3b171a5b74f) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8bd051567a..e6065ae64b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -585,7 +585,6 @@ static struct parm_struct parm_table[] = {"Domain Options", P_SEP, P_SEPARATOR}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, - {"domain other sids",P_STRING, P_GLOBAL, &Globals.szDomainOtherSIDs, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, -- cgit From 5b5eb35c91ec400a25f6e6cf3eec421bd9560d50 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Jun 1998 03:04:00 +0000 Subject: Makefile: Added ubi_sLinkList.o as the groupname.o file needs it. Added groupname.o includes.h: Added ubi_sLinkList.h include. loadparm.c: Added groupname map parameter. password.c: Fix HPUX big_crypt. username.c: New user_in_list() code. Moved groupname map code to groupname.c lib/rpc/server/srv_util.c: Added lookup_wellknown_sid_from_name(). New groupname map stuff. Note that nothing currently uses this but at compiles ok. Jeremy. (This used to be commit beef636a4d772457816ef068c62ea965d07131f6) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e6065ae64b..cf41a75500 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -126,6 +126,7 @@ typedef struct char *szDomainHostsallow; char *szDomainHostsdeny; char *szUsernameMap; + char *szGroupnameMap; char *szCharacterSet; char *szLogonScript; char *szLogonPath; @@ -591,6 +592,7 @@ static struct parm_struct parm_table[] = {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -967,6 +969,7 @@ FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) +FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) -- cgit From cb757820f5452d192ce3b1eeb4f19a17ee93c3fe Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Jun 1998 01:35:52 +0000 Subject: Added SSL support from Christian Starkjohann This patch may not yet compile with -DUSE_SSL enabled, further Makefile changes may be needed. But it was important to get this code in place before I go off to USENIX. Jeremy. (This used to be commit 31e768369fdc61e07c59630c86c62239f3d3f3f7) --- source3/param/loadparm.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cf41a75500..2122541000 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -179,6 +179,22 @@ typedef struct #ifdef USE_LDAP int ldap_port; #endif /* USE_LDAP */ +#ifdef USE_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 /* USE_SSL */ BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -432,6 +448,11 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; +#ifdef USE_SSL +static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"} + {SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL}}; +#endif + /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { @@ -499,6 +520,24 @@ static struct parm_struct parm_table[] = {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, +#ifdef USE_SSL + {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, + {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0 }, + {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0 }, + {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0} , + {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0 }, + {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0 }, + {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0 }, + {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0 }, + {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0 }, + {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0 }, + {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL , 0}, + {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL , 0}, + {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0 }, + {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, + {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0 }, +#endif /* USE_SSL */ + {"Logging Options", P_SEP, P_SEPARATOR}, {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, @@ -790,6 +829,23 @@ static void init_globals(void) Globals.ldap_port=389; #endif /* USE_LDAP */ +#ifdef USE_SSL + Globals.sslVersion = SMB_SSL_V23; + Globals.sslHostsRequire = NULL; + Globals.sslHostsResign = NULL; + Globals.sslCaCertDir = NULL; + Globals.sslCaCertFile = NULL; + Globals.sslCert = NULL; + Globals.sslPrivKey = NULL; + Globals.sslClientCert = NULL; + Globals.sslClientPrivKey = NULL; + Globals.sslCiphers = NULL; + Globals.sslEnabled = False; + Globals.sslReqClientCert = False; + Globals.sslReqServerCert = False; + Globals.sslCompatibility = False; +#endif /* USE_SSL */ + /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1003,6 +1059,23 @@ FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); #endif /* USE_LDAP */ +#ifdef USE_SSL +FN_GLOBAL_INTEGER(lp_ssl_version,&Globals.sslVersion); +FN_GLOBAL_STRING(lp_ssl_hosts,&Globals.sslHostsRequire); +FN_GLOBAL_STRING(lp_ssl_hosts_resign,&Globals.sslHostsResign); +FN_GLOBAL_STRING(lp_ssl_cacertdir,&Globals.sslCaCertDir); +FN_GLOBAL_STRING(lp_ssl_cacertfile,&Globals.sslCaCertFile); +FN_GLOBAL_STRING(lp_ssl_cert,&Globals.sslCert); +FN_GLOBAL_STRING(lp_ssl_privkey,&Globals.sslPrivKey); +FN_GLOBAL_STRING(lp_ssl_client_cert,&Globals.sslClientCert); +FN_GLOBAL_STRING(lp_ssl_client_privkey,&Globals.sslClientPrivKey); +FN_GLOBAL_STRING(lp_ssl_ciphers,&Globals.sslCiphers); +FN_GLOBAL_BOOL(lp_ssl_enabled,&Globals.sslEnabled); +FN_GLOBAL_BOOL(lp_ssl_reqClientCert,&Globals.sslReqClientCert); +FN_GLOBAL_BOOL(lp_ssl_reqServerCert,&Globals.sslReqServerCert); +FN_GLOBAL_BOOL(lp_ssl_compatibility,&Globals.sslCompatibility); +#endif /* USE_SSL */ + FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) -- cgit From bbd7ca65e706457f5dbc046e83b4bd8cdde5be8f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Jun 1998 18:25:36 +0000 Subject: clientgen: Added USE_SSL for client shutdown. clitar.c: Added 'Samba style' comments before string_create_s(). loadparm.c: Fixed missing comma in SSL code. util.c: Removed string_create_s(). Currently it's only called from clitar.c and having it here as well as a static in clitar causes the compile to break (Richard, please decide where you want this function). lib/rpc/parse/parse_net.c: Fix from to stop coredump on missing parameter. Jeremy. (This used to be commit d23b44322570cb9a7aa2b86407bf4f91010a237b) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2122541000..820479ae65 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -449,7 +449,7 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; #ifdef USE_SSL -static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"} +static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, {SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL}}; #endif -- cgit From 59d07445b61e26321e3a1770c13756ac5948aabb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Jul 1998 21:23:59 +0000 Subject: loadparm.c: With apologies to Charlton Heston and Pierre Boule. "You damn fools, you finally did it". Changed default security mode to be security=user. Yes this is a big (although small in code) change. It's something we've been discussing for a while, to finally wean people off the legacy security=share mode which is *never* what you want. Jeremy. nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun. Found by . nttrans.c: More NT smb stuff. reply.c: Unlink will overwrite an existing file. Well you learn something new about POSIX every day. :-). server.c: Tidyup unreadable code. smbpasswd.c: Code to allow -U remote_username to allow ordinary users to change remote passwords if their NT username is different from their UNIX username. Patch from . Jeremy. (This used to be commit 4eccb47cfb3c8907a6558b6ea9a02b0184458e34) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 820479ae65..d6ec24ab5b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -785,7 +785,7 @@ static void init_globals(void) Globals.deadtime = 0; Globals.max_log_size = 5000; Globals.maxprotocol = PROTOCOL_NT1; - Globals.security = SEC_SHARE; + Globals.security = SEC_USER; Globals.bEncryptPasswords = False; Globals.bUpdateEncrypt = False; Globals.bReadRaw = True; -- cgit From f1cd3cb54c6495db2a91c473f91c78d24622d98e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Jul 1998 00:06:29 +0000 Subject: Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com. ipc.c: loadparm.c: printing.c: Added code from to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy. (This used to be commit 559a9bf2bbdeae3e76ba9178779cd3a9537c4e91) --- source3/param/loadparm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d6ec24ab5b..10b261ed02 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -252,6 +252,8 @@ typedef struct char *szLprmcommand; char *szLppausecommand; char *szLpresumecommand; + char *szQueuepausecommand; + char *szQueueresumecommand; char *szPrintername; char *szPrinterDriver; char *szPrinterDriverLocation; @@ -340,6 +342,8 @@ static service sDefault = NULL, /* szLprmcommand */ NULL, /* szLppausecommand */ NULL, /* szLpresumecommand */ + NULL, /* szQueuepausecommand */ + NULL, /* szQueueresumecommand */ NULL, /* szPrintername */ NULL, /* szPrinterDriver - this is set in init_globals() */ NULL, /* szPrinterDriverLocation */ @@ -593,6 +597,9 @@ static struct parm_struct parm_table[] = {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_GLOBAL}, {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_GLOBAL}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, @@ -911,7 +918,12 @@ static void init_locals(void) #ifdef SVR4 string_initial(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); string_initial(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); -#endif + string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); + string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); +#else /* SVR4 */ + string_initial(&sDefault.szQueuepausecommand, "disable %p"); + string_initial(&sDefault.szQueueresumecommand, "enable %p"); +#endif /* SVR4 */ break; case PRINT_QNX: @@ -1153,6 +1165,8 @@ FN_LOCAL_STRING(lp_lpqcommand,szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand,szLprmcommand) FN_LOCAL_STRING(lp_lppausecommand,szLppausecommand) FN_LOCAL_STRING(lp_lpresumecommand,szLpresumecommand) +FN_LOCAL_STRING(lp_queuepausecommand,szQueuepausecommand) +FN_LOCAL_STRING(lp_queueresumecommand,szQueueresumecommand) FN_LOCAL_STRING(lp_printername,szPrintername) FN_LOCAL_STRING(lp_printerdriver,szPrinterDriver) FN_LOCAL_STRING(lp_hostsallow,szHostsallow) -- cgit From 7abcd0521e36425bf7c3dc90929c00ed49e9ab07 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Jul 1998 18:15:31 +0000 Subject: loadparm.c: Added strict sync parameter. locking.c: Added code to deal with real open mode of file. reply.c: Added strict sync parameter. server.c: Added strict sync parameter. Fixed open modes. Jeremy. (This used to be commit ed57b603b5c9333d588e62d774ad2be67e43ffd9) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 10b261ed02..da0210eee7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -308,6 +308,7 @@ typedef struct BOOL bWidelinks; BOOL bSymlinks; BOOL bSyncAlways; + BOOL bStrictSync; char magic_char; BOOL *copymap; BOOL bDeleteReadonly; @@ -398,6 +399,7 @@ static service sDefault = True, /* bWidelinks */ True, /* bSymlinks */ False, /* bSyncAlways */ + False, /* bStrictSync */ '~', /* magic char */ NULL, /* copymap */ False, /* bDeleteReadonly */ @@ -582,6 +584,7 @@ static struct parm_struct parm_table[] = {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, 0}, {"Printing Options", P_SEP, P_SEPARATOR}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, @@ -1211,6 +1214,7 @@ FN_LOCAL_BOOL(lp_manglednames,bMangledNames) FN_LOCAL_BOOL(lp_widelinks,bWidelinks) FN_LOCAL_BOOL(lp_symlinks,bSymlinks) FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) +FN_LOCAL_BOOL(lp_strict_sync,bStrictSync) FN_LOCAL_BOOL(lp_map_system,bMap_system) FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) -- cgit From 64578c0589a3a741f81fb55c16eeb882128da00b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 03:08:05 +0000 Subject: merge from the autoconf2 branch to the main branch (This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21) --- source3/param/loadparm.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da0210eee7..3e76dca731 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -176,10 +176,10 @@ typedef struct int client_code_page; int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; -#ifdef USE_LDAP +#ifdef WITH_LDAP int ldap_port; -#endif /* USE_LDAP */ -#ifdef USE_SSL +#endif /* WITH_LDAP */ +#ifdef WITH_SSL int sslVersion; char *sslHostsRequire; char *sslHostsResign; @@ -194,7 +194,7 @@ typedef struct BOOL sslReqClientCert; BOOL sslReqServerCert; BOOL sslCompatibility; -#endif /* USE_SSL */ +#endif /* WITH_SSL */ BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -454,7 +454,7 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; -#ifdef USE_SSL +#ifdef WITH_SSL static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, {SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL}}; #endif @@ -526,7 +526,7 @@ static struct parm_struct parm_table[] = {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, -#ifdef USE_SSL +#ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0 }, {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0 }, @@ -542,7 +542,7 @@ static struct parm_struct parm_table[] = {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0 }, {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0 }, -#endif /* USE_SSL */ +#endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, @@ -676,7 +676,7 @@ static struct parm_struct parm_table[] = {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, -#ifdef USE_LDAP +#ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, @@ -684,7 +684,7 @@ static struct parm_struct parm_table[] = {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, -#endif /* USE_LDAP */ +#endif /* WITH_LDAP */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, @@ -817,7 +817,7 @@ static void init_globals(void) Globals.shmem_size = SHMEM_SIZE; Globals.announce_as = ANNOUNCE_AS_NT; Globals.bUnixRealname = False; -#if (defined(NETGROUP) && defined(AUTOMOUNT)) +#if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; #ifdef NISPLUS_HOME string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); @@ -833,13 +833,13 @@ static void init_globals(void) Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; -#ifdef USE_LDAP +#ifdef WITH_LDAP /* default values for ldap */ string_set(&Globals.szLdapServer, "localhost"); Globals.ldap_port=389; -#endif /* USE_LDAP */ +#endif /* WITH_LDAP */ -#ifdef USE_SSL +#ifdef WITH_SSL Globals.sslVersion = SMB_SSL_V23; Globals.sslHostsRequire = NULL; Globals.sslHostsResign = NULL; @@ -854,7 +854,7 @@ static void init_globals(void) Globals.sslReqClientCert = False; Globals.sslReqServerCert = False; Globals.sslCompatibility = False; -#endif /* USE_SSL */ +#endif /* WITH_SSL */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -918,15 +918,15 @@ static void init_locals(void) string_initial(&sDefault.szLpqcommand,"lpstat -o%p"); string_initial(&sDefault.szLprmcommand,"cancel %p-%j"); string_initial(&sDefault.szPrintcommand,"lp -c -d%p %s; rm %s"); -#ifdef SVR4 +#ifdef SYSV string_initial(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); string_initial(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); -#else /* SVR4 */ +#else /* SYSV */ string_initial(&sDefault.szQueuepausecommand, "disable %p"); string_initial(&sDefault.szQueueresumecommand, "enable %p"); -#endif /* SVR4 */ +#endif /* SYSV */ break; case PRINT_QNX: @@ -1066,15 +1066,15 @@ FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) -#ifdef USE_LDAP +#ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); -#endif /* USE_LDAP */ +#endif /* WITH_LDAP */ -#ifdef USE_SSL +#ifdef WITH_SSL FN_GLOBAL_INTEGER(lp_ssl_version,&Globals.sslVersion); FN_GLOBAL_STRING(lp_ssl_hosts,&Globals.sslHostsRequire); FN_GLOBAL_STRING(lp_ssl_hosts_resign,&Globals.sslHostsResign); @@ -1089,7 +1089,7 @@ FN_GLOBAL_BOOL(lp_ssl_enabled,&Globals.sslEnabled); FN_GLOBAL_BOOL(lp_ssl_reqClientCert,&Globals.sslReqClientCert); FN_GLOBAL_BOOL(lp_ssl_reqServerCert,&Globals.sslReqServerCert); FN_GLOBAL_BOOL(lp_ssl_compatibility,&Globals.sslCompatibility); -#endif /* USE_SSL */ +#endif /* WITH_SSL */ FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) @@ -1147,9 +1147,9 @@ FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) -#ifdef USE_LDAP +#ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -#endif /* USE_LDAP */ +#endif /* WITH_LDAP */ FN_LOCAL_STRING(lp_preexec,szPreExec) FN_LOCAL_STRING(lp_postexec,szPostExec) -- cgit From 7284bb5ca049a682097bb25afcf25d40f1ac5479 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Jul 1998 21:18:57 +0000 Subject: Makefile.in: Moved UBIQX stuff into UTILOBJ. loadparm.c: Added "ole locking compatibility" option (default "true"). locking.c: Changes to implement union in files_struct. locking_shm.c: Changes to implement union in files_struct. nttrans.c: Made opening a directory explicit (we have to). Added create directory code for nttrans. reply.c: Changes to implement union in files_struct. server.c: Changes to implement union in files_struct. Added create directory code. trans2.c: Changes to implement union in files_struct. smb.h: Changes to implement union in files_struct. util.c: Changed linked list code to UNIQX linked list. This will make the other lists I need to implement for ChangeNotify and blocking locks easier. Jeremy. (This used to be commit 3a5eea850bb256b39cff8ace1e4fb4e0c1f5472b) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3e76dca731..4d5ef3d657 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -222,6 +222,7 @@ typedef struct BOOL bNetWkstaUserLogon; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; + BOOL bOleLockingCompat; } global; static global Globals; @@ -675,6 +676,7 @@ static struct parm_struct parm_table[] = {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, #ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, @@ -832,6 +834,7 @@ static void init_globals(void) the code in password.c protects us from this bug. */ Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; + Globals.bOleLockingCompat = True; #ifdef WITH_LDAP /* default values for ldap */ @@ -1120,6 +1123,7 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) +FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From f1abfacd4d230075e5c4029271f2f3952ac2c68a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 3 Aug 1998 18:13:13 +0000 Subject: I finished removing timestring() calls from DEBUG() messages. Also went through and changed some DEBUG() calls to DEBUGADD() to combine output under a single timestamp. There were too many timestamps. Note that Jeremy has told me that he's working on adding a config parameter to turn timestamps off. Cool. Chris -)----- (This used to be commit 247dbc9a24987035a47f1ba4fa143b1e2c050e92) --- source3/param/loadparm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4d5ef3d657..2a42546662 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1956,13 +1956,16 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) /*************************************************************************** Process a parameter. ***************************************************************************/ -static BOOL do_parameter(char *pszParmName, char *pszParmValue) +static BOOL do_parameter( char *pszParmName, char *pszParmValue ) { - if (!bInGlobalSection && bGlobalOnly) return(True); + if( !bInGlobalSection && bGlobalOnly ) + return(True); - DEBUG(3,("doing parameter %s = %s\n",pszParmName,pszParmValue)); + DEBUGADD( 3, ( "doing parameter %s = %s\n", pszParmName, pszParmValue ) ); - return lp_do_parameter(bInGlobalSection?-2:iServiceIndex, pszParmName, pszParmValue); + return( lp_do_parameter( bInGlobalSection ? -2 : iServiceIndex, + pszParmName, + pszParmValue ) ); } @@ -2082,7 +2085,7 @@ static BOOL do_section(char *pszSectionName) /* check for multiple global sections */ if (bInGlobalSection) { - DEBUG(3,( "Processing section \"[%s]\"\n", pszSectionName)); + DEBUG( 3, ( "Processing section \"[%s]\"\n", pszSectionName ) ); return(True); } -- cgit From 7448091da6ee11709b8e5117ff6810515567f88a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Aug 1998 19:07:55 +0000 Subject: First implementation of ChangeNotify - this version only checks for changes in the directory modify timestamps. A better version will look at the requested client flags, and create a hash that represents the current state of the directory, and check against this instead. debug.c: Added lp_timestamp_logs() function. loadparm.c: Added "change notify timeout" in seconds (default 60) - this is the scan rate for a directory. Added ""timestamp logs" boolean - default True. Turns off log timestamps (so I can read them :-). nttrans.c: ChangeNotify implementation. server.c: ChangeNotify implementation. shmem_sysv.c: Added exits on shmem errors (without them smbd can core dump if some calls fail). smb.h: Added ChangeNotify flags for future use. util.c: Tidied up typedef. Jeremy. (This used to be commit a0748c3f53974483680ebe2ea4f556ece8d7fa43) --- source3/param/loadparm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2a42546662..ce8ff7122d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -176,6 +176,7 @@ typedef struct int client_code_page; int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; + int change_notify_timeout; #ifdef WITH_LDAP int ldap_port; #endif /* WITH_LDAP */ @@ -223,6 +224,7 @@ typedef struct BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; BOOL bOleLockingCompat; + BOOL bTimestampLogs; } global; static global Globals; @@ -552,6 +554,7 @@ static struct parm_struct parm_table[] = {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL}, {"Protocol Options", P_SEP, P_SEPARATOR}, @@ -573,6 +576,7 @@ static struct parm_struct parm_table[] = {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, @@ -808,11 +812,13 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; + Globals.bTimestampLogs = True; Globals.os_level = 0; - Globals.max_ttl = 60*60*24*3; /* 3 days default */ - Globals.max_wins_ttl = 60*60*24*6; /* 6 days default */ - Globals.min_wins_ttl = 60*60*6; /* 6 hours default */ - Globals.machine_password_timeout = 60*60*24*7; /* 7 days default */ + Globals.max_ttl = 60*60*24*3; /* 3 days default. */ + Globals.max_wins_ttl = 60*60*24*6; /* 6 days default. */ + Globals.min_wins_ttl = 60*60*6; /* 6 hours default. */ + Globals.machine_password_timeout = 60*60*24*7; /* 7 days default. */ + Globals.change_notify_timeout = 60; /* 1 minute default. */ Globals.ReadSize = 16*1024; Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; @@ -1115,6 +1121,7 @@ FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) +FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) @@ -1150,6 +1157,7 @@ FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) +FN_GLOBAL_INTEGER(lp_change_notify_timeout,&Globals.change_notify_timeout) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -- cgit From 31c09de03c656b7309888dbbc5240c31ed81537e Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 3 Aug 1998 22:10:53 +0000 Subject: More formatting changes. Mostly converted some DEBUG() calls to DEBUGADD() so that we wouldn't get too many timestamps. Chris -)----- (This used to be commit 3e7e5fad378cf144927d9f2ffc82f80e150d44ab) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ce8ff7122d..008f4e4539 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1710,17 +1710,17 @@ BOOL lp_file_list_changed(void) pstrcpy(n2,f->name); standard_sub_basic(n2); - DEBUG(6,("file %s -> %s last mod_time: %s\n", - f->name, n2, ctime(&f->modtime))); + DEBUGADD( 6, ( "file %s -> %s last mod_time: %s\n", + f->name, n2, ctime(&f->modtime) ) ); mod_time = file_modtime(n2); if (f->modtime != mod_time) { - DEBUG(6,("file %s modified: %s\n", n2, ctime(&mod_time))); + DEBUGADD(6,("file %s modified: %s\n", n2, ctime(&mod_time))); f->modtime = mod_time; return(True); } - f = f->next; + f = f->next; } return(False); } -- cgit From c0c057c0dfc43c47b2d340e26026136cf001ff0a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 4 Aug 1998 01:01:26 +0000 Subject: loadparm.c: Added "debug timestamp" synonym for Chris. nttrans.c: Moved common code into function in server.c Removed left over debug level 0. server.c: Moved common code into function in server.c Jeremy. (This used to be commit 34ef55b7228155cef40cbdfcdc1fe623c1037bd6) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 008f4e4539..19998ece54 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -555,6 +555,7 @@ static struct parm_struct parm_table[] = {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL}, {"Protocol Options", P_SEP, P_SEPARATOR}, -- cgit From 963e96f3a980b20925e21ed2f9d3744c21802cce Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Aug 1998 01:15:14 +0000 Subject: added --with-nisplus-home option (This used to be commit 70000c21909a154344b489e8aa18a5868ff52865) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 19998ece54..dcdfbd7724 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -828,7 +828,7 @@ static void init_globals(void) Globals.bUnixRealname = False; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; -#ifdef NISPLUS_HOME +#ifdef WITH_NISPLUS_HOME string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); #else string_set(&Globals.szNISHomeMapName, "auto.home"); -- cgit From 27ff18a184556f1e157de7c2789f39e3e70a40fc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 11:24:15 +0000 Subject: these dummy files are needed for autoconf processing (This used to be commit be762dc3de6c1ef768790522dfe93007a61ce5d7) --- source3/param/dummy.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 source3/param/dummy.in (limited to 'source3/param') diff --git a/source3/param/dummy.in b/source3/param/dummy.in new file mode 100644 index 0000000000..e69de29bb2 -- cgit From 87bcd5502c105921b48f9654d1c4f6d14ed9e9f6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 11:25:49 +0000 Subject: added ignore rules for the dummy files (This used to be commit 687f76a17d6d3ebd33b4d9a848deef56f3c1f56a) --- source3/param/.cvsignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 source3/param/.cvsignore (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore new file mode 100644 index 0000000000..421376db9e --- /dev/null +++ b/source3/param/.cvsignore @@ -0,0 +1 @@ +dummy -- cgit From bad66abfe7c64069b76686563030ca6819fe4cc0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Aug 1998 05:22:10 +0000 Subject: moved username.c into lib/ so we no longer $(PASSDB_OBJ) in most utilities (This used to be commit 745d38bfe7a989a602d14b8a04757893ae40ba8e) --- source3/param/loadparm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dcdfbd7724..1c0b044598 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2315,21 +2315,20 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); printers = lp_servicenumber(PRINTERS_NAME); - for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) - { - char *home = get_home_dir(p); - - if (lp_servicenumber(p) >= 0) continue; + for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { + char *home = get_home_dir(p); - if (home && homes >= 0) - { - lp_add_home(p,homes,home); - continue; - } + if (lp_servicenumber(p) >= 0) continue; - if (printers >= 0 && pcap_printername_ok(p,NULL)) - lp_add_printer(p,printers); - } + if (home && homes >= 0) { + lp_add_home(p,homes,home); + continue; + } + + if (printers >= 0 && pcap_printername_ok(p,NULL)) { + lp_add_printer(p,printers); + } + } free(s); } -- cgit From b9623ab59e813131b1ed3f51616a46e719d59c21 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 14 Aug 1998 17:38:29 +0000 Subject: this is the bug change to using connection_struct* instead of cnum. Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6) --- source3/param/loadparm.c | 106 ++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 79 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1c0b044598..6fcd1eaf9b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2298,67 +2298,46 @@ BOOL lp_snum_ok(int iService) /*************************************************************************** -auto-load some homes and printer services +auto-load some home services ***************************************************************************/ static void lp_add_auto_services(char *str) { - char *s; - char *p; - int homes, printers; - - if (!str) - return; - - s = strdup(str); - if (!s) return; + char *s; + char *p; + int homes; - homes = lp_servicenumber(HOMES_NAME); - printers = lp_servicenumber(PRINTERS_NAME); + if (!str) return; - for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { - char *home = get_home_dir(p); + s = strdup(str); + if (!s) return; - if (lp_servicenumber(p) >= 0) continue; - - if (home && homes >= 0) { - lp_add_home(p,homes,home); - continue; - } - - if (printers >= 0 && pcap_printername_ok(p,NULL)) { - lp_add_printer(p,printers); - } - } - free(s); + homes = lp_servicenumber(HOMES_NAME); + + for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { + char *home = get_home_dir(p); + + if (lp_servicenumber(p) >= 0) continue; + + if (home && homes >= 0) { + lp_add_home(p,homes,home); + } + } + free(s); } /*************************************************************************** auto-load one printer ***************************************************************************/ -static void lp_add_one_printer(char *name,char *comment) +void lp_add_one_printer(char *name,char *comment) { - int printers = lp_servicenumber(PRINTERS_NAME); - int i; - - if (lp_servicenumber(name) < 0) - { - lp_add_printer(name,printers); - if ((i=lp_servicenumber(name)) >= 0) - string_set(&iSERVICE(i).comment,comment); - } -} - - -/*************************************************************************** -auto-load printer services -***************************************************************************/ -static void lp_add_all_printers(void) -{ - int printers = lp_servicenumber(PRINTERS_NAME); - - if (printers < 0) return; + int printers = lp_servicenumber(PRINTERS_NAME); + int i; - pcap_printer_fn(lp_add_one_printer); + if (lp_servicenumber(name) < 0) { + lp_add_printer(name,printers); + if ((i=lp_servicenumber(name)) >= 0) + string_set(&iSERVICE(i).comment,comment); + } } /*************************************************************************** @@ -2460,8 +2439,6 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) bRetval = service_ok(iServiceIndex); lp_add_auto_services(lp_auto_services()); - if (lp_load_printers()) - lp_add_all_printers(); if (add_ipc) lp_add_ipc(); @@ -2540,26 +2517,6 @@ char *volume_label(int snum) return(ret); } -#if 0 -/* - * nmbd only loads the global section. There seems to be no way to - * determine exactly is a service is printable by only looking at the - * [global] section so for now always announce as a print server. This - * will need looking at in the future. Jeremy (jallison@whistle.com). - */ -/******************************************************************* - Return true if any printer services are defined. - ******************************************************************/ -static BOOL lp_printer_services(void) -{ - int iService; - - for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && iSERVICE(iService).bPrint_ok) - return True; - return False; -} -#endif /******************************************************************* Set the server type we will announce as via nmbd. @@ -2575,15 +2532,6 @@ static void set_default_server_announce_type() else if(lp_announce_as() == ANNOUNCE_AS_WFW) default_server_announce |= SV_TYPE_WFW; default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); -/* - * nmbd only loads the [global] section. There seems to be no way to - * determine exactly if any service is printable by only looking at the - * [global] section so for now always announce as a print server. This - * will need looking at in the future. Jeremy (jallison@whistle.com). - */ -#if 0 - default_server_announce |= (lp_printer_services() ? SV_TYPE_PRINTQ_SERVER : 0); -#endif } -- cgit From 038e3433d39337f736b7b69ac1e6212e9f8e5406 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 21 Aug 1998 11:37:40 +0000 Subject: added new smb.conf option "panic action". see my samba-technical explanation. (This used to be commit c6899df44c34088a4d2bf1edc840320b0ba7e32e) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6fcd1eaf9b..765fae4f5c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -152,6 +152,7 @@ typedef struct char *szLdapFilter; char *szLdapRoot; char *szLdapRootPassword; + char *szPanicAction; int max_log_size; int mangled_stack; int max_xmit; @@ -734,6 +735,8 @@ static struct parm_struct parm_table[] = {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_GLOBAL}, {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_GLOBAL}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1065,6 +1068,7 @@ FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) +FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction); FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) -- cgit From 8afc9c80ac11649f06e5517d819dbf201c941acb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Aug 1998 21:49:10 +0000 Subject: Changed ASSERT macros to SMB_ASSERT macros as some systems already have an ASSERT macro defined. Jeremy. (This used to be commit dbe6ad014a8b5dcbf17d7cd9865650c2e040d666) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 765fae4f5c..c2f7837aa8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1068,7 +1068,7 @@ FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) -FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction); +FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) -- cgit From 2c065107b149797e2a42a6c119f883d30be411eb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Aug 1998 06:40:42 +0000 Subject: changed the default permissions code to do this: if ((sbuf->st_mode & S_IWUSR) == 0) result |= aRONLY; rather than the very complex user/group permissions checks we do currently. This is equivalent ot setting "alternate permissions = yes" in the old code. The change is motivated by three main reasons: 1) it's basically impossible to second guess whether a file is writeable without trying to open it for writing. ACLs, root squash etc just make it too hard. 2) setting it not RONLY if the owner can write is closer to what NT does (eg. look at a cdrom - files are not marked read only). 3) it prevents the silly problem of copying files from a read only share to a writeable share and then finding you can't write to them as windows preserves the RONLY flag. Lots of people get bitten by this when they drag a folder from a Samba drive. It also hurts some install programs. I have also added a new flag type for loadparm.c called FLAG_DEPRECATED which I've set for "alternate permissions". I'll soon add code to testparm to give a warning about deprecated options. (This used to be commit c4363a12fdc0be329ca2bfeb1d7b89bfe90031dc) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c2f7837aa8..6056187066 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -496,7 +496,7 @@ static struct parm_struct parm_table[] = {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED}, {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, @@ -1205,7 +1205,6 @@ FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) -FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive) FN_LOCAL_BOOL(lp_preservecase,bCasePreserve) -- cgit From 7bc68de378168bcc9891642ef58f645a5fb11bf2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Aug 1998 01:57:17 +0000 Subject: added a warning when loading a parameter that is deprecated (This used to be commit c8b0041570a1fb0be0318f511c6ba746c733cda9) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6056187066..f6c5769718 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1878,6 +1878,11 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) return(True); } + if (parm_table[parmnum].flags & FLAG_DEPRECATED) { + DEBUG(1,("WARNING: The \"%s\"option is deprecated\n", + pszParmName)); + } + def_ptr = parm_table[parmnum].ptr; /* we might point at a service, the default service or a global */ -- cgit From 38142a1ebbe860778e26eaff68585726061c05e2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Aug 1998 21:46:29 +0000 Subject: This checking fixes the statcache bug that stopped NetBench from running correctly. Added new parameter "stat cache size" - set to 50 by default. I now declare the statcache code officially "open" for business :-). It gets a hit rate of 97% with a NetBench run and seems to make using a case insensitive run as efficient as a case sensitive run. Also tidied up our sys_select usage - added a maxfd parameter and also added an implementation of select in terms of poll(), for systems where poll() is much faster. This is disabled by default. Jeremy. (This used to be commit 779b924ec1f6c81ff578d22295b20fece698d1fc) --- source3/param/loadparm.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f6c5769718..44db306d1b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -178,6 +178,7 @@ typedef struct int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; int change_notify_timeout; + int stat_cache_size; #ifdef WITH_LDAP int ldap_port; #endif /* WITH_LDAP */ @@ -579,19 +580,20 @@ static struct parm_struct parm_table[] = {"Tuning Options", P_SEP, P_SEPARATOR}, {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, 0}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, {"Printing Options", P_SEP, P_SEPARATOR}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, @@ -827,6 +829,7 @@ static void init_globals(void) Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; Globals.shmem_size = SHMEM_SIZE; + Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ Globals.announce_as = ANNOUNCE_AS_NT; Globals.bUnixRealname = False; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) @@ -1163,6 +1166,7 @@ FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_change_notify_timeout,&Globals.change_notify_timeout) +FN_GLOBAL_INTEGER(lp_stat_cache_size,&Globals.stat_cache_size) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -- cgit From 98f524bde4801bd0b013a6bc79c5552ef62b59f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 5 Sep 1998 03:14:40 +0000 Subject: Bugfix for leak in reference counted file struct. Added "nt smb support" parameter to allow NT SMB's to be turned off. Jeremy. (This used to be commit 63f65f5027d5022153fa2757b49c56829db1725b) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 44db306d1b..9bf3dce6fb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -227,6 +227,7 @@ typedef struct BOOL bPasswdChatDebug; BOOL bOleLockingCompat; BOOL bTimestampLogs; + BOOL bNTSmbSupport; } global; static global Globals; @@ -566,6 +567,7 @@ static struct parm_struct parm_table[] = {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, + {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -848,6 +850,7 @@ static void init_globals(void) Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; Globals.bOleLockingCompat = True; + Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ #ifdef WITH_LDAP /* default values for ldap */ @@ -1139,6 +1142,7 @@ FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) +FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From e9ea36e4d2270bd7d32da12ef6d6e2299641582d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Sep 1998 05:07:05 +0000 Subject: tridge the destroyer returns! prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f) --- source3/param/loadparm.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9bf3dce6fb..8e759cbbb0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -652,7 +652,6 @@ static struct parm_struct parm_table[] = {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -971,7 +970,7 @@ convenience routine to grab string parameters into a rotating buffer, and run standard_sub_basic on them. The buffers can be written to by callers without affecting the source string. ********************************************************************/ -char *lp_string(char *s) +static char *lp_string(char *s) { static char *bufs[10]; static int buflen[10]; @@ -1050,7 +1049,6 @@ FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) 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_hosts_equiv,&Globals.szHostsEquiv) FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) @@ -1059,8 +1057,6 @@ FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) -FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) -FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) @@ -1071,20 +1067,17 @@ FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) -FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) +static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) -FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) -FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) -FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); @@ -1122,7 +1115,6 @@ FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) -FN_GLOBAL_BOOL(lp_getwdcache,&use_getwd_cache) FN_GLOBAL_BOOL(lp_readprediction,&Globals.bReadPrediction) FN_GLOBAL_BOOL(lp_readbmpx,&Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw,&Globals.bReadRaw) @@ -1136,7 +1128,7 @@ FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) -FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) +static FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) @@ -1149,11 +1141,8 @@ FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) FN_GLOBAL_INTEGER(lp_max_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_min_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) -FN_GLOBAL_INTEGER(lp_mangledstack,&Globals.mangled_stack) FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) -FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) -FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) FN_GLOBAL_INTEGER(lp_usernamelevel,&Globals.unamelevel) FN_GLOBAL_INTEGER(lp_readsize,&Globals.ReadSize) @@ -1165,7 +1154,7 @@ FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) -FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) +static FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) @@ -1206,7 +1195,7 @@ FN_LOCAL_STRING(lp_force_user,force_user) FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) -FN_LOCAL_STRING(lp_volume,volume) +static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) @@ -2551,14 +2540,6 @@ static void set_default_server_announce_type() } -/******************************************************************* -rename a service -********************************************************************/ -void lp_rename_service(int snum, char *new_name) -{ - string_set(&pSERVICE(snum)->szService, new_name); -} - /******************************************************************* remove a service ********************************************************************/ -- cgit From 4fc5a74ffa491d52afc373abcdd4257a4f105aa4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 6 Sep 1998 01:37:14 +0000 Subject: add a "stat cache" boolean smb.conf option. (defaults to on) I think we need this so we can rule out stat cache bugs when dealing with bug reports. If we ask a user to disable the stat cache and the problem persists then we know it isn't a stat cache bug. The stat cache code is sufficiently complicated that it can be pretty hard to tell if it is causing problems or not. (This used to be commit c83f3775cd8a7aad13571926cdd5949a07538771) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8e759cbbb0..fe3cf2f06a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -228,6 +228,7 @@ typedef struct BOOL bOleLockingCompat; BOOL bTimestampLogs; BOOL bNTSmbSupport; + BOOL bStatCache; } global; static global Globals; @@ -643,6 +644,7 @@ static struct parm_struct parm_table[] = {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_GLOBAL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_GLOBAL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_GLOBAL}, + {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, {"Domain Options", P_SEP, P_SEPARATOR}, {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, @@ -850,6 +852,7 @@ static void init_globals(void) Globals.bPasswdChatDebug = False; Globals.bOleLockingCompat = True; Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ + Globals.bStatCache = True; /* use stat cache by default */ #ifdef WITH_LDAP /* default values for ldap */ @@ -1135,6 +1138,7 @@ FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) +FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) -- cgit From 6e0c276ec8b918165a19b3dfc86bc7bef6d1f706 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Sep 1998 19:21:04 +0000 Subject: Added back groupname map stuff removed by Andrew's "slash 'n' burn" tactics :-). Protected by #ifdef until used. Fixed bug in fd_attempt_close() where a pointer to potentially free'd memory was returned. I hate that. Added "blocking locks" as a per-share option for performance testing. Changed is_mangled() so it will return true if called with a pathname and any component of the pathname was mangled (it was already attempting to do this, but not checking for a '/' as end-of-mangle). This should be a better fix for the wierd stat cache bug Andrew identified. Jeremy. (This used to be commit 0de01f45980c7bc261248a9cead972a8d8cbd594) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fe3cf2f06a..c8ab2d411b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -126,7 +126,9 @@ typedef struct char *szDomainHostsallow; char *szDomainHostsdeny; char *szUsernameMap; +#ifdef USING_GROUPNAME_MAP char *szGroupnameMap; +#endif /* USING_GROUPNAME_MAP */ char *szCharacterSet; char *szLogonScript; char *szLogonPath; @@ -324,6 +326,7 @@ typedef struct BOOL bDosFiletimes; BOOL bDosFiletimeResolution; BOOL bFakeDirCreateTimes; + BOOL bBlockingLocks; char dummy[3]; /* for alignment */ } service; @@ -415,6 +418,7 @@ static service sDefault = False, /* bDosFiletimes */ False, /* bDosFiletimeResolution */ False, /* bFakeDirCreateTimes */ + True, /* bBlockingLocks */ "" /* dummy */ }; @@ -582,6 +586,7 @@ static struct parm_struct parm_table[] = {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, @@ -654,6 +659,9 @@ static struct parm_struct parm_table[] = {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, +#ifdef USING_GROUPNAME_MAP + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, +#endif /* USING_GROUPNAME_MAP */ {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -1060,6 +1068,9 @@ FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) +#ifdef USING_GROUPNAME_MAP +FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) +#endif /* USING_GROUPNAME_MAP */ FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) @@ -1239,6 +1250,7 @@ FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times,bFakeDirCreateTimes) +FN_LOCAL_BOOL(lp_blocking_locks,bBlockingLocks) FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -- cgit From ac9b687cc2496409e1c8d86393812faf94ec7550 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Sep 1998 19:16:12 +0000 Subject: configure configure.in: Added tests for fseek64 and ftell64. config.h.in: Added fseek64 and ftell64. includes.h: Added definition of SMB_BIG_INTEGER. smb.h: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. access.c: Tidyup of dbug statement. system.c: Added sys_fseek and sys_ftell. Changed mode calls to use mode_t. asyncdns.c: Tidyup of comment. loadparm.c: Tidyup of set_default_server_announce_type() function definition. ldap.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. nispass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpassfile.c: Use sys_fseek(). chgpasswd.c: Tidyup of debug statement. dosmode.c: Changed mode calls to use mode_t. ipc.c: Removal of dead code. nttrans.c: Changed mode calls to use mode_t. open.c: Changed mode calls to use mode_t. pipes.c: Removal of dead code. reply.c: Removal of dead code. trans2.c: Removal of dead code. Changed mode calls to use mode_t. Jeremy. (This used to be commit c381d32e3dc23fe887408016cae821aceb30da2c) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c8ab2d411b..276cb13c8e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2542,7 +2542,7 @@ char *volume_label(int snum) /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ -static void set_default_server_announce_type() +static void set_default_server_announce_type(void) { default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); -- cgit From b8b67f4fab4a6fd686c5796c2701882197a7bd9d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Sep 1998 23:06:57 +0000 Subject: configure configure.in: Added checks for statvfs64. Last bit of 64 bit widening (I hope :-). include/config.h.in: Added #undef STAT_STATVFS64. include/includes.h: Added SMB_STRUCT_STATVFS type, Changed SMB_BIG_INTEGER to SMB_BIG_UINT and SMB_BIG_INT types. include/smb.h: Added flag defines from CIFS spec. lib/debug.c: Fixed one more mode_t issue. lib/system.c: Added sys_statvfs wrapper. lib/util.c: Changed trim_string to use size_t. param/loadparm.c: Moved "blocking locks" into locking section. Alphabetised locking options. Question - shuld we do this for all options ? passdb/ldap.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/nispass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/smbpass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. smbd/dfree.c: Changed to use 64 bit types if available. Moved to use unsigned types. smbd/dosmode.c: Fixed one more mode_t issue. smbd/negprot.c: Changed literals to be FLAG_ #defines. smbd/nttrans.c: Removed dead code. smbd/open.c: Changed disk_free call. smbd/process.c: Changed literals to be FLAG_ #defines. smbd/reply.c: Changed disk_free call. smbd/trans2.c: Fixed but in SMB_QUERY_FS_VOLUME_INFO call. Was using UNICODE - should use ascii. tests/summary.c: Added STAT_STATVFS64 check. Jeremy. (This used to be commit c512b1b91fb7f2a7a93b9033a33e06d966daadb4) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 276cb13c8e..23f7155444 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -586,7 +586,6 @@ static struct parm_struct parm_table[] = {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, @@ -685,17 +684,18 @@ static struct parm_struct parm_table[] = {"WINS Options", P_SEP, P_SEPARATOR}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"Locking Options", P_SEP, P_SEPARATOR}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_GLOBAL}, + {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_GLOBAL}, {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_GLOBAL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, - {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, #ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, -- cgit From 184db9266efcbcea13169f99002b32208dc2ec9b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 17:50:18 +0000 Subject: configure configure.in include/config.h.in include/includes.h Fixed bugs in readline autoconf. param/loadparm.c smbd/open.c smbd/oplock.c: Started on kernel oplock code - checking forced by above issue. Should not be used currently. Jeremy. (This used to be commit f939efac9e6c45331b17e3d3aa6bc2235e886c1a) --- source3/param/loadparm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 23f7155444..2d469d1de2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -231,6 +231,7 @@ typedef struct BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bStatCache; + BOOL bKernelOplocks; } global; static global Globals; @@ -691,6 +692,7 @@ static struct parm_struct parm_table[] = {"Locking Options", P_SEP, P_SEPARATOR}, {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_GLOBAL}, {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, @@ -907,6 +909,12 @@ static void init_globals(void) Globals.bDNSproxy = True; + /* + * smbd will check after starting to see if this value + * should be set to "true" or not. + */ + Globals.bKernelOplocks = False; + /* * This must be done last as it checks the value in * client_code_page. @@ -1150,6 +1158,7 @@ FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) +FN_GLOBAL_BOOL(lp_kernel_oplocks,&Globals.bKernelOplocks) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -2642,3 +2651,12 @@ void lp_set_name_resolve_order(char *new_order) { Globals.szNameResolveOrder = new_order; } + +/*********************************************************** + Set the real value of kernel oplocks (called by smbd). +************************************************************/ + +void lp_set_kernel_oplocks(BOOL val) +{ + Globals.bKernelOplocks = val; +} -- cgit From 93dfc79888120a0e39a8ea82df2d04c87e45d03a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 20 Sep 1998 15:40:52 +0000 Subject: added a per-share parameter "fstype" that allows you to select the filesystem type that will be reported to the client. If unspecified then it defaults to FSTYPE_STRING (currently "Samba"). This is useful for cdroms where you want to set the fs type to CDFS. (This used to be commit 4332e2c93d69c6ea4035c456cc88d1e69de1e735) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2d469d1de2..cca7efd4df 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -282,6 +282,7 @@ typedef struct char *readlist; char *writelist; char *volume; + char *fstype; int iMinPrintSpace; int iCreate_mask; int iCreate_force_mode; @@ -374,6 +375,7 @@ static service sDefault = NULL, /* readlist */ NULL, /* writelist */ NULL, /* volume */ + NULL, /* fstype */ 0, /* iMinPrintSpace */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ @@ -739,6 +741,7 @@ static struct parm_struct parm_table[] = {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, 0}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, + {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, 0}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_GLOBAL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_GLOBAL}, @@ -778,6 +781,7 @@ static void init_globals(void) string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); string_set(&sDefault.szPrinterDriver, "NULL"); + string_set(&sDefault.fstype, FSTYPE_STRING); done_init = True; } @@ -1219,6 +1223,7 @@ FN_LOCAL_STRING(lp_force_user,force_user) FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) +FN_LOCAL_STRING(lp_fstype,fstype) static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) -- cgit From e649750cb4d2d2577f0577b1d7a87ae4daf8fb6f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 21 Sep 1998 09:07:08 +0000 Subject: major autoconf clean-up fix problems in builds with srcdir!=builddir (This used to be commit 1ffc3b807a3f80644c974b454ff5e6f68e89b546) --- source3/param/dummy.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/dummy.in b/source3/param/dummy.in index e69de29bb2..8b13789179 100644 --- a/source3/param/dummy.in +++ b/source3/param/dummy.in @@ -0,0 +1 @@ + -- cgit From aab2fe021643417854451c65e564932f4ac25f10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Sep 1998 01:48:45 +0000 Subject: First cut at kernel oplocks. This should have no effect unless runnin on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy. (This used to be commit c3c5e13f85c97939746070132dad941e79c546fb) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cca7efd4df..15bc22de2a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -917,7 +917,7 @@ static void init_globals(void) * smbd will check after starting to see if this value * should be set to "true" or not. */ - Globals.bKernelOplocks = False; + lp_set_kernel_oplocks(False); /* * This must be done last as it checks the value in -- cgit From cf971f88ac188eec353a7fb021744b8076cc4eb7 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 28 Sep 1998 00:14:36 +0000 Subject: automated generation of .dummy files for each subdirectory; dummy.in files are no longer needed, and new directories will be taken care of automatically, at configure (or config.status --recheck) time (This used to be commit 237a8e5fe62d757c04b8207cbbee4df1470cfe4e) --- source3/param/dummy.in | 1 - 1 file changed, 1 deletion(-) delete mode 100644 source3/param/dummy.in (limited to 'source3/param') diff --git a/source3/param/dummy.in b/source3/param/dummy.in deleted file mode 100644 index 8b13789179..0000000000 --- a/source3/param/dummy.in +++ /dev/null @@ -1 +0,0 @@ - -- cgit From 2d87954bc06b5c7cb50f11e12c112d7c1d7a5a99 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Mon, 28 Sep 1998 08:00:07 +0000 Subject: Make sure that WINS Server = 127.0.0.1 in case we do not set a value in smb.conf. This will be the case if we are a WINS server, or if we don't know what we are doing. The result is that smbclient can access a WINS server if it is running on the same machine as the WINS server (This used to be commit a3439986666c33f352c863a8baae766323aea7b1) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 15bc22de2a..8e222f5da5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -809,7 +809,9 @@ static void init_globals(void) /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); - + /* Set szWINSserver to 127.0.0.1 so that we have something reasonable */ + /* in case it is not set in the smb.conf */ + string_set(&Globals.szWINSserver, "127.0.0.1"); string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); Globals.bLoadPrinters = True; -- cgit From c8c89585a30310482ce65a792f814c1937d225e4 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Mon, 28 Sep 1998 09:22:06 +0000 Subject: The previous fix for WINS on the WINS server was wrong. It caused nmbd to exit :-( We now set the variable szWINSserver after the smb.conf file has been processed, but only of we are a WINS server. (This used to be commit 17212991cf0f49c5afc77cbd82dc6ce8a13f1405) --- source3/param/loadparm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8e222f5da5..259bb74581 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -809,9 +809,7 @@ static void init_globals(void) /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); - /* Set szWINSserver to 127.0.0.1 so that we have something reasonable */ - /* in case it is not set in the smb.conf */ - string_set(&Globals.szWINSserver, "127.0.0.1"); + string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); Globals.bLoadPrinters = True; @@ -2484,6 +2482,15 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) bLoaded = True; + /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ + /* if bWINSsupport is True */ + + if (Globals.bWINSsupport) { + + string_set(&Globals.szWINSserver, "127.0.0.1"); + + } + return (bRetval); } -- cgit From 376742415bee987b780e4c0729b27d3b5f0b4af1 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Mon, 28 Sep 1998 09:40:46 +0000 Subject: Backed out that just as ill-considered change :-( A more careful change will be needed in the name lookup code. (This used to be commit edfc3ab99b4c2441e765d49a7aa73ca2f3ec8de3) --- source3/param/loadparm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 259bb74581..15bc22de2a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2482,15 +2482,6 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) bLoaded = True; - /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ - /* if bWINSsupport is True */ - - if (Globals.bWINSsupport) { - - string_set(&Globals.szWINSserver, "127.0.0.1"); - - } - return (bRetval); } -- cgit From a97a4b8b99d6b3a57b01b0097e8a3583dd60f816 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 28 Sep 1998 12:52:51 +0000 Subject: made bad boolean values stand out a little better (This used to be commit 270f4b0f84167e378b4615af8aedb85970320b1d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 15bc22de2a..2fd2212a4c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1555,7 +1555,7 @@ static BOOL set_boolean(BOOL *pb, char *pszParmValue) *pb = False; else { - DEBUG(0,( "Badly formed boolean in configuration file: \"%s\".\n", + DEBUG(0,("ERROR: Badly formed boolean in configuration file: \"%s\".\n", pszParmValue)); bRetval = False; } -- cgit From e1d962659f45c6a9bc1a2385ab4f8f4ca0af081c Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Tue, 29 Sep 1998 04:43:40 +0000 Subject: Now have a better solution to the need to have smblcient find a WINS server if running on the WINS server. As suggested by Andrew, we have a flag, in_client=False by default, and set it to True in the client. loadparam.c checks this and sets szWINSserver to 127.0.0.1 when in_client && bWINSsupport. BTW, we seem to have picked up and unused value in some of Luke's new code. (This used to be commit b665756bfc813b229ad50b0d5f53e8b779537a3f) --- source3/param/loadparm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2fd2212a4c..05ed6484ac 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -65,6 +65,7 @@ #define KANJI "sbcs" #endif /* KANJI */ +BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; extern int DEBUGLEVEL; @@ -2480,6 +2481,15 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) set_default_server_announce_type(); + /* We set a WINS server address of 127.0.0.1 if we are in the client */ + /* and we have WINS support enabled */ + + if (in_client && Globals.bWINSsupport) { + + string_set(&Globals.szWINSserver, "127.0.0.1"); + + } + bLoaded = True; return (bRetval); -- cgit From a2d7f765e8500f23c126c7b7cb6bb346adc11641 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Sep 1998 04:52:17 +0000 Subject: get away with dummy and .dummy files (This used to be commit 90a8a02484a0897b053fd6531b7fec5d23098b6f) --- source3/param/.cvsignore | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore index 421376db9e..e69de29bb2 100644 --- a/source3/param/.cvsignore +++ b/source3/param/.cvsignore @@ -1 +0,0 @@ -dummy -- cgit From 5a8458c377b6901b67a039eafbd5727ed1207cf3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 30 Sep 1998 01:05:51 +0000 Subject: libsmb/clientgen.c: Fixed signed/unsigned compile warnings spotted by Herb. param/loadparm.c: smbd/oplock.c: Allow kernel oplocks to be turned off in the smb.conf file. smbd/server.c: Move init_structs() to after the smb.conf file is loaded - preparation for making a "max open files" parameter. Jeremy. (This used to be commit 6a261517a09b005f502a37941431308fa8bf2c5c) --- source3/param/loadparm.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 05ed6484ac..5cba2c95d5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -915,10 +915,10 @@ static void init_globals(void) Globals.bDNSproxy = True; /* - * smbd will check after starting to see if this value - * should be set to "true" or not. + * smbd will check at runtime to see if this value + * will really be used or not. */ - lp_set_kernel_oplocks(False); + Globals.bKernelOplocks = True; /* * This must be done last as it checks the value in @@ -1163,7 +1163,6 @@ FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) -FN_GLOBAL_BOOL(lp_kernel_oplocks,&Globals.bKernelOplocks) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -2668,10 +2667,32 @@ void lp_set_name_resolve_order(char *new_order) } /*********************************************************** - Set the real value of kernel oplocks (called by smbd). + Set the flag that says if kernel oplocks are available + (called by smbd). ************************************************************/ +static BOOL kernel_oplocks_available = False; + void lp_set_kernel_oplocks(BOOL val) { - Globals.bKernelOplocks = val; + /* + * Only set this to True if kerenl + * oplocks are really available and were + * turned on in the smb.conf file. + */ + + if(Globals.bKernelOplocks && val) + kernel_oplocks_available = True; + else + kernel_oplocks_available = False; +} + +/*********************************************************** + Return True if kernel oplocks are available and were turned + on in smb.conf. +************************************************************/ + +BOOL lp_kernel_oplocks(void) +{ + return kernel_oplocks_available; } -- cgit From 5b4d94e20fdb5888da1b71a7b6a30ebede6cb06a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 30 Sep 1998 01:49:24 +0000 Subject: (Finally) implemented "max open files" as a global smb.conf parameter. Sets up the files array correctly - limited by the smb.conf parameter and by the max fd's per process as found by getrlimit(). Jeremy. (This used to be commit eca24bd24352c688cdf48c1ef14adb8ac353468f) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5cba2c95d5..a0e43150b9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -160,6 +160,7 @@ typedef struct int mangled_stack; int max_xmit; int max_mux; + int max_open_files; int max_packet; int pwordlevel; int unamelevel; @@ -597,6 +598,7 @@ static struct parm_struct parm_table[] = {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, @@ -824,6 +826,7 @@ static void init_globals(void) Globals.unamelevel = 0; Globals.deadtime = 0; Globals.max_log_size = 5000; + Globals.max_open_files = MAX_OPEN_FILES; Globals.maxprotocol = PROTOCOL_NT1; Globals.security = SEC_USER; Globals.bEncryptPasswords = False; @@ -1169,6 +1172,7 @@ FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) FN_GLOBAL_INTEGER(lp_max_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_min_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) +FN_GLOBAL_INTEGER(lp_max_open_files,&Globals.max_open_files) FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) -- cgit From 88460e63c5934ab3d00db2a8521d5ebd33dbefc3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 30 Sep 1998 10:52:48 +0000 Subject: set the default fstype for IPC$ to "IPC". I'm not sure if this will make any difference, but it is the right thing to do. (This used to be commit a655a8a0510b0277727205394b093c580280eb55) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a0e43150b9..b0b793df60 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1437,6 +1437,7 @@ static BOOL lp_add_ipc(void) string_set(&iSERVICE(i).szPath,tmpdir()); string_set(&iSERVICE(i).szUsername,""); string_set(&iSERVICE(i).comment,comment); + string_set(&iSERVICE(i).fstype,"IPC"); iSERVICE(i).status = False; iSERVICE(i).iMaxConnections = 0; iSERVICE(i).bAvailable = True; -- cgit From 65cfbc97ae671a8fe6a3a3b522f25ed0ce4d974d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 08:33:22 +0000 Subject: - ignore *.p files (This used to be commit 5328ecbc41daa3fe1adbf8dbe9db8180ae55da3d) --- source3/param/.cvsignore | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore index e69de29bb2..f20330ba4d 100644 --- a/source3/param/.cvsignore +++ b/source3/param/.cvsignore @@ -0,0 +1 @@ +*.p -- cgit From 3a8232644e04a4cfdcbe2061f0556b78b4045191 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 14:02:50 +0000 Subject: started basic support for solaris 2.5 in smbwrapper. (This used to be commit e5c7cabae4826bde819b94a48bc4674dcd69da21) --- source3/param/.cvsignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore index f20330ba4d..6d609cec52 100644 --- a/source3/param/.cvsignore +++ b/source3/param/.cvsignore @@ -1 +1 @@ -*.p +*.po -- cgit From ca3d1b9bf01a56755a5c248a808ffafdce3e1a82 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 02:55:53 +0000 Subject: removed requirement of having a smb.conf for smbwrapper to work. (This used to be commit af58bf2ff8ddbf974dbafa36cf1b679226371e09) --- source3/param/params.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 2a0a253f20..2f54b72131 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -490,17 +490,19 @@ static FILE *OpenConfFile( char *FileName ) { FILE *OpenedFile; char *func = "params.c:OpenConfFile() -"; + extern BOOL in_client; + int lvl = in_client?1:0; if( NULL == FileName || 0 == *FileName ) { - DEBUG( 0, ("%s No configuration filename specified.\n", func) ); + DEBUG( lvl, ("%s No configuration filename specified.\n", func) ); return( NULL ); } OpenedFile = fopen( FileName, "r" ); if( NULL == OpenedFile ) { - DEBUG( 0, + DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n", func, FileName, strerror(errno)) ); } -- cgit From 217804ba43bad984e1d1c8a623acea95ed929a4e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 12:36:44 +0000 Subject: ignore *.po32 files (This used to be commit 01de9a50e030da722076c67c235801c36c90bb66) --- source3/param/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore index 6d609cec52..76e2d7ff3e 100644 --- a/source3/param/.cvsignore +++ b/source3/param/.cvsignore @@ -1 +1,3 @@ +*.po32 *.po + -- cgit From 0cf1ea4e2eafff8a65ef8766fe7351281d2dd53b Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Tue, 6 Oct 1998 23:46:01 +0000 Subject: Added capability for smbclient to use the local WINS server on the same machine if WINSsupport configured (This used to be commit 1398feebbcb65a9e78b7084811bf9727b6d89682) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b0b793df60..ad8e27be98 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -67,6 +67,7 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; +BOOL in_client = False; extern int DEBUGLEVEL; extern pstring user_socket_options; @@ -2485,8 +2486,10 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) set_default_server_announce_type(); - /* We set a WINS server address of 127.0.0.1 if we are in the client */ - /* and we have WINS support enabled */ + bLoaded = True; + + /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ + /* if bWINSsupport is true and we are in the client */ if (in_client && Globals.bWINSsupport) { @@ -2494,8 +2497,6 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) } - bLoaded = True; - return (bRetval); } -- cgit From 52d52a51313481a4d26d6b0bbdfe6fda0a9fa474 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 01:03:35 +0000 Subject: somehow "in_client" got included twice in two places. (This used to be commit 378290bfe1dc4965679495aab58be55e81ecf192) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ad8e27be98..b7486448bb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -67,7 +67,6 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; -BOOL in_client = False; extern int DEBUGLEVEL; extern pstring user_socket_options; -- cgit From f6d91d05650894e1cce2685141108e555220da8a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 18 Oct 1998 19:29:19 +0000 Subject: add an option to enable/disable nt pipes (This used to be commit c161b2f850f124ac5f24968e7865a7d0eb68e23e) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b7486448bb..37e53f437e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -232,6 +232,7 @@ typedef struct BOOL bOleLockingCompat; BOOL bTimestampLogs; BOOL bNTSmbSupport; + BOOL bNTPipeSupport; BOOL bStatCache; BOOL bKernelOplocks; } global; @@ -578,6 +579,7 @@ static struct parm_struct parm_table[] = {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -870,6 +872,7 @@ static void init_globals(void) Globals.bPasswdChatDebug = False; Globals.bOleLockingCompat = True; Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ + Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bStatCache = True; /* use stat cache by default */ #ifdef WITH_LDAP @@ -1165,6 +1168,7 @@ FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) +FN_GLOBAL_BOOL(lp_nt_pipe_support,&Globals.bNTPipeSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) -- cgit From 548b417d404a2653ebb5918b0c169ccdfafe856f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Nov 1998 05:32:37 +0000 Subject: codepages/codepage_def.936: Updated comment. param/loadparm.c: Removed "networkstation user login", "domain controller", and "domain sid" parameters. passdb/passdb.c: Removed "networkstation user login" code and changed bug test code to only check once for a bad password server. This will stop the complaints of many "bad login" audit records in NT PDC logs. utils/smbpasswd.c: Removed check for "domain controller". Jeremy. (This used to be commit d6e6e936b5dd90dd8fc38d9404efbe5c546c15e5) --- source3/param/loadparm.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 37e53f437e..fcdc2ae68d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -145,7 +145,6 @@ typedef struct char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; - char *szDomainSID; char *szDomainOtherSIDs; char *szDomainGroups; char *szDriverFile; @@ -207,7 +206,6 @@ typedef struct BOOL bWINSproxy; BOOL bLocalMaster; BOOL bPreferredMaster; - BOOL bDomainController; BOOL bDomainMaster; BOOL bDomainLogons; BOOL bEncryptPasswords; @@ -226,7 +224,6 @@ typedef struct BOOL bNISHomeMap; BOOL bTimeServer; BOOL bBindInterfacesOnly; - BOOL bNetWkstaUserLogon; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; BOOL bOleLockingCompat; @@ -577,7 +574,6 @@ static struct parm_struct parm_table[] = {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"networkstation user login", P_BOOL,P_GLOBAL, &Globals.bNetWkstaUserLogon,NULL, NULL, 0}, {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, @@ -659,9 +655,7 @@ static struct parm_struct parm_table[] = {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL, NULL, 0}, {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, - {"domain controller",P_BOOL , P_GLOBAL, &Globals.bDomainController,NULL, NULL, 0}, {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, @@ -866,8 +860,6 @@ static void init_globals(void) Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; - Globals.bNetWkstaUserLogon = False; /* This is now set to false by default as - the code in password.c protects us from this bug. */ Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; Globals.bOleLockingCompat = True; @@ -1105,7 +1097,6 @@ FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) -FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) @@ -1142,7 +1133,6 @@ FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) -FN_GLOBAL_BOOL(lp_domain_controller,&Globals.bDomainController) FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) @@ -1163,7 +1153,6 @@ FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) static FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) -FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) -- cgit From ab521a11a1e994e99a043d3622c9692c04299bbd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Nov 1998 04:17:11 +0000 Subject: I talked to Dave Miller and he thinks that we should have TCP_NODELAY on by default on OSes that support it, given the network IO pattern that Samba uses. He doesn't think it will cause problems. (This used to be commit 15016aa024854ca56ef20d1f29f54f9698a1911b) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fcdc2ae68d..74f8df6cb7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -804,6 +804,8 @@ static void init_globals(void) slprintf(s,sizeof(s)-1, "%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); string_set(&Globals.szAnnounceVersion,s); + pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); + string_set(&Globals.szLogonDrive, ""); /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ string_set(&Globals.szLogonHome, "\\\\%N\\%U"); -- cgit From 5c3295c16dd1638a03d9f80fed455c9826e478cb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 10 Nov 1998 00:37:14 +0000 Subject: Default for SMB_PASSWD program was set to smbpasswd ! This explained the problems John & Andrew were having with smbpasswd. This would cause the smbpasswd to be changed *twice* - this the second decrypt would fail. Changed it to be "/bin/passwd" and changed the name of the macro to PASSWORD_PROGRAM to make it clear this is not an smb password changer. Jeremy. (This used to be commit 8c1625365479f12fa544d83e1a9f72a548398108) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 74f8df6cb7..bfc1b801e7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -791,7 +791,7 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); string_set(&Globals.szWorkGroup, WORKGROUP); - string_set(&Globals.szPasswdProgram, SMB_PASSWD); + string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szDriverFile, DRIVERFILE); string_set(&Globals.szLockDir, LOCKDIR); -- cgit From 375e53826c59c33d52009307f757b71a1fe3d589 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 10 Nov 1998 20:51:25 +0000 Subject: include/local.h: include/smb.h: param/loadparm.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-). printing/printing.c: Added J.F.'s latest fix. rpc_parse/parse_misc.c: parse_reg.c: rpcclient/cmd_reg.c: rpcclient/display.c: SGI compiler signed/unsigned issues. smbd/reply.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-). utils/testparm.c: Added extra test. Jeremy. (This used to be commit 9668a5ef50be2e6b575f9989e87ee2ff8da5ac1d) --- source3/param/loadparm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bfc1b801e7..8b35116858 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -182,6 +182,7 @@ typedef struct int machine_password_timeout; int change_notify_timeout; int stat_cache_size; + int map_to_guest; #ifdef WITH_LDAP int ldap_port; #endif /* WITH_LDAP */ @@ -468,6 +469,29 @@ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "uppe static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; +/* + Do you want session setups at user level security with a invalid + password to be rejected or allowed in as guest? WinNT rejects them + but it can be a pain as it means "net view" needs to use a password + + You have 3 choices in the setting of map_to_guest: + + "Never" means session setups with an invalid password + are rejected. This is the default. + + "Bad User" means session setups with an invalid password + are rejected, unless the username does not exist, in which case it + is treated as a guest login + + "Bad Password" means session setups with an invalid password + are treated as a guest login + + Note that map_to_guest only has an effect in user or server + level security. +*/ + +static struct enum_list enum_map_to_guest[] = {{NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, {-1, NULL}}; + #ifdef WITH_SSL static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, {SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL}}; @@ -492,6 +516,7 @@ static struct parm_struct parm_table[] = {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, @@ -868,6 +893,7 @@ static void init_globals(void) Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bStatCache = True; /* use stat cache by default */ + Globals.map_to_guest = 0; /* By Default, "Never" */ #ifdef WITH_LDAP /* default values for ldap */ @@ -1187,6 +1213,7 @@ FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_change_notify_timeout,&Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_stat_cache_size,&Globals.stat_cache_size) +FN_GLOBAL_INTEGER(lp_map_to_guest,&Globals.map_to_guest) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -- cgit From 74d539f5573a3ed3ff1b96c54752a389da4c3e14 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 17 Nov 1998 16:19:04 +0000 Subject: - group database API. oops and oh dear, the threat has been carried out: the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION. (This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db) --- source3/param/loadparm.c | 56 ++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b35116858..7a28d3418f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -116,20 +116,16 @@ typedef struct char *szLogFile; char *szConfigFile; char *szSMBPasswdFile; + char *szSMBPassGroupFile; + char *szSMBGroupFile; + char *szSMBAliasFile; 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 *szAliasnameMap; char *szGroupnameMap; -#endif /* USING_GROUPNAME_MAP */ char *szCharacterSet; char *szLogonScript; char *szLogonPath; @@ -146,7 +142,6 @@ typedef struct char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainOtherSIDs; - char *szDomainGroups; char *szDriverFile; char *szNameResolveOrder; char *szLdapServer; @@ -501,6 +496,7 @@ static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, @@ -512,6 +508,7 @@ static struct parm_struct parm_table[] = {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, {"Security Options", P_SEP, P_SEPARATOR}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, @@ -520,6 +517,9 @@ static struct parm_struct parm_table[] = {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {"smb passgrp file", P_STRING, P_GLOBAL, &Globals.szSMBPassGroupFile, NULL, NULL, 0}, + {"smb group file", P_STRING, P_GLOBAL, &Globals.szSMBGroupFile, NULL, NULL, 0}, + {"smb alias file", P_STRING, P_GLOBAL, &Globals.szSMBAliasFile, NULL, NULL, 0}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -567,6 +567,7 @@ static struct parm_struct parm_table[] = #ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, + {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0 }, {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0 }, {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0} , @@ -584,6 +585,7 @@ static struct parm_struct parm_table[] = #endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, @@ -595,6 +597,7 @@ static struct parm_struct parm_table[] = {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL}, {"Protocol Options", P_SEP, P_SEPARATOR}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, @@ -614,6 +617,7 @@ static struct parm_struct parm_table[] = {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, @@ -632,6 +636,7 @@ static struct parm_struct parm_table[] = {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, {"Printing Options", P_SEP, P_SEPARATOR}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, @@ -653,7 +658,6 @@ static struct parm_struct parm_table[] = {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_GLOBAL}, - {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, @@ -680,17 +684,13 @@ static struct parm_struct parm_table[] = {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, - {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, -#ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, -#endif /* USING_GROUPNAME_MAP */ + + {"local group map", P_STRING, P_GLOBAL, &Globals.szAliasnameMap, NULL, NULL, 0}, + {"domain group map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, @@ -698,6 +698,7 @@ static struct parm_struct parm_table[] = {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"Browse Options", P_SEP, P_SEPARATOR}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, @@ -710,12 +711,14 @@ static struct parm_struct parm_table[] = {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"WINS Options", P_SEP, P_SEPARATOR}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"Locking Options", P_SEP, P_SEPARATOR}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, @@ -727,6 +730,7 @@ static struct parm_struct parm_table[] = #ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, @@ -737,6 +741,7 @@ static struct parm_struct parm_table[] = {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, @@ -814,6 +819,9 @@ static void init_globals(void) DEBUG(3,("Initialising global parameters\n")); string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); + string_set(&Globals.szSMBPassGroupFile, SMB_PASSGRP_FILE); + string_set(&Globals.szSMBGroupFile, SMB_GROUP_FILE); + string_set(&Globals.szSMBAliasFile, SMB_ALIAS_FILE); string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); @@ -1093,6 +1101,9 @@ FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) +FN_GLOBAL_STRING(lp_smb_passgrp_file,&Globals.szSMBPassGroupFile) +FN_GLOBAL_STRING(lp_smb_group_file,&Globals.szSMBGroupFile) +FN_GLOBAL_STRING(lp_smb_alias_file,&Globals.szSMBAliasFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) @@ -1107,9 +1118,8 @@ FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) -#ifdef USING_GROUPNAME_MAP +FN_GLOBAL_STRING(lp_aliasname_map,&Globals.szAliasnameMap) FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) -#endif /* USING_GROUPNAME_MAP */ FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) @@ -1125,12 +1135,6 @@ FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) -FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) -FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) -FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) -FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) -FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) - #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); -- cgit From 768761820e8d7481c586c4e0ab4ac7cb36d18c4b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Nov 1998 20:50:07 +0000 Subject: Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls. Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac) --- source3/param/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 2f54b72131..74dd3d7a25 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -499,7 +499,7 @@ static FILE *OpenConfFile( char *FileName ) return( NULL ); } - OpenedFile = fopen( FileName, "r" ); + OpenedFile = sys_fopen( FileName, "r" ); if( NULL == OpenedFile ) { DEBUG( lvl, -- cgit From 4cee58780cb15fe5889b9dd0dc34459512d75062 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 23 Nov 1998 21:51:05 +0000 Subject: unix instance of group database API (This used to be commit e76f593b3572ac881f1aa1fb3326d8b7169b0078) --- source3/param/loadparm.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7a28d3418f..49f1c44fcb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2727,3 +2727,43 @@ BOOL lp_kernel_oplocks(void) { return kernel_oplocks_available; } + +/*********************************************************** + returns role of Samba server +************************************************************/ +int lp_server_role(void) +{ + switch (lp_security()) + { + case SEC_SHARE: + { + if (lp_domain_logons()) + { + DEBUG(0,("Server's Role (logon server) conflicts with share-level security\n")); + } + return ROLE_DOMAIN_NONE; + } + case SEC_SERVER: + case SEC_DOMAIN: + { + if (lp_domain_logons()) + { + return ROLE_DOMAIN_BDC; + } + return ROLE_DOMAIN_MEMBER; + } + case SEC_USER: + { + if (lp_domain_logons()) + { + return ROLE_DOMAIN_BDC; + } + return ROLE_DOMAIN_PDC; + } + default: + { + DEBUG(0,("Server's Role undefined due to unknown security mode\n")); + return ROLE_DOMAIN_NONE; + } + } +} -- cgit From 0c9df3c61007eb170ae17282d7b31bea6899a656 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 24 Nov 1998 14:42:42 +0000 Subject: jean-francois pointed out problem with "lp_domain_role()" code, you could never be a PDC. (This used to be commit 2bcc540af80c37b8032a23d6d0045160a7c40e32) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 49f1c44fcb..2286d95fd5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2756,9 +2756,9 @@ int lp_server_role(void) { if (lp_domain_logons()) { - return ROLE_DOMAIN_BDC; + return ROLE_DOMAIN_PDC; } - return ROLE_DOMAIN_PDC; + return ROLE_DOMAIN_NONE; } default: { -- cgit From 30038de4623bc827ee8019c569faf00583d1fe58 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 29 Nov 1998 20:03:33 +0000 Subject: weekend work. user / group database API. - split sam_passwd and smb_passwd into separate higher-order function tables - renamed struct smb_passwd's "smb_user" to "unix_user". added "nt_user" plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd password databases to fill in the blank entries that are not obtained from whatever password database API instance is being used. NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c for the only example outside of the password database APIs i could find. - added query_useraliases code to rpcclient. - dealt with some nasty interdependencies involving non-smbd programs and the password database API. this is still not satisfactorily resolved completelely, but it's the best i can do for now. - #ifdef'd out some password database options so that people don't mistakenly set them unless they recompile to _use_ those options. lots of debugging done, it's still not finished. the unix/NT uid/gid and user-rid/group-rid issues are better, but not perfect. the "BUILTIN" domain is still missing: users cannot be added to "BUILTIN" groups yet, as we only have an "alias" db API and a "group" db API but not "builtin-alias" db API... (This used to be commit 5d5d7e4de7d1514ab87b07ede629de8aa00519a1) --- source3/param/loadparm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2286d95fd5..871fc774a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -126,6 +126,8 @@ typedef struct char *szUsernameMap; char *szAliasnameMap; char *szGroupnameMap; + char *szBuiltinnameMap; + char *szNTusernameMap; char *szCharacterSet; char *szLogonScript; char *szLogonPath; @@ -517,9 +519,13 @@ static struct parm_struct parm_table[] = {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, +#if USE_SMBFILE_DB {"smb passgrp file", P_STRING, P_GLOBAL, &Globals.szSMBPassGroupFile, NULL, NULL, 0}, +#endif +#if USE_SMBGROUP_DB {"smb group file", P_STRING, P_GLOBAL, &Globals.szSMBGroupFile, NULL, NULL, 0}, {"smb alias file", P_STRING, P_GLOBAL, &Globals.szSMBAliasFile, NULL, NULL, 0}, +#endif {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -687,6 +693,8 @@ static struct parm_struct parm_table[] = {"local group map", P_STRING, P_GLOBAL, &Globals.szAliasnameMap, NULL, NULL, 0}, {"domain group map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, + {"builtin group map", P_STRING, P_GLOBAL, &Globals.szBuiltinnameMap, NULL, NULL, 0}, + {"domain user map", P_STRING, P_GLOBAL, &Globals.szNTusernameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -819,9 +827,13 @@ static void init_globals(void) DEBUG(3,("Initialising global parameters\n")); string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); +#if USE_SMBFILE_DB string_set(&Globals.szSMBPassGroupFile, SMB_PASSGRP_FILE); +#endif +#if USE_SMBGROUP_DB string_set(&Globals.szSMBGroupFile, SMB_GROUP_FILE); string_set(&Globals.szSMBAliasFile, SMB_ALIAS_FILE); +#endif string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); @@ -1101,9 +1113,13 @@ FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) +#if USE_SMBFILE_DB FN_GLOBAL_STRING(lp_smb_passgrp_file,&Globals.szSMBPassGroupFile) +#endif +#if USE_SMBGROUP_DB FN_GLOBAL_STRING(lp_smb_group_file,&Globals.szSMBGroupFile) FN_GLOBAL_STRING(lp_smb_alias_file,&Globals.szSMBAliasFile) +#endif FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) @@ -1120,6 +1136,8 @@ FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_aliasname_map,&Globals.szAliasnameMap) FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) +FN_GLOBAL_STRING(lp_builtinname_map,&Globals.szBuiltinnameMap) +FN_GLOBAL_STRING(lp_ntusrname_map,&Globals.szNTusernameMap) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) -- cgit From 699bae847f3a29514d06424bf20e98e96dd89d8a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 7 Dec 1998 21:37:17 +0000 Subject: matthew chapman's ldap code, to date. plus docs! (This used to be commit 2c438c86cbb38833b3abd4fbead6324687633b25) --- source3/param/loadparm.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 871fc774a5..df5a584aab 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -146,11 +146,12 @@ typedef struct char *szDomainOtherSIDs; char *szDriverFile; char *szNameResolveOrder; +#ifdef WITH_LDAP char *szLdapServer; char *szLdapSuffix; - char *szLdapFilter; - char *szLdapRoot; - char *szLdapRootPassword; + char *szLdapBindAs; + char *szLdapPasswdFile; +#endif /* WITH_LDAP */ char *szPanicAction; int max_log_size; int mangled_stack; @@ -742,9 +743,8 @@ static struct parm_struct parm_table[] = {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, + {"ldap bind as", P_STRING, P_GLOBAL, &Globals.szLdapBindAs, NULL, NULL, 0}, + {"ldap passwd file", P_STRING, P_GLOBAL, &Globals.szLdapPasswdFile, NULL, NULL, 0}, #endif /* WITH_LDAP */ @@ -1156,9 +1156,8 @@ FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); -FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); -FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); -FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); +FN_GLOBAL_STRING(lp_ldap_bind_as,&Globals.szLdapBindAs); +FN_GLOBAL_STRING(lp_ldap_passwd_file,&Globals.szLdapPasswdFile); #endif /* WITH_LDAP */ #ifdef WITH_SSL -- cgit From 775bff681c1ba7b2e8fb5106e891b10894cd0e3a Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sun, 24 Jan 1999 14:08:55 +0000 Subject: Adding first of the fixes for SSL. A whole bunch of string variables in loadparm.c were not being initialized properly. Programs crashed as a result. This set of code not tested, but same code tested elsewhere, and all this guarded by #ifdef HAVE_SSL (This used to be commit fb6048bb8655e8bd87cc69b48c99219d6701a907) --- source3/param/loadparm.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index df5a584aab..ff8ccff99b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -923,15 +923,20 @@ static void init_globals(void) #ifdef WITH_SSL Globals.sslVersion = SMB_SSL_V23; - Globals.sslHostsRequire = NULL; - Globals.sslHostsResign = NULL; - Globals.sslCaCertDir = NULL; - Globals.sslCaCertFile = NULL; - Globals.sslCert = NULL; - Globals.sslPrivKey = NULL; - Globals.sslClientCert = NULL; - Globals.sslClientPrivKey = NULL; - Globals.sslCiphers = NULL; + + /* + * Most of the next variables should be string_set! + */ + + string_set(&Globals.sslHostsRequire, NULL); + string_set(&Globals.sslHostsResign, NULL); + string_set(&Globals.sslCaCertDir, NULL); + string_set(&Globals.sslCaCertFile, NULL); + string_set(&Globals.sslCert, NULL); + string_set(&Globals.sslPrivKey, NULL); + string_set(&Globals.sslClientCert, NULL); + string_set(&Globals.sslClientPrivKey, NULL); + string_set(&Globals.sslCiphers, NULL); Globals.sslEnabled = False; Globals.sslReqClientCert = False; Globals.sslReqServerCert = False; -- cgit From 07948f3f2d6625d1197036bb1763269f2e52345f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 2 Feb 1999 19:53:10 +0000 Subject: server type announcements modified to include the "role" of the server: domain member, pdc, bdc. (This used to be commit d95bb252f838b3612f5eba5d2b61d7b38b01f5ef) --- source3/param/loadparm.c | 67 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ff8ccff99b..8f92af90a9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2620,15 +2620,64 @@ char *volume_label(int snum) ********************************************************************/ static void set_default_server_announce_type(void) { - default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | - SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); - if(lp_announce_as() == ANNOUNCE_AS_NT) - default_server_announce |= (SV_TYPE_SERVER_NT | SV_TYPE_NT); - else if(lp_announce_as() == ANNOUNCE_AS_WIN95) - default_server_announce |= SV_TYPE_WIN95_PLUS; - else if(lp_announce_as() == ANNOUNCE_AS_WFW) - default_server_announce |= SV_TYPE_WFW; - default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); + default_server_announce = 0; + default_server_announce |= SV_TYPE_WORKSTATION; + default_server_announce |= SV_TYPE_SERVER; + default_server_announce |= SV_TYPE_SERVER_UNIX; + default_server_announce |= SV_TYPE_PRINTQ_SERVER; + + switch (lp_announce_as()) + { + case ANNOUNCE_AS_NT: + { + default_server_announce |= SV_TYPE_SERVER_NT; + default_server_announce |= SV_TYPE_NT; + break; + } + case ANNOUNCE_AS_WIN95: + { + default_server_announce |= SV_TYPE_WIN95_PLUS; + break; + } + case ANNOUNCE_AS_WFW: + { + default_server_announce |= SV_TYPE_WFW; + break; + } + default: + { + break; + } + } + + switch (lp_server_role()) + { + case ROLE_DOMAIN_MEMBER: + { + default_server_announce |= SV_TYPE_DOMAIN_MEMBER; + break; + } + case ROLE_DOMAIN_PDC: + { + default_server_announce |= SV_TYPE_DOMAIN_CTRL; + break; + } + case ROLE_DOMAIN_BDC: + { + default_server_announce |= SV_TYPE_DOMAIN_BAKCTRL; + break; + } + case ROLE_DOMAIN_NONE: + default: + { + break; + } + } + + if (lp_time_server()) + { + default_server_announce |= SV_TYPE_TIME_SOURCE; + } } -- cgit From 236cea4efa18094c3445bee310195ac12b6073ee Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 1 Mar 1999 16:31:14 +0000 Subject: Benjamin Kuit's MYSQL SAM Database implementation. Copyright (C) Benjamin Kuit 1999. (This used to be commit fdf61e1dabc2c977ee5cf1e9d60e3380f19840da) --- source3/param/loadparm.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8f92af90a9..845c2bd4e8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -231,6 +231,13 @@ typedef struct BOOL bNTPipeSupport; BOOL bStatCache; BOOL bKernelOplocks; +#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) + char *sMysqlDatabase; + char *sMysqlTable; + char *sMysqlUser; + char *sMysqlHost; + char *sMysqlPassFile; +#endif } global; static global Globals; @@ -747,6 +754,14 @@ static struct parm_struct parm_table[] = {"ldap passwd file", P_STRING, P_GLOBAL, &Globals.szLdapPasswdFile, NULL, NULL, 0}, #endif /* WITH_LDAP */ +#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) + {"MySQL Options", P_SEP, P_SEPARATOR}, + {"mysql host", P_STRING, P_GLOBAL, &Globals.sMysqlHost, NULL, NULL, 0}, + {"mysql user", P_STRING, P_GLOBAL, &Globals.sMysqlUser, NULL, NULL, 0}, + {"mysql pass file", P_STRING, P_GLOBAL, &Globals.sMysqlPassFile, NULL, NULL, 0}, + {"mysql database", P_STRING, P_GLOBAL, &Globals.sMysqlDatabase, NULL, NULL, 0}, + {"mysql table", P_STRING, P_GLOBAL, &Globals.sMysqlTable, NULL, NULL, 0}, +#endif /* WITH_MYSQL */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, @@ -971,6 +986,14 @@ static void init_globals(void) */ Globals.bKernelOplocks = True; +#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) + string_set(&Globals.sMysqlHost,"localhost"); + string_set(&Globals.sMysqlUser,"root"); + string_set(&Globals.sMysqlPassFile,NULL); + string_set(&Globals.sMysqlDatabase,"samba"); + string_set(&Globals.sMysqlTable,"smbpasswd"); +#endif + /* * This must be done last as it checks the value in * client_code_page. @@ -1329,6 +1352,13 @@ FN_LOCAL_INTEGER(lp_printing,iPrinting) FN_LOCAL_CHAR(lp_magicchar,magic_char) +#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) +FN_GLOBAL_STRING(lp_mysql_host,&Globals.sMysqlHost) +FN_GLOBAL_STRING(lp_mysql_user,&Globals.sMysqlUser) +FN_GLOBAL_STRING(lp_mysql_passfile,&Globals.sMysqlPassFile) +FN_GLOBAL_STRING(lp_mysql_db,&Globals.sMysqlDatabase) +FN_GLOBAL_STRING(lp_mysql_table,&Globals.sMysqlTable) +#endif /* local prototypes */ -- cgit From 00d86ccb1cceda0381383420bdbfd452456c7545 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 3 Mar 1999 20:48:48 +0000 Subject: Benjamin Kuit's latest mysql mods. issue with "make proto" needs to be resolved. (This used to be commit d59a2e669aed7ee33fdca8b8ec126b1c0a984981) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 845c2bd4e8..ccb314b2f1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -231,7 +231,7 @@ typedef struct BOOL bNTPipeSupport; BOOL bStatCache; BOOL bKernelOplocks; -#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) +#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) char *sMysqlDatabase; char *sMysqlTable; char *sMysqlUser; @@ -754,14 +754,14 @@ static struct parm_struct parm_table[] = {"ldap passwd file", P_STRING, P_GLOBAL, &Globals.szLdapPasswdFile, NULL, NULL, 0}, #endif /* WITH_LDAP */ -#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) +#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) {"MySQL Options", P_SEP, P_SEPARATOR}, {"mysql host", P_STRING, P_GLOBAL, &Globals.sMysqlHost, NULL, NULL, 0}, {"mysql user", P_STRING, P_GLOBAL, &Globals.sMysqlUser, NULL, NULL, 0}, {"mysql pass file", P_STRING, P_GLOBAL, &Globals.sMysqlPassFile, NULL, NULL, 0}, {"mysql database", P_STRING, P_GLOBAL, &Globals.sMysqlDatabase, NULL, NULL, 0}, {"mysql table", P_STRING, P_GLOBAL, &Globals.sMysqlTable, NULL, NULL, 0}, -#endif /* WITH_MYSQL */ +#endif /* MYSQL */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, @@ -986,7 +986,7 @@ static void init_globals(void) */ Globals.bKernelOplocks = True; -#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) +#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) string_set(&Globals.sMysqlHost,"localhost"); string_set(&Globals.sMysqlUser,"root"); string_set(&Globals.sMysqlPassFile,NULL); @@ -1352,7 +1352,7 @@ FN_LOCAL_INTEGER(lp_printing,iPrinting) FN_LOCAL_CHAR(lp_magicchar,magic_char) -#if defined(WITH_MYSQL) || defined(WITH_MYSQLSAM) +#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) FN_GLOBAL_STRING(lp_mysql_host,&Globals.sMysqlHost) FN_GLOBAL_STRING(lp_mysql_user,&Globals.sMysqlUser) FN_GLOBAL_STRING(lp_mysql_passfile,&Globals.sMysqlPassFile) -- cgit From 0309a98851e7f2537f677d87d573bcfa383de83a Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 4 Apr 1999 04:54:50 +0000 Subject: Added configuration parameter 'vfs object' to specify loadable object file containing a VFS implementation. (This used to be commit a7af7193e3c38d1303919b31a73eea77d0dfa92f) --- source3/param/loadparm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ccb314b2f1..2446520afb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -289,6 +289,7 @@ typedef struct char *writelist; char *volume; char *fstype; + char *vfsObjectFile; int iMinPrintSpace; int iCreate_mask; int iCreate_force_mode; @@ -382,6 +383,7 @@ static service sDefault = NULL, /* writelist */ NULL, /* volume */ NULL, /* fstype */ + NULL, /* vfs object */ 0, /* iMinPrintSpace */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ @@ -449,6 +451,7 @@ static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); +static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static void set_default_server_announce_type(void); @@ -794,6 +797,7 @@ static struct parm_struct parm_table[] = {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, 0}, + {"vfs object", P_STRING, P_LOCAL, &sDefault.vfsObjectFile, handle_vfs_object, NULL, 0}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_GLOBAL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_GLOBAL}, @@ -1299,6 +1303,7 @@ FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_fstype,fstype) +FN_LOCAL_STRING(lp_vfsobj,vfsObjectFile) static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) @@ -1839,6 +1844,21 @@ BOOL lp_file_list_changed(void) return(False); } +/*************************************************************************** + handle the interpretation of the vfs object parameter + *************************************************************************/ +static BOOL handle_vfs_object(char *pszParmValue,char **ptr) +{ + /* Set string value */ + + string_set(ptr,pszParmValue); + + /* Do any other initialisation required for vfs. Note that + anything done here may have linking repercussions in nmbd. */ + + return True; +} + /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ -- cgit From 9c2520e6cdf8951f6f6645af91915fac67b49d19 Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Sun, 11 Apr 1999 10:23:19 +0000 Subject: Trying to improve DC location & browsing performance for the average user who doesn't know what an LMB or DMB is. * check_master_browser_exists now performs the check the first time around, so if there is indeed no master browser then Samba takes up the job much faster. * Upped default OS level to 32. There is no reason why some stupid little Windows box should become LMB instead of a Samba *server*. * "domain master" now defaults to "auto". Currently this attempts to become DMB iff Samba is the PDC (ala Windows NT). "preferred master" also defaults to "auto", which enables preferred master iff Samba is DMB. * lp_server_role now just returns the predetermined role, rather than working it out each time, since the server role is becoming very heavily used (esp for the BDC code). (This used to be commit 4a23a358b5ad8873acb7db11f27b87d2a016bec1) --- source3/param/loadparm.c | 124 +++++++++++++++++++++++++++++++---------------- 1 file changed, 81 insertions(+), 43 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2446520afb..695e265afd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -441,6 +441,7 @@ static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; +static int server_role; static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) @@ -453,6 +454,7 @@ static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); +static void set_server_role(void); static void set_default_server_announce_type(void); static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, @@ -475,7 +477,7 @@ static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; -static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; +static struct enum_list enum_bool_auto[] = {{False, "False"}, {True, "True"}, {Auto, "Auto"}, {-1, NULL}}; /* Do you want session setups at user level security with a invalid @@ -719,12 +721,12 @@ static struct parm_struct parm_table[] = {"Browse Options", P_SEP, P_SEPARATOR}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, FLAG_BASIC}, - {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, FLAG_BASIC}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, @@ -902,7 +904,7 @@ static void init_globals(void) Globals.syslog = 1; Globals.bSyslogOnly = False; Globals.bTimestampLogs = True; - Globals.os_level = 0; + Globals.os_level = 32; Globals.max_ttl = 60*60*24*3; /* 3 days default. */ Globals.max_wins_ttl = 60*60*24*6; /* 6 days default. */ Globals.min_wins_ttl = 60*60*6; /* 6 hours default. */ @@ -974,9 +976,9 @@ static void init_globals(void) */ - Globals.bPreferredMaster = False; + Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */ Globals.bLocalMaster = True; - Globals.bDomainMaster = False; + Globals.bDomainMaster = Auto; /* depending on bDomainLogons */ Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = False; @@ -1214,9 +1216,7 @@ FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) -FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) -FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) FN_GLOBAL_BOOL(lp_readprediction,&Globals.bReadPrediction) @@ -2581,6 +2581,7 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) if (add_ipc) lp_add_ipc(); + set_server_role(); set_default_server_announce_type(); bLoaded = True; @@ -2665,6 +2666,50 @@ char *volume_label(int snum) } +/******************************************************************* + Set the server type we will announce as via nmbd. +********************************************************************/ +static void set_server_role(void) +{ + server_role = ROLE_DOMAIN_NONE; + + switch (lp_security()) + { + case SEC_SHARE: + { + if (lp_domain_logons()) + { + DEBUG(0,("Server's Role (logon server) conflicts with share-level security\n")); + } + break; + } + case SEC_SERVER: + case SEC_DOMAIN: + { + if (lp_domain_logons()) + { + server_role = ROLE_DOMAIN_BDC; + break; + } + server_role = ROLE_DOMAIN_MEMBER; + break; + } + case SEC_USER: + { + if (lp_domain_logons()) + { + server_role = ROLE_DOMAIN_PDC; + break; + } + break; + } + default: + { + DEBUG(0,("Server's Role undefined due to unknown security mode\n")); + } + } +} + /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ @@ -2852,39 +2897,32 @@ BOOL lp_kernel_oplocks(void) /*********************************************************** returns role of Samba server ************************************************************/ + int lp_server_role(void) { - switch (lp_security()) - { - case SEC_SHARE: - { - if (lp_domain_logons()) - { - DEBUG(0,("Server's Role (logon server) conflicts with share-level security\n")); - } - return ROLE_DOMAIN_NONE; - } - case SEC_SERVER: - case SEC_DOMAIN: - { - if (lp_domain_logons()) - { - return ROLE_DOMAIN_BDC; - } - return ROLE_DOMAIN_MEMBER; - } - case SEC_USER: - { - if (lp_domain_logons()) - { - return ROLE_DOMAIN_PDC; - } - return ROLE_DOMAIN_NONE; - } - default: - { - DEBUG(0,("Server's Role undefined due to unknown security mode\n")); - return ROLE_DOMAIN_NONE; - } - } + return server_role; +} + +/*********************************************************** + If we are PDC then prefer us as DMB +************************************************************/ + +BOOL lp_domain_master(void) +{ + if (Globals.bDomainMaster == Auto) + return (server_role == ROLE_DOMAIN_PDC); + + return Globals.bDomainMaster; +} + +/*********************************************************** + If we are DMB then prefer us as LMB +************************************************************/ + +BOOL lp_preferred_master(void) +{ + if (Globals.bPreferredMaster == Auto) + return (lp_local_master() && lp_domain_master()); + + return Globals.bPreferredMaster; } -- cgit From 5be247c62ca4445fe6983c74c662ec4ef500859e Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Sun, 11 Apr 1999 11:47:33 +0000 Subject: Allow "Yes" and "No" as well as "True" and "False" in the three-state enumeration. (This used to be commit 4ed67ccf1cdfd064cf2b2949020feb5afcb76b9d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 695e265afd..b55a4f3d21 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -477,7 +477,7 @@ static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_ static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; -static struct enum_list enum_bool_auto[] = {{False, "False"}, {True, "True"}, {Auto, "Auto"}, {-1, NULL}}; +static struct enum_list enum_bool_auto[] = {{True, "True"}, {False, "False"}, {True, "Yes"}, {False, "No"}, {Auto, "Auto"}, {-1, NULL}}; /* Do you want session setups at user level security with a invalid -- cgit From be552ca3504ebd98da37e70bac1f10b248cf860b Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Tue, 27 Apr 1999 10:43:32 +0000 Subject: rpc_parse/parse_misc.c : defined a new BUFFER5 struct include/ntdomain.h : added rpc_spoolss.h include statement include/proto.h include/rpc_dce.h : added definition of RPC_ALTER_CONTEXT request & reply param/loadparm.c : 2 new options for NT printing support and some changes to initial values in the LPRNG case. rpc_parse/parse_prs.c : added prs_uint16s() rpc_parse/parse_rpc.c : added SYNT_SPOOLSS_V1 and code for the alter-context support. rpc_server/srv_pipe.c : alter-context support smbd/nttrans.c smbd/server.c include/rpc_misc.h Makefile.in include/smb.h Jean Francois (This used to be commit 4c515804b70254248e378a3f90f47e4c32639d29) --- source3/param/loadparm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b55a4f3d21..142ab4af32 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -153,6 +153,8 @@ typedef struct char *szLdapPasswdFile; #endif /* WITH_LDAP */ char *szPanicAction; + char *szNtForms; + char *szNtDriverFile; int max_log_size; int mangled_stack; int max_xmit; @@ -676,6 +678,8 @@ static struct parm_struct parm_table[] = {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_GLOBAL}, + {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, FLAG_GLOBAL}, + {"nt printer driver",P_STRING, P_GLOBAL, &Globals.szNtDriverFile, NULL, NULL, FLAG_GLOBAL}, {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, @@ -860,6 +864,8 @@ static void init_globals(void) string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szDriverFile, DRIVERFILE); + string_set(&Globals.szNtForms, FORMSFILE); + string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); string_set(&Globals.szSmbrun, SMBRUN); @@ -1028,12 +1034,21 @@ static void init_locals(void) { case PRINT_BSD: case PRINT_AIX: - case PRINT_LPRNG: case PRINT_PLP: string_initial(&sDefault.szLpqcommand,"lpq -P%p"); string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); break; + + case PRINT_LPRNG: + string_initial(&sDefault.szLpqcommand,"lpq -P%p"); + string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); + string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); + string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); + string_initial(&sDefault.szLppausecommand,"lpc hold %p %j"); + string_initial(&sDefault.szLpresumecommand,"lpc release %p %j"); + break; case PRINT_SYSV: case PRINT_HPUX: @@ -1186,6 +1201,8 @@ static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) +FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) +FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); -- cgit From 89d51caba5bed5c3329b3776e15fce2bb41f7592 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 1 May 1999 01:41:28 +0000 Subject: added server ntlmv2 false/auto/true parameter, defaults to off. (This used to be commit 209944dabc764c6ea0c471e7868306c7d8d020d4) --- source3/param/loadparm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 142ab4af32..34c405dd50 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -211,6 +211,7 @@ typedef struct BOOL bDomainLogons; BOOL bEncryptPasswords; BOOL bUpdateEncrypt; + BOOL bServerNTLMv2; BOOL bStripDot; BOOL bNullPasswords; BOOL bLoadPrinters; @@ -529,6 +530,7 @@ static struct parm_struct parm_table[] = {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, + {"server ntlmv2", P_BOOL, P_GLOBAL, &Globals.bServerNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, @@ -970,6 +972,10 @@ static void init_globals(void) Globals.sslCompatibility = False; #endif /* WITH_SSL */ +/* NTLMv2 */ + + Globals.bServerNTLMv2 = False; + /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1244,6 +1250,7 @@ FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) +FN_GLOBAL_BOOL(lp_server_ntlmv2,&Globals.bUpdateEncrypt) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) @@ -2927,7 +2934,9 @@ int lp_server_role(void) BOOL lp_domain_master(void) { if (Globals.bDomainMaster == Auto) - return (server_role == ROLE_DOMAIN_PDC); + { + return (lp_server_role() == ROLE_DOMAIN_PDC); + } return Globals.bDomainMaster; } @@ -2939,7 +2948,9 @@ BOOL lp_domain_master(void) BOOL lp_preferred_master(void) { if (Globals.bPreferredMaster == Auto) + { return (lp_local_master() && lp_domain_master()); + } return Globals.bPreferredMaster; } -- cgit From 73891ca8e4f6cca6aa8bb0ae043f660a64baa056 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 29 Jun 1999 18:47:06 +0000 Subject: improving authentication code (tidyup). (This used to be commit ab1a6aa42db5217f025941fb5107436556bc23b7) --- source3/param/loadparm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 34c405dd50..7811d58afb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -212,6 +212,7 @@ typedef struct BOOL bEncryptPasswords; BOOL bUpdateEncrypt; BOOL bServerNTLMv2; + BOOL bClientNTLMv2; BOOL bStripDot; BOOL bNullPasswords; BOOL bLoadPrinters; @@ -530,7 +531,8 @@ static struct parm_struct parm_table[] = {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {"server ntlmv2", P_BOOL, P_GLOBAL, &Globals.bServerNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, + {"server ntlmv2", P_ENUM, P_GLOBAL, &Globals.bServerNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, + {"client ntlmv2", P_ENUM, P_GLOBAL, &Globals.bClientNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, @@ -974,6 +976,7 @@ static void init_globals(void) /* NTLMv2 */ + Globals.bClientNTLMv2 = False; Globals.bServerNTLMv2 = False; /* these parameters are set to defaults that are more appropriate @@ -1250,7 +1253,8 @@ FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) -FN_GLOBAL_BOOL(lp_server_ntlmv2,&Globals.bUpdateEncrypt) +FN_GLOBAL_BOOL(lp_client_ntlmv2,&Globals.bClientNTLMv2) +FN_GLOBAL_BOOL(lp_server_ntlmv2,&Globals.bServerNTLMv2) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) -- cgit From 8f1404739fe75464fe1500c3f6e6d39d4878ec1e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 12 Jul 1999 18:46:15 +0000 Subject: Jean-Francois Micouleau's rewritten DFS patch, originally written by Nigel Williams. despite the data format being *exactly* the same as NT's, this still doesn't work yet. more work needed. (This used to be commit 270981960bb5aab52d2f8e494827101ece6729c4) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7811d58afb..3f89c53be4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -146,6 +146,7 @@ typedef struct char *szDomainOtherSIDs; char *szDriverFile; char *szNameResolveOrder; + char *szDfsMap; #ifdef WITH_LDAP char *szLdapServer; char *szLdapSuffix; @@ -556,6 +557,7 @@ static struct parm_struct parm_table[] = {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, + {"dfs map", P_STRING, P_GLOBAL, &Globals.szDfsMap, NULL, NULL, 0}, {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED}, {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL}, @@ -589,7 +591,6 @@ static struct parm_struct parm_table[] = {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, - #ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, @@ -1212,6 +1213,7 @@ FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) +FN_GLOBAL_STRING(lp_dfs_map,&Globals.szDfsMap) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); -- cgit From 1f33d5a8aaa6b9a94dde21529fe2aa407fb5ffa1 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 14 Jul 1999 19:21:44 +0000 Subject: code from bertl to allow remap of default built-in names to anything. parameter is "builtin rid file". Copyright 1999 Bertl (This used to be commit 80d36778432d42eb265ed9428f27a27250ba5e08) --- source3/param/loadparm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3f89c53be4..c27a834914 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -127,6 +127,7 @@ typedef struct char *szAliasnameMap; char *szGroupnameMap; char *szBuiltinnameMap; + char *szBuiltinRidFile; char *szNTusernameMap; char *szCharacterSet; char *szLogonScript; @@ -716,7 +717,8 @@ static struct parm_struct parm_table[] = {"local group map", P_STRING, P_GLOBAL, &Globals.szAliasnameMap, NULL, NULL, 0}, {"domain group map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"builtin group map", P_STRING, P_GLOBAL, &Globals.szBuiltinnameMap, NULL, NULL, 0}, - {"domain user map", P_STRING, P_GLOBAL, &Globals.szNTusernameMap, NULL, NULL, 0}, + {"builtin rid file", P_STRING, P_GLOBAL, &Globals.szBuiltinRidFile, NULL, NULL, 0}, + {"domain user map", P_STRING, P_GLOBAL, &Globals.szNTusernameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -1196,6 +1198,7 @@ FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_aliasname_map,&Globals.szAliasnameMap) FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) FN_GLOBAL_STRING(lp_builtinname_map,&Globals.szBuiltinnameMap) +FN_GLOBAL_STRING(lp_builtinrid_file,&Globals.szBuiltinRidFile) FN_GLOBAL_STRING(lp_ntusrname_map,&Globals.szNTusernameMap) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) -- cgit From 1aef4d76c9ec5bd984ac1ba8123105d4c8e6cdfa Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 22 Jul 1999 04:55:13 +0000 Subject: Support for arbitrary VFS options in smb.conf. Options are of the format 'vfs option = name = value'. It would be nice to get rid of the first equals sign, but that would involve modifications to the smb.conf parser. There are a couple of naughties here - I've added a P_PTR enum as the VFS options are parsed in param/loadparm.c and stored as a linked list of structures. I couldn't for the life of me write a FN_LOCAL_PTR() macro to generate a lp_vfsoptions() function that actually worked so for the moment it is coded by hand. (This used to be commit 89ad85f0a3dfa233f6370ac6e3c97a1a645cfdfe) --- source3/param/loadparm.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c27a834914..7e736ad99d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -296,6 +296,7 @@ typedef struct char *volume; char *fstype; char *vfsObjectFile; + struct vfs_options *vfsOptions; int iMinPrintSpace; int iCreate_mask; int iCreate_force_mode; @@ -390,6 +391,7 @@ static service sDefault = NULL, /* volume */ NULL, /* fstype */ NULL, /* vfs object */ + NULL, /* vfs options */ 0, /* iMinPrintSpace */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ @@ -459,6 +461,7 @@ static BOOL handle_copy(char *pszParmValue, char **ptr); static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); +static BOOL handle_vfs_option(char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -810,7 +813,6 @@ static struct parm_struct parm_table[] = {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, 0}, - {"vfs object", P_STRING, P_LOCAL, &sDefault.vfsObjectFile, handle_vfs_object, NULL, 0}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_GLOBAL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_GLOBAL}, @@ -824,6 +826,10 @@ static struct parm_struct parm_table[] = {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_GLOBAL}, {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {"VFS options", P_SEP, P_SEPARATOR}, + + {"vfs object", P_STRING, P_LOCAL, &sDefault.vfsObjectFile, handle_vfs_object, NULL, 0}, + {"vfs option", P_PTR, P_LOCAL, &sDefault.vfsOptions, handle_vfs_option, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1170,6 +1176,9 @@ static char *lp_string(char *s) #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} +struct vfs_options *lp_vfsoptions(int i) +{ return(LP_SNUM_OK(i) ? pSERVICE(i)->vfsOptions : sDefault.vfsOptions); } + FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) @@ -1892,6 +1901,65 @@ static BOOL handle_vfs_object(char *pszParmValue,char **ptr) return True; } +/*************************************************************************** + handle the interpretation of the vfs option parameter + *************************************************************************/ +static BOOL handle_vfs_option(char *pszParmValue, char **ptr) +{ + struct vfs_options *new_option, **options = (struct vfs_options **)ptr; + int i; + + /* Create new vfs option */ + + new_option = (struct vfs_options *)malloc(sizeof(*new_option)); + if (new_option == NULL) { + return False; + } + + ZERO_STRUCTP(new_option); + + /* Get name and value */ + + new_option->name = strtok(pszParmValue, "="); + + if (new_option->name == NULL) { + return False; + } + + while(isspace(*new_option->name)) { + *new_option->name++; + } + + for (i = strlen(new_option->name); i > 0; i--) { + if (!isspace(new_option->name[i - 1])) break; + } + + new_option->name[i] = '\0'; + new_option->name = strdup(new_option->name); + + new_option->value = strtok(NULL, "="); + + if (new_option->value != NULL) { + + while(isspace(*new_option->value)) { + *new_option->value++; + } + + for (i = strlen(new_option->value); i > 0; i--) { + if (!isspace(new_option->value[i - 1])) break; + } + + new_option->value[i] = '\0'; + new_option->value = strdup(new_option->value); + } + + /* Add to list */ + + DLIST_ADD(*options, new_option); + + return True; +} + /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ -- cgit From 6b56ebb7cf48b350ba4e9fd5c61a8900b805a001 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 16 Nov 1999 17:27:41 +0000 Subject: added two new params: "trusted domains" and "trusting domains". these _may_ not actually ever get used, as trust relationships really need to be established with shared secrets, and you need to get the SID of the trusted and trusting domains, so this may have to go in a private/xxx.mac file. (This used to be commit 71f12138679251a9ebcada35969d9baea286a3e9) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7e736ad99d..b7aef21013 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -123,6 +123,8 @@ typedef struct char *szSocketOptions; char *szValidChars; char *szWorkGroup; + char *szTrustedDomains; + char *szTrustingDomains; char *szUsernameMap; char *szAliasnameMap; char *szGroupnameMap; @@ -717,6 +719,8 @@ static struct parm_struct parm_table[] = {"Domain Options", P_SEP, P_SEPARATOR}, + {"trusted domains", P_STRING, P_GLOBAL, &Globals.szTrustedDomains, NULL, NULL, 0}, + {"trusting domains", P_STRING, P_GLOBAL, &Globals.szTrustingDomains, NULL, NULL, 0}, {"local group map", P_STRING, P_GLOBAL, &Globals.szAliasnameMap, NULL, NULL, 0}, {"domain group map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"builtin group map", P_STRING, P_GLOBAL, &Globals.szBuiltinnameMap, NULL, NULL, 0}, @@ -1203,6 +1207,8 @@ FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) +FN_GLOBAL_STRING(lp_trusted_domains,&Globals.szTrustedDomains) +FN_GLOBAL_STRING(lp_trusting_domains,&Globals.szTrustingDomains) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) FN_GLOBAL_STRING(lp_aliasname_map,&Globals.szAliasnameMap) FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) -- cgit From f6276724bafdb6145c0c7b565172d80cb04516ea Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 12 Dec 1999 21:00:35 +0000 Subject: changed function name of get_home_dir() to get_unixhome_dir(), to stop clash with gnu readline library. fixed issue with [homes] service not being there - call lp_add_home() just before starting the msrpc processing. (This used to be commit 054195df9b6187c663ede5cf4489499abbdc29fc) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b7aef21013..82755d05a3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2559,7 +2559,7 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { - char *home = get_home_dir(p); + char *home = get_unixhome_dir(p); if (lp_servicenumber(p) >= 0) continue; -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/param/loadparm.c | 863 ++++++++++++++++++++--------------------------- 1 file changed, 365 insertions(+), 498 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 82755d05a3..e24877e124 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -116,21 +116,20 @@ typedef struct char *szLogFile; char *szConfigFile; char *szSMBPasswdFile; - char *szSMBPassGroupFile; - char *szSMBGroupFile; - char *szSMBAliasFile; char *szPasswordServer; char *szSocketOptions; char *szValidChars; char *szWorkGroup; - char *szTrustedDomains; - char *szTrustingDomains; + char *szDomainAdminGroup; + char *szDomainGuestGroup; + char *szDomainAdminUsers; + char *szDomainGuestUsers; + char *szDomainHostsallow; + char *szDomainHostsdeny; char *szUsernameMap; - char *szAliasnameMap; +#ifdef USING_GROUPNAME_MAP char *szGroupnameMap; - char *szBuiltinnameMap; - char *szBuiltinRidFile; - char *szNTusernameMap; +#endif /* USING_GROUPNAME_MAP */ char *szCharacterSet; char *szLogonScript; char *szLogonPath; @@ -147,18 +146,18 @@ typedef struct char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainOtherSIDs; + char *szDomainGroups; char *szDriverFile; char *szNameResolveOrder; - char *szDfsMap; -#ifdef WITH_LDAP char *szLdapServer; char *szLdapSuffix; - char *szLdapBindAs; - char *szLdapPasswdFile; -#endif /* WITH_LDAP */ + char *szLdapFilter; + char *szLdapRoot; + char *szLdapRootPassword; char *szPanicAction; - char *szNtForms; - char *szNtDriverFile; + char *szAddUserScript; + char *szDelUserScript; + char *szWINSHook; int max_log_size; int mangled_stack; int max_xmit; @@ -187,6 +186,8 @@ typedef struct 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 */ @@ -215,8 +216,6 @@ typedef struct BOOL bDomainLogons; BOOL bEncryptPasswords; BOOL bUpdateEncrypt; - BOOL bServerNTLMv2; - BOOL bClientNTLMv2; BOOL bStripDot; BOOL bNullPasswords; BOOL bLoadPrinters; @@ -237,15 +236,14 @@ typedef struct BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; + BOOL bNTAclSupport; BOOL bStatCache; BOOL bKernelOplocks; -#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) - char *sMysqlDatabase; - char *sMysqlTable; - char *sMysqlUser; - char *sMysqlHost; - char *sMysqlPassFile; -#endif + BOOL bAllowTrustedDomains; + BOOL bRestrictAnonymous; + BOOL bDebugHiresTimestamp; + BOOL bDebugPid; + BOOL bDebugUid; } global; static global Globals; @@ -297,17 +295,23 @@ typedef struct char *writelist; char *volume; char *fstype; - char *vfsObjectFile; - struct vfs_options *vfsOptions; int iMinPrintSpace; + int iWriteCacheSize; int iCreate_mask; int iCreate_force_mode; + int iSecurity_mask; + int iSecurity_force_mode; int iDir_mask; int iDir_force_mode; + int iDir_Security_mask; + int iDir_Security_force_mode; int iMaxConnections; int iDefaultCase; int iPrinting; + int iOplockContentionLimit; BOOL bAlternatePerm; + BOOL bPreexecClose; + BOOL bRootpreexecClose; BOOL bRevalidate; BOOL bCaseSensitive; BOOL bCasePreserve; @@ -330,6 +334,7 @@ typedef struct BOOL bStrictLocking; BOOL bShareModes; BOOL bOpLocks; + BOOL bLevel2OpLocks; BOOL bOnlyUser; BOOL bMangledNames; BOOL bWidelinks; @@ -392,17 +397,23 @@ static service sDefault = NULL, /* writelist */ NULL, /* volume */ NULL, /* fstype */ - NULL, /* vfs object */ - NULL, /* vfs options */ 0, /* iMinPrintSpace */ + 0, /* iWriteCacheSize */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ + -1, /* iSecurity_mask */ + -1, /* iSecurity_force_mode */ 0755, /* iDir_mask */ 0000, /* iDir_force_mode */ + -1, /* iDir_Security_mask */ + -1, /* iDir_Security_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ DEFAULT_PRINTING, /* iPrinting */ + 2, /* iOplockContentionLimit */ False, /* bAlternatePerm */ + False, /* bPreexecClose */ + False, /* bRootpreexecClose */ False, /* revalidate */ False, /* case sensitive */ True, /* case preserve */ @@ -425,6 +436,7 @@ static service sDefault = False, /* bStrictLocking */ True, /* bShareModes */ True, /* bOpLocks */ + True, /* bLevel2OpLocks */ False, /* bOnlyUser */ True, /* bMangledNames */ True, /* bWidelinks */ @@ -451,7 +463,6 @@ static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; -static int server_role; static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) @@ -462,10 +473,8 @@ static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); -static BOOL handle_vfs_object(char *pszParmValue, char **ptr); -static BOOL handle_vfs_option(char *pszParmValue, char **ptr); +static BOOL handle_client_code_page(char *pszParmValue,char **ptr); -static void set_server_role(void); static void set_default_server_announce_type(void); static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, @@ -481,14 +490,19 @@ static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "ai {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, {PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, {PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, - {-1, NULL}}; + {PRINT_CUPS, "cups"}, {-1, NULL}}; -static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT, "NT"}, {ANNOUNCE_AS_WIN95, "win95"}, - {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL}}; +/* Types of machine we can announce as. */ +#define ANNOUNCE_AS_NT_SERVER 1 +#define ANNOUNCE_AS_WIN95 2 +#define ANNOUNCE_AS_WFW 3 +#define ANNOUNCE_AS_NT_WORKSTATION 4 + +static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, {ANNOUNCE_AS_WIN95, "win95"}, {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL}}; static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; -static struct enum_list enum_bool_auto[] = {{True, "True"}, {False, "False"}, {True, "Yes"}, {False, "No"}, {Auto, "Auto"}, {-1, NULL}}; +static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; /* Do you want session setups at user level security with a invalid @@ -522,37 +536,29 @@ static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, - {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, {"Security Options", P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {"server ntlmv2", P_ENUM, P_GLOBAL, &Globals.bServerNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, - {"client ntlmv2", P_ENUM, P_GLOBAL, &Globals.bClientNTLMv2, NULL, enum_bool_auto, FLAG_BASIC}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"allow trusted domains",P_BOOL,P_GLOBAL, &Globals.bAllowTrustedDomains,NULL, NULL, 0}, + {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, -#if USE_SMBFILE_DB - {"smb passgrp file", P_STRING, P_GLOBAL, &Globals.szSMBPassGroupFile, NULL, NULL, 0}, -#endif -#if USE_SMBGROUP_DB - {"smb group file", P_STRING, P_GLOBAL, &Globals.szSMBGroupFile, NULL, NULL, 0}, - {"smb alias file", P_STRING, P_GLOBAL, &Globals.szSMBAliasFile, NULL, NULL, 0}, -#endif - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -563,43 +569,47 @@ static struct parm_struct parm_table[] = {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"dfs map", P_STRING, P_GLOBAL, &Globals.szDfsMap, NULL, NULL, 0}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL}, + {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous,NULL, NULL, 0}, + {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_PRINT|FLAG_GLOBAL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, 0}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_GLOBAL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC|FLAG_SHARE}, {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"force security mode",P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode,NULL,NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"force directory mode", P_OCTAL,P_LOCAL,&sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"directory security mask",P_OCTAL,P_LOCAL,&sDefault.iDir_Security_mask,NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, + {"force directory security mode",P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode,NULL,NULL,FLAG_GLOBAL|FLAG_SHARE}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_PRINT}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, 0}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_PRINT}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + #ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, - {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0 }, {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0 }, {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0} , @@ -617,7 +627,6 @@ static struct parm_struct parm_table[] = #endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, @@ -626,168 +635,162 @@ static struct parm_struct parm_table[] = {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL}, + {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, + {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, + {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE|FLAG_PRINT}, {"Protocol Options", P_SEP, P_SEPARATOR}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, + {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, + {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, + {"name resolve order",P_STRING, P_GLOBAL, &Globals.szNameResolveOrder,NULL, NULL, 0}, {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, 0}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, 0}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, {"Printing Options", P_SEP, P_SEPARATOR}, - - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, 0}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, 0}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, FLAG_PRINT}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT|FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, 0}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_GLOBAL}, - {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, FLAG_GLOBAL}, - {"nt printer driver",P_STRING, P_GLOBAL, &Globals.szNtDriverFile, NULL, NULL, FLAG_GLOBAL}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, NULL, NULL, 0}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, 0}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_GLOBAL}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_GLOBAL}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, FLAG_GLOBAL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_GLOBAL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_GLOBAL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_GLOBAL}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_GLOBAL}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_GLOBAL}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, FLAG_GLOBAL}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_GLOBAL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_GLOBAL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_GLOBAL}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, + {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, {"Domain Options", P_SEP, P_SEPARATOR}, - - {"trusted domains", P_STRING, P_GLOBAL, &Globals.szTrustedDomains, NULL, NULL, 0}, - {"trusting domains", P_STRING, P_GLOBAL, &Globals.szTrustingDomains, NULL, NULL, 0}, - {"local group map", P_STRING, P_GLOBAL, &Globals.szAliasnameMap, NULL, NULL, 0}, - {"domain group map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, - {"builtin group map", P_STRING, P_GLOBAL, &Globals.szBuiltinnameMap, NULL, NULL, 0}, - {"builtin rid file", P_STRING, P_GLOBAL, &Globals.szBuiltinRidFile, NULL, NULL, 0}, - {"domain user map", P_STRING, P_GLOBAL, &Globals.szNTusernameMap, NULL, NULL, 0}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, + {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, + {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, +#ifdef USING_GROUPNAME_MAP + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, +#endif /* USING_GROUPNAME_MAP */ {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, - - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, + {"delete user script",P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_DOS_STRING}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_DOS_STRING}, {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_DOS_STRING}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"Browse Options", P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, FLAG_BASIC}, + {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, FLAG_BASIC}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"WINS Options", P_SEP, P_SEPARATOR}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, {"Locking Options", P_SEP, P_SEPARATOR}, - - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, 0}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, 0}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_GLOBAL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_GLOBAL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_GLOBAL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"oplock break wait time",P_INTEGER,P_GLOBAL,&Globals.oplock_break_wait_time,NULL,NULL,FLAG_GLOBAL}, + {"oplock contention limit",P_INTEGER,P_LOCAL,&sDefault.iOplockContentionLimit,NULL,NULL,FLAG_SHARE|FLAG_GLOBAL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, #ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, - {"ldap bind as", P_STRING, P_GLOBAL, &Globals.szLdapBindAs, NULL, NULL, 0}, - {"ldap passwd file", P_STRING, P_GLOBAL, &Globals.szLdapPasswdFile, NULL, NULL, 0}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, + {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, + {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, #endif /* WITH_LDAP */ -#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) - {"MySQL Options", P_SEP, P_SEPARATOR}, - {"mysql host", P_STRING, P_GLOBAL, &Globals.sMysqlHost, NULL, NULL, 0}, - {"mysql user", P_STRING, P_GLOBAL, &Globals.sMysqlUser, NULL, NULL, 0}, - {"mysql pass file", P_STRING, P_GLOBAL, &Globals.sMysqlPassFile, NULL, NULL, 0}, - {"mysql database", P_STRING, P_GLOBAL, &Globals.sMysqlDatabase, NULL, NULL, 0}, - {"mysql table", P_STRING, P_GLOBAL, &Globals.sMysqlTable, NULL, NULL, 0}, -#endif /* MYSQL */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, @@ -809,31 +812,29 @@ static struct parm_struct parm_table[] = {"-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, 0}, + {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, 0}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, 0}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, 0}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, 0}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, 0}, - {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, 0}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, 0}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_GLOBAL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_GLOBAL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, 0}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, 0}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, 0}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_GLOBAL}, - {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_GLOBAL}, + {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, 0}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose,NULL, NULL, 0}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, + {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_GLOBAL}, + {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, - {"VFS options", P_SEP, P_SEPARATOR}, - - {"vfs object", P_STRING, P_LOCAL, &sDefault.vfsObjectFile, handle_vfs_object, NULL, 0}, - {"vfs option", P_PTR, P_LOCAL, &sDefault.vfsOptions, handle_vfs_option, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -850,7 +851,7 @@ static void init_globals(void) if (!done_init) { int i; - bzero((void *)&Globals,sizeof(Globals)); + memset((void *)&Globals,'\0',sizeof(Globals)); for (i = 0; parm_table[i].label; i++) if ((parm_table[i].type == P_STRING || @@ -869,20 +870,14 @@ static void init_globals(void) DEBUG(3,("Initialising global parameters\n")); string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); -#if USE_SMBFILE_DB - string_set(&Globals.szSMBPassGroupFile, SMB_PASSGRP_FILE); -#endif -#if USE_SMBGROUP_DB - string_set(&Globals.szSMBGroupFile, SMB_GROUP_FILE); - string_set(&Globals.szSMBAliasFile, SMB_ALIAS_FILE); -#endif - string_set(&Globals.szPasswdChat,"*old*password* %o\\n *new*password* %n\\n *new*password* %n\\n *changed*"); + /* + * Allow the default PASSWD_CHAT to be overridden in local.h. + */ + string_set(&Globals.szPasswdChat,DEFAULT_PASSWD_CHAT); string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szDriverFile, DRIVERFILE); - string_set(&Globals.szNtForms, FORMSFILE); - string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); string_set(&Globals.szSmbrun, SMBRUN); @@ -921,13 +916,15 @@ static void init_globals(void) Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; - Globals.bReadbmpx = True; + Globals.bReadbmpx = False; Globals.bNullPasswords = False; Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; Globals.bTimestampLogs = True; - Globals.os_level = 32; + Globals.bDebugHiresTimestamp = False; + Globals.bDebugPid = False; + Globals.bDebugUid = False; Globals.max_ttl = 60*60*24*3; /* 3 days default. */ Globals.max_wins_ttl = 60*60*24*6; /* 6 days default. */ Globals.min_wins_ttl = 60*60*6; /* 6 hours default. */ @@ -938,7 +935,7 @@ static void init_globals(void) Globals.lm_interval = 60; Globals.shmem_size = SHMEM_SIZE; Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ - Globals.announce_as = ANNOUNCE_AS_NT; + Globals.announce_as = ANNOUNCE_AS_NT_SERVER; Globals.bUnixRealname = False; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; @@ -956,8 +953,12 @@ static void init_globals(void) Globals.bOleLockingCompat = True; Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ + Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ Globals.bStatCache = True; /* use stat cache by default */ + Globals.bRestrictAnonymous = False; Globals.map_to_guest = 0; /* By Default, "Never" */ + Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ + Globals.oplock_break_wait_time = 10; /* By Default, 10 msecs. */ #ifdef WITH_LDAP /* default values for ldap */ @@ -967,31 +968,21 @@ static void init_globals(void) #ifdef WITH_SSL Globals.sslVersion = SMB_SSL_V23; - - /* - * Most of the next variables should be string_set! - */ - - string_set(&Globals.sslHostsRequire, NULL); - string_set(&Globals.sslHostsResign, NULL); - string_set(&Globals.sslCaCertDir, NULL); - string_set(&Globals.sslCaCertFile, NULL); - string_set(&Globals.sslCert, NULL); - string_set(&Globals.sslPrivKey, NULL); - string_set(&Globals.sslClientCert, NULL); - string_set(&Globals.sslClientPrivKey, NULL); - string_set(&Globals.sslCiphers, NULL); + string_set(&Globals.sslHostsRequire, ""); + string_set(&Globals.sslHostsResign, ""); + string_set(&Globals.sslCaCertDir, ""); + string_set(&Globals.sslCaCertFile, ""); + string_set(&Globals.sslCert, ""); + string_set(&Globals.sslPrivKey, ""); + string_set(&Globals.sslClientCert, ""); + string_set(&Globals.sslClientPrivKey, ""); + string_set(&Globals.sslCiphers, ""); Globals.sslEnabled = False; Globals.sslReqClientCert = False; Globals.sslReqServerCert = False; Globals.sslCompatibility = False; #endif /* WITH_SSL */ -/* NTLMv2 */ - - Globals.bClientNTLMv2 = False; - Globals.bServerNTLMv2 = False; - /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1004,9 +995,10 @@ static void init_globals(void) */ - Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */ + Globals.os_level = 20; + Globals.bPreferredMaster = False; Globals.bLocalMaster = True; - Globals.bDomainMaster = Auto; /* depending on bDomainLogons */ + Globals.bDomainMaster = False; Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = False; @@ -1020,13 +1012,7 @@ static void init_globals(void) */ Globals.bKernelOplocks = True; -#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) - string_set(&Globals.sMysqlHost,"localhost"); - string_set(&Globals.sMysqlUser,"root"); - string_set(&Globals.sMysqlPassFile,NULL); - string_set(&Globals.sMysqlDatabase,"samba"); - string_set(&Globals.sMysqlTable,"smbpasswd"); -#endif + Globals.bAllowTrustedDomains = True; /* * This must be done last as it checks the value in @@ -1056,20 +1042,19 @@ static void init_locals(void) { case PRINT_BSD: case PRINT_AIX: + case PRINT_LPRNG: case PRINT_PLP: string_initial(&sDefault.szLpqcommand,"lpq -P%p"); string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); break; - - case PRINT_LPRNG: - string_initial(&sDefault.szLpqcommand,"lpq -P%p"); - string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); - string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); - string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); - string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); - string_initial(&sDefault.szLppausecommand,"lpc hold %p %j"); - string_initial(&sDefault.szLpresumecommand,"lpc release %p %j"); + + case PRINT_CUPS: + string_initial(&sDefault.szLpqcommand,"/usr/bin/lpstat -o%p"); + string_initial(&sDefault.szLprmcommand,"/usr/bin/cancel %p-%j"); + string_initial(&sDefault.szPrintcommand,"/usr/bin/lp -d%p -oraw %s; rm %s"); + string_initial(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); + string_initial(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); break; case PRINT_SYSV: @@ -1077,14 +1062,14 @@ static void init_locals(void) string_initial(&sDefault.szLpqcommand,"lpstat -o%p"); string_initial(&sDefault.szLprmcommand,"cancel %p-%j"); string_initial(&sDefault.szPrintcommand,"lp -c -d%p %s; rm %s"); -#ifdef SYSV +#ifdef HPUX + string_initial(&sDefault.szQueuepausecommand, "disable %p"); + string_initial(&sDefault.szQueueresumecommand, "enable %p"); +#else /* SYSV */ string_initial(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); string_initial(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); -#else /* SYSV */ - string_initial(&sDefault.szQueuepausecommand, "disable %p"); - string_initial(&sDefault.szQueueresumecommand, "enable %p"); #endif /* SYSV */ break; @@ -1111,14 +1096,14 @@ convenience routine to grab string parameters into a rotating buffer, and run standard_sub_basic on them. The buffers can be written to by callers without affecting the source string. ********************************************************************/ -static char *lp_string(char *s) +static char *lp_string(const char *s) { static char *bufs[10]; - static int buflen[10]; + static size_t buflen[10]; static int next = -1; char *ret; int i; - int len = s?strlen(s):0; + size_t len = s?strlen(s):0; if (next == -1) { /* initialisation */ @@ -1134,7 +1119,8 @@ static char *lp_string(char *s) if (buflen[next] != len) { buflen[next] = len; - if (bufs[next]) free(bufs[next]); + if (bufs[next]) + free(bufs[next]); bufs[next] = (char *)malloc(len); if (!bufs[next]) { DEBUG(0,("out of memory in lp_string()")); @@ -1148,7 +1134,7 @@ static char *lp_string(char *s) if (!s) *ret = 0; else - StrCpy(ret,s); + StrnCpy(ret,s,len-1); trim_string(ret, "\"", "\""); @@ -1180,20 +1166,10 @@ static char *lp_string(char *s) #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} -struct vfs_options *lp_vfsoptions(int i) -{ return(LP_SNUM_OK(i) ? pSERVICE(i)->vfsOptions : sDefault.vfsOptions); } - FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) -#if USE_SMBFILE_DB -FN_GLOBAL_STRING(lp_smb_passgrp_file,&Globals.szSMBPassGroupFile) -#endif -#if USE_SMBGROUP_DB -FN_GLOBAL_STRING(lp_smb_group_file,&Globals.szSMBGroupFile) -FN_GLOBAL_STRING(lp_smb_alias_file,&Globals.szSMBAliasFile) -#endif FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) @@ -1207,14 +1183,10 @@ FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) -FN_GLOBAL_STRING(lp_trusted_domains,&Globals.szTrustedDomains) -FN_GLOBAL_STRING(lp_trusting_domains,&Globals.szTrustingDomains) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) -FN_GLOBAL_STRING(lp_aliasname_map,&Globals.szAliasnameMap) +#ifdef USING_GROUPNAME_MAP FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) -FN_GLOBAL_STRING(lp_builtinname_map,&Globals.szBuiltinnameMap) -FN_GLOBAL_STRING(lp_builtinrid_file,&Globals.szBuiltinRidFile) -FN_GLOBAL_STRING(lp_ntusrname_map,&Globals.szNTusernameMap) +#endif /* USING_GROUPNAME_MAP */ FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) @@ -1229,15 +1201,22 @@ static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) -FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) -FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) -FN_GLOBAL_STRING(lp_dfs_map,&Globals.szDfsMap) +FN_GLOBAL_STRING(lp_adduser_script,&Globals.szAddUserScript) +FN_GLOBAL_STRING(lp_deluser_script,&Globals.szDelUserScript) +FN_GLOBAL_STRING(lp_wins_hook,&Globals.szWINSHook) + +FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) +FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) +FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) +FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) +FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); -FN_GLOBAL_STRING(lp_ldap_bind_as,&Globals.szLdapBindAs); -FN_GLOBAL_STRING(lp_ldap_passwd_file,&Globals.szLdapPasswdFile); +FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); +FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); +FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); #endif /* WITH_LDAP */ #ifdef WITH_SSL @@ -1262,7 +1241,9 @@ FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) +FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) +FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) FN_GLOBAL_BOOL(lp_readprediction,&Globals.bReadPrediction) @@ -1273,10 +1254,11 @@ FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) -FN_GLOBAL_BOOL(lp_client_ntlmv2,&Globals.bClientNTLMv2) -FN_GLOBAL_BOOL(lp_server_ntlmv2,&Globals.bServerNTLMv2) FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) +FN_GLOBAL_BOOL(lp_debug_hires_timestamp,&Globals.bDebugHiresTimestamp) +FN_GLOBAL_BOOL(lp_debug_pid,&Globals.bDebugPid) +FN_GLOBAL_BOOL(lp_debug_uid,&Globals.bDebugUid) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) @@ -1287,7 +1269,10 @@ FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) FN_GLOBAL_BOOL(lp_nt_pipe_support,&Globals.bNTPipeSupport) +FN_GLOBAL_BOOL(lp_nt_acl_support,&Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) +FN_GLOBAL_BOOL(lp_allow_trusted_domains,&Globals.bAllowTrustedDomains) +FN_GLOBAL_BOOL(lp_restrict_anonymous,&Globals.bRestrictAnonymous) FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) @@ -1315,6 +1300,8 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_change_notify_timeout,&Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_stat_cache_size,&Globals.stat_cache_size) FN_GLOBAL_INTEGER(lp_map_to_guest,&Globals.map_to_guest) +FN_GLOBAL_INTEGER(lp_min_passwd_length,&Globals.min_passwd_length) +FN_GLOBAL_INTEGER(lp_oplock_break_wait_time,&Globals.oplock_break_wait_time) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) @@ -1351,7 +1338,6 @@ FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_fstype,fstype) -FN_LOCAL_STRING(lp_vfsobj,vfsObjectFile) static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) @@ -1359,6 +1345,8 @@ FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) +FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose) +FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive) FN_LOCAL_BOOL(lp_preservecase,bCasePreserve) @@ -1379,6 +1367,7 @@ FN_LOCAL_BOOL(lp_locking,bLocking) FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) FN_LOCAL_BOOL(lp_share_modes,bShareModes) FN_LOCAL_BOOL(lp_oplocks,bOpLocks) +FN_LOCAL_BOOL(lp_level2_oplocks,bLevel2OpLocks) FN_LOCAL_BOOL(lp_onlyuser,bOnlyUser) FN_LOCAL_BOOL(lp_manglednames,bMangledNames) FN_LOCAL_BOOL(lp_widelinks,bWidelinks) @@ -1394,24 +1383,23 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times,bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks,bBlockingLocks) -FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask) +FN_LOCAL_INTEGER(lp_create_mask,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -FN_LOCAL_INTEGER(lp_dir_mode,iDir_mask) +FN_LOCAL_INTEGER(_lp_security_mask,iSecurity_mask) +FN_LOCAL_INTEGER(_lp_force_security_mode,iSecurity_force_mode) +FN_LOCAL_INTEGER(lp_dir_mask,iDir_mask) FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode) +FN_LOCAL_INTEGER(_lp_dir_security_mask,iDir_Security_mask) +FN_LOCAL_INTEGER(_lp_force_dir_security_mode,iDir_Security_force_mode) FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) FN_LOCAL_INTEGER(lp_printing,iPrinting) +FN_LOCAL_INTEGER(lp_oplock_contention_limit,iOplockContentionLimit) +FN_LOCAL_INTEGER(lp_write_cache_size,iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar,magic_char) -#if defined(HAVE_MYSQL_H) && defined(WITH_MYSQLSAM) -FN_GLOBAL_STRING(lp_mysql_host,&Globals.sMysqlHost) -FN_GLOBAL_STRING(lp_mysql_user,&Globals.sMysqlUser) -FN_GLOBAL_STRING(lp_mysql_passfile,&Globals.sMysqlPassFile) -FN_GLOBAL_STRING(lp_mysql_db,&Globals.sMysqlDatabase) -FN_GLOBAL_STRING(lp_mysql_table,&Globals.sMysqlTable) -#endif /* local prototypes */ @@ -1433,7 +1421,7 @@ initialise a service to the defaults ***************************************************************************/ static void init_service(service *pservice) { - bzero((char *)pservice,sizeof(service)); + memset((char *)pservice,'\0',sizeof(service)); copy_service(pservice,&sDefault,NULL); } @@ -1508,9 +1496,10 @@ static int add_a_service(service *pservice, char *name) init_service(pSERVICE(i)); copy_service(pSERVICE(i),&tservice,NULL); - if (name) + if (name) { string_set(&iSERVICE(i).szService,name); - + unix_to_dos(iSERVICE(i).szService, True); + } return(i); } @@ -1892,80 +1881,6 @@ BOOL lp_file_list_changed(void) return(False); } -/*************************************************************************** - handle the interpretation of the vfs object parameter - *************************************************************************/ -static BOOL handle_vfs_object(char *pszParmValue,char **ptr) -{ - /* Set string value */ - - string_set(ptr,pszParmValue); - - /* Do any other initialisation required for vfs. Note that - anything done here may have linking repercussions in nmbd. */ - - return True; -} - -/*************************************************************************** - handle the interpretation of the vfs option parameter - *************************************************************************/ -static BOOL handle_vfs_option(char *pszParmValue, char **ptr) -{ - struct vfs_options *new_option, **options = (struct vfs_options **)ptr; - int i; - - /* Create new vfs option */ - - new_option = (struct vfs_options *)malloc(sizeof(*new_option)); - if (new_option == NULL) { - return False; - } - - ZERO_STRUCTP(new_option); - - /* Get name and value */ - - new_option->name = strtok(pszParmValue, "="); - - if (new_option->name == NULL) { - return False; - } - - while(isspace(*new_option->name)) { - *new_option->name++; - } - - for (i = strlen(new_option->name); i > 0; i--) { - if (!isspace(new_option->name[i - 1])) break; - } - - new_option->name[i] = '\0'; - new_option->name = strdup(new_option->name); - - new_option->value = strtok(NULL, "="); - - if (new_option->value != NULL) { - - while(isspace(*new_option->value)) { - *new_option->value++; - } - - for (i = strlen(new_option->value); i > 0; i--) { - if (!isspace(new_option->value[i - 1])) break; - } - - new_option->value[i] = '\0'; - new_option->value = strdup(new_option->value); - } - - /* Add to list */ - - DLIST_ADD(*options, new_option); - - return True; -} - /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ @@ -1977,19 +1892,41 @@ static BOOL handle_coding_system(char *pszParmValue,char **ptr) } /*************************************************************************** -handle the interpretation of the character set system parameter + Handle the interpretation of the character set system parameter. ***************************************************************************/ + +static char *saved_character_set = NULL; + static BOOL handle_character_set(char *pszParmValue,char **ptr) { + /* A dependency here is that the parameter client code page should be + set before this is called. + */ string_set(ptr,pszParmValue); - interpret_character_set(pszParmValue); + strupper(*ptr); + saved_character_set = strdup(*ptr); + interpret_character_set(*ptr,lp_client_code_page()); return(True); } +/*************************************************************************** + Handle the interpretation of the client code page parameter. + We handle this separately so that we can reset the character set + parameter in case this came before 'client code page' in the smb.conf. +***************************************************************************/ + +static BOOL handle_client_code_page(char *pszParmValue,char **ptr) +{ + Globals.client_code_page = atoi(pszParmValue); + if (saved_character_set != NULL) + interpret_character_set(saved_character_set,lp_client_code_page()); + return(True); +} /*************************************************************************** handle the valid chars lines ***************************************************************************/ + static BOOL handle_valid_chars(char *pszParmValue,char **ptr) { string_set(ptr,pszParmValue); @@ -2004,10 +1941,10 @@ static BOOL handle_valid_chars(char *pszParmValue,char **ptr) return(True); } - /*************************************************************************** handle the include operation ***************************************************************************/ + static BOOL handle_include(char *pszParmValue,char **ptr) { pstring fname; @@ -2081,10 +2018,10 @@ static void init_copymap(service *pservice) if (pservice->copymap) free(pservice->copymap); pservice->copymap = (BOOL *)malloc(sizeof(BOOL)*NUMPARAMETERS); if (!pservice->copymap) - DEBUG(0,("Couldn't allocate copymap!! (size %d)\n",NUMPARAMETERS)); - - for (i=0;icopymap[i] = True; + DEBUG(0,("Couldn't allocate copymap!! (size %d)\n",(int)NUMPARAMETERS)); + else + for (i=0;icopymap[i] = True; } @@ -2176,19 +2113,27 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) case P_STRING: string_set(parm_ptr,pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); break; case P_USTRING: string_set(parm_ptr,pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); strupper(*(char **)parm_ptr); break; case P_GSTRING: pstrcpy((char *)parm_ptr,pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); break; case P_UGSTRING: pstrcpy((char *)parm_ptr,pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); strupper((char *)parm_ptr); break; @@ -2256,7 +2201,7 @@ static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) break; case P_OCTAL: - fprintf(f,"0%o",*(int *)ptr); + fprintf(f,"%s",octal_string(*(int *)ptr)); break; case P_GSTRING: @@ -2404,7 +2349,7 @@ Display the contents of the global structure. static void dump_globals(FILE *f) { int i; - fprintf(f, "# Global parameters\n"); + fprintf(f, "# Global parameters\n[global]\n"); for (i=0;parm_table[i].label;i++) if (parm_table[i].class == P_GLOBAL && @@ -2559,7 +2504,7 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { - char *home = get_unixhome_dir(p); + char *home = get_user_home_dir(p); if (lp_servicenumber(p) >= 0) continue; @@ -2688,7 +2633,6 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) if (add_ipc) lp_add_ipc(); - set_server_role(); set_default_server_announce_type(); bLoaded = True; @@ -2706,6 +2650,14 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) } +/*************************************************************************** +reset the max number of services +***************************************************************************/ +void lp_resetnumservices(void) +{ + iNumServices = 0; +} + /*************************************************************************** return the max number of services ***************************************************************************/ @@ -2717,7 +2669,7 @@ int lp_numservices(void) /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE *f, BOOL show_defaults) +void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) { int iService; @@ -2729,15 +2681,21 @@ void lp_dump(FILE *f, BOOL show_defaults) dump_a_service(&sDefault, f); - for (iService = 0; iService < iNumServices; iService++) - { - if (VALID(iService)) - { - if (iSERVICE(iService).szService[0] == '\0') - break; - dump_a_service(pSERVICE(iService), f); - } - } + for (iService = 0; iService < maxtoprint; iService++) + lp_dump_one(f, show_defaults, iService); +} + +/*************************************************************************** +Display the contents of one service in human-readable form. +***************************************************************************/ +void lp_dump_one(FILE *f, BOOL show_defaults, int snum) +{ + if (VALID(snum)) + { + if (iSERVICE(snum).szService[0] == '\0') + return; + dump_a_service(pSERVICE(snum), f); + } } @@ -2773,113 +2731,22 @@ char *volume_label(int snum) } -/******************************************************************* - Set the server type we will announce as via nmbd. -********************************************************************/ -static void set_server_role(void) -{ - server_role = ROLE_DOMAIN_NONE; - - switch (lp_security()) - { - case SEC_SHARE: - { - if (lp_domain_logons()) - { - DEBUG(0,("Server's Role (logon server) conflicts with share-level security\n")); - } - break; - } - case SEC_SERVER: - case SEC_DOMAIN: - { - if (lp_domain_logons()) - { - server_role = ROLE_DOMAIN_BDC; - break; - } - server_role = ROLE_DOMAIN_MEMBER; - break; - } - case SEC_USER: - { - if (lp_domain_logons()) - { - server_role = ROLE_DOMAIN_PDC; - break; - } - break; - } - default: - { - DEBUG(0,("Server's Role undefined due to unknown security mode\n")); - } - } -} - /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ static void set_default_server_announce_type(void) { - default_server_announce = 0; - default_server_announce |= SV_TYPE_WORKSTATION; - default_server_announce |= SV_TYPE_SERVER; - default_server_announce |= SV_TYPE_SERVER_UNIX; - default_server_announce |= SV_TYPE_PRINTQ_SERVER; - - switch (lp_announce_as()) - { - case ANNOUNCE_AS_NT: - { - default_server_announce |= SV_TYPE_SERVER_NT; - default_server_announce |= SV_TYPE_NT; - break; - } - case ANNOUNCE_AS_WIN95: - { - default_server_announce |= SV_TYPE_WIN95_PLUS; - break; - } - case ANNOUNCE_AS_WFW: - { - default_server_announce |= SV_TYPE_WFW; - break; - } - default: - { - break; - } - } - - switch (lp_server_role()) - { - case ROLE_DOMAIN_MEMBER: - { - default_server_announce |= SV_TYPE_DOMAIN_MEMBER; - break; - } - case ROLE_DOMAIN_PDC: - { - default_server_announce |= SV_TYPE_DOMAIN_CTRL; - break; - } - case ROLE_DOMAIN_BDC: - { - default_server_announce |= SV_TYPE_DOMAIN_BAKCTRL; - break; - } - case ROLE_DOMAIN_NONE: - default: - { - break; - } - } - - if (lp_time_server()) - { - default_server_announce |= SV_TYPE_TIME_SOURCE; - } + default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | + SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); + if(lp_announce_as() == ANNOUNCE_AS_NT_SERVER) + default_server_announce |= (SV_TYPE_SERVER_NT | SV_TYPE_NT); + if(lp_announce_as() == ANNOUNCE_AS_NT_WORKSTATION) + default_server_announce |= SV_TYPE_NT; + else if(lp_announce_as() == ANNOUNCE_AS_WIN95) + default_server_announce |= SV_TYPE_WIN95_PLUS; + else if(lp_announce_as() == ANNOUNCE_AS_WFW) + default_server_announce |= SV_TYPE_WFW; + default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); } @@ -3002,38 +2869,38 @@ BOOL lp_kernel_oplocks(void) } /*********************************************************** - returns role of Samba server + Functions to return the current security masks/modes. If + set to -1 then return the create mask/mode instead. ************************************************************/ -int lp_server_role(void) +int lp_security_mask(int snum) { - return server_role; + int val = _lp_security_mask(snum); + if(val == -1) + return lp_create_mask(snum); + return val; } -/*********************************************************** - If we are PDC then prefer us as DMB -************************************************************/ - -BOOL lp_domain_master(void) +int lp_force_security_mode(int snum) { - if (Globals.bDomainMaster == Auto) - { - return (lp_server_role() == ROLE_DOMAIN_PDC); - } - - return Globals.bDomainMaster; + int val = _lp_force_security_mode(snum); + if(val == -1) + return lp_force_create_mode(snum); + return val; } -/*********************************************************** - If we are DMB then prefer us as LMB -************************************************************/ - -BOOL lp_preferred_master(void) +int lp_dir_security_mask(int snum) { - if (Globals.bPreferredMaster == Auto) - { - return (lp_local_master() && lp_domain_master()); - } + int val = _lp_dir_security_mask(snum); + if(val == -1) + return lp_dir_mask(snum); + return val; +} - return Globals.bPreferredMaster; +int lp_force_dir_security_mode(int snum) +{ + int val = _lp_force_dir_security_mode(snum); + if(val == -1) + return lp_force_dir_mode(snum); + return val; } -- cgit From e004340f715743e16f599bd0be3e9dad4c53bf2d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Dec 1999 02:15:53 +0000 Subject: Fix based on code from monyo@home.monyo.com to fix multibyte continuation issues. Jeremy. (This used to be commit 023f90e7664d358ddf73272597e75041f5413e9f) --- source3/param/params.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 74dd3d7a25..944bc3d1b4 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -157,28 +157,42 @@ static int EatComment( FILE *InFile ) return( c ); } /* EatComment */ +/***************************************************************************** + * Scan backards within a string to discover if the last non-whitespace + * character is a line-continuation character ('\\'). + * + * Input: line - A pointer to a buffer containing the string to be + * scanned. + * pos - This is taken to be the offset of the end of the + * string. This position is *not* scanned. + * + * Output: The offset of the '\\' character if it was found, or -1 to + * indicate that it was not. + * + *****************************************************************************/ + static int Continuation( char *line, int pos ) - /* ------------------------------------------------------------------------ ** - * Scan backards within a string to discover if the last non-whitespace - * character is a line-continuation character ('\\'). - * - * Input: line - A pointer to a buffer containing the string to be - * scanned. - * pos - This is taken to be the offset of the end of the - * string. This position is *not* scanned. - * - * Output: The offset of the '\\' character if it was found, or -1 to - * indicate that it was not. - * - * ------------------------------------------------------------------------ ** - */ - { +{ + int pos2 = 0; + pos--; while( (pos >= 0) && isspace(line[pos]) ) pos--; - return( ((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); - } /* Continuation */ + /* we should recognize if `\` is part of a multibyte character or not. */ + while(pos2 <= pos) { + size_t skip = 0; + skip = skip_multibyte_char(line[pos2]); + if (skip) { + pos2 += skip; + } else if (pos == pos2) { + return( ((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); + } else { + pos2++; + } + } + return (-1); +} static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) -- cgit From 794aafe349fb37e75630a7fca8da7a1cfe6f4c40 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 4 Jan 2000 19:19:07 +0000 Subject: Added "crap" fix for rotating string buffers. (Increased to 20, added #define). Andrew - please fix this properly when you have time :-). Jeremy. (This used to be commit 8515bdb39c603864246d3a4ff2349fa76b0bd86e) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e24877e124..6d82554130 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1090,6 +1090,7 @@ static void init_locals(void) } } +#define NUMBER_OF_STATIC_STRING_BUFS 20 /******************************************************************* a convenience routine to grab string parameters into a rotating buffer, @@ -1098,8 +1099,8 @@ callers without affecting the source string. ********************************************************************/ static char *lp_string(const char *s) { - static char *bufs[10]; - static size_t buflen[10]; + static char *bufs[NUMBER_OF_STATIC_STRING_BUFS]; + static size_t buflen[NUMBER_OF_STATIC_STRING_BUFS]; static int next = -1; char *ret; int i; @@ -1107,7 +1108,7 @@ static char *lp_string(const char *s) if (next == -1) { /* initialisation */ - for (i=0;i<10;i++) { + for (i=0;i Date: Wed, 5 Jan 2000 06:36:36 +0000 Subject: implemented talloc() as described on samba-technical. This fixes the lp_string() bug properly. we still need to add lp_talloc_free() calls in all the main event loops, I've only put it in smbd and nmbd thus far. (This used to be commit aa7f81552540f5dca2c146f5edd805611d5b390f) --- source3/param/loadparm.c | 66 ++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6d82554130..b76af54609 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1092,55 +1092,43 @@ static void init_locals(void) #define NUMBER_OF_STATIC_STRING_BUFS 20 +static TALLOC_CTX *lp_talloc; + /******************************************************************* a -convenience routine to grab string parameters into a rotating buffer, +free up temporary memory - called from the main loop +********************************************************************/ +void lp_talloc_free(void) +{ + if (!lp_talloc) return; + talloc_destroy(lp_talloc); + lp_talloc = NULL; +} + +/******************************************************************* +convenience routine to grab string parameters into temporary memory and run standard_sub_basic on them. The buffers can be written to by callers without affecting the source string. ********************************************************************/ static char *lp_string(const char *s) { - static char *bufs[NUMBER_OF_STATIC_STRING_BUFS]; - static size_t buflen[NUMBER_OF_STATIC_STRING_BUFS]; - static int next = -1; - char *ret; - int i; - size_t len = s?strlen(s):0; - - if (next == -1) { - /* initialisation */ - for (i=0;i Date: Thu, 6 Jan 2000 01:41:27 +0000 Subject: Re-added "dfree command" functionality that was described in the man pages but was not in the code. Jeremy. (This used to be commit f4898a1f16a2dbc25d062b0088d6c589a34c93a0) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b76af54609..e57b5e7d4f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1165,6 +1165,7 @@ FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) 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_hosts_equiv,&Globals.szHostsEquiv) FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) -- cgit From f0a38833799f3fb329ce94bfdfc9e3522a4b5969 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 Jan 2000 21:58:26 +0000 Subject: Removed unneeded #define. Jeremy. (This used to be commit c33b6d2aba63027408bd9895d2fedfc82f69a8f0) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e57b5e7d4f..2d2cd9db35 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1090,8 +1090,6 @@ static void init_locals(void) } } -#define NUMBER_OF_STATIC_STRING_BUFS 20 - static TALLOC_CTX *lp_talloc; /******************************************************************* a -- cgit From 171da4d78736730557a94b44af9f2d62081b80ba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jan 2000 06:55:36 +0000 Subject: this looks like a big commit, but it isn't really :) This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name. (This used to be commit b563be824b8c3141c49558eced7829b48d4ab26f) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2d2cd9db35..fed05b53a1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -71,6 +71,7 @@ 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" @@ -542,6 +543,7 @@ static struct parm_struct parm_table[] = {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, + {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, 0}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, -- cgit From 3c37bfe1aada2e161cdb3f4fc3dc907109817c97 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jan 2000 08:48:04 +0000 Subject: netbios scope is a DOS_STRING (This used to be commit e42b629baa15bf9328945d641d780fc4c7b3ffe0) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fed05b53a1..b19cd93832 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -543,7 +543,7 @@ static struct parm_struct parm_table[] = {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, - {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, 0}, + {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, -- cgit From 1e2f92af555166ea4e042e33ef41957354d233f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Jan 2000 03:09:17 +0000 Subject: Added utmp fix from David Lee . Jeremy. (This used to be commit 95d37a1d25d56316c80eec54aea1f358cd621d4c) --- source3/param/loadparm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b19cd93832..5a3cc806d5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -159,6 +159,9 @@ typedef struct char *szAddUserScript; char *szDelUserScript; char *szWINSHook; +#ifdef WITH_UTMP + char *szUtmpDir; +#endif /* WITH_UTMP */ int max_log_size; int mangled_stack; int max_xmit; @@ -333,6 +336,9 @@ typedef struct BOOL bMap_archive; BOOL bLocking; BOOL bStrictLocking; +#ifdef WITH_UTMP + BOOL bUtmp; +#endif BOOL bShareModes; BOOL bOpLocks; BOOL bLevel2OpLocks; @@ -435,6 +441,9 @@ static service sDefault = True, /* bMap_archive */ True, /* bLocking */ False, /* bStrictLocking */ +#ifdef WITH_UTMP + False, /* bUtmp */ +#endif True, /* bShareModes */ True, /* bOpLocks */ True, /* bLevel2OpLocks */ @@ -773,6 +782,9 @@ static struct parm_struct parm_table[] = {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, +#ifdef WITH_UTMP + {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, +#endif {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, @@ -799,6 +811,10 @@ static struct parm_struct parm_table[] = {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, +#ifdef WITH_UTMP + {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, +#endif /* WITH_UTMP */ {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, @@ -882,6 +898,7 @@ static void init_globals(void) string_set(&Globals.szDriverFile, DRIVERFILE); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); + string_set(&Globals.szUtmpDir, ""); string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); @@ -1162,6 +1179,9 @@ FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) +#ifdef WITH_UTMP +FN_GLOBAL_STRING(lp_utmpdir,&Globals.szUtmpDir) +#endif /* WITH_UTMP */ FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) FN_GLOBAL_STRING(lp_defaultservice,&Globals.szDefaultService) FN_GLOBAL_STRING(lp_msg_command,&Globals.szMsgCommand) @@ -1355,6 +1375,9 @@ FN_LOCAL_BOOL(lp_map_hidden,bMap_hidden) FN_LOCAL_BOOL(lp_map_archive,bMap_archive) FN_LOCAL_BOOL(lp_locking,bLocking) FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) +#ifdef WITH_UTMP +FN_LOCAL_BOOL(lp_utmp,bUtmp) +#endif FN_LOCAL_BOOL(lp_share_modes,bShareModes) FN_LOCAL_BOOL(lp_oplocks,bOpLocks) FN_LOCAL_BOOL(lp_level2_oplocks,bLevel2OpLocks) -- cgit From 6d81c60a05570bae53eba8efe6eb3d62c440b750 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 13 Jan 2000 00:42:04 +0000 Subject: Added missing #ifdef for WITH_UTMP. Jeremy. (This used to be commit 465c5a830827b82f0535d4507b3432c2df6de658) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5a3cc806d5..3ac6d78f04 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -898,7 +898,9 @@ static void init_globals(void) string_set(&Globals.szDriverFile, DRIVERFILE); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); +#ifdef WITH_UTMP string_set(&Globals.szUtmpDir, ""); +#endif /* WITH_UTMP */ string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); -- cgit From 3a6c2069d77176bfa2b379ef711034396c477791 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 14 Jan 2000 01:41:04 +0000 Subject: Added "inherit permissions" patch. Fixed locking bug found by Andrew. Jeremy. (This used to be commit 38dffd360dc2e44bfc9e751f017e24f81ff0f2fa) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3ac6d78f04..eb981fb5d2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -357,6 +357,7 @@ typedef struct BOOL bDosFiletimeResolution; BOOL bFakeDirCreateTimes; BOOL bBlockingLocks; + BOOL bInheritPerms; char dummy[3]; /* for alignment */ } service; @@ -462,6 +463,7 @@ static service sDefault = False, /* bDosFiletimeResolution */ False, /* bFakeDirCreateTimes */ True, /* bBlockingLocks */ + False, /* bInheritPerms */ "" /* dummy */ }; @@ -609,6 +611,7 @@ static struct parm_struct parm_table[] = {"force directory mode", P_OCTAL,P_LOCAL,&sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"directory security mask",P_OCTAL,P_LOCAL,&sDefault.iDir_Security_mask,NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"force directory security mode",P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode,NULL,NULL,FLAG_GLOBAL|FLAG_SHARE}, + {"inherit permissions",P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, @@ -1397,6 +1400,7 @@ FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times,bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks,bBlockingLocks) +FN_LOCAL_BOOL(lp_inherit_perms,bInheritPerms) FN_LOCAL_INTEGER(lp_create_mask,iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -- cgit From b3b634ff4251cca647e1e545fe1e4160736d96b9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2000 11:18:04 +0000 Subject: use string_set() instead of string_init() bug pointed out by Richard (This used to be commit 070f49397ff24e4d6ba7c2c1cfaef2dfa0944bd0) --- source3/param/loadparm.c | 62 ++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index eb981fb5d2..1ae3ca88df 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -878,7 +878,7 @@ static void init_globals(void) if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].ptr) - string_init(parm_table[i].ptr,""); + string_set(parm_table[i].ptr,""); string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); string_set(&sDefault.szPrinterDriver, "NULL"); @@ -1046,16 +1046,6 @@ static void init_globals(void) interpret_coding_system(KANJI); } -/*************************************************************************** -check if a string is initialised and if not then initialise it -***************************************************************************/ -static void string_initial(char **s,char *v) -{ - if (!*s || !**s) - string_init(s,v); -} - - /*************************************************************************** Initialise the sDefault parameter structure. ***************************************************************************/ @@ -1068,47 +1058,47 @@ static void init_locals(void) case PRINT_AIX: case PRINT_LPRNG: case PRINT_PLP: - string_initial(&sDefault.szLpqcommand,"lpq -P%p"); - string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); - string_initial(&sDefault.szPrintcommand,"lpr -r -P%p %s"); + string_set(&sDefault.szLpqcommand,"lpq -P%p"); + string_set(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_set(&sDefault.szPrintcommand,"lpr -r -P%p %s"); break; case PRINT_CUPS: - string_initial(&sDefault.szLpqcommand,"/usr/bin/lpstat -o%p"); - string_initial(&sDefault.szLprmcommand,"/usr/bin/cancel %p-%j"); - string_initial(&sDefault.szPrintcommand,"/usr/bin/lp -d%p -oraw %s; rm %s"); - string_initial(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); - string_initial(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); + 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 -oraw %s; rm %s"); + string_set(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); + string_set(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); break; case PRINT_SYSV: case PRINT_HPUX: - string_initial(&sDefault.szLpqcommand,"lpstat -o%p"); - string_initial(&sDefault.szLprmcommand,"cancel %p-%j"); - string_initial(&sDefault.szPrintcommand,"lp -c -d%p %s; rm %s"); + 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"); #ifdef HPUX - string_initial(&sDefault.szQueuepausecommand, "disable %p"); - string_initial(&sDefault.szQueueresumecommand, "enable %p"); + string_set(&sDefault.szQueuepausecommand, "disable %p"); + string_set(&sDefault.szQueueresumecommand, "enable %p"); #else /* SYSV */ - string_initial(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); - string_initial(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); - string_initial(&sDefault.szQueuepausecommand, "lpc stop %p"); - string_initial(&sDefault.szQueueresumecommand, "lpc start %p"); + string_set(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); + string_set(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); + string_set(&sDefault.szQueuepausecommand, "lpc stop %p"); + string_set(&sDefault.szQueueresumecommand, "lpc start %p"); #endif /* SYSV */ break; case PRINT_QNX: - string_initial(&sDefault.szLpqcommand,"lpq -P%p"); - string_initial(&sDefault.szLprmcommand,"lprm -P%p %j"); - string_initial(&sDefault.szPrintcommand,"lp -r -P%p %s"); + string_set(&sDefault.szLpqcommand,"lpq -P%p"); + string_set(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_set(&sDefault.szPrintcommand,"lp -r -P%p %s"); break; case PRINT_SOFTQ: - string_initial(&sDefault.szLpqcommand,"qstat -l -d%p"); - string_initial(&sDefault.szLprmcommand,"qstat -s -j%j -c"); - string_initial(&sDefault.szPrintcommand,"lp -d%p -s %s; rm %s"); - string_initial(&sDefault.szLppausecommand,"qstat -s -j%j -h"); - string_initial(&sDefault.szLpresumecommand,"qstat -s -j%j -r"); + string_set(&sDefault.szLpqcommand,"qstat -l -d%p"); + string_set(&sDefault.szLprmcommand,"qstat -s -j%j -c"); + string_set(&sDefault.szPrintcommand,"lp -d%p -s %s; rm %s"); + string_set(&sDefault.szLppausecommand,"qstat -s -j%j -h"); + string_set(&sDefault.szLpresumecommand,"qstat -s -j%j -r"); break; } -- cgit From ea9909cb343308865179ec8026395652f4493579 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Jan 2000 05:11:29 +0000 Subject: Added Herb's swat fixes. Jeremy. (This used to be commit fa3d91de8957c932f02205f9257dd3e47892a43d) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1ae3ca88df..e33e26d762 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -835,10 +835,10 @@ static struct parm_struct parm_table[] = {"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE}, {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, 0}, + {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose,NULL, NULL, 0}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose,NULL, NULL, FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, -- cgit From d85e6f2c9a5ca97f47b3c6b7b86f4ca07a8133c2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Jan 2000 17:16:07 +0000 Subject: Moved Herb's global -> local changes to HEAD. Jeremy. (This used to be commit bdb2ff6a38f55a66fa7e142f30442899193805ee) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e33e26d762..e0e4d60910 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -698,8 +698,8 @@ static struct parm_struct parm_table[] = {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, FLAG_PRINT}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT|FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, -- cgit From d867b86721e988dee56d5e9382b32c870ccb2790 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 26 Jan 2000 00:12:35 +0000 Subject: Second set of inline optimisation fixes from Ying Chen . Stop makeing function calls for every use of skip_multibyte_char. This function is called several *million* times during a NetBench run :-). Jeremy. (This used to be commit e5a3deba46ea2d4cb49a6c4b73edd766fe8b5a5c) --- source3/param/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 944bc3d1b4..3ecdcdc92b 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -182,7 +182,7 @@ static int Continuation( char *line, int pos ) /* we should recognize if `\` is part of a multibyte character or not. */ while(pos2 <= pos) { size_t skip = 0; - skip = skip_multibyte_char(line[pos2]); + skip = get_character_len(line[pos2]); if (skip) { pos2 += skip; } else if (pos == pos2) { -- cgit From ebfef23a7d255c68785bff4682117e09957bc23e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 29 Jan 2000 00:03:50 +0000 Subject: Fix from Motonobu TAKAHASHI to sort code page parameters first. Needed when reading the rest of smb.conf. Jeremy. (This used to be commit 171bef4d95390c1a74591fb06327cc993360a764) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e0e4d60910..7655b8978b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -548,6 +548,8 @@ static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, @@ -720,8 +722,6 @@ static struct parm_struct parm_table[] = {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, -- cgit From 230f81bf648f53ccc93fc88eb5dd6adc9e74583a Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Sun, 30 Jan 2000 01:00:00 +0000 Subject: made "enable" and "disable" the default "lpresume" and "lppause" commands for SYSV instead of the lpc commands (since these are BSD commands) I still don't like the default "lppause" and "lpresume" commands for SYSV since these seem to be SUN specific additions to the lp command (at least I don't find them in IRIX and HPUX). I think this should be inside an ifdef SUN??? but I'm not sure what the define should be so I have left it for now. (This used to be commit d3557b7f728e262d880bd7f7bbe20b853dbf165a) --- source3/param/loadparm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7655b8978b..2b8040685c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1076,14 +1076,11 @@ static void init_locals(void) 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"); -#ifdef HPUX string_set(&sDefault.szQueuepausecommand, "disable %p"); string_set(&sDefault.szQueueresumecommand, "enable %p"); -#else /* SYSV */ +#ifndef HPUX string_set(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); string_set(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); - string_set(&sDefault.szQueuepausecommand, "lpc stop %p"); - string_set(&sDefault.szQueueresumecommand, "lpc start %p"); #endif /* SYSV */ break; -- cgit From 6df7bfbd9f5badd1d8489b7c329961441f71b471 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 3 Feb 2000 05:11:26 +0000 Subject: Added 'vfs object' and 'vfs options' smb.conf parameters. (This used to be commit f872518972e7942e31b5ac5150d7ed8b0fbcf641) --- source3/param/loadparm.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2b8040685c..839c9c9e16 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -299,6 +299,8 @@ typedef struct char *writelist; char *volume; char *fstype; + char *szVfsObjectFile; + char *szVfsOptions; int iMinPrintSpace; int iWriteCacheSize; int iCreate_mask; @@ -405,6 +407,8 @@ static service sDefault = NULL, /* writelist */ NULL, /* volume */ NULL, /* fstype */ + NULL, /* vfs object */ + NULL, /* vfs options */ 0, /* iMinPrintSpace */ 0, /* iWriteCacheSize */ 0744, /* iCreate_mask */ @@ -486,6 +490,7 @@ static BOOL handle_copy(char *pszParmValue, char **ptr); static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); static BOOL handle_client_code_page(char *pszParmValue,char **ptr); +static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static void set_default_server_announce_type(void); @@ -856,6 +861,10 @@ static struct parm_struct parm_table[] = {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {"VFS options", P_SEP, P_SEPARATOR}, + + {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, + {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1340,6 +1349,7 @@ FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) FN_LOCAL_STRING(lp_fstype,fstype) +FN_LOCAL_STRING(lp_vfsobj,szVfsObjectFile) static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) @@ -1887,6 +1897,21 @@ BOOL lp_file_list_changed(void) return(False); } +/*************************************************************************** + handle the interpretation of the vfs object parameter + *************************************************************************/ +static BOOL handle_vfs_object(char *pszParmValue,char **ptr) +{ + /* Set string value */ + + string_set(ptr,pszParmValue); + + /* Do any other initialisation required for vfs. Note that + anything done here may have linking repercussions in nmbd. */ + + return True; +} + /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ -- cgit From 59ac32c2556e970ea1fe171e7b76cfee2142fbf0 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Mon, 7 Feb 2000 16:22:16 +0000 Subject: Jeremy can you check lib/util_unistr.c for codepages support ? I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F. (This used to be commit b81dc7b7f832cae2e66076398a134fbb6c1f78ca) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 839c9c9e16..8508246741 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -159,6 +159,8 @@ typedef struct char *szAddUserScript; char *szDelUserScript; char *szWINSHook; + char *szNtForms; + char *szNtDriverFile; #ifdef WITH_UTMP char *szUtmpDir; #endif /* WITH_UTMP */ @@ -721,6 +723,8 @@ static struct parm_struct parm_table[] = {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, + {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, FLAG_GLOBAL}, + {"nt printer driver",P_STRING, P_GLOBAL, &Globals.szNtDriverFile, NULL, NULL, FLAG_GLOBAL}, {"Filename Handling", P_SEP, P_SEPARATOR}, @@ -908,6 +912,8 @@ static void init_globals(void) string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szDriverFile, DRIVERFILE); + string_set(&Globals.szNtForms, FORMSFILE); + string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); #ifdef WITH_UTMP @@ -1222,6 +1228,9 @@ FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) +FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) +FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) + #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); -- cgit From 4175061348544af75b5e7ea8153aa6bbbf6001db Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Feb 2000 02:35:53 +0000 Subject: Added "source environment" parameter from Nicolas Williams . Jeremy. (This used to be commit f29847cbeeb0109f1fa61e9851e8cb0689b5228d) --- source3/param/loadparm.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8508246741..7a225b035e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -164,6 +164,7 @@ typedef struct #ifdef WITH_UTMP char *szUtmpDir; #endif /* WITH_UTMP */ + char *szSourceEnv; int max_log_size; int mangled_stack; int max_xmit; @@ -493,6 +494,8 @@ static BOOL handle_character_set(char *pszParmValue,char **ptr); static BOOL handle_coding_system(char *pszParmValue,char **ptr); static BOOL handle_client_code_page(char *pszParmValue,char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); +static BOOL handle_source_env(char *pszParmValue,char **ptr); +static BOOL handle_netbios_name(char *pszParmValue,char **ptr); static void set_default_server_announce_type(void); @@ -561,7 +564,7 @@ static struct parm_struct parm_table[] = {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, @@ -853,6 +856,7 @@ static struct parm_struct parm_table[] = {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, + {"source environment",P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env,NULL,0}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, @@ -1190,6 +1194,7 @@ FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_utmpdir,&Globals.szUtmpDir) #endif /* WITH_UTMP */ 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) @@ -1906,6 +1911,136 @@ BOOL lp_file_list_changed(void) return(False); } +/*************************************************************************** + Run standard_sub_basic on netbios name... needed because global_myname + is not accessed through any lp_ macro. +***************************************************************************/ + +static BOOL handle_netbios_name(char *pszParmValue,char **ptr) +{ + pstring netbios_name; + + pstrcpy(netbios_name,pszParmValue); + + standard_sub_basic(netbios_name); + strupper(netbios_name); + string_set(ptr,netbios_name); + + /* + * Convert from UNIX to DOS string - the UNIX to DOS converter + * isn't called on the special handlers. + */ + unix_to_dos(netbios_name, True); + pstrcpy(global_myname,netbios_name); + + DEBUG(4,("handle_netbios_name: set global_myname to: %s\n", global_myname)); + + return(True); +} + +/*************************************************************************** + Do the work of sourcing in environment variable/value pairs. +***************************************************************************/ + +static BOOL source_env(FILE *fenv) +{ + pstring line; + char *varval; + size_t len; + char *p; + + while (!feof(fenv)) { + if (fgets(line, sizeof(line), fenv) == NULL) + break; + + if(feof(fenv)) + break; + + 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(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(char *pszParmValue,char **ptr) +{ + pstring fname; + char *p = fname; + FILE *env; + BOOL result; + + pstrcpy(fname,pszParmValue); + + standard_sub_basic(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 == '|') { + + DEBUG(4, ("handle_source_env: source env from pipe\n")); + p++; + + if ((env = sys_popen(p, "r")) == NULL) { + DEBUG(0,("handle_source_env: Failed to popen %s. Error was %s\n", p, strerror(errno) )); + return(False); + } + + DEBUG(4, ("handle_source_env: calling source_env()\n")); + result = source_env(env); + sys_pclose(env); + + } else { + + DEBUG(4, ("handle_source_env: source env from file %s\n", fname)); + if ((env = sys_fopen(fname, "r")) == NULL) { + DEBUG(0,("handle_source_env: Failed to open file %s, Error was %s\n", fname, strerror(errno) )); + return(False); + } + result=source_env(env); + fclose(env); + } + return(result); +} + /*************************************************************************** handle the interpretation of the vfs object parameter *************************************************************************/ -- cgit From 3958c3910658e99fe1cfd737e0cfc126dffc75da Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 7 Mar 2000 21:55:42 +0000 Subject: added a tcon test: make two tconXs with the same user/pass, open a file with one of them and try to write to the file with the other. (This used to be commit f8d3ce0419aee44e4d5efe1257ce4b27f7511ceb) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7a225b035e..25c9440019 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -964,7 +964,7 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; - Globals.bTimestampLogs = True; + Globals.bTimestampLogs = False; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; -- cgit From 952799d9afe028d822181831715b85521c89a7ef Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Wed, 8 Mar 2000 22:14:30 +0000 Subject: dded Microsoft Dfs services. * added a new msdfs/ directory under source/ * added msdfs sources under this directory. * modified configure setup to add a --with-msdfs configure time option Modified Files: Makefile.in acconfig.h configure configure.in include/config.h.in include/includes.h include/proto.h include/smb.h include/smb_macros.h param/loadparm.c smbd/negprot.c smbd/nttrans.c smbd/process.c smbd/reply.c smbd/server.c smbd/trans2.c Added Files: include/msdfs.h msdfs/README msdfs/msdfs.c msdfs/msdfs_tdb.c msdfs/parse_dfs_map.c ---------------------------------------------------------------------- (This used to be commit 4684b4a188b54493dbe7f0de2909a8d3c5c3ebf9) --- source3/param/loadparm.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 25c9440019..7f7132b5b7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -251,6 +251,9 @@ typedef struct BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; +#ifdef MS_DFS + BOOL bHostMSDfs; +#endif } global; static global Globals; @@ -363,6 +366,10 @@ typedef struct BOOL bFakeDirCreateTimes; BOOL bBlockingLocks; BOOL bInheritPerms; +#ifdef MS_DFS + char *szDfsMap; + BOOL bDfsMapLoaded; +#endif char dummy[3]; /* for alignment */ } service; @@ -471,6 +478,10 @@ static service sDefault = False, /* bFakeDirCreateTimes */ True, /* bBlockingLocks */ False, /* bInheritPerms */ +#ifdef MS_DFS + NULL, /* MS Dfs map path */ + False, /* bDfsMapLoaded */ +#endif "" /* dummy */ }; @@ -873,6 +884,12 @@ static struct parm_struct parm_table[] = {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, + +#ifdef MS_DFS + {"dfs map", P_STRING, P_LOCAL, &sDefault.szDfsMap, NULL, NULL, FLAG_SHARE}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, +#endif + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1298,7 +1315,9 @@ FN_GLOBAL_BOOL(lp_nt_acl_support,&Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains,&Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous,&Globals.bRestrictAnonymous) - +#ifdef MS_DFS +FN_GLOBAL_BOOL(lp_host_msdfs,&Globals.bHostMSDfs) +#endif 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) @@ -1371,6 +1390,11 @@ FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) +#ifdef MS_DFS +FN_LOCAL_STRING(lp_dfsmap,szDfsMap) +FN_LOCAL_BOOL(lp_dfsmap_loaded,bDfsMapLoaded) +#endif + FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose) FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) @@ -2041,6 +2065,16 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) return(result); } + + +#ifdef MS_DFS +void set_dfsmap_loaded(int i,BOOL b) +{ + pSERVICE(i)->bDfsMapLoaded = b; +} + +#endif + /*************************************************************************** handle the interpretation of the vfs object parameter *************************************************************************/ @@ -2183,7 +2217,6 @@ static BOOL handle_copy(char *pszParmValue,char **ptr) return (bRetval); } - /*************************************************************************** initialise a copymap ***************************************************************************/ @@ -3079,3 +3112,5 @@ int lp_force_dir_security_mode(int snum) return lp_force_dir_mode(snum); return val; } + + -- cgit From 0307b23a31e23649493c4bcc21134d275c0d6293 Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Fri, 10 Mar 2000 22:53:36 +0000 Subject: Cleaning up the warnings from configure.developer. Found that Jeremy had already made some of the changes. (This used to be commit ca02d9f8219265f80fe11236c8c146db1dbb1ae2) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7f7132b5b7..a9c7f29ea1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -251,9 +251,7 @@ typedef struct BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; -#ifdef MS_DFS BOOL bHostMSDfs; -#endif } global; static global Globals; @@ -1315,9 +1313,7 @@ FN_GLOBAL_BOOL(lp_nt_acl_support,&Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains,&Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous,&Globals.bRestrictAnonymous) -#ifdef MS_DFS FN_GLOBAL_BOOL(lp_host_msdfs,&Globals.bHostMSDfs) -#endif 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) -- cgit From 01d88573ea1b3809a3e264989e1e04cd397528f7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 13 Mar 2000 20:05:18 +0000 Subject: include/smb.h: smbd/negprot.c: smbd/reply.c: Fixes to recognise Win2k. param/loadparm.c: Put debug timestamp parameter back to correct default. smbd/nttrans.c: Fix to detect Win2k unicode bug with transact create. Jeremy. (This used to be commit bb100352ab2f98fab3978008d269920e03efcf6d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a9c7f29ea1..48dc6cf123 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -979,7 +979,7 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; - Globals.bTimestampLogs = False; + Globals.bTimestampLogs = True; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; -- cgit From e601c0259e9e6a48e04ce3e0ff793cb564a89716 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Mar 2000 20:55:37 +0000 Subject: Fixes to add "paranoid" option to popen. Checks some basic things. Jeremy (This used to be commit 3b8cbb10de322fd7a1063fb5b681790b10d24ab0) --- source3/param/loadparm.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 48dc6cf123..4f6178a569 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2039,7 +2039,7 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) DEBUG(4, ("handle_source_env: source env from pipe\n")); p++; - if ((env = sys_popen(p, "r")) == NULL) { + if ((env = sys_popen(p, "r", True)) == NULL) { DEBUG(0,("handle_source_env: Failed to popen %s. Error was %s\n", p, strerror(errno) )); return(False); } @@ -2050,11 +2050,29 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) } else { + SMB_STRUCT_STAT st; + DEBUG(4, ("handle_source_env: source env from file %s\n", fname)); if ((env = sys_fopen(fname, "r")) == NULL) { DEBUG(0,("handle_source_env: Failed to open file %s, Error was %s\n", fname, strerror(errno) )); return(False); } + + /* + * Ensure this file is owned by root and not writable by world. + */ + if(fstat(fileno(env), &st) != 0) { + DEBUG(0,("handle_source_env: Failed to stat file %s, Error was %s\n", fname, strerror(errno) )); + fclose(env); + return False; + } + + if((st.st_uid != (uid_t)0) || (st.st_mode & S_IWOTH)) { + DEBUG(0,("handle_source_env: unsafe to source env file %s. Not owned by root or world writable\n", fname )); + fclose(env); + return False; + } + result=source_env(env); fclose(env); } -- cgit From 0583c25087c2e1dcb42e0e7f9f38ffc6f9103b15 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Mar 2000 20:25:34 +0000 Subject: Fixed crash bug in new handle_netbios_name code. Jeremy. (This used to be commit 26963f2f8ec923991efecf6ac177fb17e7a924b0) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4f6178a569..ab96d85494 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -573,7 +573,7 @@ static struct parm_struct parm_table[] = {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING,P_GLOBAL, NULL, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, @@ -1934,6 +1934,7 @@ BOOL lp_file_list_changed(void) /*************************************************************************** Run standard_sub_basic on netbios name... needed because global_myname is not accessed through any lp_ macro. + Note: We must *NOT* use string_set() here as ptr points to global_myname. ***************************************************************************/ static BOOL handle_netbios_name(char *pszParmValue,char **ptr) @@ -1944,7 +1945,6 @@ static BOOL handle_netbios_name(char *pszParmValue,char **ptr) standard_sub_basic(netbios_name); strupper(netbios_name); - string_set(ptr,netbios_name); /* * Convert from UNIX to DOS string - the UNIX to DOS converter -- cgit From 6b201d043a799548def37c613b8902572f545815 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Mar 2000 20:32:33 +0000 Subject: Fix for coredump in testparm. Jeremy. (This used to be commit c4c06650dd2407919213e5393ae501815a10c4f5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ab96d85494..a3b54376cc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -573,7 +573,7 @@ static struct parm_struct parm_table[] = {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING,P_GLOBAL, NULL, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, -- cgit From d6981c2d3a7d2e24f2536e057a86871717787b1c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Apr 2000 23:06:03 +0000 Subject: Fix for compiler warning about invalid structure type. jeremy. (This used to be commit 58a16e2718e6400fe9f20d61990818f2d146042f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a3b54376cc..e0cf808b57 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2061,7 +2061,7 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) /* * Ensure this file is owned by root and not writable by world. */ - if(fstat(fileno(env), &st) != 0) { + if(sys_fstat(fileno(env), &st) != 0) { DEBUG(0,("handle_source_env: Failed to stat file %s, Error was %s\n", fname, strerror(errno) )); fclose(env); return False; -- cgit From dc2d1544b3718dce5b3d7d91989b3cc5abfdef6b Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Wed, 5 Apr 2000 10:05:32 +0000 Subject: changed all the status code to ERROR_xxx instead of NT_STATUS_xx which are wrong in the spoolss case. fxed a bug in the job notify code (that's the polite answer), the truth is different: there is a bug in the NT spooler service, including SP6a and NT2K. changed the default lpcommand in the LPRNG case. J.F. (This used to be commit 396f73c11b29a47650b3243fef0825252a3cef9b) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e0cf808b57..5f948f78a4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1090,11 +1090,20 @@ static void init_locals(void) { case PRINT_BSD: case PRINT_AIX: + string_set(&sDefault.szLpqcommand,"lpq -P%p"); + string_set(&sDefault.szLprmcommand,"lprm -P%p %j"); + string_set(&sDefault.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"); break; case PRINT_CUPS: -- cgit From 8316237e9ca83d1bd0cecdc63d7e47b44cf13181 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Apr 2000 17:59:09 +0000 Subject: Code to map tdb locks onto POSIX. Mainly placeholder code at the moment, but the structure is done enough so that Andrew can look it over and give a yea/nay decision. Jeremy. (This used to be commit db96f83e34a139f47776fcbb5c1624fbf9d9943b) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5f948f78a4..a55018446d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -342,6 +342,7 @@ typedef struct BOOL bMap_archive; BOOL bLocking; BOOL bStrictLocking; + BOOL bPosixLocking; #ifdef WITH_UTMP BOOL bUtmp; #endif @@ -454,6 +455,7 @@ static service sDefault = True, /* bMap_archive */ True, /* bLocking */ False, /* bStrictLocking */ + True, /* bPosixLocking */ #ifdef WITH_UTMP False, /* bUtmp */ #endif @@ -814,6 +816,7 @@ static struct parm_struct parm_table[] = {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"oplock break wait time",P_INTEGER,P_GLOBAL,&Globals.oplock_break_wait_time,NULL,NULL,FLAG_GLOBAL}, {"oplock contention limit",P_INTEGER,P_LOCAL,&sDefault.iOplockContentionLimit,NULL,NULL,FLAG_SHARE|FLAG_GLOBAL}, + {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, @@ -1420,6 +1423,7 @@ FN_LOCAL_BOOL(lp_map_hidden,bMap_hidden) FN_LOCAL_BOOL(lp_map_archive,bMap_archive) FN_LOCAL_BOOL(lp_locking,bLocking) FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) +FN_LOCAL_BOOL(lp_posix_locking,bPosixLocking) #ifdef WITH_UTMP FN_LOCAL_BOOL(lp_utmp,bUtmp) #endif -- cgit From a018d6b3262d0617242f8be10b4e2dfb96f813e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Apr 2000 23:01:11 +0000 Subject: Removed "ole locking compat" parameter (no longer used). We now get/set/check POSIX locks, but I still need to code up the close fd braindamage... Jeremy. (This used to be commit 3de058bd43976853b0ed2b6b5529e2a3a08909eb) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a55018446d..6890a08fce 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -239,7 +239,6 @@ typedef struct BOOL bBindInterfacesOnly; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; - BOOL bOleLockingCompat; BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; @@ -811,7 +810,6 @@ static struct parm_struct parm_table[] = #ifdef WITH_UTMP {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, #endif - {"ole locking compatibility", P_BOOL, P_GLOBAL, &Globals.bOleLockingCompat, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, {"oplock break wait time",P_INTEGER,P_GLOBAL,&Globals.oplock_break_wait_time,NULL,NULL,FLAG_GLOBAL}, @@ -1011,7 +1009,6 @@ static void init_globals(void) Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; - Globals.bOleLockingCompat = True; Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ @@ -1318,7 +1315,6 @@ static FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) -FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat) FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) FN_GLOBAL_BOOL(lp_nt_pipe_support,&Globals.bNTPipeSupport) FN_GLOBAL_BOOL(lp_nt_acl_support,&Globals.bNTAclSupport) -- cgit From 19f946ba6fe442544ac9b0f71bcd33112fc79995 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Apr 2000 11:00:21 +0000 Subject: converted a bunch more functions to use a fd instead of a FILE* to support some of this I added the following functions in util_file.c file_lines_pload : load lines from a pipe file_pload : load a pipe into memory (This used to be commit a09470817c5b21dba42f9ef4ce5e8b768a254c0b) --- source3/param/loadparm.c | 60 +++++++++---------------------------- source3/param/params.c | 78 ++++++++++++++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 75 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6890a08fce..cc5a51c6c6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1971,19 +1971,15 @@ static BOOL handle_netbios_name(char *pszParmValue,char **ptr) Do the work of sourcing in environment variable/value pairs. ***************************************************************************/ -static BOOL source_env(FILE *fenv) +static BOOL source_env(char **lines) { - pstring line; char *varval; size_t len; + int i; char *p; - while (!feof(fenv)) { - if (fgets(line, sizeof(line), fenv) == NULL) - break; - - if(feof(fenv)) - break; + for (i=0; lines[i]; i++) { + char *line = lines[i]; if((len = strlen(line)) == 0) continue; @@ -2028,8 +2024,8 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) { pstring fname; char *p = fname; - FILE *env; BOOL result; + char **lines; pstrcpy(fname,pszParmValue); @@ -2044,47 +2040,19 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) */ if (*p == '|') { - - DEBUG(4, ("handle_source_env: source env from pipe\n")); - p++; - - if ((env = sys_popen(p, "r", True)) == NULL) { - DEBUG(0,("handle_source_env: Failed to popen %s. Error was %s\n", p, strerror(errno) )); - return(False); - } - - DEBUG(4, ("handle_source_env: calling source_env()\n")); - result = source_env(env); - sys_pclose(env); - + lines = file_lines_pload(p+1, NULL); } else { + lines = file_lines_load(fname, NULL); + } - SMB_STRUCT_STAT st; - - DEBUG(4, ("handle_source_env: source env from file %s\n", fname)); - if ((env = sys_fopen(fname, "r")) == NULL) { - DEBUG(0,("handle_source_env: Failed to open file %s, Error was %s\n", fname, strerror(errno) )); - return(False); - } - - /* - * Ensure this file is owned by root and not writable by world. - */ - if(sys_fstat(fileno(env), &st) != 0) { - DEBUG(0,("handle_source_env: Failed to stat file %s, Error was %s\n", fname, strerror(errno) )); - fclose(env); - return False; - } + if (!lines) { + DEBUG(0,("handle_source_env: Failed to open file %s, Error was %s\n", fname, strerror(errno) )); + return(False); + } - if((st.st_uid != (uid_t)0) || (st.st_mode & S_IWOTH)) { - DEBUG(0,("handle_source_env: unsafe to source env file %s. Not owned by root or world writable\n", fname )); - fclose(env); - return False; - } + result=source_env(lines); + file_lines_free(lines); - result=source_env(env); - fclose(env); - } return(result); } diff --git a/source3/param/params.c b/source3/param/params.c index 3ecdcdc92b..8e92621791 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -103,11 +103,32 @@ extern int DEBUGLEVEL; static char *bufr = NULL; static int bSize = 0; +/* we can't use FILE* due to the 256 fd limit - use this cheap hack + instead */ +typedef struct { + char *buf; + char *p; + size_t size; +} myFILE; + +static int mygetc(myFILE *f) +{ + if (f->p >= f->buf+f->size) return EOF; + return (int)*(f->p++); +} + +static void myfile_close(myFILE *f) +{ + if (!f) return; + if (f->buf) free(f->buf); + free(f); +} + /* -------------------------------------------------------------------------- ** * Functions... */ -static int EatWhitespace( FILE *InFile ) +static int EatWhitespace( myFILE *InFile ) /* ------------------------------------------------------------------------ ** * Scan past whitespace (see ctype(3C)) and return the first non-whitespace * character, or newline, or EOF. @@ -127,12 +148,12 @@ static int EatWhitespace( FILE *InFile ) { int c; - for( c = getc( InFile ); isspace( c ) && ('\n' != c); c = getc( InFile ) ) + for( c = mygetc( InFile ); isspace( c ) && ('\n' != c); c = mygetc( InFile ) ) ; return( c ); } /* EatWhitespace */ -static int EatComment( FILE *InFile ) +static int EatComment( myFILE *InFile ) /* ------------------------------------------------------------------------ ** * Scan to the end of a comment. * @@ -152,7 +173,7 @@ static int EatComment( FILE *InFile ) { int c; - for( c = getc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = getc( InFile ) ) + for( c = mygetc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = mygetc( InFile ) ) ; return( c ); } /* EatComment */ @@ -195,7 +216,7 @@ static int Continuation( char *line, int pos ) } -static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) +static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) /* ------------------------------------------------------------------------ ** * Scan a section name, and pass the name to function sfunc(). * @@ -264,7 +285,7 @@ static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) return( False ); } end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); - c = getc( InFile ); /* Continue with next line. */ + c = mygetc( InFile ); /* Continue with next line. */ break; default: /* All else are a valid name chars. */ @@ -278,7 +299,7 @@ static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) { bufr[i++] = c; end = i; - c = getc( InFile ); + c = mygetc( InFile ); } } } @@ -288,7 +309,7 @@ static BOOL Section( FILE *InFile, BOOL (*sfunc)(char *) ) return( False ); } /* Section */ -static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) +static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) /* ------------------------------------------------------------------------ ** * Scan a parameter name and value, and pass these two fields to pfunc(). * @@ -357,7 +378,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) return( True ); } end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); - c = getc( InFile ); /* Read past eoln. */ + c = mygetc( InFile ); /* Read past eoln. */ break; case '\0': /* Shouldn't have EOF within param name. */ @@ -377,7 +398,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) { bufr[i++] = c; end = i; - c = getc( InFile ); + c = mygetc( InFile ); } } } @@ -401,7 +422,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) switch( c ) { case '\r': /* Explicitly remove '\r' because the older */ - c = getc( InFile ); /* version called fgets_slash() which also */ + c = mygetc( InFile ); /* version called fgets_slash() which also */ break; /* removes them. */ case '\n': /* Marks end of value unless there's a '\'. */ @@ -412,7 +433,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) { for( end = i; (end >= 0) && isspace(bufr[end]); end-- ) ; - c = getc( InFile ); + c = mygetc( InFile ); } break; @@ -420,7 +441,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) bufr[i++] = c; /* not advance . This allows trimming */ if( !isspace( c ) ) /* of whitespace at the end of the line. */ end = i; - c = getc( InFile ); + c = mygetc( InFile ); break; } } @@ -429,7 +450,7 @@ static BOOL Parameter( FILE *InFile, BOOL (*pfunc)(char *, char *), int c ) return( pfunc( bufr, &bufr[vstart] ) ); /* Pass name & value to pfunc(). */ } /* Parameter */ -static BOOL Parse( FILE *InFile, +static BOOL Parse( myFILE *InFile, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ) /* ------------------------------------------------------------------------ ** @@ -490,38 +511,37 @@ static BOOL Parse( FILE *InFile, return( True ); } /* Parse */ -static FILE *OpenConfFile( char *FileName ) +static myFILE *OpenConfFile( char *FileName ) /* ------------------------------------------------------------------------ ** * Open a configuration file. * * Input: FileName - The pathname of the config file to be opened. * - * Output: A pointer of type (FILE *) to the opened file, or NULL if the - * file could not be opened. + * Output: A pointer of type (char **) to the lines of the file * * ------------------------------------------------------------------------ ** */ { - FILE *OpenedFile; char *func = "params.c:OpenConfFile() -"; extern BOOL in_client; int lvl = in_client?1:0; + myFILE *ret; - if( NULL == FileName || 0 == *FileName ) - { - DEBUG( lvl, ("%s No configuration filename specified.\n", func) ); - return( NULL ); - } + ret = (myFILE *)malloc(sizeof(*ret)); + if (!ret) return NULL; - OpenedFile = sys_fopen( FileName, "r" ); - if( NULL == OpenedFile ) + ret->buf = file_load(FileName, &ret->size); + if( NULL == ret->buf ) { DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n", func, FileName, strerror(errno)) ); + free(ret); + ret = NULL; } - return( OpenedFile ); + ret->p = ret->buf; + return( ret ); } /* OpenConfFile */ BOOL pm_process( char *FileName, @@ -542,7 +562,7 @@ BOOL pm_process( char *FileName, */ { int result; - FILE *InFile; + myFILE *InFile; char *func = "params.c:pm_process() -"; InFile = OpenConfFile( FileName ); /* Open the config file. */ @@ -562,7 +582,7 @@ BOOL pm_process( char *FileName, if( NULL == bufr ) { DEBUG(0,("%s memory allocation failure.\n", func)); - fclose(InFile); + myfile_close(InFile); return( False ); } result = Parse( InFile, sfunc, pfunc ); @@ -571,7 +591,7 @@ BOOL pm_process( char *FileName, bSize = 0; } - fclose(InFile); + myfile_close(InFile); if( !result ) /* Generic failure. */ { -- cgit From b39cee0bb9de856f8e4fa1f8a227ff885a5c56ff Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Fri, 28 Apr 2000 18:36:47 +0000 Subject: Added info level 1005 to netsharegetinfo (is the share a DFS root) Added dfs_server announcement in set_default_server_announce_type() (This used to be commit 99d07e13520b04d99999938d259d56fa65c8a8ea) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cc5a51c6c6..ff19f34a0e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2946,6 +2946,7 @@ static void set_default_server_announce_type(void) else if(lp_announce_as() == ANNOUNCE_AS_WFW) default_server_announce |= SV_TYPE_WFW; default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); + default_server_announce |= (lp_host_msdfs() ? SV_TYPE_DFS_SERVER : 0); } -- cgit From 32d5416b6a777a7874fec8518ec44e750560d882 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 May 2000 13:55:42 +0000 Subject: split the username in the vuser structure into a separate userdom_struct. As the name implies this also contains a domain (unused at the moment). This will be important shortly, as operation in appliance mode needs the domain to be always carried with the username. (This used to be commit ee8546342d5be90e730372b985710d764564b124) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ff19f34a0e..1294eda45c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -995,7 +995,7 @@ static void init_globals(void) Globals.shmem_size = SHMEM_SIZE; Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ Globals.announce_as = ANNOUNCE_AS_NT_SERVER; - Globals.bUnixRealname = False; + Globals.bUnixRealname = True; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; #ifdef WITH_NISPLUS_HOME -- cgit From c7ddaacd269528dd10aabdc5ce5ad05b6c66a601 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 5 May 2000 04:18:22 +0000 Subject: Fix for crash bug in OpenConfFile() if no smb.conf exists. (This used to be commit b531ddb2657e9eac1c1e9f32344b67c3963ce30a) --- source3/param/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 8e92621791..1cf3aa9eb1 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -537,7 +537,7 @@ static myFILE *OpenConfFile( char *FileName ) ("%s Unable to open configuration file \"%s\":\n\t%s\n", func, FileName, strerror(errno)) ); free(ret); - ret = NULL; + return NULL; } ret->p = ret->buf; -- cgit From 12a38a4632d7e5955b547a8bffdef86d3393393f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 May 2000 15:06:45 +0000 Subject: added winbindd options in head branch, so it is possible to combine branches (This used to be commit cd5e2494279792f8516947a63bf313f8142a52c0) --- source3/param/loadparm.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1294eda45c..04bf6522bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -165,6 +165,10 @@ typedef struct char *szUtmpDir; #endif /* WITH_UTMP */ char *szSourceEnv; + char *szWinbindUID; + char *szWinbindGID; + char *szTemplateHomedir; + char *szTemplateShell; int max_log_size; int mangled_stack; int max_xmit; @@ -195,6 +199,7 @@ typedef struct int map_to_guest; int min_passwd_length; int oplock_break_wait_time; + int winbind_cache_time; #ifdef WITH_LDAP int ldap_port; #endif /* WITH_LDAP */ @@ -506,6 +511,7 @@ static BOOL handle_client_code_page(char *pszParmValue,char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue,char **ptr); static BOOL handle_netbios_name(char *pszParmValue,char **ptr); +static BOOL handle_winbind_id(char *pszParmValue, char **ptr); static void set_default_server_announce_type(void); @@ -889,6 +895,14 @@ static struct parm_struct parm_table[] = {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, #endif + {"Winbind options", P_SEP, P_SEPARATOR}, + + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, + {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, + {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1072,6 +1086,10 @@ static void init_globals(void) Globals.bAllowTrustedDomains = True; + string_set(&Globals.szTemplateShell, "/bin/false"); + string_set(&Globals.szTemplateHomedir, "/home/%U"); + Globals.winbind_cache_time = 15; + /* * This must be done last as it checks the value in * client_code_page. @@ -2208,6 +2226,37 @@ static BOOL handle_copy(char *pszParmValue,char **ptr) return (bRetval); } +/*************************************************************************** + Handle winbind uid and gid allocation parameters. The format of these + parameters is: + + [global] + + winbind uid = 1000-1999 + winbind gid = 700-899 + + We only do simple parsing checks here. The strings are parsed into useful + structures in the winbind daemon code. + +***************************************************************************/ + +/* Do some simple checks on "winbind [ug]id" parameter value */ + +static BOOL handle_winbind_id(char *pszParmValue, char **ptr) +{ + int low, high; + + if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2) { + return False; + } + + /* Parse OK */ + + string_set(ptr,pszParmValue); + + return True; +} + /*************************************************************************** initialise a copymap ***************************************************************************/ -- cgit From ddc9b8b40642c90fe7c34b088eae4f8075f4033a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 09:49:55 +0000 Subject: more merging it is now at the stage that winbindd can compile in the head branch, but not link (This used to be commit d178c00aae77710ae6ff20a7f54a30e3bd8232bb) --- source3/param/loadparm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 04bf6522bf..1945dcffb2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1087,7 +1087,7 @@ static void init_globals(void) Globals.bAllowTrustedDomains = True; string_set(&Globals.szTemplateShell, "/bin/false"); - string_set(&Globals.szTemplateHomedir, "/home/%U"); + string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); Globals.winbind_cache_time = 15; /* @@ -1279,6 +1279,10 @@ FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) #ifdef WITH_LDAP +FN_GLOBAL_STRING(lp_winbind_uid,&Globals.szWinbindUID) +FN_GLOBAL_STRING(lp_winbind_gid,&Globals.szWinbindGID) +FN_GLOBAL_STRING(lp_template_homedir,&Globals.szTemplateHomedir) +FN_GLOBAL_STRING(lp_template_shell,&Globals.szTemplateShell) FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); @@ -1478,6 +1482,7 @@ FN_LOCAL_INTEGER(lp_write_cache_size,iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar,magic_char) +FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) /* local prototypes */ static int strwicmp( char *psz1, char *psz2 ); -- cgit From 277932cb7975ebb14a214bef208b916a9f251342 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 May 2000 11:20:46 +0000 Subject: remove autoloaded printers that are no longer in /etc/printcap when we get a HUP (This used to be commit 23f16c5ce60f76633458cc21b2d260d347b1b459) --- source3/param/loadparm.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1945dcffb2..14da552dcb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -268,6 +268,7 @@ static global Globals; typedef struct { BOOL valid; + BOOL autoloaded; char *szService; char *szPath; char *szUsername; @@ -381,6 +382,7 @@ typedef struct static service sDefault = { True, /* valid */ + False, /* not autoloaded */ NULL, /* szService */ NULL, /* szPath */ NULL, /* szUsername */ @@ -2778,8 +2780,10 @@ void lp_add_one_printer(char *name,char *comment) if (lp_servicenumber(name) < 0) { lp_add_printer(name,printers); - if ((i=lp_servicenumber(name)) >= 0) + if ((i=lp_servicenumber(name)) >= 0) { string_set(&iSERVICE(i).comment,comment); + iSERVICE(i).autoloaded = True; + } } } @@ -2788,7 +2792,7 @@ have we loaded a services file yet? ***************************************************************************/ BOOL lp_loaded(void) { - return(bLoaded); + return(bLoaded); } /*************************************************************************** @@ -2796,13 +2800,27 @@ unload unused services ***************************************************************************/ void lp_killunused(BOOL (*snumused)(int )) { - int i; - for (i=0;i Date: Wed, 10 May 2000 11:48:30 +0000 Subject: I found a better way of handling deleted auto printers (This used to be commit f838707820175f97db82fc32f124c3b69b051e6b) --- source3/param/loadparm.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 14da552dcb..97901cae8e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1423,6 +1423,7 @@ FN_LOCAL_STRING(lp_dfsmap,szDfsMap) FN_LOCAL_BOOL(lp_dfsmap_loaded,bDfsMapLoaded) #endif +FN_LOCAL_BOOL(lp_autoloaded,autoloaded) FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose) FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose) FN_LOCAL_BOOL(lp_revalidate,bRevalidate) @@ -2802,21 +2803,9 @@ void lp_killunused(BOOL (*snumused)(int )) { int i; for (i=0;i Date: Fri, 12 May 2000 06:30:45 +0000 Subject: use "winbind separator" option for domain/user separator character (This used to be commit 6cbb826b154e61085fd651116caf472d4d438c1d) --- source3/param/loadparm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 97901cae8e..9acfd5c170 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -169,6 +169,7 @@ typedef struct char *szWinbindGID; char *szTemplateHomedir; char *szTemplateShell; + char *szWinbindSeparator; int max_log_size; int mangled_stack; int max_xmit; @@ -903,6 +904,7 @@ static struct parm_struct parm_table[] = {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, + {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} @@ -1090,6 +1092,7 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); + string_set(&Globals.szWinbindSeparator, "\\"); Globals.winbind_cache_time = 15; /* @@ -1280,11 +1283,13 @@ FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) -#ifdef WITH_LDAP FN_GLOBAL_STRING(lp_winbind_uid,&Globals.szWinbindUID) FN_GLOBAL_STRING(lp_winbind_gid,&Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir,&Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell,&Globals.szTemplateShell) +FN_GLOBAL_STRING(lp_winbind_separator,&Globals.szWinbindSeparator) + +#ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); -- cgit From 651946153e41354769839fa6cbcfd36fd320efbe Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Tue, 16 May 2000 01:13:16 +0000 Subject: The new msdfs implementation that uses symlinks to point to other servers. Very intuitive. Removed the dfs map parsing code and tdb maintenance code (files msdfs/parse_dfs_map.c & msdfs/msdfs_tdb.c), dfs map loading and unloading calls (param/loadparm.c smbd/server.c). Added code to display msdfs format symlinks as directories in a transact2_findfirst/findnext. (smbd/trans2.c) Modified msdfs/msdfs.c to use the msdfs symlinks to create dfs referrals. Changed msdfs/README to reflect new operability. (This used to be commit 6803d2574fab9e5931786d5c9aa5dc5867bb5f05) --- source3/param/loadparm.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9acfd5c170..afb3774a54 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -371,10 +371,8 @@ typedef struct BOOL bFakeDirCreateTimes; BOOL bBlockingLocks; BOOL bInheritPerms; -#ifdef MS_DFS - char *szDfsMap; - BOOL bDfsMapLoaded; -#endif + BOOL bMSDfsRoot; + char dummy[3]; /* for alignment */ } service; @@ -485,10 +483,8 @@ static service sDefault = False, /* bFakeDirCreateTimes */ True, /* bBlockingLocks */ False, /* bInheritPerms */ -#ifdef MS_DFS - NULL, /* MS Dfs map path */ - False, /* bDfsMapLoaded */ -#endif + False, /* bMSDfsRoot */ + "" /* dummy */ }; @@ -893,10 +889,8 @@ static struct parm_struct parm_table[] = {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, -#ifdef MS_DFS - {"dfs map", P_STRING, P_LOCAL, &sDefault.szDfsMap, NULL, NULL, FLAG_SHARE}, + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, -#endif {"Winbind options", P_SEP, P_SEPARATOR}, @@ -1422,11 +1416,7 @@ FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) - -#ifdef MS_DFS -FN_LOCAL_STRING(lp_dfsmap,szDfsMap) -FN_LOCAL_BOOL(lp_dfsmap_loaded,bDfsMapLoaded) -#endif +FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) FN_LOCAL_BOOL(lp_autoloaded,autoloaded) FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose) @@ -2087,16 +2077,6 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) return(result); } - - -#ifdef MS_DFS -void set_dfsmap_loaded(int i,BOOL b) -{ - pSERVICE(i)->bDfsMapLoaded = b; -} - -#endif - /*************************************************************************** handle the interpretation of the vfs object parameter *************************************************************************/ -- cgit From 89a532aa2cd0c51bab44e2bc1b44b9a7c0012ae0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 May 2000 07:21:22 +0000 Subject: removed lp_revalidate() (This used to be commit fba5886a05ba64b4633d4a9f3e5cb0687fb4b20d) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index afb3774a54..39bb63f137 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -328,7 +328,6 @@ typedef struct BOOL bAlternatePerm; BOOL bPreexecClose; BOOL bRootpreexecClose; - BOOL bRevalidate; BOOL bCaseSensitive; BOOL bCasePreserve; BOOL bShortCasePreserve; @@ -440,7 +439,6 @@ static service sDefault = False, /* bAlternatePerm */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ - False, /* revalidate */ False, /* case sensitive */ True, /* case preserve */ True, /* short case preserve */ @@ -610,7 +608,6 @@ static struct parm_struct parm_table[] = {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous,NULL, NULL, 0}, - {"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, @@ -1421,7 +1418,6 @@ FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) FN_LOCAL_BOOL(lp_autoloaded,autoloaded) FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose) FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose) -FN_LOCAL_BOOL(lp_revalidate,bRevalidate) FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive) FN_LOCAL_BOOL(lp_preservecase,bCasePreserve) FN_LOCAL_BOOL(lp_shortpreservecase,bShortCasePreserve) -- cgit From 9d1bc48232d3f2d1994424008f88b7f7982cf233 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 27 May 2000 02:49:23 +0000 Subject: TIMESTAMPS ARE IRRITATING AS HELL WHEN DEBUGGING! NGGGH!! switched default to False, i expect someone to revert this very soon [for security reasons], but for now am doing this so i don't get exasperated by seeing stupid timestamps splitting up debug output. (This used to be commit 038dab9053c51938538f693db405ccabb0af9010) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 39bb63f137..f058dead2f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -989,7 +989,7 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; - Globals.bTimestampLogs = True; + Globals.bTimestampLogs = False; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; -- cgit From 140523dc46786bff24d9940728baacfa3a359b80 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 28 May 2000 23:34:34 +0000 Subject: lp_server_role() + use in srv_reg. (This used to be commit 82e47e268ca33dd7e692c5e6d0571428307b5287) --- source3/param/loadparm.c | 4803 ++++++++++++++++++++++++++-------------------- 1 file changed, 2701 insertions(+), 2102 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f058dead2f..57f93095a2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -65,7 +65,7 @@ #define KANJI "sbcs" #endif /* KANJI */ -BOOL in_client = False; /* Not in the client by default */ +BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; extern int DEBUGLEVEL; @@ -91,173 +91,174 @@ pstring global_scope = ""; #define LP_SNUM_OK(iService) (((iService) >= 0) && ((iService) < iNumServices) && iSERVICE(iService).valid) #define VALID(i) iSERVICE(i).valid -int keepalive=DEFAULT_KEEPALIVE; +int keepalive = DEFAULT_KEEPALIVE; extern BOOL use_getwd_cache; extern int extra_time_offset; -static BOOL defaults_saved=False; +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; + 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; - char *szWINSHook; - char *szNtForms; - char *szNtDriverFile; + 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; + char *szWINSHook; + char *szNtForms; + char *szNtDriverFile; #ifdef WITH_UTMP - char *szUtmpDir; -#endif /* WITH_UTMP */ - char *szSourceEnv; - char *szWinbindUID; - char *szWinbindGID; - char *szTemplateHomedir; - char *szTemplateShell; - char *szWinbindSeparator; - 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; - int winbind_cache_time; + char *szUtmpDir; +#endif /* WITH_UTMP */ + char *szSourceEnv; + char *szWinbindUID; + char *szWinbindGID; + char *szTemplateHomedir; + char *szTemplateShell; + char *szWinbindSeparator; + 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; + int winbind_cache_time; #ifdef WITH_LDAP - int ldap_port; -#endif /* 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 bTimestampLogs; - BOOL bNTSmbSupport; - BOOL bNTPipeSupport; - BOOL bNTAclSupport; - BOOL bStatCache; - BOOL bKernelOplocks; - BOOL bAllowTrustedDomains; - BOOL bRestrictAnonymous; - BOOL bDebugHiresTimestamp; - BOOL bDebugPid; - BOOL bDebugUid; - BOOL bHostMSDfs; -} global; + 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 bTimestampLogs; + BOOL bNTSmbSupport; + BOOL bNTPipeSupport; + BOOL bNTAclSupport; + BOOL bStatCache; + BOOL bKernelOplocks; + BOOL bAllowTrustedDomains; + BOOL bRestrictAnonymous; + BOOL bDebugHiresTimestamp; + BOOL bDebugPid; + BOOL bDebugUid; + BOOL bHostMSDfs; +} +global; static global Globals; @@ -268,222 +269,222 @@ static global Globals; */ typedef struct { - BOOL valid; - BOOL autoloaded; - 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; - char *szVfsObjectFile; - char *szVfsOptions; - int iMinPrintSpace; - int iWriteCacheSize; - int iCreate_mask; - int iCreate_force_mode; - int iSecurity_mask; - int iSecurity_force_mode; - int iDir_mask; - int iDir_force_mode; - int iDir_Security_mask; - int iDir_Security_force_mode; - int iMaxConnections; - int iDefaultCase; - int iPrinting; - int iOplockContentionLimit; - BOOL bAlternatePerm; - BOOL bPreexecClose; - BOOL bRootpreexecClose; - BOOL bCaseSensitive; - BOOL bCasePreserve; - BOOL bShortCasePreserve; - BOOL bCaseMangle; - BOOL status; - BOOL bHideDotFiles; - BOOL bBrowseable; - BOOL bAvailable; - BOOL bRead_only; - BOOL bNo_set_dir; - BOOL bGuest_only; - BOOL bGuest_ok; - BOOL bPrint_ok; - BOOL bPostscript; - BOOL bMap_system; - BOOL bMap_hidden; - BOOL bMap_archive; - BOOL bLocking; - BOOL bStrictLocking; - BOOL bPosixLocking; + BOOL valid; + BOOL autoloaded; + 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; + char *szVfsObjectFile; + char *szVfsOptions; + int iMinPrintSpace; + int iWriteCacheSize; + int iCreate_mask; + int iCreate_force_mode; + int iSecurity_mask; + int iSecurity_force_mode; + int iDir_mask; + int iDir_force_mode; + int iDir_Security_mask; + int iDir_Security_force_mode; + int iMaxConnections; + int iDefaultCase; + int iPrinting; + int iOplockContentionLimit; + BOOL bAlternatePerm; + BOOL bPreexecClose; + BOOL bRootpreexecClose; + BOOL bCaseSensitive; + BOOL bCasePreserve; + BOOL bShortCasePreserve; + BOOL bCaseMangle; + BOOL status; + BOOL bHideDotFiles; + BOOL bBrowseable; + BOOL bAvailable; + BOOL bRead_only; + BOOL bNo_set_dir; + BOOL bGuest_only; + BOOL bGuest_ok; + BOOL bPrint_ok; + BOOL bPostscript; + BOOL bMap_system; + BOOL bMap_hidden; + BOOL bMap_archive; + BOOL bLocking; + BOOL bStrictLocking; + BOOL bPosixLocking; #ifdef WITH_UTMP - BOOL bUtmp; + BOOL bUtmp; #endif - BOOL bShareModes; - BOOL bOpLocks; - BOOL bLevel2OpLocks; - BOOL bOnlyUser; - BOOL bMangledNames; - BOOL bWidelinks; - BOOL bSymlinks; - BOOL bSyncAlways; - BOOL bStrictSync; - char magic_char; - BOOL *copymap; - BOOL bDeleteReadonly; - BOOL bFakeOplocks; - BOOL bDeleteVetoFiles; - BOOL bDosFiletimes; - BOOL bDosFiletimeResolution; - BOOL bFakeDirCreateTimes; - BOOL bBlockingLocks; - BOOL bInheritPerms; - BOOL bMSDfsRoot; - - char dummy[3]; /* for alignment */ -} service; + BOOL bShareModes; + BOOL bOpLocks; + BOOL bLevel2OpLocks; + BOOL bOnlyUser; + BOOL bMangledNames; + BOOL bWidelinks; + BOOL bSymlinks; + BOOL bSyncAlways; + BOOL bStrictSync; + char magic_char; + BOOL *copymap; + BOOL bDeleteReadonly; + BOOL bFakeOplocks; + BOOL bDeleteVetoFiles; + BOOL bDosFiletimes; + BOOL bDosFiletimeResolution; + BOOL bFakeDirCreateTimes; + BOOL bBlockingLocks; + BOOL bInheritPerms; + BOOL bMSDfsRoot; + + char dummy[3]; /* for alignment */ +} +service; /* This is a default service used to prime a services structure */ -static service sDefault = -{ - True, /* valid */ - False, /* not autoloaded */ - NULL, /* szService */ - NULL, /* szPath */ - NULL, /* szUsername */ - NULL, /* szGuestAccount - this is set in init_globals() */ - NULL, /* szInvalidUsers */ - NULL, /* szValidUsers */ - NULL, /* szAdminUsers */ - NULL, /* szCopy */ - NULL, /* szInclude */ - NULL, /* szPreExec */ - NULL, /* szPostExec */ - NULL, /* szRootPreExec */ - NULL, /* szRootPostExec */ - NULL, /* szPrintcommand */ - NULL, /* szLpqcommand */ - NULL, /* szLprmcommand */ - NULL, /* szLppausecommand */ - NULL, /* szLpresumecommand */ - NULL, /* szQueuepausecommand */ - NULL, /* szQueueresumecommand */ - NULL, /* szPrintername */ - NULL, /* szPrinterDriver - this is set in init_globals() */ - NULL, /* szPrinterDriverLocation */ - NULL, /* szDontdescend */ - NULL, /* szHostsallow */ - NULL, /* szHostsdeny */ - NULL, /* szMagicScript */ - NULL, /* szMagicOutput */ - NULL, /* szMangledMap */ - NULL, /* szVetoFiles */ - NULL, /* szHideFiles */ - NULL, /* szVetoOplockFiles */ - NULL, /* comment */ - NULL, /* force user */ - NULL, /* force group */ - NULL, /* readlist */ - NULL, /* writelist */ - NULL, /* volume */ - NULL, /* fstype */ - NULL, /* vfs object */ - NULL, /* vfs options */ - 0, /* iMinPrintSpace */ - 0, /* iWriteCacheSize */ - 0744, /* iCreate_mask */ - 0000, /* iCreate_force_mode */ - -1, /* iSecurity_mask */ - -1, /* iSecurity_force_mode */ - 0755, /* iDir_mask */ - 0000, /* iDir_force_mode */ - -1, /* iDir_Security_mask */ - -1, /* iDir_Security_force_mode */ - 0, /* iMaxConnections */ - CASE_LOWER, /* iDefaultCase */ - DEFAULT_PRINTING, /* iPrinting */ - 2, /* iOplockContentionLimit */ - False, /* bAlternatePerm */ - False, /* bPreexecClose */ - False, /* bRootpreexecClose */ - False, /* case sensitive */ - True, /* case preserve */ - True, /* short case preserve */ - False, /* case mangle */ - True, /* status */ - True, /* bHideDotFiles */ - True, /* bBrowseable */ - True, /* bAvailable */ - True, /* bRead_only */ - True, /* bNo_set_dir */ - False, /* bGuest_only */ - False, /* bGuest_ok */ - False, /* bPrint_ok */ - False, /* bPostscript */ - False, /* bMap_system */ - False, /* bMap_hidden */ - True, /* bMap_archive */ - True, /* bLocking */ - False, /* bStrictLocking */ - True, /* bPosixLocking */ +static service sDefault = { + True, /* valid */ + False, /* not autoloaded */ + NULL, /* szService */ + NULL, /* szPath */ + NULL, /* szUsername */ + NULL, /* szGuestAccount - this is set in init_globals() */ + NULL, /* szInvalidUsers */ + NULL, /* szValidUsers */ + NULL, /* szAdminUsers */ + NULL, /* szCopy */ + NULL, /* szInclude */ + NULL, /* szPreExec */ + NULL, /* szPostExec */ + NULL, /* szRootPreExec */ + NULL, /* szRootPostExec */ + NULL, /* szPrintcommand */ + NULL, /* szLpqcommand */ + NULL, /* szLprmcommand */ + NULL, /* szLppausecommand */ + NULL, /* szLpresumecommand */ + NULL, /* szQueuepausecommand */ + NULL, /* szQueueresumecommand */ + NULL, /* szPrintername */ + NULL, /* szPrinterDriver - this is set in init_globals() */ + NULL, /* szPrinterDriverLocation */ + NULL, /* szDontdescend */ + NULL, /* szHostsallow */ + NULL, /* szHostsdeny */ + NULL, /* szMagicScript */ + NULL, /* szMagicOutput */ + NULL, /* szMangledMap */ + NULL, /* szVetoFiles */ + NULL, /* szHideFiles */ + NULL, /* szVetoOplockFiles */ + NULL, /* comment */ + NULL, /* force user */ + NULL, /* force group */ + NULL, /* readlist */ + NULL, /* writelist */ + NULL, /* volume */ + NULL, /* fstype */ + NULL, /* vfs object */ + NULL, /* vfs options */ + 0, /* iMinPrintSpace */ + 0, /* iWriteCacheSize */ + 0744, /* iCreate_mask */ + 0000, /* iCreate_force_mode */ + -1, /* iSecurity_mask */ + -1, /* iSecurity_force_mode */ + 0755, /* iDir_mask */ + 0000, /* iDir_force_mode */ + -1, /* iDir_Security_mask */ + -1, /* iDir_Security_force_mode */ + 0, /* iMaxConnections */ + CASE_LOWER, /* iDefaultCase */ + DEFAULT_PRINTING, /* iPrinting */ + 2, /* iOplockContentionLimit */ + False, /* bAlternatePerm */ + False, /* bPreexecClose */ + False, /* bRootpreexecClose */ + False, /* case sensitive */ + True, /* case preserve */ + True, /* short case preserve */ + False, /* case mangle */ + True, /* status */ + True, /* bHideDotFiles */ + True, /* bBrowseable */ + True, /* bAvailable */ + True, /* bRead_only */ + True, /* bNo_set_dir */ + False, /* bGuest_only */ + False, /* bGuest_ok */ + False, /* bPrint_ok */ + False, /* bPostscript */ + False, /* bMap_system */ + False, /* bMap_hidden */ + True, /* bMap_archive */ + True, /* bLocking */ + False, /* bStrictLocking */ + True, /* bPosixLocking */ #ifdef WITH_UTMP - False, /* bUtmp */ + False, /* bUtmp */ #endif - True, /* bShareModes */ - True, /* bOpLocks */ - True, /* bLevel2OpLocks */ - False, /* bOnlyUser */ - True, /* bMangledNames */ - True, /* bWidelinks */ - True, /* bSymlinks */ - False, /* bSyncAlways */ - False, /* bStrictSync */ - '~', /* magic char */ - NULL, /* copymap */ - False, /* bDeleteReadonly */ - False, /* bFakeOplocks */ - False, /* bDeleteVetoFiles */ - False, /* bDosFiletimes */ - False, /* bDosFiletimeResolution */ - False, /* bFakeDirCreateTimes */ - True, /* bBlockingLocks */ - False, /* bInheritPerms */ - False, /* bMSDfsRoot */ - - "" /* dummy */ + True, /* bShareModes */ + True, /* bOpLocks */ + True, /* bLevel2OpLocks */ + False, /* bOnlyUser */ + True, /* bMangledNames */ + True, /* bWidelinks */ + True, /* bSymlinks */ + False, /* bSyncAlways */ + False, /* bStrictSync */ + '~', /* magic char */ + NULL, /* copymap */ + False, /* bDeleteReadonly */ + False, /* bFakeOplocks */ + False, /* bDeleteVetoFiles */ + False, /* bDosFiletimes */ + False, /* bDosFiletimeResolution */ + False, /* bFakeDirCreateTimes */ + True, /* bBlockingLocks */ + False, /* bInheritPerms */ + False, /* bMSDfsRoot */ + + "" /* dummy */ }; @@ -494,6 +495,7 @@ static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; +static int server_role; static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) @@ -502,30 +504,37 @@ static int default_server_announce; static BOOL handle_valid_chars(char *pszParmValue, char **ptr); static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_character_set(char *pszParmValue,char **ptr); -static BOOL handle_coding_system(char *pszParmValue,char **ptr); -static BOOL handle_client_code_page(char *pszParmValue,char **ptr); +static BOOL handle_character_set(char *pszParmValue, char **ptr); +static BOOL handle_coding_system(char *pszParmValue, char **ptr); +static BOOL handle_client_code_page(char *pszParmValue, char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); -static BOOL handle_source_env(char *pszParmValue,char **ptr); -static BOOL handle_netbios_name(char *pszParmValue,char **ptr); +static BOOL handle_source_env(char *pszParmValue, char **ptr); +static BOOL handle_netbios_name(char *pszParmValue, char **ptr); static BOOL handle_winbind_id(char *pszParmValue, char **ptr); +static void set_server_role(void); static void set_default_server_announce_type(void); -static struct enum_list enum_protocol[] = {{PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, - {PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE,"CORE"}, - {PROTOCOL_COREPLUS, "COREPLUS"}, - {PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL}}; +static struct enum_list enum_protocol[] = + { {PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, +{PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE, "CORE"}, +{PROTOCOL_COREPLUS, "COREPLUS"}, +{PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL} +}; -static struct enum_list enum_security[] = {{SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, - {SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, - {-1, NULL}}; +static struct enum_list enum_security[] = + { {SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, +{SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, +{-1, NULL} +}; -static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, - {PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, - {PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, - {PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, - {PRINT_CUPS, "cups"}, {-1, NULL}}; +static struct enum_list enum_printing[] = + { {PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, +{PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, +{PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, +{PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, +{PRINT_CUPS, "cups"}, {-1, NULL} +}; /* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT_SERVER 1 @@ -533,11 +542,17 @@ static struct enum_list enum_printing[] = {{PRINT_SYSV, "sysv"}, {PRINT_AIX, "ai #define ANNOUNCE_AS_WFW 3 #define ANNOUNCE_AS_NT_WORKSTATION 4 -static struct enum_list enum_announce_as[] = {{ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, {ANNOUNCE_AS_WIN95, "win95"}, {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL}}; +static struct enum_list enum_announce_as[] = + { {ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, + {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, {ANNOUNCE_AS_WIN95, + "win95"}, + {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL} }; -static struct enum_list enum_case[] = {{CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL}}; +static struct enum_list enum_case[] = + { {CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL} }; -static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Auto"}, {-1, NULL}}; +static struct enum_list enum_bool_auto[] = + { {False, "False"}, {True, "True"}, {Auto, "Auto"}, {-1, NULL} }; /* Do you want session setups at user level security with a invalid @@ -560,345 +575,634 @@ static struct enum_list enum_lm_announce[] = {{0, "False"}, {1, "True"}, {2, "Au level security. */ -static struct enum_list enum_map_to_guest[] = {{NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, {-1, NULL}}; +static struct enum_list enum_map_to_guest[] = + { {NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, + "Bad User"}, + {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, {-1, NULL} }; #ifdef WITH_SSL -static struct enum_list enum_ssl_version[] = {{SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, - {SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL}}; +static struct enum_list enum_ssl_version[] = + { {SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, +{SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL} +}; #endif /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ -static struct parm_struct parm_table[] = -{ - {"Base Options", P_SEP, P_SEPARATOR}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_DOS_STRING}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING,P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, - {"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC|FLAG_DOS_STRING}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, - {"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0}, - - {"Security Options", P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, - {"encrypt passwords",P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {"allow trusted domains",P_BOOL,P_GLOBAL, &Globals.bAllowTrustedDomains,NULL, NULL, 0}, - {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, - {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, - {"passwd chat debug",P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous,NULL, NULL, 0}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT|FLAG_GLOBAL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC|FLAG_SHARE}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, - {"force create mode",P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"force security mode",P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode,NULL,NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, - {"force directory mode", P_OCTAL,P_LOCAL,&sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"directory security mask",P_OCTAL,P_LOCAL,&sDefault.iDir_Security_mask,NULL, NULL, FLAG_GLOBAL|FLAG_SHARE}, - {"force directory security mode",P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode,NULL,NULL,FLAG_GLOBAL|FLAG_SHARE}, - {"inherit permissions",P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL|FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, +static struct parm_struct parm_table[] = { + {"Base Options", P_SEP, P_SEPARATOR}, + + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, + handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, + handle_client_code_page, NULL, 0}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, + FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, + FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, + FLAG_DOS_STRING}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, + FLAG_BASIC | FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, + handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, + NULL, NULL, FLAG_DOS_STRING}, + {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, + FLAG_DOS_STRING}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, + NULL, FLAG_BASIC | FLAG_DOS_STRING}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, + FLAG_BASIC}, + {"bind interfaces only", P_BOOL, P_GLOBAL, + &Globals.bBindInterfacesOnly, NULL, NULL, 0}, + + {"Security Options", P_SEP, P_SEPARATOR}, + + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, + enum_security, FLAG_BASIC}, + {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, + NULL, NULL, FLAG_BASIC}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, + NULL, FLAG_BASIC}, + {"allow trusted domains", P_BOOL, P_GLOBAL, + &Globals.bAllowTrustedDomains, NULL, NULL, 0}, + {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, + NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, + 0}, + {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, + NULL, NULL, 0}, + {"min password length", P_INTEGER, P_GLOBAL, + &Globals.min_passwd_length, NULL, NULL, 0}, + {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, + enum_map_to_guest, 0}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, + NULL, 0}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, + NULL, NULL, 0}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, + NULL, NULL, 0}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, + 0}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + + {"passwd program", P_STRING, P_GLOBAL, + &Globals.szPasswdProgram, NULL, NULL, 0}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, + 0}, + {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, + NULL, NULL, 0}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, + NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, + NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, + NULL, 0}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, + NULL, NULL, 0}, + {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, + NULL, NULL, 0}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, + NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, + NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, + NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, + FLAG_SHARE}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, + FLAG_SHARE}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, + NULL, FLAG_BASIC | FLAG_SHARE}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, + NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, + FLAG_GLOBAL}, + {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, + NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, + NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force security mode", P_OCTAL, P_LOCAL, + &sDefault.iSecurity_force_mode, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, + FLAG_GLOBAL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, + NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory security mask", P_OCTAL, P_LOCAL, + &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force directory security mode", P_OCTAL, P_LOCAL, + &sDefault.iDir_Security_force_mode, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE}, + {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, + NULL, NULL, FLAG_SHARE}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, + FLAG_SHARE}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, + FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, + NULL, FLAG_SHARE}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, + FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, + 0}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, + FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, + 0}, #ifdef WITH_SSL - {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, - {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0 }, - {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0 }, - {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0} , - {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0 }, - {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0 }, - {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0 }, - {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0 }, - {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0 }, - {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0 }, - {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL , 0}, - {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL , 0}, - {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0 }, - {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, - {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0 }, -#endif /* WITH_SSL */ - - {"Logging Options", P_SEP, P_SEPARATOR}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, - {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, - {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, - {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL|FLAG_SHARE|FLAG_PRINT}, - - {"Protocol Options", P_SEP, P_SEPARATOR}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {"name resolve order",P_STRING, P_GLOBAL, &Globals.szNameResolveOrder,NULL, NULL, 0}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, - - {"Tuning Options", P_SEP, P_SEPARATOR}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, NULL, 0}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, - {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, - - {"Printing Options", P_SEP, P_SEPARATOR}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, FLAG_PRINT}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT|FLAG_GLOBAL}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand,NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT|FLAG_GLOBAL}, - {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, FLAG_GLOBAL}, - {"nt printer driver",P_STRING, P_GLOBAL, &Globals.szNtDriverFile, NULL, NULL, FLAG_GLOBAL}, - - - {"Filename Handling", P_SEP, P_SEPARATOR}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"short preserve case",P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve,NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, - {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL, NULL, FLAG_SHARE|FLAG_GLOBAL|FLAG_DOS_STRING}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, - - {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, - {"domain admin group",P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, - {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, - {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, + {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, + {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, + + {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, + NULL, NULL, 0}, + {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, + NULL, NULL, 0}, + {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, + NULL, 0}, + {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, + NULL, 0}, + {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, + 0}, + {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, + NULL, 0}, + {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, + NULL, 0}, + {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, + NULL, NULL, 0}, + {"ssl require clientcert", P_BOOL, P_GLOBAL, + &Globals.sslReqClientCert, NULL, NULL, 0}, + {"ssl require servercert", P_BOOL, P_GLOBAL, + &Globals.sslReqServerCert, NULL, NULL, 0}, + {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, + 0}, + {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, + enum_ssl_version, 0}, + {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, + NULL, NULL, 0}, +#endif /* WITH_SSL */ + + {"Logging Options", P_SEP, P_SEPARATOR}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, + NULL, NULL, 0}, + {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, + NULL, 0}, + {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, + NULL, 0}, + {"debug hires timestamp", P_BOOL, P_GLOBAL, + &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, + {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, + {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, + + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, + FLAG_GLOBAL | FLAG_SHARE | FLAG_PRINT}, + + {"Protocol Options", P_SEP, P_SEPARATOR}, + + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, + enum_protocol, 0}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + + {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, + NULL, NULL, 0}, + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, + NULL, 0}, + {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, + NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, + NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, + enum_announce_as, 0}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + + {"name resolve order", P_STRING, P_GLOBAL, + &Globals.szNameResolveOrder, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, + 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, + 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, + NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, + NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, + 0}, + + {"Tuning Options", P_SEP, P_SEPARATOR}, + + {"change notify timeout", P_INTEGER, P_GLOBAL, + &Globals.change_notify_timeout, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, + NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, + NULL, NULL, FLAG_SHARE}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, + NULL, 0}, + {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, + NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, + NULL, NULL, FLAG_PRINT}, + {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, + NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, + NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, + NULL, 0}, + {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, + NULL, NULL, 0}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, + FLAG_SHARE}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, + FLAG_SHARE}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, + NULL, NULL, FLAG_SHARE}, + + {"Printing Options", P_SEP, P_SEPARATOR}, + + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, + NULL, NULL, FLAG_PRINT}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, + NULL, FLAG_PRINT}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, + 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, + NULL, NULL, FLAG_PRINT}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, + FLAG_PRINT}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, + NULL, FLAG_PRINT}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, + enum_printing, FLAG_PRINT | FLAG_GLOBAL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, + NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, + FLAG_PRINT | FLAG_GLOBAL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, + NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, + NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, + NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, + &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, + &sDefault.szQueueresumecommand, NULL, NULL, + FLAG_PRINT | FLAG_GLOBAL}, + + + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, + NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, + 0}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, + NULL, FLAG_PRINT}, + {"printer driver location", P_STRING, P_LOCAL, + &sDefault.szPrinterDriverLocation, NULL, NULL, + FLAG_PRINT | FLAG_GLOBAL}, + {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, + FLAG_GLOBAL}, + {"nt printer driver", P_STRING, P_GLOBAL, &Globals.szNtDriverFile, + NULL, NULL, FLAG_GLOBAL}, + + + {"Filename Handling", P_SEP, P_SEPARATOR}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, + handle_character_set, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, + NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, + enum_case, FLAG_SHARE}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, + NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, + NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, + NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, + NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, + + {"Domain Options", P_SEP, P_SEPARATOR}, + + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, + NULL, NULL, 0}, + {"domain admin group", P_STRING, P_GLOBAL, + &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group", P_STRING, P_GLOBAL, + &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {"domain admin users", P_STRING, P_GLOBAL, + &Globals.szDomainAdminUsers, NULL, NULL, 0}, + {"domain guest users", P_STRING, P_GLOBAL, + &Globals.szDomainGuestUsers, NULL, NULL, 0}, #ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, + + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, + NULL, NULL, 0}, #endif /* USING_GROUPNAME_MAP */ - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, - - {"Logon Options", P_SEP, P_SEPARATOR}, - {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, - {"delete user script",P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_DOS_STRING}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_DOS_STRING}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_DOS_STRING}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, - - {"Browse Options", P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_lm_announce, 0}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, FLAG_BASIC}, - {"prefered master", P_BOOL, P_GLOBAL, &Globals.bPreferredMaster, NULL, NULL, 0}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {"domain master", P_BOOL, P_GLOBAL, &Globals.bDomainMaster, NULL, NULL, FLAG_BASIC}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, - - {"WINS Options", P_SEP, P_SEPARATOR}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, - {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, - - {"Locking Options", P_SEP, P_SEPARATOR}, - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, - {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + + {"machine password timeout", P_INTEGER, P_GLOBAL, + &Globals.machine_password_timeout, NULL, NULL, 0}, + + {"Logon Options", P_SEP, P_SEPARATOR}, + + {"add user script", P_STRING, P_GLOBAL, + &Globals.szAddUserScript, NULL, NULL, 0}, + {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, + NULL, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, + NULL, FLAG_DOS_STRING}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, + FLAG_DOS_STRING}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, + 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, + FLAG_DOS_STRING}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, + NULL, 0}, + + {"Browse Options", P_SEP, P_SEPARATOR}, + + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, + NULL, FLAG_BASIC}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, + enum_bool_auto, 0}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, + 0}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, + NULL, enum_bool_auto, FLAG_BASIC}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, + enum_bool_auto, FLAG_HIDE}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, + FLAG_BASIC}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, + enum_bool_auto, FLAG_BASIC}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, + 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, + FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + + {"WINS Options", P_SEP, P_SEPARATOR}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, + NULL, NULL, FLAG_BASIC}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, + FLAG_BASIC}, + {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, + + {"Locking Options", P_SEP, P_SEPARATOR}, + + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, + NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, + FLAG_SHARE}, + {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, + NULL, FLAG_GLOBAL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_UTMP - {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + + {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, #endif - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"oplock break wait time",P_INTEGER,P_GLOBAL,&Globals.oplock_break_wait_time,NULL,NULL,FLAG_GLOBAL}, - {"oplock contention limit",P_INTEGER,P_LOCAL,&sDefault.iOplockContentionLimit,NULL,NULL,FLAG_SHARE|FLAG_GLOBAL}, - {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"oplock break wait time", P_INTEGER, P_GLOBAL, + &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, + {"oplock contention limit", P_INTEGER, P_LOCAL, + &sDefault.iOplockContentionLimit, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_LDAP - {"Ldap Options", P_SEP, P_SEPARATOR}, - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, - {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, - {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword,NULL, NULL, 0}, + {"Ldap Options", P_SEP, P_SEPARATOR}, + + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, + NULL, NULL, 0}, + {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, + NULL, NULL, 0}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, + 0}, + {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, + + {"ldap root passwd", P_STRING, P_GLOBAL, + &Globals.szLdapRootPassword, NULL, NULL, 0}, #endif /* WITH_LDAP */ - {"Miscellaneous Options", P_SEP, P_SEPARATOR}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, + + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, + NULL, NULL, FLAG_HIDE}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, + 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, + NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, + NULL, NULL, 0}, #ifdef WITH_UTMP - {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, + NULL, NULL, 0}, #endif /* WITH_UTMP */ - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, - {"remote browse sync",P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync,NULL, NULL, 0}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, - {"-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_SHARE|FLAG_PRINT}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose,NULL, NULL, FLAG_SHARE}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, - {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, - {"source environment",P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env,NULL,0}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"dos filetime resolution",P_BOOL,P_LOCAL,&sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - - {"fake directory create times", P_BOOL,P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, - - {"VFS options", P_SEP, P_SEPARATOR}, - - {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, - {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, - - {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, - - {"Winbind options", P_SEP, P_SEPARATOR}, - - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, - {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, - {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, - {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, - - {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} + + {"default service", P_STRING, P_GLOBAL, + &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, + 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, + NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, + 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, + handle_valid_chars, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, + NULL, NULL, 0}, + {"remote browse sync", P_STRING, P_GLOBAL, + &Globals.szRemoteBrowseSync, NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, + NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, + NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, + 0}, + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, + NULL, 0}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, + 0}, + {"-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_SHARE | FLAG_PRINT}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + + {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, + NULL, NULL, FLAG_SHARE}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, + FLAG_SHARE | FLAG_PRINT}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, + NULL, FLAG_SHARE | FLAG_PRINT}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, + NULL, NULL, FLAG_SHARE}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, + NULL, FLAG_SHARE | FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, + FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, + FLAG_SHARE}, + {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, + FLAG_SHARE}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, + NULL, FLAG_SHARE}, + {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, + handle_source_env, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, + NULL, FLAG_SHARE}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, + NULL, FLAG_SHARE}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, + NULL, FLAG_SHARE}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, + NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetime resolution", P_BOOL, P_LOCAL, + &sDefault.bDosFiletimeResolution, NULL, NULL, + FLAG_SHARE | FLAG_GLOBAL}, + + + {"fake directory create times", P_BOOL, P_LOCAL, + &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, + NULL, 0}, + + {"VFS options", P_SEP, P_SEPARATOR}, + + + {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, + handle_vfs_object, NULL, 0}, + {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, + 0}, + + + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, + NULL, FLAG_SHARE}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, + FLAG_GLOBAL}, + + {"Winbind options", P_SEP, P_SEPARATOR}, + + + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, + handle_winbind_id, NULL, 0}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, + handle_winbind_id, NULL, 0}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, + NULL, NULL, 0}, + {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, + NULL, 0}, + {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, + NULL, NULL, 0}, + {"winbind cache time", P_INTEGER, P_GLOBAL, + &Globals.winbind_cache_time, NULL, NULL, 0}, + + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -908,147 +1212,148 @@ Initialise the global parameter structure. ***************************************************************************/ static void init_globals(void) { - static BOOL done_init = False; - pstring s; - - if (!done_init) - { - int i; - memset((void *)&Globals,'\0',sizeof(Globals)); - - for (i = 0; parm_table[i].label; i++) - if ((parm_table[i].type == P_STRING || - parm_table[i].type == P_USTRING) && - parm_table[i].ptr) - string_set(parm_table[i].ptr,""); - - string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); - string_set(&sDefault.szPrinterDriver, "NULL"); - string_set(&sDefault.fstype, FSTYPE_STRING); - - done_init = True; - } - - - DEBUG(3,("Initialising global parameters\n")); - - string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); - /* - * Allow the default PASSWD_CHAT to be overridden in local.h. - */ - string_set(&Globals.szPasswdChat,DEFAULT_PASSWD_CHAT); - string_set(&Globals.szWorkGroup, WORKGROUP); - string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); - string_set(&Globals.szPrintcapname, PRINTCAP_NAME); - string_set(&Globals.szDriverFile, DRIVERFILE); - string_set(&Globals.szNtForms, FORMSFILE); - string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); - string_set(&Globals.szLockDir, LOCKDIR); - string_set(&Globals.szRootdir, "/"); + static BOOL done_init = False; + pstring s; + + if (!done_init) + { + int i; + memset((void *)&Globals, '\0', sizeof(Globals)); + + for (i = 0; parm_table[i].label; i++) + if ((parm_table[i].type == P_STRING || + parm_table[i].type == P_USTRING) && + parm_table[i].ptr) + string_set(parm_table[i].ptr, ""); + + string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); + string_set(&sDefault.szPrinterDriver, "NULL"); + string_set(&sDefault.fstype, FSTYPE_STRING); + + done_init = True; + } + + + DEBUG(3, ("Initialising global parameters\n")); + + string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); + /* + * Allow the default PASSWD_CHAT to be overridden in local.h. + */ + string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT); + string_set(&Globals.szWorkGroup, WORKGROUP); + string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); + string_set(&Globals.szPrintcapname, PRINTCAP_NAME); + string_set(&Globals.szDriverFile, DRIVERFILE); + string_set(&Globals.szNtForms, FORMSFILE); + string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); + string_set(&Globals.szLockDir, LOCKDIR); + string_set(&Globals.szRootdir, "/"); #ifdef WITH_UTMP - string_set(&Globals.szUtmpDir, ""); + string_set(&Globals.szUtmpDir, ""); #endif /* WITH_UTMP */ - string_set(&Globals.szSmbrun, SMBRUN); - string_set(&Globals.szSocketAddress, "0.0.0.0"); - pstrcpy(s, "Samba "); - pstrcat(s, VERSION); - string_set(&Globals.szServerString,s); - slprintf(s,sizeof(s)-1, "%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); - string_set(&Globals.szAnnounceVersion,s); - - pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); - - string_set(&Globals.szLogonDrive, ""); - /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ - string_set(&Globals.szLogonHome, "\\\\%N\\%U"); - string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); - - string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); - - Globals.bLoadPrinters = True; - Globals.bUseRhosts = False; - Globals.max_packet = 65535; - Globals.mangled_stack = 50; - Globals.max_xmit = 65535; - Globals.max_mux = 50; /* This is *needed* for profile support. */ - Globals.lpqcachetime = 10; - Globals.pwordlevel = 0; - Globals.unamelevel = 0; - Globals.deadtime = 0; - Globals.max_log_size = 5000; - Globals.max_open_files = MAX_OPEN_FILES; - Globals.maxprotocol = PROTOCOL_NT1; - Globals.security = SEC_USER; - Globals.bEncryptPasswords = False; - Globals.bUpdateEncrypt = False; - Globals.bReadRaw = True; - Globals.bWriteRaw = True; - Globals.bReadPrediction = False; - Globals.bReadbmpx = False; - Globals.bNullPasswords = False; - Globals.bStripDot = False; - Globals.syslog = 1; - Globals.bSyslogOnly = False; - Globals.bTimestampLogs = False; - Globals.bDebugHiresTimestamp = False; - Globals.bDebugPid = False; - Globals.bDebugUid = False; - Globals.max_ttl = 60*60*24*3; /* 3 days default. */ - Globals.max_wins_ttl = 60*60*24*6; /* 6 days default. */ - Globals.min_wins_ttl = 60*60*6; /* 6 hours default. */ - Globals.machine_password_timeout = 60*60*24*7; /* 7 days default. */ - Globals.change_notify_timeout = 60; /* 1 minute default. */ - Globals.ReadSize = 16*1024; - Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ - Globals.lm_interval = 60; - Globals.shmem_size = SHMEM_SIZE; - Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ - Globals.announce_as = ANNOUNCE_AS_NT_SERVER; - Globals.bUnixRealname = True; + string_set(&Globals.szSmbrun, SMBRUN); + string_set(&Globals.szSocketAddress, "0.0.0.0"); + pstrcpy(s, "Samba "); + pstrcat(s, VERSION); + string_set(&Globals.szServerString, s); + slprintf(s, sizeof(s) - 1, "%d.%d", DEFAULT_MAJOR_VERSION, + DEFAULT_MINOR_VERSION); + string_set(&Globals.szAnnounceVersion, s); + + pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); + + string_set(&Globals.szLogonDrive, ""); + /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ + string_set(&Globals.szLogonHome, "\\\\%N\\%U"); + string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); + + string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); + + Globals.bLoadPrinters = True; + Globals.bUseRhosts = False; + Globals.max_packet = 65535; + Globals.mangled_stack = 50; + Globals.max_xmit = 65535; + Globals.max_mux = 50; /* This is *needed* for profile support. */ + Globals.lpqcachetime = 10; + Globals.pwordlevel = 0; + Globals.unamelevel = 0; + Globals.deadtime = 0; + Globals.max_log_size = 5000; + Globals.max_open_files = MAX_OPEN_FILES; + Globals.maxprotocol = PROTOCOL_NT1; + Globals.security = SEC_USER; + Globals.bEncryptPasswords = False; + Globals.bUpdateEncrypt = False; + Globals.bReadRaw = True; + Globals.bWriteRaw = True; + Globals.bReadPrediction = False; + Globals.bReadbmpx = False; + Globals.bNullPasswords = False; + Globals.bStripDot = False; + Globals.syslog = 1; + Globals.bSyslogOnly = False; + Globals.bTimestampLogs = False; + Globals.bDebugHiresTimestamp = False; + Globals.bDebugPid = False; + Globals.bDebugUid = False; + Globals.max_ttl = 60 * 60 * 24 * 3; /* 3 days default. */ + Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */ + Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */ + Globals.machine_password_timeout = 60 * 60 * 24 * 7; /* 7 days default. */ + Globals.change_notify_timeout = 60; /* 1 minute default. */ + Globals.ReadSize = 16 * 1024; + Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ + Globals.lm_interval = 60; + Globals.shmem_size = SHMEM_SIZE; + Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ + Globals.announce_as = ANNOUNCE_AS_NT_SERVER; + Globals.bUnixRealname = True; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) - Globals.bNISHomeMap = False; + Globals.bNISHomeMap = False; #ifdef WITH_NISPLUS_HOME - string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); + string_set(&Globals.szNISHomeMapName, "auto_home.org_dir"); #else - string_set(&Globals.szNISHomeMapName, "auto.home"); + string_set(&Globals.szNISHomeMapName, "auto.home"); #endif #endif - Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; - Globals.bTimeServer = False; - Globals.bBindInterfacesOnly = False; - Globals.bUnixPasswdSync = False; - Globals.bPasswdChatDebug = False; - Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ - Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ - Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ - Globals.bStatCache = True; /* use stat cache by default */ - Globals.bRestrictAnonymous = False; - Globals.map_to_guest = 0; /* By Default, "Never" */ - Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ - Globals.oplock_break_wait_time = 10; /* By Default, 10 msecs. */ + Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; + Globals.bTimeServer = False; + Globals.bBindInterfacesOnly = False; + Globals.bUnixPasswdSync = False; + Globals.bPasswdChatDebug = False; + Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ + Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ + Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ + Globals.bStatCache = True; /* use stat cache by default */ + Globals.bRestrictAnonymous = False; + Globals.map_to_guest = 0; /* By Default, "Never" */ + Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ + Globals.oplock_break_wait_time = 10; /* By Default, 10 msecs. */ #ifdef WITH_LDAP - /* default values for ldap */ - string_set(&Globals.szLdapServer, "localhost"); - Globals.ldap_port=389; + /* default values for ldap */ + string_set(&Globals.szLdapServer, "localhost"); + Globals.ldap_port = 389; #endif /* WITH_LDAP */ #ifdef WITH_SSL - Globals.sslVersion = SMB_SSL_V23; - string_set(&Globals.sslHostsRequire, ""); - string_set(&Globals.sslHostsResign, ""); - string_set(&Globals.sslCaCertDir, ""); - string_set(&Globals.sslCaCertFile, ""); - string_set(&Globals.sslCert, ""); - string_set(&Globals.sslPrivKey, ""); - string_set(&Globals.sslClientCert, ""); - string_set(&Globals.sslClientPrivKey, ""); - string_set(&Globals.sslCiphers, ""); - Globals.sslEnabled = False; - Globals.sslReqClientCert = False; - Globals.sslReqServerCert = False; - Globals.sslCompatibility = False; -#endif /* WITH_SSL */ + Globals.sslVersion = SMB_SSL_V23; + string_set(&Globals.sslHostsRequire, ""); + string_set(&Globals.sslHostsResign, ""); + string_set(&Globals.sslCaCertDir, ""); + string_set(&Globals.sslCaCertFile, ""); + string_set(&Globals.sslCert, ""); + string_set(&Globals.sslPrivKey, ""); + string_set(&Globals.sslClientCert, ""); + string_set(&Globals.sslClientPrivKey, ""); + string_set(&Globals.sslCiphers, ""); + Globals.sslEnabled = False; + Globals.sslReqClientCert = False; + Globals.sslReqServerCert = False; + Globals.sslCompatibility = False; +#endif /* WITH_SSL */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1062,36 +1367,36 @@ static void init_globals(void) */ - Globals.os_level = 20; - Globals.bPreferredMaster = False; - Globals.bLocalMaster = True; - Globals.bDomainMaster = False; - Globals.bDomainLogons = False; - Globals.bBrowseList = True; - Globals.bWINSsupport = False; - Globals.bWINSproxy = False; + Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */ + Globals.os_level = 20; + Globals.bLocalMaster = True; + Globals.bDomainMaster = Auto; /* depending on bDomainLogons */ + Globals.bDomainLogons = False; + Globals.bBrowseList = True; + Globals.bWINSsupport = False; + Globals.bWINSproxy = False; - Globals.bDNSproxy = True; + Globals.bDNSproxy = True; - /* - * smbd will check at runtime to see if this value - * will really be used or not. - */ - Globals.bKernelOplocks = True; + /* + * smbd will check at runtime to see if this value + * will really be used or not. + */ + Globals.bKernelOplocks = True; - Globals.bAllowTrustedDomains = True; + Globals.bAllowTrustedDomains = True; - string_set(&Globals.szTemplateShell, "/bin/false"); - string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); - string_set(&Globals.szWinbindSeparator, "\\"); - Globals.winbind_cache_time = 15; + string_set(&Globals.szTemplateShell, "/bin/false"); + string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); + string_set(&Globals.szWinbindSeparator, "\\"); + Globals.winbind_cache_time = 15; - /* - * This must be done last as it checks the value in - * client_code_page. - */ + /* + * This must be done last as it checks the value in + * client_code_page. + */ - interpret_coding_system(KANJI); + interpret_coding_system(KANJI); } /*************************************************************************** @@ -1099,63 +1404,83 @@ Initialise the sDefault parameter structure. ***************************************************************************/ static void init_locals(void) { - /* choose defaults depending on the type of printing */ - switch (sDefault.iPrinting) - { - case PRINT_BSD: - case PRINT_AIX: - string_set(&sDefault.szLpqcommand,"lpq -P%p"); - string_set(&sDefault.szLprmcommand,"lprm -P%p %j"); - string_set(&sDefault.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"); - break; - - case PRINT_CUPS: - 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 -oraw %s; rm %s"); - string_set(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); - string_set(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); - 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"); + /* choose defaults depending on the type of printing */ + switch (sDefault.iPrinting) + { + case PRINT_BSD: + case PRINT_AIX: + string_set(&sDefault.szLpqcommand, "lpq -P%p"); + string_set(&sDefault.szLprmcommand, "lprm -P%p %j"); + string_set(&sDefault.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"); + break; + + case PRINT_CUPS: + 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 -oraw %s; rm %s"); + string_set(&sDefault.szQueuepausecommand, + "/usr/bin/disable %p"); + string_set(&sDefault.szQueueresumecommand, + "/usr/bin/enable %p"); + 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"); #ifndef HPUX - string_set(&sDefault.szLppausecommand,"lp -i %p-%j -H hold"); - string_set(&sDefault.szLpresumecommand,"lp -i %p-%j -H resume"); + string_set(&sDefault.szLppausecommand, + "lp -i %p-%j -H hold"); + string_set(&sDefault.szLpresumecommand, + "lp -i %p-%j -H resume"); #endif /* SYSV */ - break; + 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"); + 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"); - break; + case PRINT_SOFTQ: + string_set(&sDefault.szLpqcommand, "qstat -l -d%p"); + string_set(&sDefault.szLprmcommand, + "qstat -s -j%j -c"); + string_set(&sDefault.szPrintcommand, + "lp -d%p -s %s; rm %s"); + string_set(&sDefault.szLppausecommand, + "qstat -s -j%j -h"); + string_set(&sDefault.szLpresumecommand, + "qstat -s -j%j -r"); + break; - case PRINT_SOFTQ: - string_set(&sDefault.szLpqcommand,"qstat -l -d%p"); - string_set(&sDefault.szLprmcommand,"qstat -s -j%j -c"); - string_set(&sDefault.szPrintcommand,"lp -d%p -s %s; rm %s"); - string_set(&sDefault.szLppausecommand,"qstat -s -j%j -h"); - string_set(&sDefault.szLpresumecommand,"qstat -s -j%j -r"); - break; - - } + } } static TALLOC_CTX *lp_talloc; @@ -1165,7 +1490,8 @@ free up temporary memory - called from the main loop ********************************************************************/ void lp_talloc_free(void) { - if (!lp_talloc) return; + if (!lp_talloc) + return; talloc_destroy(lp_talloc); lp_talloc = NULL; } @@ -1177,24 +1503,26 @@ callers without affecting the source string. ********************************************************************/ static char *lp_string(const char *s) { - size_t len = s?strlen(s):0; + size_t len = s ? strlen(s) : 0; char *ret; - if (!lp_talloc) lp_talloc = talloc_init(); - - ret = (char *)talloc(lp_talloc, len + 100); /* leave room for substitution */ + if (!lp_talloc) + lp_talloc = talloc_init(); + + ret = (char *)talloc(lp_talloc, len + 100); /* leave room for substitution */ - if (!ret) return NULL; + if (!ret) + return NULL; - if (!s) + if (!s) *ret = 0; else - StrnCpy(ret,s,len); + StrnCpy(ret, s, len); trim_string(ret, "\"", "\""); standard_sub_basic(ret); - return(ret); + return (ret); } @@ -1221,362 +1549,364 @@ static char *lp_string(const char *s) #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} -FN_GLOBAL_STRING(lp_logfile,&Globals.szLogFile) -FN_GLOBAL_STRING(lp_smbrun,&Globals.szSmbrun) -FN_GLOBAL_STRING(lp_configfile,&Globals.szConfigFile) -FN_GLOBAL_STRING(lp_smb_passwd_file,&Globals.szSMBPasswdFile) -FN_GLOBAL_STRING(lp_serverstring,&Globals.szServerString) -FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname) -FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) +FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) +FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun) +FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) +FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) +FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) +FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) +FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP -FN_GLOBAL_STRING(lp_utmpdir,&Globals.szUtmpDir) + FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) #endif /* WITH_UTMP */ -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_hosts_equiv,&Globals.szHostsEquiv) -FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) -FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) -FN_GLOBAL_STRING(lp_passwd_chat,&Globals.szPasswdChat) -FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) -FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) -FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) -FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) + 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_hosts_equiv, &Globals.szHostsEquiv) +FN_GLOBAL_STRING(lp_auto_services, &Globals.szAutoServices) +FN_GLOBAL_STRING(lp_passwd_program, &Globals.szPasswdProgram) +FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) +FN_GLOBAL_STRING(lp_passwordserver, &Globals.szPasswordServer) +FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) +FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) +FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) #ifdef USING_GROUPNAME_MAP -FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) + FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) #endif /* USING_GROUPNAME_MAP */ -FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) -FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) -FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) -FN_GLOBAL_STRING(lp_logon_home,&Globals.szLogonHome) -FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce) -FN_GLOBAL_STRING(lp_remote_browse_sync,&Globals.szRemoteBrowseSync) -FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) -FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) -FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) -FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) -static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) -FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) -FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) -FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) -FN_GLOBAL_STRING(lp_adduser_script,&Globals.szAddUserScript) -FN_GLOBAL_STRING(lp_deluser_script,&Globals.szDelUserScript) -FN_GLOBAL_STRING(lp_wins_hook,&Globals.szWINSHook) - -FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) -FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) -FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) -FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) -FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) - -FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms) -FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile) - -FN_GLOBAL_STRING(lp_winbind_uid,&Globals.szWinbindUID) -FN_GLOBAL_STRING(lp_winbind_gid,&Globals.szWinbindGID) -FN_GLOBAL_STRING(lp_template_homedir,&Globals.szTemplateHomedir) -FN_GLOBAL_STRING(lp_template_shell,&Globals.szTemplateShell) -FN_GLOBAL_STRING(lp_winbind_separator,&Globals.szWinbindSeparator) - + FN_GLOBAL_STRING(lp_logon_script, &Globals.szLogonScript) +FN_GLOBAL_STRING(lp_logon_path, &Globals.szLogonPath) +FN_GLOBAL_STRING(lp_logon_drive, &Globals.szLogonDrive) +FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome) +FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce) +FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync) +FN_GLOBAL_STRING(lp_wins_server, &Globals.szWINSserver) +FN_GLOBAL_STRING(lp_interfaces, &Globals.szInterfaces) +FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) +FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) + static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) + FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) +FN_GLOBAL_STRING(lp_driverfile, &Globals.szDriverFile) +FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) +FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) +FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) +FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) +FN_GLOBAL_STRING(lp_domain_groups, &Globals.szDomainGroups) +FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) +FN_GLOBAL_STRING(lp_domain_guest_group, &Globals.szDomainGuestGroup) +FN_GLOBAL_STRING(lp_domain_admin_users, &Globals.szDomainAdminUsers) +FN_GLOBAL_STRING(lp_domain_guest_users, &Globals.szDomainGuestUsers) +FN_GLOBAL_STRING(lp_nt_forms, &Globals.szNtForms) +FN_GLOBAL_STRING(lp_nt_drivers_file, &Globals.szNtDriverFile) +FN_GLOBAL_STRING(lp_winbind_uid, &Globals.szWinbindUID) +FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) +FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) +FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) +FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) #ifdef WITH_LDAP -FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); -FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix); -FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter); -FN_GLOBAL_STRING(lp_ldap_root,&Globals.szLdapRoot); -FN_GLOBAL_STRING(lp_ldap_rootpasswd,&Globals.szLdapRootPassword); +FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer); +FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix); +FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter); +FN_GLOBAL_STRING(lp_ldap_root, &Globals.szLdapRoot); +FN_GLOBAL_STRING(lp_ldap_rootpasswd, &Globals.szLdapRootPassword); #endif /* WITH_LDAP */ #ifdef WITH_SSL -FN_GLOBAL_INTEGER(lp_ssl_version,&Globals.sslVersion); -FN_GLOBAL_STRING(lp_ssl_hosts,&Globals.sslHostsRequire); -FN_GLOBAL_STRING(lp_ssl_hosts_resign,&Globals.sslHostsResign); -FN_GLOBAL_STRING(lp_ssl_cacertdir,&Globals.sslCaCertDir); -FN_GLOBAL_STRING(lp_ssl_cacertfile,&Globals.sslCaCertFile); -FN_GLOBAL_STRING(lp_ssl_cert,&Globals.sslCert); -FN_GLOBAL_STRING(lp_ssl_privkey,&Globals.sslPrivKey); -FN_GLOBAL_STRING(lp_ssl_client_cert,&Globals.sslClientCert); -FN_GLOBAL_STRING(lp_ssl_client_privkey,&Globals.sslClientPrivKey); -FN_GLOBAL_STRING(lp_ssl_ciphers,&Globals.sslCiphers); -FN_GLOBAL_BOOL(lp_ssl_enabled,&Globals.sslEnabled); -FN_GLOBAL_BOOL(lp_ssl_reqClientCert,&Globals.sslReqClientCert); -FN_GLOBAL_BOOL(lp_ssl_reqServerCert,&Globals.sslReqServerCert); -FN_GLOBAL_BOOL(lp_ssl_compatibility,&Globals.sslCompatibility); -#endif /* WITH_SSL */ - -FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy) -FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport) -FN_GLOBAL_BOOL(lp_we_are_a_wins_server,&Globals.bWINSsupport) -FN_GLOBAL_BOOL(lp_wins_proxy,&Globals.bWINSproxy) -FN_GLOBAL_BOOL(lp_local_master,&Globals.bLocalMaster) -FN_GLOBAL_BOOL(lp_domain_master,&Globals.bDomainMaster) -FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) -FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) -FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) -FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) -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_writeraw,&Globals.bWriteRaw) -FN_GLOBAL_BOOL(lp_null_passwords,&Globals.bNullPasswords) -FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot) -FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords) -FN_GLOBAL_BOOL(lp_update_encrypted,&Globals.bUpdateEncrypt) -FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly) -FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) -FN_GLOBAL_BOOL(lp_debug_hires_timestamp,&Globals.bDebugHiresTimestamp) -FN_GLOBAL_BOOL(lp_debug_pid,&Globals.bDebugPid) -FN_GLOBAL_BOOL(lp_debug_uid,&Globals.bDebugUid) -FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) -FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) -FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) -static FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) -FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) -FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) -FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug) -FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport) -FN_GLOBAL_BOOL(lp_nt_pipe_support,&Globals.bNTPipeSupport) -FN_GLOBAL_BOOL(lp_nt_acl_support,&Globals.bNTAclSupport) -FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache) -FN_GLOBAL_BOOL(lp_allow_trusted_domains,&Globals.bAllowTrustedDomains) -FN_GLOBAL_BOOL(lp_restrict_anonymous,&Globals.bRestrictAnonymous) -FN_GLOBAL_BOOL(lp_host_msdfs,&Globals.bHostMSDfs) -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_min_wins_ttl,&Globals.max_wins_ttl) -FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) -FN_GLOBAL_INTEGER(lp_max_open_files,&Globals.max_open_files) -FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) -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_shmem_size,&Globals.shmem_size) -FN_GLOBAL_INTEGER(lp_deadtime,&Globals.deadtime) -FN_GLOBAL_INTEGER(lp_maxprotocol,&Globals.maxprotocol) -FN_GLOBAL_INTEGER(lp_security,&Globals.security) -FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) -FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) -FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) -FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) -static FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) -FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) -FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) -FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) -FN_GLOBAL_INTEGER(lp_change_notify_timeout,&Globals.change_notify_timeout) -FN_GLOBAL_INTEGER(lp_stat_cache_size,&Globals.stat_cache_size) -FN_GLOBAL_INTEGER(lp_map_to_guest,&Globals.map_to_guest) -FN_GLOBAL_INTEGER(lp_min_passwd_length,&Globals.min_passwd_length) -FN_GLOBAL_INTEGER(lp_oplock_break_wait_time,&Globals.oplock_break_wait_time) +FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion); +FN_GLOBAL_STRING(lp_ssl_hosts, &Globals.sslHostsRequire); +FN_GLOBAL_STRING(lp_ssl_hosts_resign, &Globals.sslHostsResign); +FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir); +FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile); +FN_GLOBAL_STRING(lp_ssl_cert, &Globals.sslCert); +FN_GLOBAL_STRING(lp_ssl_privkey, &Globals.sslPrivKey); +FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert); +FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey); +FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers); +FN_GLOBAL_BOOL(lp_ssl_enabled, &Globals.sslEnabled); +FN_GLOBAL_BOOL(lp_ssl_reqClientCert, &Globals.sslReqClientCert); +FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert); +FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility); +#endif /* WITH_SSL */ +FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) +FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport) +FN_GLOBAL_BOOL(lp_we_are_a_wins_server, &Globals.bWINSsupport) +FN_GLOBAL_BOOL(lp_wins_proxy, &Globals.bWINSproxy) +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_use_rhosts, &Globals.bUseRhosts) +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_writeraw, &Globals.bWriteRaw) +FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) +FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) +FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) +FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) +FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) +FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) +FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) +FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) +FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) +FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) +FN_GLOBAL_BOOL(lp_unix_realname, &Globals.bUnixRealname) +FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) + static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) + FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) +FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) +FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) +FN_GLOBAL_BOOL(lp_nt_smb_support, &Globals.bNTSmbSupport) +FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport) +FN_GLOBAL_BOOL(lp_nt_acl_support, &Globals.bNTAclSupport) +FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) +FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) +FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) +FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) +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_min_wins_ttl, &Globals.max_wins_ttl) +FN_GLOBAL_INTEGER(lp_max_log_size, &Globals.max_log_size) +FN_GLOBAL_INTEGER(lp_max_open_files, &Globals.max_open_files) +FN_GLOBAL_INTEGER(lp_maxxmit, &Globals.max_xmit) +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_shmem_size, &Globals.shmem_size) +FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime) +FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) +FN_GLOBAL_INTEGER(lp_security, &Globals.security) +FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) +FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) +FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) +FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) + static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) + FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) +FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) +FN_GLOBAL_INTEGER(lp_machine_password_timeout, + &Globals. + machine_password_timeout) +FN_GLOBAL_INTEGER(lp_change_notify_timeout, + &Globals. + change_notify_timeout) FN_GLOBAL_INTEGER(lp_stat_cache_size, + &Globals. + stat_cache_size) +FN_GLOBAL_INTEGER(lp_map_to_guest, + &Globals. + map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, + &Globals. + min_passwd_length) +FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) #ifdef WITH_LDAP -FN_GLOBAL_INTEGER(lp_ldap_port,&Globals.ldap_port) -#endif /* WITH_LDAP */ - -FN_LOCAL_STRING(lp_preexec,szPreExec) -FN_LOCAL_STRING(lp_postexec,szPostExec) -FN_LOCAL_STRING(lp_rootpreexec,szRootPreExec) -FN_LOCAL_STRING(lp_rootpostexec,szRootPostExec) -FN_LOCAL_STRING(lp_servicename,szService) -FN_LOCAL_STRING(lp_pathname,szPath) -FN_LOCAL_STRING(lp_dontdescend,szDontdescend) -FN_LOCAL_STRING(lp_username,szUsername) -FN_LOCAL_STRING(lp_guestaccount,szGuestaccount) -FN_LOCAL_STRING(lp_invalid_users,szInvalidUsers) -FN_LOCAL_STRING(lp_valid_users,szValidUsers) -FN_LOCAL_STRING(lp_admin_users,szAdminUsers) -FN_LOCAL_STRING(lp_printcommand,szPrintcommand) -FN_LOCAL_STRING(lp_lpqcommand,szLpqcommand) -FN_LOCAL_STRING(lp_lprmcommand,szLprmcommand) -FN_LOCAL_STRING(lp_lppausecommand,szLppausecommand) -FN_LOCAL_STRING(lp_lpresumecommand,szLpresumecommand) -FN_LOCAL_STRING(lp_queuepausecommand,szQueuepausecommand) -FN_LOCAL_STRING(lp_queueresumecommand,szQueueresumecommand) -FN_LOCAL_STRING(lp_printername,szPrintername) -FN_LOCAL_STRING(lp_printerdriver,szPrinterDriver) -FN_LOCAL_STRING(lp_hostsallow,szHostsallow) -FN_LOCAL_STRING(lp_hostsdeny,szHostsdeny) -FN_LOCAL_STRING(lp_magicscript,szMagicScript) -FN_LOCAL_STRING(lp_magicoutput,szMagicOutput) -FN_LOCAL_STRING(lp_comment,comment) -FN_LOCAL_STRING(lp_force_user,force_user) -FN_LOCAL_STRING(lp_force_group,force_group) -FN_LOCAL_STRING(lp_readlist,readlist) -FN_LOCAL_STRING(lp_writelist,writelist) -FN_LOCAL_STRING(lp_fstype,fstype) -FN_LOCAL_STRING(lp_vfsobj,szVfsObjectFile) -static FN_LOCAL_STRING(lp_volume,volume) -FN_LOCAL_STRING(lp_mangled_map,szMangledMap) -FN_LOCAL_STRING(lp_veto_files,szVetoFiles) -FN_LOCAL_STRING(lp_hide_files,szHideFiles) -FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) -FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) +FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) +#endif /* WITH_LDAP */ + FN_LOCAL_STRING(lp_preexec, szPreExec) +FN_LOCAL_STRING(lp_postexec, szPostExec) +FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) +FN_LOCAL_STRING(lp_rootpostexec, szRootPostExec) +FN_LOCAL_STRING(lp_servicename, szService) +FN_LOCAL_STRING(lp_pathname, szPath) +FN_LOCAL_STRING(lp_dontdescend, szDontdescend) +FN_LOCAL_STRING(lp_username, szUsername) +FN_LOCAL_STRING(lp_guestaccount, szGuestaccount) +FN_LOCAL_STRING(lp_invalid_users, szInvalidUsers) +FN_LOCAL_STRING(lp_valid_users, szValidUsers) +FN_LOCAL_STRING(lp_admin_users, szAdminUsers) +FN_LOCAL_STRING(lp_printcommand, szPrintcommand) +FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) +FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) +FN_LOCAL_STRING(lp_lppausecommand, szLppausecommand) +FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) +FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) +FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) +FN_LOCAL_STRING(lp_printername, szPrintername) +FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) +FN_LOCAL_STRING(lp_hostsallow, szHostsallow) +FN_LOCAL_STRING(lp_hostsdeny, szHostsdeny) +FN_LOCAL_STRING(lp_magicscript, szMagicScript) +FN_LOCAL_STRING(lp_magicoutput, szMagicOutput) +FN_LOCAL_STRING(lp_comment, comment) +FN_LOCAL_STRING(lp_force_user, force_user) +FN_LOCAL_STRING(lp_force_group, force_group) +FN_LOCAL_STRING(lp_readlist, readlist) +FN_LOCAL_STRING(lp_writelist, writelist) +FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) + static FN_LOCAL_STRING(lp_volume, volume) + FN_LOCAL_STRING(lp_mangled_map, szMangledMap) + FN_LOCAL_STRING(lp_veto_files, szVetoFiles) +FN_LOCAL_STRING(lp_hide_files, szHideFiles) +FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) +FN_LOCAL_STRING(lp_driverlocation, szPrinterDriverLocation) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) - -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_BOOL(lp_preservecase,bCasePreserve) -FN_LOCAL_BOOL(lp_shortpreservecase,bShortCasePreserve) -FN_LOCAL_BOOL(lp_casemangle,bCaseMangle) -FN_LOCAL_BOOL(lp_status,status) -FN_LOCAL_BOOL(lp_hide_dot_files,bHideDotFiles) -FN_LOCAL_BOOL(lp_browseable,bBrowseable) -FN_LOCAL_BOOL(lp_readonly,bRead_only) -FN_LOCAL_BOOL(lp_no_set_dir,bNo_set_dir) -FN_LOCAL_BOOL(lp_guest_ok,bGuest_ok) -FN_LOCAL_BOOL(lp_guest_only,bGuest_only) -FN_LOCAL_BOOL(lp_print_ok,bPrint_ok) -FN_LOCAL_BOOL(lp_postscript,bPostscript) -FN_LOCAL_BOOL(lp_map_hidden,bMap_hidden) -FN_LOCAL_BOOL(lp_map_archive,bMap_archive) -FN_LOCAL_BOOL(lp_locking,bLocking) -FN_LOCAL_BOOL(lp_strict_locking,bStrictLocking) -FN_LOCAL_BOOL(lp_posix_locking,bPosixLocking) +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_BOOL(lp_preservecase, bCasePreserve) +FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve) +FN_LOCAL_BOOL(lp_casemangle, bCaseMangle) +FN_LOCAL_BOOL(lp_status, status) +FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles) +FN_LOCAL_BOOL(lp_browseable, bBrowseable) +FN_LOCAL_BOOL(lp_readonly, bRead_only) +FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) +FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) +FN_LOCAL_BOOL(lp_guest_only, bGuest_only) +FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) +FN_LOCAL_BOOL(lp_postscript, bPostscript) +FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) +FN_LOCAL_BOOL(lp_map_archive, bMap_archive) +FN_LOCAL_BOOL(lp_locking, bLocking) +FN_LOCAL_BOOL(lp_strict_locking, bStrictLocking) +FN_LOCAL_BOOL(lp_posix_locking, bPosixLocking) #ifdef WITH_UTMP -FN_LOCAL_BOOL(lp_utmp,bUtmp) +FN_LOCAL_BOOL(lp_utmp, bUtmp) #endif -FN_LOCAL_BOOL(lp_share_modes,bShareModes) -FN_LOCAL_BOOL(lp_oplocks,bOpLocks) -FN_LOCAL_BOOL(lp_level2_oplocks,bLevel2OpLocks) -FN_LOCAL_BOOL(lp_onlyuser,bOnlyUser) -FN_LOCAL_BOOL(lp_manglednames,bMangledNames) -FN_LOCAL_BOOL(lp_widelinks,bWidelinks) -FN_LOCAL_BOOL(lp_symlinks,bSymlinks) -FN_LOCAL_BOOL(lp_syncalways,bSyncAlways) -FN_LOCAL_BOOL(lp_strict_sync,bStrictSync) -FN_LOCAL_BOOL(lp_map_system,bMap_system) -FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly) -FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks) -FN_LOCAL_BOOL(lp_recursive_veto_delete,bDeleteVetoFiles) -FN_LOCAL_BOOL(lp_dos_filetimes,bDosFiletimes) -FN_LOCAL_BOOL(lp_dos_filetime_resolution,bDosFiletimeResolution) -FN_LOCAL_BOOL(lp_fake_dir_create_times,bFakeDirCreateTimes) -FN_LOCAL_BOOL(lp_blocking_locks,bBlockingLocks) -FN_LOCAL_BOOL(lp_inherit_perms,bInheritPerms) - -FN_LOCAL_INTEGER(lp_create_mask,iCreate_mask) -FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode) -FN_LOCAL_INTEGER(_lp_security_mask,iSecurity_mask) -FN_LOCAL_INTEGER(_lp_force_security_mode,iSecurity_force_mode) -FN_LOCAL_INTEGER(lp_dir_mask,iDir_mask) -FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode) -FN_LOCAL_INTEGER(_lp_dir_security_mask,iDir_Security_mask) -FN_LOCAL_INTEGER(_lp_force_dir_security_mode,iDir_Security_force_mode) -FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections) -FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase) -FN_LOCAL_INTEGER(lp_minprintspace,iMinPrintSpace) -FN_LOCAL_INTEGER(lp_printing,iPrinting) -FN_LOCAL_INTEGER(lp_oplock_contention_limit,iOplockContentionLimit) -FN_LOCAL_INTEGER(lp_write_cache_size,iWriteCacheSize) - -FN_LOCAL_CHAR(lp_magicchar,magic_char) - - +FN_LOCAL_BOOL(lp_share_modes, bShareModes) +FN_LOCAL_BOOL(lp_oplocks, bOpLocks) +FN_LOCAL_BOOL(lp_level2_oplocks, bLevel2OpLocks) +FN_LOCAL_BOOL(lp_onlyuser, bOnlyUser) +FN_LOCAL_BOOL(lp_manglednames, bMangledNames) +FN_LOCAL_BOOL(lp_widelinks, bWidelinks) +FN_LOCAL_BOOL(lp_symlinks, bSymlinks) +FN_LOCAL_BOOL(lp_syncalways, bSyncAlways) +FN_LOCAL_BOOL(lp_strict_sync, bStrictSync) +FN_LOCAL_BOOL(lp_map_system, bMap_system) +FN_LOCAL_BOOL(lp_delete_readonly, bDeleteReadonly) +FN_LOCAL_BOOL(lp_fake_oplocks, bFakeOplocks) +FN_LOCAL_BOOL(lp_recursive_veto_delete, bDeleteVetoFiles) +FN_LOCAL_BOOL(lp_dos_filetimes, bDosFiletimes) +FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) +FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) +FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) +FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) +FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) +FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) +FN_LOCAL_INTEGER(_lp_security_mask, iSecurity_mask) +FN_LOCAL_INTEGER(_lp_force_security_mode, iSecurity_force_mode) +FN_LOCAL_INTEGER(lp_dir_mask, iDir_mask) +FN_LOCAL_INTEGER(lp_force_dir_mode, iDir_force_mode) +FN_LOCAL_INTEGER(_lp_dir_security_mask, iDir_Security_mask) +FN_LOCAL_INTEGER(_lp_force_dir_security_mode, iDir_Security_force_mode) +FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections) +FN_LOCAL_INTEGER(lp_defaultcase, iDefaultCase) +FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) +FN_LOCAL_INTEGER(lp_printing, iPrinting) +FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) +FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) +FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) - /* local prototypes */ -static int strwicmp( char *psz1, char *psz2 ); -static int map_parameter( char *pszParmName); -static BOOL set_boolean( BOOL *pb, char *pszParmValue ); -static int getservicebyname(char *pszServiceName, service *pserviceDest); -static void copy_service( service *pserviceDest, - service *pserviceSource, - BOOL *pcopymapDest ); -static BOOL service_ok(int iService); -static BOOL do_parameter(char *pszParmName, char *pszParmValue); -static BOOL do_section(char *pszSectionName); -static void init_copymap(service *pservice); + static int strwicmp(char *psz1, char *psz2); + static int map_parameter(char *pszParmName); + static BOOL set_boolean(BOOL *pb, char *pszParmValue); + static int getservicebyname(char *pszServiceName, + service * pserviceDest); + static void copy_service(service * pserviceDest, + service * pserviceSource, BOOL *pcopymapDest); + static BOOL service_ok(int iService); + static BOOL do_parameter(char *pszParmName, char *pszParmValue); + static BOOL do_section(char *pszSectionName); + static void init_copymap(service * pservice); /*************************************************************************** initialise a service to the defaults ***************************************************************************/ -static void init_service(service *pservice) + static void init_service(service * pservice) { - memset((char *)pservice,'\0',sizeof(service)); - copy_service(pservice,&sDefault,NULL); + memset((char *)pservice, '\0', sizeof(service)); + copy_service(pservice, &sDefault, NULL); } /*************************************************************************** free the dynamically allocated parts of a service struct ***************************************************************************/ -static void free_service(service *pservice) +static void free_service(service * pservice) { - int i; - if (!pservice) - return; - - if(pservice->szService) - DEBUG(5,("free_service: Freeing service %s\n", pservice->szService)); + int i; + if (!pservice) + return; + + if (pservice->szService) + DEBUG(5, + ("free_service: Freeing service %s\n", + pservice->szService)); + + string_free(&pservice->szService); + if (pservice->copymap) + { + free(pservice->copymap); + pservice->copymap = NULL; + } - string_free(&pservice->szService); - if (pservice->copymap) - { - free(pservice->copymap); - pservice->copymap = NULL; - } - - for (i=0;parm_table[i].label;i++) - if ((parm_table[i].type == P_STRING || - parm_table[i].type == P_USTRING) && - parm_table[i].class == P_LOCAL) - string_free((char **)(((char *)pservice) + PTR_DIFF(parm_table[i].ptr,&sDefault))); + for (i = 0; parm_table[i].label; i++) + if ((parm_table[i].type == P_STRING || + parm_table[i].type == P_USTRING) && + parm_table[i].class == P_LOCAL) + string_free((char **) + (((char *)pservice) + + PTR_DIFF(parm_table[i].ptr, &sDefault))); } /*************************************************************************** add a new service to the services array initialising it with the given service ***************************************************************************/ -static int add_a_service(service *pservice, char *name) +static int add_a_service(service * pservice, char *name) { - int i; - service tservice; - int num_to_alloc = iNumServices+1; - - tservice = *pservice; - - /* it might already exist */ - if (name) - { - i = getservicebyname(name,NULL); - if (i >= 0) - return(i); - } + int i; + service tservice; + int num_to_alloc = iNumServices + 1; - /* find an invalid one */ - for (i=0;ivalid) - break; + tservice = *pservice; - /* if not, then create one */ - if (i == iNumServices) - { - ServicePtrs = (service **)Realloc(ServicePtrs,sizeof(service *)*num_to_alloc); - if (ServicePtrs) - pSERVICE(iNumServices) = (service *)malloc(sizeof(service)); + /* it might already exist */ + if (name) + { + i = getservicebyname(name, NULL); + if (i >= 0) + return (i); + } - if (!ServicePtrs || !pSERVICE(iNumServices)) - return(-1); + /* find an invalid one */ + for (i = 0; i < iNumServices; i++) + if (!pSERVICE(i)->valid) + break; - iNumServices++; - } - else - free_service(pSERVICE(i)); + /* if not, then create one */ + if (i == iNumServices) + { + ServicePtrs = + (service **) Realloc(ServicePtrs, + sizeof(service *) * + num_to_alloc); + if (ServicePtrs) + pSERVICE(iNumServices) = + (service *) malloc(sizeof(service)); + + if (!ServicePtrs || !pSERVICE(iNumServices)) + return (-1); + + iNumServices++; + } + else + free_service(pSERVICE(i)); - pSERVICE(i)->valid = True; + pSERVICE(i)->valid = True; - init_service(pSERVICE(i)); - copy_service(pSERVICE(i),&tservice,NULL); - if (name) { - string_set(&iSERVICE(i).szService,name); - unix_to_dos(iSERVICE(i).szService, True); - } - return(i); + init_service(pSERVICE(i)); + copy_service(pSERVICE(i), &tservice, NULL); + if (name) + { + string_set(&iSERVICE(i).szService, name); + unix_to_dos(iSERVICE(i).szService, True); + } + return (i); } /*************************************************************************** @@ -1585,26 +1915,28 @@ from service ifrom ***************************************************************************/ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) { - int i = add_a_service(pSERVICE(iDefaultService),pszHomename); + int i = add_a_service(pSERVICE(iDefaultService), pszHomename); - if (i < 0) - return(False); + if (i < 0) + return (False); - if (!(*(iSERVICE(i).szPath)) || strequal(iSERVICE(i).szPath,lp_pathname(-1))) - string_set(&iSERVICE(i).szPath,pszHomedir); - if (!(*(iSERVICE(i).comment))) - { - pstring comment; - slprintf(comment,sizeof(comment)-1, - "Home directory of %s",pszHomename); - string_set(&iSERVICE(i).comment,comment); - } - iSERVICE(i).bAvailable = sDefault.bAvailable; - iSERVICE(i).bBrowseable = sDefault.bBrowseable; + if (!(*(iSERVICE(i).szPath)) + || strequal(iSERVICE(i).szPath, lp_pathname(-1))) + string_set(&iSERVICE(i).szPath, pszHomedir); + if (!(*(iSERVICE(i).comment))) + { + pstring comment; + slprintf(comment, sizeof(comment) - 1, + "Home directory of %s", pszHomename); + string_set(&iSERVICE(i).comment, comment); + } + iSERVICE(i).bAvailable = sDefault.bAvailable; + iSERVICE(i).bBrowseable = sDefault.bBrowseable; - DEBUG(3,("adding home directory %s at %s\n", pszHomename, pszHomedir)); + DEBUG(3, + ("adding home directory %s at %s\n", pszHomename, pszHomedir)); - return(True); + return (True); } /*************************************************************************** @@ -1612,7 +1944,7 @@ add a new service, based on an old one ***************************************************************************/ int lp_add_service(char *pszService, int iDefaultService) { - return(add_a_service(pSERVICE(iDefaultService),pszService)); + return (add_a_service(pSERVICE(iDefaultService), pszService)); } @@ -1621,31 +1953,31 @@ add the IPC service ***************************************************************************/ static BOOL lp_add_ipc(void) { - pstring comment; - int i = add_a_service(&sDefault,"IPC$"); + pstring comment; + int i = add_a_service(&sDefault, "IPC$"); - if (i < 0) - return(False); + if (i < 0) + return (False); - slprintf(comment,sizeof(comment)-1, - "IPC Service (%s)", Globals.szServerString ); + slprintf(comment, sizeof(comment) - 1, + "IPC Service (%s)", Globals.szServerString); - string_set(&iSERVICE(i).szPath,tmpdir()); - string_set(&iSERVICE(i).szUsername,""); - string_set(&iSERVICE(i).comment,comment); - string_set(&iSERVICE(i).fstype,"IPC"); - iSERVICE(i).status = False; - iSERVICE(i).iMaxConnections = 0; - iSERVICE(i).bAvailable = True; - iSERVICE(i).bRead_only = True; - iSERVICE(i).bGuest_only = False; - iSERVICE(i).bGuest_ok = True; - iSERVICE(i).bPrint_ok = False; - iSERVICE(i).bBrowseable = sDefault.bBrowseable; + string_set(&iSERVICE(i).szPath, tmpdir()); + string_set(&iSERVICE(i).szUsername, ""); + string_set(&iSERVICE(i).comment, comment); + string_set(&iSERVICE(i).fstype, "IPC"); + iSERVICE(i).status = False; + iSERVICE(i).iMaxConnections = 0; + iSERVICE(i).bAvailable = True; + iSERVICE(i).bRead_only = True; + iSERVICE(i).bGuest_only = False; + iSERVICE(i).bGuest_ok = True; + iSERVICE(i).bPrint_ok = False; + iSERVICE(i).bBrowseable = sDefault.bBrowseable; - DEBUG(3,("adding IPC service\n")); + DEBUG(3, ("adding IPC service\n")); - return(True); + return (True); } @@ -1654,33 +1986,33 @@ add a new printer service, with defaults coming from service iFrom ***************************************************************************/ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) { - char *comment = "From Printcap"; - int i = add_a_service(pSERVICE(iDefaultService),pszPrintername); - - if (i < 0) - return(False); - - /* note that we do NOT default the availability flag to True - */ - /* we take it from the default service passed. This allows all */ - /* dynamic printers to be disabled by disabling the [printers] */ - /* entry (if/when the 'available' keyword is implemented!). */ - - /* the printer name is set to the service name. */ - string_set(&iSERVICE(i).szPrintername,pszPrintername); - string_set(&iSERVICE(i).comment,comment); - iSERVICE(i).bBrowseable = sDefault.bBrowseable; - /* Printers cannot be read_only. */ - iSERVICE(i).bRead_only = False; - /* No share modes on printer services. */ - iSERVICE(i).bShareModes = False; - /* No oplocks on printer services. */ - iSERVICE(i).bOpLocks = False; - /* Printer services must be printable. */ - iSERVICE(i).bPrint_ok = True; - - DEBUG(3,("adding printer service %s\n",pszPrintername)); - - return(True); + char *comment = "From Printcap"; + int i = add_a_service(pSERVICE(iDefaultService), pszPrintername); + + if (i < 0) + return (False); + + /* note that we do NOT default the availability flag to True - */ + /* we take it from the default service passed. This allows all */ + /* dynamic printers to be disabled by disabling the [printers] */ + /* entry (if/when the 'available' keyword is implemented!). */ + + /* the printer name is set to the service name. */ + string_set(&iSERVICE(i).szPrintername, pszPrintername); + string_set(&iSERVICE(i).comment, comment); + iSERVICE(i).bBrowseable = sDefault.bBrowseable; + /* Printers cannot be read_only. */ + iSERVICE(i).bRead_only = False; + /* No share modes on printer services. */ + iSERVICE(i).bShareModes = False; + /* No oplocks on printer services. */ + iSERVICE(i).bOpLocks = False; + /* Printer services must be printable. */ + iSERVICE(i).bPrint_ok = True; + + DEBUG(3, ("adding printer service %s\n", pszPrintername)); + + return (True); } @@ -1689,30 +2021,29 @@ Do a case-insensitive, whitespace-ignoring string compare. ***************************************************************************/ static int strwicmp(char *psz1, char *psz2) { - /* if BOTH strings are NULL, return TRUE, if ONE is NULL return */ - /* appropriate value. */ - if (psz1 == psz2) - return (0); - else - if (psz1 == NULL) - return (-1); - else - if (psz2 == NULL) - return (1); - - /* sync the strings on first non-whitespace */ - while (1) - { - while (isspace(*psz1)) - psz1++; - while (isspace(*psz2)) - psz2++; - if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0' || *psz2 == '\0') - break; - psz1++; - psz2++; - } - return (*psz1 - *psz2); + /* if BOTH strings are NULL, return TRUE, if ONE is NULL return */ + /* appropriate value. */ + if (psz1 == psz2) + return (0); + else if (psz1 == NULL) + return (-1); + else if (psz2 == NULL) + return (1); + + /* sync the strings on first non-whitespace */ + while (1) + { + while (isspace(*psz1)) + psz1++; + while (isspace(*psz2)) + psz2++; + if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0' + || *psz2 == '\0') + break; + psz1++; + psz2++; + } + return (*psz1 - *psz2); } /*************************************************************************** @@ -1721,17 +2052,17 @@ Returns False if the parameter string is not recognised, else TRUE. ***************************************************************************/ static int map_parameter(char *pszParmName) { - int iIndex; + int iIndex; - if (*pszParmName == '-') - return(-1); + if (*pszParmName == '-') + return (-1); - for (iIndex = 0; parm_table[iIndex].label; iIndex++) - if (strwicmp(parm_table[iIndex].label, pszParmName) == 0) - return(iIndex); + for (iIndex = 0; parm_table[iIndex].label; iIndex++) + if (strwicmp(parm_table[iIndex].label, pszParmName) == 0) + return (iIndex); - DEBUG(0,( "Unknown parameter encountered: \"%s\"\n", pszParmName)); - return(-1); + DEBUG(0, ("Unknown parameter encountered: \"%s\"\n", pszParmName)); + return (-1); } @@ -1742,44 +2073,47 @@ represent a boolean. ***************************************************************************/ static BOOL set_boolean(BOOL *pb, char *pszParmValue) { - BOOL bRetval; - - bRetval = True; - if (strwicmp(pszParmValue, "yes") == 0 || - strwicmp(pszParmValue, "true") == 0 || - strwicmp(pszParmValue, "1") == 0) - *pb = True; - else - if (strwicmp(pszParmValue, "no") == 0 || - strwicmp(pszParmValue, "False") == 0 || - strwicmp(pszParmValue, "0") == 0) - *pb = False; - else - { - DEBUG(0,("ERROR: Badly formed boolean in configuration file: \"%s\".\n", - pszParmValue)); - bRetval = False; - } - return (bRetval); + BOOL bRetval; + + bRetval = True; + if (strwicmp(pszParmValue, "yes") == 0 || + strwicmp(pszParmValue, "true") == 0 || + strwicmp(pszParmValue, "1") == 0) + *pb = True; + else + if (strwicmp(pszParmValue, "no") == 0 || + strwicmp(pszParmValue, "False") == 0 || + strwicmp(pszParmValue, "0") == 0) + *pb = False; + else + { + DEBUG(0, + ("ERROR: Badly formed boolean in configuration file: \"%s\".\n", + pszParmValue)); + bRetval = False; + } + return (bRetval); } /*************************************************************************** Find a service by name. Otherwise works like get_service. ***************************************************************************/ -static int getservicebyname(char *pszServiceName, service *pserviceDest) -{ - int iService; - - for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && - strwicmp(iSERVICE(iService).szService, pszServiceName) == 0) - { - if (pserviceDest != NULL) - copy_service(pserviceDest, pSERVICE(iService), NULL); - break; - } +static int getservicebyname(char *pszServiceName, service * pserviceDest) +{ + int iService; + + for (iService = iNumServices - 1; iService >= 0; iService--) + if (VALID(iService) && + strwicmp(iSERVICE(iService).szService, + pszServiceName) == 0) + { + if (pserviceDest != NULL) + copy_service(pserviceDest, pSERVICE(iService), + NULL); + break; + } - return (iService); + return (iService); } @@ -1789,60 +2123,64 @@ Copy a service structure to another If pcopymapDest is NULL then copy all fields ***************************************************************************/ -static void copy_service(service *pserviceDest, - service *pserviceSource, - BOOL *pcopymapDest) -{ - int i; - BOOL bcopyall = (pcopymapDest == NULL); - - for (i=0;parm_table[i].label;i++) - if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && - (bcopyall || pcopymapDest[i])) - { - void *def_ptr = parm_table[i].ptr; - void *src_ptr = - ((char *)pserviceSource) + PTR_DIFF(def_ptr,&sDefault); - void *dest_ptr = - ((char *)pserviceDest) + PTR_DIFF(def_ptr,&sDefault); +static void copy_service(service * pserviceDest, + service * pserviceSource, BOOL *pcopymapDest) +{ + int i; + BOOL bcopyall = (pcopymapDest == NULL); + + for (i = 0; parm_table[i].label; i++) + if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && + (bcopyall || pcopymapDest[i])) + { + void *def_ptr = parm_table[i].ptr; + void *src_ptr = + ((char *)pserviceSource) + PTR_DIFF(def_ptr, + &sDefault); + void *dest_ptr = + ((char *)pserviceDest) + PTR_DIFF(def_ptr, + &sDefault); + + switch (parm_table[i].type) + { + case P_BOOL: + case P_BOOLREV: + *(BOOL *)dest_ptr = *(BOOL *)src_ptr; + break; + + case P_INTEGER: + case P_ENUM: + case P_OCTAL: + *(int *)dest_ptr = *(int *)src_ptr; + break; + + case P_CHAR: + *(char *)dest_ptr = *(char *)src_ptr; + break; + + case P_STRING: + string_set(dest_ptr, + *(char **)src_ptr); + break; + + case P_USTRING: + string_set(dest_ptr, + *(char **)src_ptr); + strupper(*(char **)dest_ptr); + break; + default: + break; + } + } - switch (parm_table[i].type) - { - case P_BOOL: - case P_BOOLREV: - *(BOOL *)dest_ptr = *(BOOL *)src_ptr; - break; - - case P_INTEGER: - case P_ENUM: - case P_OCTAL: - *(int *)dest_ptr = *(int *)src_ptr; - break; - - case P_CHAR: - *(char *)dest_ptr = *(char *)src_ptr; - break; - - case P_STRING: - string_set(dest_ptr,*(char **)src_ptr); - break; - - case P_USTRING: - string_set(dest_ptr,*(char **)src_ptr); - strupper(*(char **)dest_ptr); - break; - default: - break; - } - } - - if (bcopyall) - { - init_copymap(pserviceDest); - if (pserviceSource->copymap) - memcpy((void *)pserviceDest->copymap, - (void *)pserviceSource->copymap,sizeof(BOOL)*NUMPARAMETERS); - } + if (bcopyall) + { + init_copymap(pserviceDest); + if (pserviceSource->copymap) + memcpy((void *)pserviceDest->copymap, + (void *)pserviceSource->copymap, + sizeof(BOOL) * NUMPARAMETERS); + } } /*************************************************************************** @@ -1851,46 +2189,52 @@ incomplete or faulty, else True. ***************************************************************************/ static BOOL service_ok(int iService) { - BOOL bRetval; - - bRetval = True; - if (iSERVICE(iService).szService[0] == '\0') - { - DEBUG(0,( "The following message indicates an internal error:\n")); - DEBUG(0,( "No service name in service entry.\n")); - bRetval = False; - } - - /* The [printers] entry MUST be printable. I'm all for flexibility, but */ - /* I can't see why you'd want a non-printable printer service... */ - if (strwicmp(iSERVICE(iService).szService,PRINTERS_NAME) == 0) - if (!iSERVICE(iService).bPrint_ok) - { - DEBUG(0,( "WARNING: [%s] service MUST be printable!\n", - iSERVICE(iService).szService)); - iSERVICE(iService).bPrint_ok = True; - } - - if (iSERVICE(iService).szPath[0] == '\0' && - strwicmp(iSERVICE(iService).szService,HOMES_NAME) != 0) - { - DEBUG(0,("No path in service %s - using %s\n",iSERVICE(iService).szService,tmpdir())); - string_set(&iSERVICE(iService).szPath,tmpdir()); - } - - /* If a service is flagged unavailable, log the fact at level 0. */ - if (!iSERVICE(iService).bAvailable) - DEBUG(1,( "NOTE: Service %s is flagged unavailable.\n", - iSERVICE(iService).szService)); - - return (bRetval); -} - -static struct file_lists { - struct file_lists *next; - char *name; - time_t modtime; -} *file_lists = NULL; + BOOL bRetval; + + bRetval = True; + if (iSERVICE(iService).szService[0] == '\0') + { + DEBUG(0, + ("The following message indicates an internal error:\n")); + DEBUG(0, ("No service name in service entry.\n")); + bRetval = False; + } + + /* The [printers] entry MUST be printable. I'm all for flexibility, but */ + /* I can't see why you'd want a non-printable printer service... */ + if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) + if (!iSERVICE(iService).bPrint_ok) + { + DEBUG(0, + ("WARNING: [%s] service MUST be printable!\n", + iSERVICE(iService).szService)); + iSERVICE(iService).bPrint_ok = True; + } + + if (iSERVICE(iService).szPath[0] == '\0' && + strwicmp(iSERVICE(iService).szService, HOMES_NAME) != 0) + { + DEBUG(0, + ("No path in service %s - using %s\n", + iSERVICE(iService).szService, tmpdir())); + string_set(&iSERVICE(iService).szPath, tmpdir()); + } + + /* If a service is flagged unavailable, log the fact at level 0. */ + if (!iSERVICE(iService).bAvailable) + DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n", + iSERVICE(iService).szService)); + + return (bRetval); +} + +static struct file_lists +{ + struct file_lists *next; + char *name; + time_t modtime; +} + *file_lists = NULL; /******************************************************************* keep a linked list of all config files so we know when one has changed @@ -1898,31 +2242,36 @@ it's date and needs to be reloaded ********************************************************************/ static void add_to_file_list(char *fname) { - struct file_lists *f=file_lists; + struct file_lists *f = file_lists; - while (f) { - if (f->name && !strcmp(f->name,fname)) break; - f = f->next; - } + while (f) + { + if (f->name && !strcmp(f->name, fname)) + break; + f = f->next; + } - if (!f) { - f = (struct file_lists *)malloc(sizeof(file_lists[0])); - if (!f) return; - f->next = file_lists; - f->name = strdup(fname); - if (!f->name) { - free(f); - return; - } - file_lists = f; - } + if (!f) + { + f = (struct file_lists *)malloc(sizeof(file_lists[0])); + if (!f) + return; + f->next = file_lists; + f->name = strdup(fname); + if (!f->name) + { + free(f); + return; + } + file_lists = f; + } - { - pstring n2; - pstrcpy(n2,fname); - standard_sub_basic(n2); - f->modtime = file_modtime(n2); - } + { + pstring n2; + pstrcpy(n2, fname); + standard_sub_basic(n2); + f->modtime = file_modtime(n2); + } } @@ -1931,30 +2280,33 @@ check if a config file has changed date ********************************************************************/ BOOL lp_file_list_changed(void) { - struct file_lists *f = file_lists; - DEBUG(6,("lp_file_list_changed()\n")); + struct file_lists *f = file_lists; + DEBUG(6, ("lp_file_list_changed()\n")); - while (f) - { - pstring n2; - time_t mod_time; + while (f) + { + pstring n2; + time_t mod_time; - pstrcpy(n2,f->name); - standard_sub_basic(n2); + pstrcpy(n2, f->name); + standard_sub_basic(n2); - DEBUGADD( 6, ( "file %s -> %s last mod_time: %s\n", - f->name, n2, ctime(&f->modtime) ) ); + DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", + f->name, n2, ctime(&f->modtime))); - mod_time = file_modtime(n2); + mod_time = file_modtime(n2); - if (f->modtime != mod_time) { - DEBUGADD(6,("file %s modified: %s\n", n2, ctime(&mod_time))); - f->modtime = mod_time; - return(True); - } - f = f->next; - } - return(False); + if (f->modtime != mod_time) + { + DEBUGADD(6, + ("file %s modified: %s\n", n2, + ctime(&mod_time))); + f->modtime = mod_time; + return (True); + } + f = f->next; + } + return (False); } /*************************************************************************** @@ -1963,11 +2315,11 @@ BOOL lp_file_list_changed(void) Note: We must *NOT* use string_set() here as ptr points to global_myname. ***************************************************************************/ -static BOOL handle_netbios_name(char *pszParmValue,char **ptr) +static BOOL handle_netbios_name(char *pszParmValue, char **ptr) { pstring netbios_name; - pstrcpy(netbios_name,pszParmValue); + pstrcpy(netbios_name, pszParmValue); standard_sub_basic(netbios_name); strupper(netbios_name); @@ -1977,11 +2329,13 @@ static BOOL handle_netbios_name(char *pszParmValue,char **ptr) * isn't called on the special handlers. */ unix_to_dos(netbios_name, True); - pstrcpy(global_myname,netbios_name); + pstrcpy(global_myname, netbios_name); - DEBUG(4,("handle_netbios_name: set global_myname to: %s\n", global_myname)); + DEBUG(4, + ("handle_netbios_name: set global_myname to: %s\n", + global_myname)); - return(True); + return (True); } /*************************************************************************** @@ -1995,60 +2349,68 @@ static BOOL source_env(char **lines) int i; char *p; - for (i=0; lines[i]; i++) { + for (i = 0; lines[i]; i++) + { char *line = lines[i]; - if((len = strlen(line)) == 0) + 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); + 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)); + DEBUG(4, ("source_env: Adding to environment: %s\n", line)); strncpy(varval, line, len); varval[len] = '\0'; - p=strchr(line, (int) '='); - if (p == NULL) { - DEBUG(4,("source_env: missing '=': %s\n", line)); + p = strchr(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 )); + if (putenv(varval)) + { + DEBUG(0, + ("source_env: Failed to put environment variable %s\n", + varval)); continue; } - *p='\0'; + *p = '\0'; p++; - DEBUG(4,("source_env: getting var %s = %s\n", line, getenv(line))); + DEBUG(4, + ("source_env: getting var %s = %s\n", line, + getenv(line))); } - DEBUG(4,("source_env: returning successfully\n")); - return(True); + DEBUG(4, ("source_env: returning successfully\n")); + return (True); } /*************************************************************************** Handle the source environment operation ***************************************************************************/ -static BOOL handle_source_env(char *pszParmValue,char **ptr) +static BOOL handle_source_env(char *pszParmValue, char **ptr) { pstring fname; char *p = fname; BOOL result; char **lines; - pstrcpy(fname,pszParmValue); + pstrcpy(fname, pszParmValue); standard_sub_basic(fname); - string_set(ptr,pszParmValue); + string_set(ptr, pszParmValue); DEBUG(4, ("handle_source_env: checking env type\n")); @@ -2056,46 +2418,52 @@ static BOOL handle_source_env(char *pszParmValue,char **ptr) * Filename starting with '|' means popen and read from stdin. */ - if (*p == '|') { - lines = file_lines_pload(p+1, NULL); - } else { + 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); + 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); + result = source_env(lines); file_lines_free(lines); - return(result); + return (result); } /*************************************************************************** handle the interpretation of the vfs object parameter *************************************************************************/ -static BOOL handle_vfs_object(char *pszParmValue,char **ptr) +static BOOL handle_vfs_object(char *pszParmValue, char **ptr) { - /* Set string value */ + /* Set string value */ - string_set(ptr,pszParmValue); + string_set(ptr, pszParmValue); - /* Do any other initialisation required for vfs. Note that - anything done here may have linking repercussions in nmbd. */ + /* Do any other initialisation required for vfs. Note that + anything done here may have linking repercussions in nmbd. */ - return True; + return True; } /*************************************************************************** handle the interpretation of the coding system parameter *************************************************************************/ -static BOOL handle_coding_system(char *pszParmValue,char **ptr) +static BOOL handle_coding_system(char *pszParmValue, char **ptr) { - string_set(ptr,pszParmValue); + string_set(ptr, pszParmValue); interpret_coding_system(pszParmValue); - return(True); + return (True); } /*************************************************************************** @@ -2104,16 +2472,16 @@ static BOOL handle_coding_system(char *pszParmValue,char **ptr) static char *saved_character_set = NULL; -static BOOL handle_character_set(char *pszParmValue,char **ptr) +static BOOL handle_character_set(char *pszParmValue, char **ptr) { - /* A dependency here is that the parameter client code page should be - set before this is called. - */ - string_set(ptr,pszParmValue); + /* A dependency here is that the parameter client code page should be + set before this is called. + */ + string_set(ptr, pszParmValue); strupper(*ptr); saved_character_set = strdup(*ptr); - interpret_character_set(*ptr,lp_client_code_page()); - return(True); + interpret_character_set(*ptr, lp_client_code_page()); + return (True); } /*************************************************************************** @@ -2122,97 +2490,99 @@ static BOOL handle_character_set(char *pszParmValue,char **ptr) parameter in case this came before 'client code page' in the smb.conf. ***************************************************************************/ -static BOOL handle_client_code_page(char *pszParmValue,char **ptr) +static BOOL handle_client_code_page(char *pszParmValue, char **ptr) { Globals.client_code_page = atoi(pszParmValue); if (saved_character_set != NULL) - interpret_character_set(saved_character_set,lp_client_code_page()); - return(True); + interpret_character_set(saved_character_set, + lp_client_code_page()); + return (True); } /*************************************************************************** handle the valid chars lines ***************************************************************************/ -static BOOL handle_valid_chars(char *pszParmValue,char **ptr) -{ - string_set(ptr,pszParmValue); +static BOOL handle_valid_chars(char *pszParmValue, char **ptr) +{ + string_set(ptr, pszParmValue); - /* A dependency here is that the parameter client code page must be - set before this is called - as calling codepage_initialise() - would overwrite the valid char lines. - */ - codepage_initialise(lp_client_code_page()); + /* A dependency here is that the parameter client code page must be + set before this is called - as calling codepage_initialise() + would overwrite the valid char lines. + */ + codepage_initialise(lp_client_code_page()); - add_char_string(pszParmValue); - return(True); + add_char_string(pszParmValue); + return (True); } /*************************************************************************** handle the include operation ***************************************************************************/ -static BOOL handle_include(char *pszParmValue,char **ptr) -{ - pstring fname; - pstrcpy(fname,pszParmValue); +static BOOL handle_include(char *pszParmValue, char **ptr) +{ + pstring fname; + pstrcpy(fname, pszParmValue); - add_to_file_list(fname); + add_to_file_list(fname); - standard_sub_basic(fname); + standard_sub_basic(fname); - string_set(ptr,fname); + string_set(ptr, fname); - if (file_exist(fname,NULL)) - return(pm_process(fname, do_section, do_parameter)); + if (file_exist(fname, NULL)) + return (pm_process(fname, do_section, do_parameter)); - DEBUG(2,("Can't find include file %s\n",fname)); + DEBUG(2, ("Can't find include file %s\n", fname)); - return(False); + return (False); } /*************************************************************************** handle the interpretation of the copy parameter ***************************************************************************/ -static BOOL handle_copy(char *pszParmValue,char **ptr) +static BOOL handle_copy(char *pszParmValue, char **ptr) { - BOOL bRetval; - int iTemp; - service serviceTemp; + BOOL bRetval; + int iTemp; + service serviceTemp; - string_set(ptr,pszParmValue); + string_set(ptr, pszParmValue); - init_service(&serviceTemp); + init_service(&serviceTemp); - bRetval = False; - - DEBUG(3,("Copying service from service %s\n",pszParmValue)); - - if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) - { - if (iTemp == iServiceIndex) - { - DEBUG(0,("Can't copy service %s - unable to copy self!\n", - pszParmValue)); - } - else - { - copy_service(pSERVICE(iServiceIndex), - &serviceTemp, - iSERVICE(iServiceIndex).copymap); - bRetval = True; - } - } - else - { - DEBUG(0,( "Unable to copy service - source not found: %s\n", - pszParmValue)); - bRetval = False; - } - - free_service(&serviceTemp); - return (bRetval); + bRetval = False; + + DEBUG(3, ("Copying service from service %s\n", pszParmValue)); + + if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) + { + if (iTemp == iServiceIndex) + { + DEBUG(0, + ("Can't copy service %s - unable to copy self!\n", + pszParmValue)); + } + else + { + copy_service(pSERVICE(iServiceIndex), + &serviceTemp, + iSERVICE(iServiceIndex).copymap); + bRetval = True; + } + } + else + { + DEBUG(0, ("Unable to copy service - source not found: %s\n", + pszParmValue)); + bRetval = False; + } + + free_service(&serviceTemp); + return (bRetval); } /*************************************************************************** @@ -2233,32 +2603,36 @@ static BOOL handle_copy(char *pszParmValue,char **ptr) static BOOL handle_winbind_id(char *pszParmValue, char **ptr) { - int low, high; + int low, high; - if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2) { - return False; - } + if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2) + { + return False; + } - /* Parse OK */ + /* Parse OK */ - string_set(ptr,pszParmValue); + string_set(ptr, pszParmValue); - return True; + return True; } /*************************************************************************** initialise a copymap ***************************************************************************/ -static void init_copymap(service *pservice) +static void init_copymap(service * pservice) { - int i; - if (pservice->copymap) free(pservice->copymap); - pservice->copymap = (BOOL *)malloc(sizeof(BOOL)*NUMPARAMETERS); - if (!pservice->copymap) - DEBUG(0,("Couldn't allocate copymap!! (size %d)\n",(int)NUMPARAMETERS)); - else - for (i=0;icopymap[i] = True; + int i; + if (pservice->copymap) + free(pservice->copymap); + pservice->copymap = (BOOL *)malloc(sizeof(BOOL) * NUMPARAMETERS); + if (!pservice->copymap) + DEBUG(0, + ("Couldn't allocate copymap!! (size %d)\n", + (int)NUMPARAMETERS)); + else + for (i = 0; i < NUMPARAMETERS; i++) + pservice->copymap[i] = True; } @@ -2268,7 +2642,7 @@ static void init_copymap(service *pservice) ***************************************************************************/ void *lp_local_ptr(int snum, void *ptr) { - return (void *)(((char *)pSERVICE(snum)) + PTR_DIFF(ptr,&sDefault)); + return (void *)(((char *)pSERVICE(snum)) + PTR_DIFF(ptr, &sDefault)); } /*************************************************************************** @@ -2277,183 +2651,205 @@ then assume we are in the globals ***************************************************************************/ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) { - int parmnum, i; - void *parm_ptr=NULL; /* where we are going to store the result */ - void *def_ptr=NULL; - - parmnum = map_parameter(pszParmName); - - if (parmnum < 0) - { - DEBUG(0,( "Ignoring unknown parameter \"%s\"\n", pszParmName)); - return(True); - } - - if (parm_table[parmnum].flags & FLAG_DEPRECATED) { - DEBUG(1,("WARNING: The \"%s\"option is deprecated\n", - pszParmName)); - } - - def_ptr = parm_table[parmnum].ptr; - - /* we might point at a service, the default service or a global */ - if (snum < 0) { - parm_ptr = def_ptr; - } else { - if (parm_table[parmnum].class == P_GLOBAL) { - DEBUG(0,( "Global parameter %s found in service section!\n",pszParmName)); - return(True); - } - parm_ptr = ((char *)pSERVICE(snum)) + PTR_DIFF(def_ptr,&sDefault); - } - - if (snum >= 0) { - if (!iSERVICE(snum).copymap) - init_copymap(pSERVICE(snum)); - - /* this handles the aliases - set the copymap for other entries with - the same data pointer */ - for (i=0;parm_table[i].label;i++) - if (parm_table[i].ptr == parm_table[parmnum].ptr) - iSERVICE(snum).copymap[i] = False; - } - - /* if it is a special case then go ahead */ - if (parm_table[parmnum].special) { - parm_table[parmnum].special(pszParmValue,(char **)parm_ptr); - return(True); - } - - /* now switch on the type of variable it is */ - switch (parm_table[parmnum].type) - { - case P_BOOL: - set_boolean(parm_ptr,pszParmValue); - break; - - case P_BOOLREV: - set_boolean(parm_ptr,pszParmValue); - *(BOOL *)parm_ptr = ! *(BOOL *)parm_ptr; - break; - - case P_INTEGER: - *(int *)parm_ptr = atoi(pszParmValue); - break; - - case P_CHAR: - *(char *)parm_ptr = *pszParmValue; - break; - - case P_OCTAL: - sscanf(pszParmValue,"%o",(int *)parm_ptr); - break; - - case P_STRING: - string_set(parm_ptr,pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); - break; - - case P_USTRING: - string_set(parm_ptr,pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); - strupper(*(char **)parm_ptr); - break; - - case P_GSTRING: - pstrcpy((char *)parm_ptr,pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); - break; - - case P_UGSTRING: - pstrcpy((char *)parm_ptr,pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); - strupper((char *)parm_ptr); - 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; - } - } - break; - case P_SEP: - break; - } - - return(True); + int parmnum, i; + void *parm_ptr = NULL; /* where we are going to store the result */ + void *def_ptr = NULL; + + parmnum = map_parameter(pszParmName); + + if (parmnum < 0) + { + DEBUG(0, + ("Ignoring unknown parameter \"%s\"\n", pszParmName)); + return (True); + } + + if (parm_table[parmnum].flags & FLAG_DEPRECATED) + { + DEBUG(1, ("WARNING: The \"%s\"option is deprecated\n", + pszParmName)); + } + + def_ptr = parm_table[parmnum].ptr; + + /* we might point at a service, the default service or a global */ + if (snum < 0) + { + parm_ptr = def_ptr; + } + else + { + if (parm_table[parmnum].class == P_GLOBAL) + { + DEBUG(0, + ("Global parameter %s found in service section!\n", + pszParmName)); + return (True); + } + parm_ptr = + ((char *)pSERVICE(snum)) + PTR_DIFF(def_ptr, + &sDefault); + } + + if (snum >= 0) + { + if (!iSERVICE(snum).copymap) + init_copymap(pSERVICE(snum)); + + /* this handles the aliases - set the copymap for other entries with + the same data pointer */ + for (i = 0; parm_table[i].label; i++) + if (parm_table[i].ptr == parm_table[parmnum].ptr) + iSERVICE(snum).copymap[i] = False; + } + + /* if it is a special case then go ahead */ + if (parm_table[parmnum].special) + { + parm_table[parmnum].special(pszParmValue, (char **)parm_ptr); + return (True); + } + + /* now switch on the type of variable it is */ + switch (parm_table[parmnum].type) + { + case P_BOOL: + set_boolean(parm_ptr, pszParmValue); + break; + + case P_BOOLREV: + set_boolean(parm_ptr, pszParmValue); + *(BOOL *)parm_ptr = !*(BOOL *)parm_ptr; + break; + + case P_INTEGER: + *(int *)parm_ptr = atoi(pszParmValue); + break; + + case P_CHAR: + *(char *)parm_ptr = *pszParmValue; + break; + + case P_OCTAL: + sscanf(pszParmValue, "%o", (int *)parm_ptr); + break; + + case P_STRING: + string_set(parm_ptr, pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); + break; + + case P_USTRING: + string_set(parm_ptr, pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); + strupper(*(char **)parm_ptr); + break; + + case P_GSTRING: + pstrcpy((char *)parm_ptr, pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); + break; + + case P_UGSTRING: + pstrcpy((char *)parm_ptr, pszParmValue); + if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); + strupper((char *)parm_ptr); + 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; + } + } + break; + case P_SEP: + break; + } + + return (True); } /*************************************************************************** Process a parameter. ***************************************************************************/ -static BOOL do_parameter( char *pszParmName, char *pszParmValue ) +static BOOL do_parameter(char *pszParmName, char *pszParmValue) { - if( !bInGlobalSection && bGlobalOnly ) - return(True); + if (!bInGlobalSection && bGlobalOnly) + return (True); - DEBUGADD( 3, ( "doing parameter %s = %s\n", pszParmName, pszParmValue ) ); + DEBUGADD(3, ("doing parameter %s = %s\n", pszParmName, pszParmValue)); - return( lp_do_parameter( bInGlobalSection ? -2 : iServiceIndex, - pszParmName, - pszParmValue ) ); + return (lp_do_parameter(bInGlobalSection ? -2 : iServiceIndex, + pszParmName, pszParmValue)); } /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) +static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) { int i; - switch (p->type) { - case P_ENUM: - for (i=0;p->enum_list[i].name;i++) { - if (*(int *)ptr == p->enum_list[i].value) { - fprintf(f,"%s",p->enum_list[i].name); - break; + switch (p->type) + { + case P_ENUM: + for (i = 0; p->enum_list[i].name; i++) + { + if (*(int *)ptr == p->enum_list[i].value) + { + fprintf(f, "%s", + p->enum_list[i].name); + break; + } } - } - break; - - case P_BOOL: - fprintf(f,"%s",BOOLSTR(*(BOOL *)ptr)); - break; - - case P_BOOLREV: - fprintf(f,"%s",BOOLSTR(! *(BOOL *)ptr)); - break; - - case P_INTEGER: - fprintf(f,"%d",*(int *)ptr); - break; - - case P_CHAR: - fprintf(f,"%c",*(char *)ptr); - break; - - case P_OCTAL: - fprintf(f,"%s",octal_string(*(int *)ptr)); - break; - - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) - fprintf(f,"%s",(char *)ptr); - break; - - case P_STRING: - case P_USTRING: - if (*(char **)ptr) - fprintf(f,"%s",*(char **)ptr); - break; - case P_SEP: - break; + break; + + case P_BOOL: + fprintf(f, "%s", BOOLSTR(*(BOOL *)ptr)); + break; + + case P_BOOLREV: + fprintf(f, "%s", BOOLSTR(!*(BOOL *)ptr)); + break; + + case P_INTEGER: + fprintf(f, "%d", *(int *)ptr); + break; + + case P_CHAR: + fprintf(f, "%c", *(char *)ptr); + break; + + case P_OCTAL: + fprintf(f, "%s", octal_string(*(int *)ptr)); + break; + + case P_GSTRING: + case P_UGSTRING: + if ((char *)ptr) + fprintf(f, "%s", (char *)ptr); + break; + + case P_STRING: + case P_USTRING: + if (*(char **)ptr) + fprintf(f, "%s", *(char **)ptr); + break; + case P_SEP: + break; } } @@ -2461,42 +2857,46 @@ static void print_parameter(struct parm_struct *p,void *ptr, FILE *f) /*************************************************************************** check if two parameters are equal ***************************************************************************/ -static BOOL equal_parameter(parm_type type,void *ptr1,void *ptr2) -{ - switch (type) - { - case P_BOOL: - case P_BOOLREV: - return(*((BOOL *)ptr1) == *((BOOL *)ptr2)); - - case P_INTEGER: - case P_ENUM: - case P_OCTAL: - return(*((int *)ptr1) == *((int *)ptr2)); - - case P_CHAR: - return(*((char *)ptr1) == *((char *)ptr2)); - - case P_GSTRING: - case P_UGSTRING: - { - char *p1 = (char *)ptr1, *p2 = (char *)ptr2; - if (p1 && !*p1) p1 = NULL; - if (p2 && !*p2) p2 = NULL; - return(p1==p2 || strequal(p1,p2)); - } - case P_STRING: - case P_USTRING: - { - char *p1 = *(char **)ptr1, *p2 = *(char **)ptr2; - if (p1 && !*p1) p1 = NULL; - if (p2 && !*p2) p2 = NULL; - return(p1==p2 || strequal(p1,p2)); - } - case P_SEP: - break; - } - return(False); +static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) +{ + switch (type) + { + case P_BOOL: + case P_BOOLREV: + return (*((BOOL *)ptr1) == *((BOOL *)ptr2)); + + case P_INTEGER: + case P_ENUM: + case P_OCTAL: + return (*((int *)ptr1) == *((int *)ptr2)); + + case P_CHAR: + return (*((char *)ptr1) == *((char *)ptr2)); + + case P_GSTRING: + case P_UGSTRING: + { + char *p1 = (char *)ptr1, *p2 = (char *)ptr2; + if (p1 && !*p1) + p1 = NULL; + if (p2 && !*p2) + p2 = NULL; + return (p1 == p2 || strequal(p1, p2)); + } + case P_STRING: + case P_USTRING: + { + char *p1 = *(char **)ptr1, *p2 = *(char **)ptr2; + if (p1 && !*p1) + p1 = NULL; + if (p2 && !*p2) + p2 = NULL; + return (p1 == p2 || strequal(p1, p2)); + } + case P_SEP: + break; + } + return (False); } /*************************************************************************** @@ -2506,48 +2906,50 @@ Returns True on success, False on failure. ***************************************************************************/ static BOOL do_section(char *pszSectionName) { - BOOL bRetval; - BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || - (strwicmp(pszSectionName, GLOBAL_NAME2) == 0)); - bRetval = False; + BOOL bRetval; + BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || + (strwicmp(pszSectionName, GLOBAL_NAME2) == 0)); + bRetval = False; - /* if we were in a global section then do the local inits */ - if (bInGlobalSection && !isglobal) - init_locals(); + /* if we were in a global section then do the local inits */ + if (bInGlobalSection && !isglobal) + init_locals(); - /* if we've just struck a global section, note the fact. */ - bInGlobalSection = isglobal; + /* if we've just struck a global section, note the fact. */ + bInGlobalSection = isglobal; - /* check for multiple global sections */ - if (bInGlobalSection) - { - DEBUG( 3, ( "Processing section \"[%s]\"\n", pszSectionName ) ); - return(True); - } + /* check for multiple global sections */ + if (bInGlobalSection) + { + DEBUG(3, ("Processing section \"[%s]\"\n", pszSectionName)); + return (True); + } - if (!bInGlobalSection && bGlobalOnly) return(True); + if (!bInGlobalSection && bGlobalOnly) + return (True); - /* if we have a current service, tidy it up before moving on */ - bRetval = True; + /* if we have a current service, tidy it up before moving on */ + bRetval = True; - if (iServiceIndex >= 0) - bRetval = service_ok(iServiceIndex); + if (iServiceIndex >= 0) + bRetval = service_ok(iServiceIndex); - /* if all is still well, move to the next record in the services array */ - if (bRetval) - { - /* We put this here to avoid an odd message order if messages are */ - /* issued by the post-processing of a previous section. */ - DEBUG(2,( "Processing section \"[%s]\"\n", pszSectionName)); + /* if all is still well, move to the next record in the services array */ + if (bRetval) + { + /* We put this here to avoid an odd message order if messages are */ + /* issued by the post-processing of a previous section. */ + DEBUG(2, ("Processing section \"[%s]\"\n", pszSectionName)); - if ((iServiceIndex=add_a_service(&sDefault,pszSectionName)) < 0) - { - DEBUG(0,("Failed to add a new service\n")); - return(False); - } - } + if ((iServiceIndex = add_a_service(&sDefault, pszSectionName)) + < 0) + { + DEBUG(0, ("Failed to add a new service\n")); + return (False); + } + } - return (bRetval); + return (bRetval); } @@ -2556,25 +2958,32 @@ determine if a partcular base parameter is currently set to the default value. ***************************************************************************/ static BOOL is_default(int i) { - if (!defaults_saved) return False; - switch (parm_table[i].type) { - case P_STRING: - case P_USTRING: - return strequal(parm_table[i].def.svalue,*(char **)parm_table[i].ptr); - case P_GSTRING: - case P_UGSTRING: - return strequal(parm_table[i].def.svalue,(char *)parm_table[i].ptr); - case P_BOOL: - case P_BOOLREV: - return parm_table[i].def.bvalue == *(BOOL *)parm_table[i].ptr; - case P_CHAR: - return parm_table[i].def.cvalue == *(char *)parm_table[i].ptr; - case P_INTEGER: - case P_OCTAL: - case P_ENUM: - return parm_table[i].def.ivalue == *(int *)parm_table[i].ptr; - case P_SEP: - break; + if (!defaults_saved) + return False; + switch (parm_table[i].type) + { + case P_STRING: + case P_USTRING: + return strequal(parm_table[i].def.svalue, + *(char **)parm_table[i].ptr); + case P_GSTRING: + case P_UGSTRING: + return strequal(parm_table[i].def.svalue, + (char *)parm_table[i].ptr); + case P_BOOL: + case P_BOOLREV: + return parm_table[i].def.bvalue == + *(BOOL *)parm_table[i].ptr; + case P_CHAR: + return parm_table[i].def.cvalue == + *(char *)parm_table[i].ptr; + case P_INTEGER: + case P_OCTAL: + case P_ENUM: + return parm_table[i].def.ivalue == + *(int *)parm_table[i].ptr; + case P_SEP: + break; } return False; } @@ -2583,19 +2992,21 @@ static BOOL is_default(int i) /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ -static void dump_globals(FILE *f) +static void dump_globals(FILE * f) { int i; fprintf(f, "# Global parameters\n[global]\n"); - - for (i=0;parm_table[i].label;i++) + + for (i = 0; parm_table[i].label; i++) if (parm_table[i].class == P_GLOBAL && parm_table[i].ptr && - (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) { - if (defaults_saved && is_default(i)) continue; - fprintf(f,"\t%s = ",parm_table[i].label); - print_parameter(&parm_table[i],parm_table[i].ptr, f); - fprintf(f,"\n"); + (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) + { + if (defaults_saved && is_default(i)) + continue; + fprintf(f, "\t%s = ", parm_table[i].label); + print_parameter(&parm_table[i], parm_table[i].ptr, f); + fprintf(f, "\n"); } } @@ -2604,8 +3015,8 @@ return True if a local parameter is currently set to the global default ***************************************************************************/ BOOL lp_is_default(int snum, struct parm_struct *parm) { - int pdiff = PTR_DIFF(parm->ptr,&sDefault); - + int pdiff = PTR_DIFF(parm->ptr, &sDefault); + return equal_parameter(parm->type, ((char *)pSERVICE(snum)) + pdiff, ((char *)&sDefault) + pdiff); @@ -2615,32 +3026,39 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ -static void dump_a_service(service *pService, FILE *f) +static void dump_a_service(service * pService, FILE * f) { int i; if (pService != &sDefault) - fprintf(f,"\n[%s]\n",pService->szService); + 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].ptr && (*parm_table[i].label != '-') && - (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) { - int pdiff = PTR_DIFF(parm_table[i].ptr,&sDefault); - - if (pService == &sDefault) { - if (defaults_saved && is_default(i)) continue; - } else { + (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) + { + int pdiff = PTR_DIFF(parm_table[i].ptr, &sDefault); + + if (pService == &sDefault) + { + if (defaults_saved && is_default(i)) + continue; + } + else + { if (equal_parameter(parm_table[i].type, - ((char *)pService) + pdiff, - ((char *)&sDefault) + pdiff)) + ((char *)pService) + + pdiff, + ((char *)&sDefault) + + pdiff)) continue; } - fprintf(f,"\t%s = ",parm_table[i].label); + fprintf(f, "\t%s = ", parm_table[i].label); print_parameter(&parm_table[i], ((char *)pService) + pdiff, f); - fprintf(f,"\n"); + fprintf(f, "\n"); } } @@ -2652,38 +3070,53 @@ return NULL when out of parameters ***************************************************************************/ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { - if (snum == -1) { + if (snum == -1) + { /* do the globals */ - for (;parm_table[*i].label;(*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + for (; parm_table[*i].label; (*i)++) + { + if (parm_table[*i].class == P_SEPARATOR) return &parm_table[(*i)++]; - if (!parm_table[*i].ptr || (*parm_table[*i].label == '-')) + if (!parm_table[*i].ptr + || (*parm_table[*i].label == '-')) continue; - - if ((*i) > 0 && (parm_table[*i].ptr == parm_table[(*i)-1].ptr)) + + if ((*i) > 0 + && (parm_table[*i].ptr == + parm_table[(*i) - 1].ptr)) continue; return &parm_table[(*i)++]; } - } else { + } + else + { service *pService = pSERVICE(snum); - for (;parm_table[*i].label;(*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + for (; parm_table[*i].label; (*i)++) + { + if (parm_table[*i].class == P_SEPARATOR) return &parm_table[(*i)++]; if (parm_table[*i].class == P_LOCAL && - parm_table[*i].ptr && + parm_table[*i].ptr && (*parm_table[*i].label != '-') && - ((*i) == 0 || - (parm_table[*i].ptr != parm_table[(*i)-1].ptr))) { - int pdiff = PTR_DIFF(parm_table[*i].ptr,&sDefault); - + ((*i) == 0 || + (parm_table[*i].ptr != + parm_table[(*i) - 1].ptr))) + { + int pdiff = + PTR_DIFF(parm_table[*i].ptr, + &sDefault); + if (allparameters || !equal_parameter(parm_table[*i].type, - ((char *)pService) + pdiff, - ((char *)&sDefault) + pdiff)) { + ((char *)pService) + + pdiff, + ((char *)&sDefault) + + pdiff)) + { return &parm_table[(*i)++]; } } @@ -2700,18 +3133,19 @@ Display the contents of a single copy structure. ***************************************************************************/ static void dump_copy_map(BOOL *pcopymap) { - int i; - if (!pcopymap) return; + int i; + if (!pcopymap) + return; - printf("\n\tNon-Copied parameters:\n"); + printf("\n\tNon-Copied parameters:\n"); - for (i=0;parm_table[i].label;i++) - if (parm_table[i].class == P_LOCAL && - parm_table[i].ptr && !pcopymap[i] && - (i == 0 || (parm_table[i].ptr != parm_table[i-1].ptr))) - { - printf("\t\t%s\n",parm_table[i].label); - } + for (i = 0; parm_table[i].label; i++) + if (parm_table[i].class == P_LOCAL && + parm_table[i].ptr && !pcopymap[i] && + (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) + { + printf("\t\t%s\n", parm_table[i].label); + } } #endif @@ -2720,7 +3154,7 @@ Return TRUE if the passed service number is within range. ***************************************************************************/ BOOL lp_snum_ok(int iService) { - return (LP_SNUM_OK(iService) && iSERVICE(iService).bAvailable); + return (LP_SNUM_OK(iService) && iSERVICE(iService).bAvailable); } @@ -2733,20 +3167,25 @@ static void lp_add_auto_services(char *str) char *p; int homes; - if (!str) return; + if (!str) + return; s = strdup(str); - if (!s) return; + if (!s) + return; homes = lp_servicenumber(HOMES_NAME); - - for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) { + + for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) + { char *home = get_user_home_dir(p); - - if (lp_servicenumber(p) >= 0) continue; - - if (home && homes >= 0) { - lp_add_home(p,homes,home); + + if (lp_servicenumber(p) >= 0) + continue; + + if (home && homes >= 0) + { + lp_add_home(p, homes, home); } } free(s); @@ -2755,15 +3194,17 @@ static void lp_add_auto_services(char *str) /*************************************************************************** auto-load one printer ***************************************************************************/ -void lp_add_one_printer(char *name,char *comment) +void lp_add_one_printer(char *name, char *comment) { int printers = lp_servicenumber(PRINTERS_NAME); int i; - if (lp_servicenumber(name) < 0) { - lp_add_printer(name,printers); - if ((i=lp_servicenumber(name)) >= 0) { - string_set(&iSERVICE(i).comment,comment); + if (lp_servicenumber(name) < 0) + { + lp_add_printer(name, printers); + if ((i = lp_servicenumber(name)) >= 0) + { + string_set(&iSERVICE(i).comment, comment); iSERVICE(i).autoloaded = True; } } @@ -2774,19 +3215,22 @@ have we loaded a services file yet? ***************************************************************************/ BOOL lp_loaded(void) { - return(bLoaded); + return (bLoaded); } /*************************************************************************** unload unused services ***************************************************************************/ -void lp_killunused(BOOL (*snumused)(int )) +void lp_killunused(BOOL (*snumused) (int)) { int i; - for (i=0;i0 && parm_table[i].ptr == parm_table[i-1].ptr) continue; - switch (parm_table[i].type) { - case P_STRING: - case P_USTRING: - parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr); - break; - case P_GSTRING: - case P_UGSTRING: - parm_table[i].def.svalue = strdup((char *)parm_table[i].ptr); - break; - case P_BOOL: - case P_BOOLREV: - parm_table[i].def.bvalue = *(BOOL *)parm_table[i].ptr; - break; - case P_CHAR: - parm_table[i].def.cvalue = *(char *)parm_table[i].ptr; + for (i = 0; parm_table[i].label; i++) + { + if (i > 0 && parm_table[i].ptr == parm_table[i - 1].ptr) + continue; + switch (parm_table[i].type) + { + case P_STRING: + case P_USTRING: + parm_table[i].def.svalue = + strdup(*(char **)parm_table[i].ptr); + break; + case P_GSTRING: + case P_UGSTRING: + parm_table[i].def.svalue = + strdup((char *)parm_table[i].ptr); + break; + case P_BOOL: + case P_BOOLREV: + parm_table[i].def.bvalue = + *(BOOL *)parm_table[i].ptr; + break; + case P_CHAR: + parm_table[i].def.cvalue = + *(char *)parm_table[i].ptr; + break; + case P_INTEGER: + case P_OCTAL: + case P_ENUM: + parm_table[i].def.ivalue = + *(int *)parm_table[i].ptr; + break; + case P_SEP: + break; + } + } + defaults_saved = True; +} + +/******************************************************************* + Set the server type we will announce as via nmbd. +********************************************************************/ +static void set_server_role(void) +{ + server_role = ROLE_STANDALONE; + + switch (lp_security()) + { + case SEC_SHARE: + { + if (lp_domain_logons()) + { + DEBUG(0, + ("Server's Role (logon server) conflicts with share-level security\n")); + } break; - case P_INTEGER: - case P_OCTAL: - case P_ENUM: - parm_table[i].def.ivalue = *(int *)parm_table[i].ptr; + } + case SEC_SERVER: + case SEC_DOMAIN: + { + if (lp_domain_logons()) + { + server_role = ROLE_DOMAIN_BDC; + break; + } + server_role = ROLE_DOMAIN_MEMBER; break; - case P_SEP: + } + case SEC_USER: + { + if (lp_domain_logons()) + { + server_role = ROLE_DOMAIN_PDC; + break; + } break; } + default: + { + DEBUG(0, + ("Server's Role undefined due to unknown security mode\n")); + } } - defaults_saved = True; } @@ -2837,57 +3335,61 @@ static void lp_save_defaults(void) Load the services array from the services file. Return True on success, False on failure. ***************************************************************************/ -BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc) +BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, + BOOL add_ipc) { - pstring n2; - BOOL bRetval; + pstring n2; + BOOL bRetval; - add_to_file_list(pszFname); + add_to_file_list(pszFname); - bRetval = False; + bRetval = False; - bInGlobalSection = True; - bGlobalOnly = global_only; - - init_globals(); + bInGlobalSection = True; + bGlobalOnly = global_only; - if (save_defaults) { - init_locals(); - lp_save_defaults(); - } - - pstrcpy(n2,pszFname); - standard_sub_basic(n2); + init_globals(); - /* We get sections first, so have to start 'behind' to make up */ - iServiceIndex = -1; - bRetval = pm_process(n2, do_section, do_parameter); - - /* finish up the last section */ - DEBUG(3,("pm_process() returned %s\n", BOOLSTR(bRetval))); - if (bRetval) - if (iServiceIndex >= 0) - bRetval = service_ok(iServiceIndex); + if (save_defaults) + { + init_locals(); + lp_save_defaults(); + } - lp_add_auto_services(lp_auto_services()); + pstrcpy(n2, pszFname); + standard_sub_basic(n2); - if (add_ipc) - lp_add_ipc(); + /* We get sections first, so have to start 'behind' to make up */ + iServiceIndex = -1; + bRetval = pm_process(n2, do_section, do_parameter); - set_default_server_announce_type(); + /* finish up the last section */ + DEBUG(3, ("pm_process() returned %s\n", BOOLSTR(bRetval))); + if (bRetval) + if (iServiceIndex >= 0) + bRetval = service_ok(iServiceIndex); - bLoaded = True; + lp_add_auto_services(lp_auto_services()); - /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ - /* if bWINSsupport is true and we are in the client */ + if (add_ipc) + lp_add_ipc(); - if (in_client && Globals.bWINSsupport) { + set_server_role(); + set_default_server_announce_type(); - string_set(&Globals.szWINSserver, "127.0.0.1"); + bLoaded = True; - } + /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ + /* if bWINSsupport is true and we are in the client */ - return (bRetval); + if (in_client && Globals.bWINSsupport) + { + + string_set(&Globals.szWINSserver, "127.0.0.1"); + + } + + return (bRetval); } @@ -2896,7 +3398,7 @@ reset the max number of services ***************************************************************************/ void lp_resetnumservices(void) { - iNumServices = 0; + iNumServices = 0; } /*************************************************************************** @@ -2904,39 +3406,40 @@ return the max number of services ***************************************************************************/ int lp_numservices(void) { - return(iNumServices); + return (iNumServices); } /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) +void lp_dump(FILE * f, BOOL show_defaults, int maxtoprint) { - int iService; + int iService; - if (show_defaults) { - defaults_saved = False; - } + if (show_defaults) + { + defaults_saved = False; + } - dump_globals(f); - - dump_a_service(&sDefault, f); + dump_globals(f); - for (iService = 0; iService < maxtoprint; iService++) - lp_dump_one(f, show_defaults, iService); + dump_a_service(&sDefault, f); + + for (iService = 0; iService < maxtoprint; iService++) + lp_dump_one(f, show_defaults, iService); } /*************************************************************************** Display the contents of one service in human-readable form. ***************************************************************************/ -void lp_dump_one(FILE *f, BOOL show_defaults, int snum) +void lp_dump_one(FILE * f, BOOL show_defaults, int snum) { - if (VALID(snum)) - { - if (iSERVICE(snum).szService[0] == '\0') - return; - dump_a_service(pSERVICE(snum), f); - } + if (VALID(snum)) + { + if (iSERVICE(snum).szService[0] == '\0') + return; + dump_a_service(pSERVICE(snum), f); + } } @@ -2948,17 +3451,19 @@ does not copy the found service. ***************************************************************************/ int lp_servicenumber(char *pszServiceName) { - int iService; + int iService; - for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && - strequal(lp_servicename(iService), pszServiceName)) - break; + for (iService = iNumServices - 1; iService >= 0; iService--) + if (VALID(iService) && + strequal(lp_servicename(iService), pszServiceName)) + break; - if (iService < 0) - DEBUG(7,("lp_servicenumber: couldn't find %s\n",pszServiceName)); - - return (iService); + if (iService < 0) + DEBUG(7, + ("lp_servicenumber: couldn't find %s\n", + pszServiceName)); + + return (iService); } /******************************************************************* @@ -2966,9 +3471,10 @@ int lp_servicenumber(char *pszServiceName) ******************************************************************/ char *volume_label(int snum) { - char *ret = lp_volume(snum); - if (!*ret) return(lp_servicename(snum)); - return(ret); + char *ret = lp_volume(snum); + if (!*ret) + return (lp_servicename(snum)); + return (ret); } @@ -2977,20 +3483,113 @@ char *volume_label(int snum) ********************************************************************/ static void set_default_server_announce_type(void) { - default_server_announce = (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | - SV_TYPE_SERVER_UNIX | SV_TYPE_PRINTQ_SERVER); - if(lp_announce_as() == ANNOUNCE_AS_NT_SERVER) - default_server_announce |= (SV_TYPE_SERVER_NT | SV_TYPE_NT); - if(lp_announce_as() == ANNOUNCE_AS_NT_WORKSTATION) - default_server_announce |= SV_TYPE_NT; - else if(lp_announce_as() == ANNOUNCE_AS_WIN95) - default_server_announce |= SV_TYPE_WIN95_PLUS; - else if(lp_announce_as() == ANNOUNCE_AS_WFW) - default_server_announce |= SV_TYPE_WFW; - default_server_announce |= (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0); - default_server_announce |= (lp_host_msdfs() ? SV_TYPE_DFS_SERVER : 0); + default_server_announce = 0; + default_server_announce |= SV_TYPE_WORKSTATION; + default_server_announce |= SV_TYPE_SERVER; + default_server_announce |= SV_TYPE_SERVER_UNIX; + default_server_announce |= SV_TYPE_PRINTQ_SERVER; + + switch (lp_announce_as()) + { + case ANNOUNCE_AS_NT_SERVER: + { + default_server_announce |= SV_TYPE_SERVER_NT; + /* fall through... */ + } + case ANNOUNCE_AS_NT_WORKSTATION: + { + default_server_announce |= SV_TYPE_NT; + break; + } + case ANNOUNCE_AS_WIN95: + { + default_server_announce |= SV_TYPE_WIN95_PLUS; + break; + } + case ANNOUNCE_AS_WFW: + { + default_server_announce |= SV_TYPE_WFW; + break; + } + default: + { + break; + } + } + + switch (lp_server_role()) + { + case ROLE_DOMAIN_MEMBER: + { + default_server_announce |= SV_TYPE_DOMAIN_MEMBER; + break; + } + case ROLE_DOMAIN_PDC: + { + default_server_announce |= SV_TYPE_DOMAIN_CTRL; + break; + } + case ROLE_DOMAIN_BDC: + { + default_server_announce |= SV_TYPE_DOMAIN_BAKCTRL; + break; + } + case ROLE_STANDALONE: + default: + { + break; + } + } + + if (lp_time_server()) + { + default_server_announce |= SV_TYPE_TIME_SOURCE; + } + + if (lp_host_msdfs()) + { + default_server_announce |= SV_TYPE_DFS_SERVER; + } +} + +/*********************************************************** + returns role of Samba server +************************************************************/ + +int lp_server_role(void) +{ + return server_role; +} + +/*********************************************************** + If we are PDC then prefer us as DMB +************************************************************/ + +BOOL lp_domain_master(void) +{ + if (Globals.bDomainMaster == Auto) + { + return (lp_server_role() == ROLE_DOMAIN_PDC); + } + + return Globals.bDomainMaster; } +/*********************************************************** + If we are DMB then prefer us as LMB +************************************************************/ + +BOOL lp_preferred_master(void) +{ + if (Globals.bPreferredMaster == Auto) + { + return (lp_local_master() && lp_domain_master()); + } + + return Globals.bPreferredMaster; +} + + /******************************************************************* remove a service @@ -3007,7 +3606,8 @@ void lp_copy_service(int snum, char *new_name) { char *oldname = lp_servicename(snum); do_section(new_name); - if (snum >= 0) { + if (snum >= 0) + { snum = lp_servicenumber(new_name); if (snum >= 0) lp_do_parameter(snum, "copy", oldname); @@ -3020,7 +3620,7 @@ void lp_copy_service(int snum, char *new_name) ********************************************************************/ int lp_default_server_announce(void) { - return default_server_announce; + return default_server_announce; } /******************************************************************* @@ -3028,55 +3628,55 @@ int lp_default_server_announce(void) ********************************************************************/ int lp_major_announce_version(void) { - static BOOL got_major = False; - static int major_version = DEFAULT_MAJOR_VERSION; - char *vers; - char *p; + static BOOL got_major = False; + static int major_version = DEFAULT_MAJOR_VERSION; + char *vers; + char *p; + + if (got_major) + return major_version; - if(got_major) - return major_version; + got_major = True; + if ((vers = lp_announce_version()) == NULL) + return major_version; - got_major = True; - if((vers = lp_announce_version()) == NULL) - return major_version; - - if((p = strchr(vers, '.')) == 0) - return major_version; + if ((p = strchr(vers, '.')) == 0) + return major_version; - *p = '\0'; - major_version = atoi(vers); - return major_version; + *p = '\0'; + major_version = atoi(vers); + return major_version; } int lp_minor_announce_version(void) { - static BOOL got_minor = False; - static int minor_version = DEFAULT_MINOR_VERSION; - char *vers; - char *p; - - if(got_minor) - return minor_version; - - got_minor = True; - if((vers = lp_announce_version()) == NULL) - return minor_version; - - if((p = strchr(vers, '.')) == 0) - return minor_version; - - p++; - minor_version = atoi(p); - return minor_version; -} + static BOOL got_minor = False; + static int minor_version = DEFAULT_MINOR_VERSION; + char *vers; + char *p; + + if (got_minor) + return minor_version; + + got_minor = True; + if ((vers = lp_announce_version()) == NULL) + return minor_version; + + if ((p = strchr(vers, '.')) == 0) + return minor_version; + + p++; + minor_version = atoi(p); + return minor_version; +} /*********************************************************** Set the global name resolution order (used in smbclient). ************************************************************/ void lp_set_name_resolve_order(char *new_order) -{ - Globals.szNameResolveOrder = new_order; +{ + Globals.szNameResolveOrder = new_order; } /*********************************************************** @@ -3088,16 +3688,16 @@ static BOOL kernel_oplocks_available = False; void lp_set_kernel_oplocks(BOOL val) { - /* - * Only set this to True if kerenl - * oplocks are really available and were - * turned on in the smb.conf file. - */ + /* + * Only set this to True if kerenl + * oplocks are really available and were + * turned on in the smb.conf file. + */ - if(Globals.bKernelOplocks && val) - kernel_oplocks_available = True; - else - kernel_oplocks_available = False; + if (Globals.bKernelOplocks && val) + kernel_oplocks_available = True; + else + kernel_oplocks_available = False; } /*********************************************************** @@ -3107,7 +3707,7 @@ void lp_set_kernel_oplocks(BOOL val) BOOL lp_kernel_oplocks(void) { - return kernel_oplocks_available; + return kernel_oplocks_available; } /*********************************************************** @@ -3117,34 +3717,33 @@ BOOL lp_kernel_oplocks(void) int lp_security_mask(int snum) { - int val = _lp_security_mask(snum); - if(val == -1) - return lp_create_mask(snum); - return val; + int val = _lp_security_mask(snum); + if (val == -1) + return lp_create_mask(snum); + return val; } int lp_force_security_mode(int snum) { - int val = _lp_force_security_mode(snum); - if(val == -1) - return lp_force_create_mode(snum); - return val; + int val = _lp_force_security_mode(snum); + if (val == -1) + return lp_force_create_mode(snum); + return val; } int lp_dir_security_mask(int snum) { - int val = _lp_dir_security_mask(snum); - if(val == -1) - return lp_dir_mask(snum); - return val; + int val = _lp_dir_security_mask(snum); + if (val == -1) + return lp_dir_mask(snum); + return val; } int lp_force_dir_security_mode(int snum) { - int val = _lp_force_dir_security_mode(snum); - if(val == -1) - return lp_force_dir_mode(snum); - return val; + int val = _lp_force_dir_security_mode(snum); + if (val == -1) + return lp_force_dir_mode(snum); + return val; } - -- cgit From a6e52f2b2e0de393507ac09a9dcfa211a898529c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 29 May 2000 00:20:21 +0000 Subject: make proto (This used to be commit 62271c30f415cad71aea9edfd578f0b7ab42fb42) --- source3/param/loadparm.c | 71 ++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 39 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 57f93095a2..ada49515bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1557,9 +1557,9 @@ FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP - FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) +FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) #endif /* WITH_UTMP */ - FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) +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) @@ -1573,9 +1573,9 @@ FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) #ifdef USING_GROUPNAME_MAP - FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) +FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) #endif /* USING_GROUPNAME_MAP */ - FN_GLOBAL_STRING(lp_logon_script, &Globals.szLogonScript) +FN_GLOBAL_STRING(lp_logon_script, &Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path, &Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive, &Globals.szLogonDrive) FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome) @@ -1585,8 +1585,8 @@ FN_GLOBAL_STRING(lp_wins_server, &Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces, &Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) - static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) - FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) +static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) +FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile, &Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) @@ -1653,8 +1653,8 @@ FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname, &Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) - static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) - FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) +static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) +FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_nt_smb_support, &Globals.bNTSmbSupport) @@ -1683,22 +1683,14 @@ FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) - static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) - FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) +static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) +FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) -FN_GLOBAL_INTEGER(lp_machine_password_timeout, - &Globals. - machine_password_timeout) -FN_GLOBAL_INTEGER(lp_change_notify_timeout, - &Globals. - change_notify_timeout) FN_GLOBAL_INTEGER(lp_stat_cache_size, - &Globals. - stat_cache_size) -FN_GLOBAL_INTEGER(lp_map_to_guest, - &Globals. - map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, - &Globals. - min_passwd_length) +FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout) +FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) +FN_GLOBAL_INTEGER(lp_stat_cache_size, &Globals.stat_cache_size) +FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) +FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) @@ -1733,10 +1725,11 @@ FN_LOCAL_STRING(lp_force_user, force_user) FN_LOCAL_STRING(lp_force_group, force_group) FN_LOCAL_STRING(lp_readlist, readlist) FN_LOCAL_STRING(lp_writelist, writelist) -FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) - static FN_LOCAL_STRING(lp_volume, volume) - FN_LOCAL_STRING(lp_mangled_map, szMangledMap) - FN_LOCAL_STRING(lp_veto_files, szVetoFiles) +FN_LOCAL_STRING(lp_fstype, fstype) +FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) +static FN_LOCAL_STRING(lp_volume, volume) +FN_LOCAL_STRING(lp_mangled_map, szMangledMap) +FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation, szPrinterDriverLocation) @@ -1800,23 +1793,23 @@ FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) /* local prototypes */ - static int strwicmp(char *psz1, char *psz2); - static int map_parameter(char *pszParmName); - static BOOL set_boolean(BOOL *pb, char *pszParmValue); - static int getservicebyname(char *pszServiceName, - service * pserviceDest); - static void copy_service(service * pserviceDest, - service * pserviceSource, BOOL *pcopymapDest); - static BOOL service_ok(int iService); - static BOOL do_parameter(char *pszParmName, char *pszParmValue); - static BOOL do_section(char *pszSectionName); - static void init_copymap(service * pservice); +static int strwicmp(char *psz1, char *psz2); +static int map_parameter(char *pszParmName); +static BOOL set_boolean(BOOL *pb, char *pszParmValue); +static int getservicebyname(char *pszServiceName, + service * pserviceDest); +static void copy_service(service * pserviceDest, + service * pserviceSource, BOOL *pcopymapDest); +static BOOL service_ok(int iService); +static BOOL do_parameter(char *pszParmName, char *pszParmValue); +static BOOL do_section(char *pszSectionName); +static void init_copymap(service * pservice); /*************************************************************************** initialise a service to the defaults ***************************************************************************/ - static void init_service(service * pservice) +static void init_service(service * pservice) { memset((char *)pservice, '\0', sizeof(service)); copy_service(pservice, &sDefault, NULL); -- cgit From e67aa6b43cbb2dca355e3ea9868df9509925f795 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 31 May 2000 05:42:16 +0000 Subject: space in front of lp_preexec() causing make proto to not detect this fn. (This used to be commit 3a1ebfa080fa5b26c9d0e7573cbd4bd4c239f182) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ada49515bf..3bab4dd175 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1695,7 +1695,7 @@ FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) #ifdef WITH_LDAP FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) #endif /* WITH_LDAP */ - FN_LOCAL_STRING(lp_preexec, szPreExec) +FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) FN_LOCAL_STRING(lp_rootpostexec, szRootPostExec) -- cgit From b9fedcb2de5612bdb4e763fe0788e1a4a9c16d33 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 1 Jun 2000 21:00:37 +0000 Subject: param/loadparm.c: Looks like someone ran indent on this ! passdb/smbpass.c: Insure uninitialized memory reference fix. printing/nt_printing.c: rpc_server/srv_spoolss_nt.c: Insure memory leak fixes. smbd/unix_acls.c: Shadow ref fix. Jeremy. (This used to be commit d175d3ebefc053e9badd91ca5f2d8bd03eb6705d) --- source3/param/loadparm.c | 822 +++++++++++++++++------------------------------ 1 file changed, 293 insertions(+), 529 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3bab4dd175..a1b741a639 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -159,8 +159,6 @@ typedef struct char *szAddUserScript; char *szDelUserScript; char *szWINSHook; - char *szNtForms; - char *szNtDriverFile; #ifdef WITH_UTMP char *szUtmpDir; #endif /* WITH_UTMP */ @@ -515,25 +513,35 @@ static BOOL handle_winbind_id(char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); -static struct enum_list enum_protocol[] = - { {PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, -{PROTOCOL_LANMAN1, "LANMAN1"}, {PROTOCOL_CORE, "CORE"}, -{PROTOCOL_COREPLUS, "COREPLUS"}, -{PROTOCOL_COREPLUS, "CORE+"}, {-1, NULL} +static struct enum_list enum_protocol[] = { + {PROTOCOL_NT1, "NT1"}, + {PROTOCOL_LANMAN2, "LANMAN2"}, + {PROTOCOL_LANMAN1, "LANMAN1"}, + {PROTOCOL_CORE, "CORE"}, + {PROTOCOL_COREPLUS, "COREPLUS"}, + {PROTOCOL_COREPLUS, "CORE+"}, + {-1, NULL} }; -static struct enum_list enum_security[] = - { {SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, -{SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, -{-1, NULL} +static struct enum_list enum_security[] = { + {SEC_SHARE, "SHARE"}, + {SEC_USER, "USER"}, + {SEC_SERVER, "SERVER"}, + {SEC_DOMAIN, "DOMAIN"}, + {-1, NULL} }; -static struct enum_list enum_printing[] = - { {PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, -{PRINT_HPUX, "hpux"}, {PRINT_BSD, "bsd"}, -{PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, -{PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, -{PRINT_CUPS, "cups"}, {-1, NULL} +static struct enum_list enum_printing[] = { + {PRINT_SYSV, "sysv"}, + {PRINT_AIX, "aix"}, + {PRINT_HPUX, "hpux"}, + {PRINT_BSD, "bsd"}, + {PRINT_QNX, "qnx"}, + {PRINT_PLP, "plp"}, + {PRINT_LPRNG, "lprng"}, + {PRINT_SOFTQ, "softq"}, + {PRINT_CUPS, "cups"}, + {-1, NULL} }; /* Types of machine we can announce as. */ @@ -542,17 +550,27 @@ static struct enum_list enum_printing[] = #define ANNOUNCE_AS_WFW 3 #define ANNOUNCE_AS_NT_WORKSTATION 4 -static struct enum_list enum_announce_as[] = - { {ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, - {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, {ANNOUNCE_AS_WIN95, - "win95"}, - {ANNOUNCE_AS_WFW, "WfW"}, {-1, NULL} }; +static struct enum_list enum_announce_as[] = { + {ANNOUNCE_AS_NT_SERVER, "NT"}, + {ANNOUNCE_AS_NT_SERVER, "NT Server"}, + {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, + {ANNOUNCE_AS_WIN95, "win95"}, + {ANNOUNCE_AS_WFW, "WfW"}, + {-1, NULL} +}; -static struct enum_list enum_case[] = - { {CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL} }; +static struct enum_list enum_case[] = { + {CASE_LOWER, "lower"}, + {CASE_UPPER, "upper"}, + {-1, NULL} +}; -static struct enum_list enum_bool_auto[] = - { {False, "False"}, {True, "True"}, {Auto, "Auto"}, {-1, NULL} }; +static struct enum_list enum_bool_auto[] = { + {False, "False"}, + {True, "True"}, + {Auto, "Auto"}, + {-1, NULL} +}; /* Do you want session setups at user level security with a invalid @@ -575,15 +593,20 @@ static struct enum_list enum_bool_auto[] = level security. */ -static struct enum_list enum_map_to_guest[] = - { {NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, - "Bad User"}, - {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, {-1, NULL} }; +static struct enum_list enum_map_to_guest[] = { + {NEVER_MAP_TO_GUEST, "Never"}, + {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, + {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, + {-1, NULL} +}; #ifdef WITH_SSL -static struct enum_list enum_ssl_version[] = - { {SMB_SSL_V2, "ssl2"}, {SMB_SSL_V3, "ssl3"}, -{SMB_SSL_V23, "ssl2or3"}, {SMB_SSL_TLS1, "tls1"}, {-1, NULL} +static struct enum_list enum_ssl_version[] = { + {SMB_SSL_V2, "ssl2"}, + {SMB_SSL_V3, "ssl3"}, + {SMB_SSL_V23, "ssl2or3"}, + {SMB_SSL_TLS1, "tls1"}, + {-1, NULL} }; #endif @@ -591,182 +614,106 @@ static struct enum_list enum_ssl_version[] = static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, - handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, - handle_client_code_page, NULL, 0}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, - FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, - FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, - FLAG_DOS_STRING}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, - FLAG_BASIC | FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, - handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, - NULL, NULL, FLAG_DOS_STRING}, - {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, - FLAG_DOS_STRING}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, - NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, - FLAG_BASIC}, - {"bind interfaces only", P_BOOL, P_GLOBAL, - &Globals.bBindInterfacesOnly, NULL, NULL, 0}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, + {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING}, + {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, + {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, + {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, {"Security Options", P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, - enum_security, FLAG_BASIC}, - {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, - NULL, NULL, FLAG_BASIC}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, - NULL, FLAG_BASIC}, - {"allow trusted domains", P_BOOL, P_GLOBAL, - &Globals.bAllowTrustedDomains, NULL, NULL, 0}, - {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, - NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, - 0}, - {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, - NULL, NULL, 0}, - {"min password length", P_INTEGER, P_GLOBAL, - &Globals.min_passwd_length, NULL, NULL, 0}, - {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, - enum_map_to_guest, 0}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, - NULL, 0}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, - NULL, NULL, 0}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, - NULL, NULL, 0}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, - 0}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, + {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, + {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"passwd program", P_STRING, P_GLOBAL, - &Globals.szPasswdProgram, NULL, NULL, 0}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, - 0}, - {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, - NULL, NULL, 0}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, - NULL, 0}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, - NULL, 0}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, - NULL, 0}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, - NULL, NULL, 0}, - {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, - NULL, NULL, 0}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, + {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, - NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, - NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, - NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, - FLAG_SHARE}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, - FLAG_SHARE}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, + {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, - NULL, FLAG_BASIC | FLAG_SHARE}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, - NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, - FLAG_GLOBAL}, - {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, - NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, - NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force security mode", P_OCTAL, P_LOCAL, - &sDefault.iSecurity_force_mode, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, - FLAG_GLOBAL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, - NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory security mask", P_OCTAL, P_LOCAL, - &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force directory security mode", P_OCTAL, P_LOCAL, - &sDefault.iDir_Security_force_mode, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE}, - {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, - NULL, NULL, FLAG_SHARE}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, - FLAG_SHARE}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, - FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, - NULL, FLAG_SHARE}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, - FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, - 0}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, - FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, - 0}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, + {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, #ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, - {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, - NULL, NULL, 0}, - {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, - NULL, NULL, 0}, - {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, - NULL, 0}, - {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, - NULL, 0}, - {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, - 0}, - {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, - NULL, 0}, - {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, - NULL, 0}, - {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, - NULL, NULL, 0}, - {"ssl require clientcert", P_BOOL, P_GLOBAL, - &Globals.sslReqClientCert, NULL, NULL, 0}, - {"ssl require servercert", P_BOOL, P_GLOBAL, - &Globals.sslReqServerCert, NULL, NULL, 0}, - {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, - 0}, - {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, - enum_ssl_version, 0}, - {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, - NULL, NULL, 0}, + {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, + {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, + {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, + {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, + {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0}, + {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0}, + {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, + {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, + {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, + {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, + {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, + {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, + {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, #endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, @@ -776,431 +723,252 @@ static struct parm_struct parm_table[] = { {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, - NULL, NULL, 0}, - {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, - NULL, 0}, - {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, - NULL, 0}, - {"debug hires timestamp", P_BOOL, P_GLOBAL, - &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, - FLAG_GLOBAL | FLAG_SHARE | FLAG_PRINT}, + {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_PRINT}, {"Protocol Options", P_SEP, P_SEPARATOR}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, - enum_protocol, 0}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, - NULL, NULL, 0}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, - NULL, 0}, - {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, - NULL, 0}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, - NULL, NULL, 0}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, - enum_announce_as, 0}, + {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, + {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {"name resolve order", P_STRING, P_GLOBAL, - &Globals.szNameResolveOrder, NULL, NULL, 0}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, - 0}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, - 0}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, - NULL, NULL, 0}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, - NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, - 0}, + {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, - {"change notify timeout", P_INTEGER, P_GLOBAL, - &Globals.change_notify_timeout, NULL, NULL, 0}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, - NULL, NULL, 0}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, - NULL, NULL, FLAG_SHARE}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, - NULL, 0}, - {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, - NULL, 0}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, - NULL, NULL, FLAG_PRINT}, - {"read prediction", P_BOOL, P_GLOBAL, &Globals.bReadPrediction, NULL, - NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, - NULL, NULL, 0}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, - NULL, 0}, - {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, - NULL, NULL, 0}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, - FLAG_SHARE}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, - FLAG_SHARE}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, - NULL, NULL, FLAG_SHARE}, + {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, {"Printing Options", P_SEP, P_SEPARATOR}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, - NULL, NULL, FLAG_PRINT}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, - NULL, FLAG_PRINT}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, - 0}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, - NULL, NULL, FLAG_PRINT}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, - FLAG_PRINT}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, FLAG_PRINT}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, - NULL, FLAG_PRINT}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, - enum_printing, FLAG_PRINT | FLAG_GLOBAL}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, - NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, - FLAG_PRINT | FLAG_GLOBAL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, - NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, - NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, - NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, - &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, - &sDefault.szQueueresumecommand, NULL, NULL, - FLAG_PRINT | FLAG_GLOBAL}, - - - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, - NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, - 0}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, - NULL, FLAG_PRINT}, - {"printer driver location", P_STRING, P_LOCAL, - &sDefault.szPrinterDriverLocation, NULL, NULL, - FLAG_PRINT | FLAG_GLOBAL}, - {"nt forms file", P_STRING, P_GLOBAL, &Globals.szNtForms, NULL, NULL, - FLAG_GLOBAL}, - {"nt printer driver", P_STRING, P_GLOBAL, &Globals.szNtDriverFile, - NULL, NULL, FLAG_GLOBAL}, - + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, - handle_character_set, NULL, 0}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, - NULL, 0}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, - enum_case, FLAG_SHARE}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, - NULL, 0}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, - NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, - NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, - {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, - NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, - NULL, NULL, 0}, - {"domain admin group", P_STRING, P_GLOBAL, - &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group", P_STRING, P_GLOBAL, - &Globals.szDomainGuestGroup, NULL, NULL, 0}, - {"domain admin users", P_STRING, P_GLOBAL, - &Globals.szDomainAdminUsers, NULL, NULL, 0}, - {"domain guest users", P_STRING, P_GLOBAL, - &Globals.szDomainGuestUsers, NULL, NULL, 0}, + {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, + {"domain admin group", P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group", P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {"domain admin users", P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, + {"domain guest users", P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, #ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, - NULL, NULL, 0}, + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, #endif /* USING_GROUPNAME_MAP */ - {"machine password timeout", P_INTEGER, P_GLOBAL, - &Globals.machine_password_timeout, NULL, NULL, 0}, + {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, - {"add user script", P_STRING, P_GLOBAL, - &Globals.szAddUserScript, NULL, NULL, 0}, - {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, - NULL, NULL, 0}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, - NULL, FLAG_DOS_STRING}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, - FLAG_DOS_STRING}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, - 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, - FLAG_DOS_STRING}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, - NULL, 0}, + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, + {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_DOS_STRING}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_DOS_STRING}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_DOS_STRING}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"Browse Options", P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, - NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, - enum_bool_auto, 0}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, - 0}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, - NULL, enum_bool_auto, FLAG_BASIC}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, - enum_bool_auto, FLAG_HIDE}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, - FLAG_BASIC}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, - enum_bool_auto, FLAG_BASIC}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, - 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, - FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, {"WINS Options", P_SEP, P_SEPARATOR}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, - NULL, NULL, FLAG_BASIC}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, - FLAG_BASIC}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, {"Locking Options", P_SEP, P_SEPARATOR}, - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, - NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, - FLAG_SHARE}, - {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, - NULL, FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, + {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_UTMP - - {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, + {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, #endif - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"oplock break wait time", P_INTEGER, P_GLOBAL, - &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, - {"oplock contention limit", P_INTEGER, P_LOCAL, - &sDefault.iOplockContentionLimit, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"oplock break wait time", P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, + {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_LDAP {"Ldap Options", P_SEP, P_SEPARATOR}, - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, - NULL, NULL, 0}, - {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, - - {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, - NULL, NULL, 0}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, - 0}, + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, + {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - - {"ldap root passwd", P_STRING, P_GLOBAL, - &Globals.szLdapRootPassword, NULL, NULL, 0}, + {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, #endif /* WITH_LDAP */ - {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, - NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, - 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, - NULL, 0}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, - NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, - NULL, NULL, 0}, + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, #endif /* WITH_UTMP */ - {"default service", P_STRING, P_GLOBAL, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, - 0}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, - NULL, 0}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, - 0}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, - handle_valid_chars, NULL, 0}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, - NULL, NULL, 0}, - {"remote browse sync", P_STRING, P_GLOBAL, - &Globals.szRemoteBrowseSync, NULL, NULL, 0}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, - NULL, 0}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, - NULL, 0}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, - 0}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, - NULL, 0}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, - 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, + {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, {"-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_SHARE | FLAG_PRINT}, + {"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_SHARE | FLAG_PRINT}, {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, - NULL, NULL, FLAG_SHARE}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, - FLAG_SHARE | FLAG_PRINT}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, - NULL, FLAG_SHARE | FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, - NULL, NULL, FLAG_SHARE}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, - NULL, FLAG_SHARE | FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, - FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, - FLAG_SHARE}, - {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, - FLAG_SHARE}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, - NULL, FLAG_SHARE}, - {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, - handle_source_env, NULL, 0}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, - NULL, FLAG_SHARE}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, - NULL, FLAG_SHARE}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, - NULL, FLAG_SHARE}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, - NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, - &sDefault.bDosFiletimeResolution, NULL, NULL, - FLAG_SHARE | FLAG_GLOBAL}, - - - {"fake directory create times", P_BOOL, P_LOCAL, - &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, - NULL, 0}, + {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, + {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, + {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + + {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, {"VFS options", P_SEP, P_SEPARATOR}, - - {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, - handle_vfs_object, NULL, 0}, - {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, - 0}, + {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, + {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, - {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, - NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, - FLAG_GLOBAL}, + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, {"Winbind options", P_SEP, P_SEPARATOR}, - - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, - handle_winbind_id, NULL, 0}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, - handle_winbind_id, NULL, 0}, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, - NULL, NULL, 0}, - {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, - NULL, 0}, - {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, - NULL, NULL, 0}, - {"winbind cache time", P_INTEGER, P_GLOBAL, - &Globals.winbind_cache_time, NULL, NULL, 0}, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, + {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, + {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, + {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1245,8 +1013,6 @@ static void init_globals(void) string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szDriverFile, DRIVERFILE); - string_set(&Globals.szNtForms, FORMSFILE); - string_set(&Globals.szNtDriverFile, NTDRIVERSDIR); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); #ifdef WITH_UTMP @@ -1597,8 +1363,6 @@ FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group, &Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_domain_admin_users, &Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users, &Globals.szDomainGuestUsers) -FN_GLOBAL_STRING(lp_nt_forms, &Globals.szNtForms) -FN_GLOBAL_STRING(lp_nt_drivers_file, &Globals.szNtDriverFile) FN_GLOBAL_STRING(lp_winbind_uid, &Globals.szWinbindUID) FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) -- cgit From a62d17dc618f3de641341118af02fb43b6cb7e6a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Jun 2000 22:24:13 +0000 Subject: Change from "David S. Chappell" to make "printer driver file" a share parameter. This fits better with the new NT printing subsystem. Jeremy. (This used to be commit 7afb68461f3938a647a6c48689293af8ed36ccb7) --- source3/param/loadparm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a1b741a639..8f23d20796 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -148,7 +148,6 @@ typedef struct char *szNetbiosAliases; char *szDomainOtherSIDs; char *szDomainGroups; - char *szDriverFile; char *szNameResolveOrder; char *szLdapServer; char *szLdapSuffix; @@ -292,6 +291,7 @@ typedef struct char *szPrintername; char *szPrinterDriver; char *szPrinterDriverLocation; + char *szDriverFile; char *szDontdescend; char *szHostsallow; char *szHostsdeny; @@ -403,6 +403,7 @@ static service sDefault = { NULL, /* szPrintername */ NULL, /* szPrinterDriver - this is set in init_globals() */ NULL, /* szPrinterDriverLocation */ + NULL, /* szDriverFile */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -781,7 +782,6 @@ static struct parm_struct parm_table[] = { {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"printer driver file", P_STRING, P_GLOBAL, &Globals.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, @@ -797,6 +797,7 @@ static struct parm_struct parm_table[] = { {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, + {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"Filename Handling", P_SEP, P_SEPARATOR}, @@ -1012,7 +1013,6 @@ static void init_globals(void) string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); - string_set(&Globals.szDriverFile, DRIVERFILE); string_set(&Globals.szLockDir, LOCKDIR); string_set(&Globals.szRootdir, "/"); #ifdef WITH_UTMP @@ -1170,6 +1170,8 @@ Initialise the sDefault parameter structure. ***************************************************************************/ static void init_locals(void) { + string_set(&sDefault.szDriverFile, DRIVERFILE); + /* choose defaults depending on the type of printing */ switch (sDefault.iPrinting) { @@ -1353,7 +1355,6 @@ FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) -FN_GLOBAL_STRING(lp_driverfile, &Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) @@ -1479,6 +1480,7 @@ FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) FN_LOCAL_STRING(lp_printername, szPrintername) +FN_LOCAL_STRING(lp_driverfile, szDriverFile) FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) FN_LOCAL_STRING(lp_hostsallow, szHostsallow) FN_LOCAL_STRING(lp_hostsdeny, szHostsdeny) -- cgit From 52cb05678a9b08b5aa7dbe13ae6b54ff9ee4ecac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 10 Jun 2000 13:38:07 +0000 Subject: continued the split of the kernel level oplocks code into a more modular form. In this pass I added oplock_irix.c and added a "struct kernel_oplocks" that describes a kernel oplock implementation. (This used to be commit b5ceab810292602ea9a81696c20a781c16b706c2) --- source3/param/loadparm.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8f23d20796..ef62fc82ca 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1429,6 +1429,7 @@ FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) +FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) 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) @@ -3438,37 +3439,6 @@ void lp_set_name_resolve_order(char *new_order) Globals.szNameResolveOrder = new_order; } -/*********************************************************** - Set the flag that says if kernel oplocks are available - (called by smbd). -************************************************************/ - -static BOOL kernel_oplocks_available = False; - -void lp_set_kernel_oplocks(BOOL val) -{ - /* - * Only set this to True if kerenl - * oplocks are really available and were - * turned on in the smb.conf file. - */ - - if (Globals.bKernelOplocks && val) - kernel_oplocks_available = True; - else - kernel_oplocks_available = False; -} - -/*********************************************************** - Return True if kernel oplocks are available and were turned - on in smb.conf. -************************************************************/ - -BOOL lp_kernel_oplocks(void) -{ - return kernel_oplocks_available; -} - /*********************************************************** Functions to return the current security masks/modes. If set to -1 then return the create mask/mode instead. -- cgit From 26848a3478ab132cd924f14a66f85f74c2433329 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 10 Jun 2000 14:29:31 +0000 Subject: a first pass at Linux kernel oplocks support (This used to be commit 3253085d9883a181c04b9c9ecf7d0ccdfbcee88d) --- source3/param/loadparm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ef62fc82ca..28dd455e51 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1144,10 +1144,7 @@ static void init_globals(void) Globals.bDNSproxy = True; - /* - * smbd will check at runtime to see if this value - * will really be used or not. - */ + /* this just means to use them if they exist */ Globals.bKernelOplocks = True; Globals.bAllowTrustedDomains = True; @@ -2550,7 +2547,7 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) if (!bInGlobalSection && bGlobalOnly) return (True); - DEBUGADD(3, ("doing parameter %s = %s\n", pszParmName, pszParmValue)); + DEBUGADD(4, ("doing parameter %s = %s\n", pszParmName, pszParmValue)); return (lp_do_parameter(bInGlobalSection ? -2 : iServiceIndex, pszParmName, pszParmValue)); @@ -3124,7 +3121,7 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, bRetval = pm_process(n2, do_section, do_parameter); /* finish up the last section */ - DEBUG(3, ("pm_process() returned %s\n", BOOLSTR(bRetval))); + DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval))); if (bRetval) if (iServiceIndex >= 0) bRetval = service_ok(iServiceIndex); -- cgit From 8843a6379d7c1cf59f0f3673cbc567b09994b7d2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 11 Jun 2000 05:57:58 +0000 Subject: Linux kernel oplocks now seem to work, but need a _lot_ of testing I had to modify sys_select() to not loop on EINTR. I added a wrapper called sys_select_intr() which gives the old behaviour. (This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 28dd455e51..20eec790dd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1014,7 +1014,6 @@ static void init_globals(void) string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szLockDir, LOCKDIR); - string_set(&Globals.szRootdir, "/"); #ifdef WITH_UTMP string_set(&Globals.szUtmpDir, ""); #endif /* WITH_UTMP */ -- cgit From db2f46df1ea7d2f639169187bdaf905f7928f586 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Jun 2000 15:53:13 +0000 Subject: more update. (This used to be commit ac91ef30932e3e472a16c4c756f6dfddc1b18487) --- source3/param/loadparm.c | 138 ----------------------------------------------- source3/param/params.c | 1 - 2 files changed, 139 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 20eec790dd..d42733bdaa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,7 +119,6 @@ typedef struct char *szSMBPasswdFile; char *szPasswordServer; char *szSocketOptions; - char *szValidChars; char *szWorkGroup; char *szDomainAdminGroup; char *szDomainGuestGroup; @@ -189,7 +188,6 @@ typedef struct 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; @@ -500,12 +498,8 @@ static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ -static BOOL handle_valid_chars(char *pszParmValue, char **ptr); static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_character_set(char *pszParmValue, char **ptr); -static BOOL handle_coding_system(char *pszParmValue, char **ptr); -static BOOL handle_client_code_page(char *pszParmValue, char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); @@ -615,8 +609,6 @@ static struct enum_list enum_ssl_version[] = { static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, @@ -803,7 +795,6 @@ static struct parm_struct parm_table[] = { {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -916,7 +907,6 @@ static struct parm_struct parm_table[] = { {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, @@ -1083,7 +1073,6 @@ static void init_globals(void) string_set(&Globals.szNISHomeMapName, "auto.home"); #endif #endif - Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; @@ -1153,12 +1142,6 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); Globals.winbind_cache_time = 15; - /* - * This must be done last as it checks the value in - * client_code_page. - */ - - interpret_coding_system(KANJI); } /*************************************************************************** @@ -1444,7 +1427,6 @@ FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) -FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) @@ -1660,7 +1642,6 @@ static int add_a_service(service * pservice, char *name) if (name) { string_set(&iSERVICE(i).szService, name); - unix_to_dos(iSERVICE(i).szService, True); } return (i); } @@ -2084,7 +2065,6 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) * Convert from UNIX to DOS string - the UNIX to DOS converter * isn't called on the special handlers. */ - unix_to_dos(netbios_name, True); pstrcpy(global_myname, netbios_name); DEBUG(4, @@ -2212,66 +2192,6 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) return True; } -/*************************************************************************** - handle the interpretation of the coding system parameter - *************************************************************************/ -static BOOL handle_coding_system(char *pszParmValue, char **ptr) -{ - string_set(ptr, pszParmValue); - interpret_coding_system(pszParmValue); - return (True); -} - -/*************************************************************************** - Handle the interpretation of the character set system parameter. -***************************************************************************/ - -static char *saved_character_set = NULL; - -static BOOL handle_character_set(char *pszParmValue, char **ptr) -{ - /* A dependency here is that the parameter client code page should be - set before this is called. - */ - string_set(ptr, pszParmValue); - strupper(*ptr); - saved_character_set = strdup(*ptr); - interpret_character_set(*ptr, lp_client_code_page()); - return (True); -} - -/*************************************************************************** - Handle the interpretation of the client code page parameter. - We handle this separately so that we can reset the character set - parameter in case this came before 'client code page' in the smb.conf. -***************************************************************************/ - -static BOOL handle_client_code_page(char *pszParmValue, char **ptr) -{ - Globals.client_code_page = atoi(pszParmValue); - if (saved_character_set != NULL) - interpret_character_set(saved_character_set, - lp_client_code_page()); - return (True); -} - -/*************************************************************************** -handle the valid chars lines -***************************************************************************/ - -static BOOL handle_valid_chars(char *pszParmValue, char **ptr) -{ - string_set(ptr, pszParmValue); - - /* A dependency here is that the parameter client code page must be - set before this is called - as calling codepage_initialise() - would overwrite the valid char lines. - */ - codepage_initialise(lp_client_code_page()); - - add_char_string(pszParmValue); - return (True); -} /*************************************************************************** handle the include operation @@ -2493,26 +2413,22 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) case P_STRING: string_set(parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); break; case P_USTRING: string_set(parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); strupper(*(char **)parm_ptr); break; case P_GSTRING: pstrcpy((char *)parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); break; case P_UGSTRING: pstrcpy((char *)parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); strupper((char *)parm_ptr); break; @@ -2914,58 +2830,6 @@ BOOL lp_snum_ok(int iService) } -/*************************************************************************** -auto-load some home services -***************************************************************************/ -static void lp_add_auto_services(char *str) -{ - char *s; - char *p; - int homes; - - if (!str) - return; - - s = strdup(str); - if (!s) - return; - - homes = lp_servicenumber(HOMES_NAME); - - for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) - { - char *home = get_user_home_dir(p); - - if (lp_servicenumber(p) >= 0) - continue; - - if (home && homes >= 0) - { - lp_add_home(p, homes, home); - } - } - free(s); -} - -/*************************************************************************** -auto-load one printer -***************************************************************************/ -void lp_add_one_printer(char *name, char *comment) -{ - int printers = lp_servicenumber(PRINTERS_NAME); - int i; - - if (lp_servicenumber(name) < 0) - { - lp_add_printer(name, printers); - if ((i = lp_servicenumber(name)) >= 0) - { - string_set(&iSERVICE(i).comment, comment); - iSERVICE(i).autoloaded = True; - } - } -} - /*************************************************************************** have we loaded a services file yet? ***************************************************************************/ @@ -3125,8 +2989,6 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, if (iServiceIndex >= 0) bRetval = service_ok(iServiceIndex); - lp_add_auto_services(lp_auto_services()); - if (add_ipc) lp_add_ipc(); diff --git a/source3/param/params.c b/source3/param/params.c index 1cf3aa9eb1..25f9004c27 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -203,7 +203,6 @@ static int Continuation( char *line, int pos ) /* we should recognize if `\` is part of a multibyte character or not. */ while(pos2 <= pos) { size_t skip = 0; - skip = get_character_len(line[pos2]); if (skip) { pos2 += skip; } else if (pos == pos2) { -- cgit From c89f1ae0cf5856c30172c11fb935ee68f15f8be7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Jun 2000 23:57:09 +0000 Subject: reverted lukes changes in param/ apparently they were not deliberate, they were probably a result of Luke accidentally copying a CVS directory from one spot to another in error (This used to be commit 2d35d0cf1d152438c20648d863f5993e672337dc) --- source3/param/loadparm.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++ source3/param/params.c | 1 + 2 files changed, 139 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d42733bdaa..20eec790dd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,6 +119,7 @@ typedef struct char *szSMBPasswdFile; char *szPasswordServer; char *szSocketOptions; + char *szValidChars; char *szWorkGroup; char *szDomainAdminGroup; char *szDomainGuestGroup; @@ -188,6 +189,7 @@ typedef struct 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; @@ -498,8 +500,12 @@ static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ +static BOOL handle_valid_chars(char *pszParmValue, char **ptr); static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); +static BOOL handle_character_set(char *pszParmValue, char **ptr); +static BOOL handle_coding_system(char *pszParmValue, char **ptr); +static BOOL handle_client_code_page(char *pszParmValue, char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); @@ -609,6 +615,8 @@ static struct enum_list enum_ssl_version[] = { static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, + {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, + {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, @@ -795,6 +803,7 @@ static struct parm_struct parm_table[] = { {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -907,6 +916,7 @@ static struct parm_struct parm_table[] = { {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, @@ -1073,6 +1083,7 @@ static void init_globals(void) string_set(&Globals.szNISHomeMapName, "auto.home"); #endif #endif + Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; @@ -1142,6 +1153,12 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); Globals.winbind_cache_time = 15; + /* + * This must be done last as it checks the value in + * client_code_page. + */ + + interpret_coding_system(KANJI); } /*************************************************************************** @@ -1427,6 +1444,7 @@ FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) +FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) @@ -1642,6 +1660,7 @@ static int add_a_service(service * pservice, char *name) if (name) { string_set(&iSERVICE(i).szService, name); + unix_to_dos(iSERVICE(i).szService, True); } return (i); } @@ -2065,6 +2084,7 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) * Convert from UNIX to DOS string - the UNIX to DOS converter * isn't called on the special handlers. */ + unix_to_dos(netbios_name, True); pstrcpy(global_myname, netbios_name); DEBUG(4, @@ -2192,6 +2212,66 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) return True; } +/*************************************************************************** + handle the interpretation of the coding system parameter + *************************************************************************/ +static BOOL handle_coding_system(char *pszParmValue, char **ptr) +{ + string_set(ptr, pszParmValue); + interpret_coding_system(pszParmValue); + return (True); +} + +/*************************************************************************** + Handle the interpretation of the character set system parameter. +***************************************************************************/ + +static char *saved_character_set = NULL; + +static BOOL handle_character_set(char *pszParmValue, char **ptr) +{ + /* A dependency here is that the parameter client code page should be + set before this is called. + */ + string_set(ptr, pszParmValue); + strupper(*ptr); + saved_character_set = strdup(*ptr); + interpret_character_set(*ptr, lp_client_code_page()); + return (True); +} + +/*************************************************************************** + Handle the interpretation of the client code page parameter. + We handle this separately so that we can reset the character set + parameter in case this came before 'client code page' in the smb.conf. +***************************************************************************/ + +static BOOL handle_client_code_page(char *pszParmValue, char **ptr) +{ + Globals.client_code_page = atoi(pszParmValue); + if (saved_character_set != NULL) + interpret_character_set(saved_character_set, + lp_client_code_page()); + return (True); +} + +/*************************************************************************** +handle the valid chars lines +***************************************************************************/ + +static BOOL handle_valid_chars(char *pszParmValue, char **ptr) +{ + string_set(ptr, pszParmValue); + + /* A dependency here is that the parameter client code page must be + set before this is called - as calling codepage_initialise() + would overwrite the valid char lines. + */ + codepage_initialise(lp_client_code_page()); + + add_char_string(pszParmValue); + return (True); +} /*************************************************************************** handle the include operation @@ -2413,22 +2493,26 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) case P_STRING: string_set(parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); break; case P_USTRING: string_set(parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos(*(char **)parm_ptr, True); strupper(*(char **)parm_ptr); break; case P_GSTRING: pstrcpy((char *)parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); break; case P_UGSTRING: pstrcpy((char *)parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) + unix_to_dos((char *)parm_ptr, True); strupper((char *)parm_ptr); break; @@ -2830,6 +2914,58 @@ BOOL lp_snum_ok(int iService) } +/*************************************************************************** +auto-load some home services +***************************************************************************/ +static void lp_add_auto_services(char *str) +{ + char *s; + char *p; + int homes; + + if (!str) + return; + + s = strdup(str); + if (!s) + return; + + homes = lp_servicenumber(HOMES_NAME); + + for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) + { + char *home = get_user_home_dir(p); + + if (lp_servicenumber(p) >= 0) + continue; + + if (home && homes >= 0) + { + lp_add_home(p, homes, home); + } + } + free(s); +} + +/*************************************************************************** +auto-load one printer +***************************************************************************/ +void lp_add_one_printer(char *name, char *comment) +{ + int printers = lp_servicenumber(PRINTERS_NAME); + int i; + + if (lp_servicenumber(name) < 0) + { + lp_add_printer(name, printers); + if ((i = lp_servicenumber(name)) >= 0) + { + string_set(&iSERVICE(i).comment, comment); + iSERVICE(i).autoloaded = True; + } + } +} + /*************************************************************************** have we loaded a services file yet? ***************************************************************************/ @@ -2989,6 +3125,8 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, if (iServiceIndex >= 0) bRetval = service_ok(iServiceIndex); + lp_add_auto_services(lp_auto_services()); + if (add_ipc) lp_add_ipc(); diff --git a/source3/param/params.c b/source3/param/params.c index 25f9004c27..1cf3aa9eb1 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -203,6 +203,7 @@ static int Continuation( char *line, int pos ) /* we should recognize if `\` is part of a multibyte character or not. */ while(pos2 <= pos) { size_t skip = 0; + skip = get_character_len(line[pos2]); if (skip) { pos2 += skip; } else if (pos == pos2) { -- cgit From 68b4dc2ad17df97368f1cdb6822cc2edc4c87699 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Jun 2000 02:24:59 +0000 Subject: Changed default printer driver to "" from NULL. Jeremy. (This used to be commit 54bf7c12b89005f0fb7d82108e8403d89931e422) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 20eec790dd..0bcb63984b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -996,7 +996,7 @@ static void init_globals(void) string_set(parm_table[i].ptr, ""); string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); - string_set(&sDefault.szPrinterDriver, "NULL"); + string_set(&sDefault.szPrinterDriver, ""); string_set(&sDefault.fstype, FSTYPE_STRING); done_init = True; -- cgit From eecab5c66096cc42323aaa4a796bf4a17e491a00 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Jun 2000 23:59:22 +0000 Subject: Changed enumports to show printernames as ports. In line with 'the grand plan' :-) Gerald & I discussed with HP. More changes to follow. Jeremy. (This used to be commit 193a248beda99103c73a0b0ea5e2fbcbb516ce8e) --- source3/param/loadparm.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0bcb63984b..57db8f0e87 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1476,7 +1476,7 @@ FN_LOCAL_STRING(lp_lppausecommand, szLppausecommand) FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) -FN_LOCAL_STRING(lp_printername, szPrintername) +static FN_LOCAL_STRING(_lp_printername, szPrintername) FN_LOCAL_STRING(lp_driverfile, szDriverFile) FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) FN_LOCAL_STRING(lp_hostsallow, szHostsallow) @@ -1958,14 +1958,17 @@ static BOOL service_ok(int iService) /* The [printers] entry MUST be printable. I'm all for flexibility, but */ /* I can't see why you'd want a non-printable printer service... */ - if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) - if (!iSERVICE(iService).bPrint_ok) - { + if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) { + if (!iSERVICE(iService).bPrint_ok) { DEBUG(0, ("WARNING: [%s] service MUST be printable!\n", iSERVICE(iService).szService)); iSERVICE(iService).bPrint_ok = True; } + /* [printers] service must also be non-browsable. */ + if (iSERVICE(iService).bBrowseable) + iSERVICE(iService).bBrowseable = False; + } if (iSERVICE(iService).szPath[0] == '\0' && strwicmp(iSERVICE(iService).szService, HOMES_NAME) != 0) @@ -3472,3 +3475,11 @@ int lp_force_dir_security_mode(int snum) return val; } +char *lp_printername(int snum) +{ + char *ret = _lp_printername(snum); + if (ret == NULL || (ret != NULL && *ret == '\0')) + ret = lp_servicename(snum); + + return ret; +} -- cgit From a7f6c0a642428372f5fab30a5eb94f9bcc0f6173 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jul 2000 03:53:49 +0000 Subject: don't need shmem any more (This used to be commit a81371a4fd6f7972b054bea90428d1d2fd6d1d22) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 57db8f0e87..3650d4edd3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -188,7 +188,6 @@ typedef struct 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; @@ -770,7 +769,6 @@ static struct parm_struct parm_table[] = { {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"shared mem size", P_INTEGER, P_GLOBAL, &Globals.shmem_size, NULL, NULL, 0}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, @@ -1071,7 +1069,6 @@ static void init_globals(void) Globals.ReadSize = 16 * 1024; Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; - Globals.shmem_size = SHMEM_SIZE; Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ Globals.announce_as = ANNOUNCE_AS_NT_SERVER; Globals.bUnixRealname = True; @@ -1437,7 +1434,6 @@ 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_shmem_size, &Globals.shmem_size) FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) -- cgit From b35f21fb3a19417e2aab82a573ff121a086b224c Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 19 Jul 2000 01:21:30 +0000 Subject: First cut toward adding WINS server failover. *Note: failover doesn't actually work yet!* It's just that the code I'm adding provides all of the pieces necessary. I do have one big question. Something that I'll have to ask Jeremy, I'm thinkin'. In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to set up the Unicast subnet. ...so what happens if the WINS server changes? My guess is either: a) nothing. b) I'd have to change the unicast subnet entry whenever the WINS server changes. Urq. BTW, the lp_wins_server() function no longer returns the WINS server name or IP. It returns the list of WINS servers entered in smb.conf. To get the currently 'live' WINS server, use the wins_srv() function. Fun, eh? Chris -)----- (This used to be commit cc08bdc74f4cd111fdc582ee7babef47ed8a950d) --- source3/param/loadparm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3650d4edd3..61e38bea60 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -509,6 +509,7 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); static BOOL handle_winbind_id(char *pszParmValue, char **ptr); +static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -863,7 +864,7 @@ static struct parm_struct parm_table[] = { {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, NULL, NULL, FLAG_BASIC}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, @@ -2372,6 +2373,19 @@ static BOOL handle_winbind_id(char *pszParmValue, char **ptr) return True; } +/*************************************************************************** + Handle the WINS SERVER list +***************************************************************************/ +static BOOL handle_wins_server_list( char *pszParmValue, char **ptr ) + { + if( !wins_srv_load_list( pszParmValue ) ) + return( False ); /* Parse failed. */ + + string_set( ptr, pszParmValue ); + return( True ); + } + + /*************************************************************************** initialise a copymap ***************************************************************************/ -- cgit From 49fcb300de40d6da8682b485fd2c51236bcbb3dd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 31 Jul 2000 20:41:51 +0000 Subject: Added John Reilly's enumports/addprinter/delprinter scripting code plus the fix for the Win9x printer drivers. Changed command names to add "command" string on the end for some consistancy with the other scripting commands. Added '%P' option to tdbpack/unpack to store long comment string. Made port name be "Samba Printer Port" if no enum port script given. Fixed prs_uint32_pre code to cope with null args. Jeremy. (This used to be commit 902ada63799cf27924c72e24e7593a8c9fb5eba9) --- source3/param/loadparm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 61e38bea60..318c1ea534 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -104,6 +104,9 @@ static BOOL defaults_saved = False; typedef struct { char *szPrintcapname; + char *szEnumPortsCommand; + char *szAddPrinterCommand; + char *szDeletePrinterCommand; char *szLockDir; char *szRootdir; char *szDefaultService; @@ -793,6 +796,10 @@ static struct parm_struct parm_table[] = { {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, + {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, + {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, @@ -1317,6 +1324,9 @@ FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) +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_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) @@ -3007,6 +3017,18 @@ void lp_killunused(BOOL (*snumused) (int)) } +/*************************************************************************** +unload a service +***************************************************************************/ +void lp_killservice(int iServiceIn) +{ + if (VALID(iServiceIn)) + { + iSERVICE(iServiceIn).valid = False; + free_service(pSERVICE(iServiceIn)); + } +} + /*************************************************************************** save the curent values of all global and sDefault parameters into the defaults union. This allows swat and testparm to show only the -- cgit From db2445358161e1a0a68b80a7551ed88e7dcc38c6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Aug 2000 04:19:18 +0000 Subject: added printer admin option any user in that list can do anything to a printer (This used to be commit 7b5912be150dd590d6195be40b0976305b8716ba) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 318c1ea534..17a109dd06 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -308,6 +308,7 @@ typedef struct char *force_group; char *readlist; char *writelist; + char *printer_admin; char *volume; char *fstype; char *szVfsObjectFile; @@ -420,6 +421,7 @@ static service sDefault = { NULL, /* force group */ NULL, /* readlist */ NULL, /* writelist */ + NULL, /* printer admin */ NULL, /* volume */ NULL, /* fstype */ NULL, /* vfs object */ @@ -669,6 +671,7 @@ static struct parm_struct parm_table[] = { {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"printer admin", P_STRING, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, @@ -1495,6 +1498,7 @@ FN_LOCAL_STRING(lp_force_user, force_user) FN_LOCAL_STRING(lp_force_group, force_group) FN_LOCAL_STRING(lp_readlist, readlist) FN_LOCAL_STRING(lp_writelist, writelist) +FN_LOCAL_STRING(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) static FN_LOCAL_STRING(lp_volume, volume) -- cgit From 295d684f538ccb1e7e7cef886791eec68d937f3f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 11 Aug 2000 00:53:13 +0000 Subject: Fix case where volumename could be returned as UNIX charset or DOS codepage depending on where it came from. Jeremy. (This used to be commit cfbf78085d48671e5be382e7486953a85a893be1) --- source3/param/loadparm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 17a109dd06..0ed1dad1f7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3267,8 +3267,12 @@ int lp_servicenumber(char *pszServiceName) char *volume_label(int snum) { char *ret = lp_volume(snum); - if (!*ret) - return (lp_servicename(snum)); + if (!*ret) { + /* lp_volume returns a unix charset - lp_servicename returns a + dos codepage - convert so volume_label() always returns UNIX. + */ + return (dos_to_unix(lp_servicename(snum), False)); + } return (ret); } -- cgit From bbc7918ad07c179729c41ed839a5a9afae91f2dc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 28 Aug 2000 02:06:25 +0000 Subject: arrgh. whoever added "auto" parameters in loadparam only supported "True", "False" and "Auto", and did not support "Yes" and "No" like booleans. This means anyone using "preferred master = yes" didn't get what they expected! (This used to be commit 311a4dfb9a9a39a54dcb47d83e1604ad7461dce4) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0ed1dad1f7..957ba88011 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -573,7 +573,11 @@ static struct enum_list enum_case[] = { static struct enum_list enum_bool_auto[] = { {False, "False"}, + {False, "No"}, + {False, "0"}, {True, "True"}, + {True, "Yes"}, + {True, "1"}, {Auto, "Auto"}, {-1, NULL} }; -- cgit From 4326894f6a10c55a1b95b94023952c4e30439074 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 29 Aug 2000 14:33:39 +0000 Subject: needed to use strwicmp() in smbclient code, so I moved it to util_str.c and made it non-static --jerry (This used to be commit dfdca21bd90b9c83f195d580ec9d774f1be8f9cb) --- source3/param/loadparm.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 957ba88011..da23ab1cb6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1786,37 +1786,6 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) return (True); } - -/*************************************************************************** -Do a case-insensitive, whitespace-ignoring string compare. -***************************************************************************/ -static int strwicmp(char *psz1, char *psz2) -{ - /* if BOTH strings are NULL, return TRUE, if ONE is NULL return */ - /* appropriate value. */ - if (psz1 == psz2) - return (0); - else if (psz1 == NULL) - return (-1); - else if (psz2 == NULL) - return (1); - - /* sync the strings on first non-whitespace */ - while (1) - { - while (isspace(*psz1)) - psz1++; - while (isspace(*psz2)) - psz2++; - if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0' - || *psz2 == '\0') - break; - psz1++; - psz2++; - } - return (*psz1 - *psz2); -} - /*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. -- cgit From 3b33053b886b88bb7546f77dcdb038fcdc501c6c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 29 Aug 2000 16:47:20 +0000 Subject: missed removing the static declaration of strwicmp() jerry (This used to be commit d09d8a3f4b32c1b4467dff5f2284e382163b7f09) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da23ab1cb6..129a9396f3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1571,7 +1571,6 @@ FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) /* local prototypes */ -static int strwicmp(char *psz1, char *psz2); static int map_parameter(char *pszParmName); static BOOL set_boolean(BOOL *pb, char *pszParmValue); static int getservicebyname(char *pszServiceName, -- cgit From 13904f585cbc4ccd5a366c288e6a32af44c30d27 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 Sep 2000 22:32:56 +0000 Subject: param/loadparm.c: Fix based on Damian's code to stop printer scripts getting overwritten. rpc_parse/parse_spoolss.c: Tidyup to call function for relstring arrays. Win2000 now does "Add Printer" successfully !!!!! Jeremy. (This used to be commit d666b958bc335c7fceebeb7a6333d78bc421c30f) --- source3/param/loadparm.c | 184 +++++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 87 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 129a9396f3..883d03f6a4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -988,6 +988,92 @@ static struct parm_struct parm_table[] = { }; +/*************************************************************************** +Initialise the sDefault parameter structure for the printer values. +***************************************************************************/ +static void init_printer_values(void) +{ + string_set(&sDefault.szPrinterDriver, ""); + string_set(&sDefault.szDriverFile, DRIVERFILE); + + /* choose defaults depending on the type of printing */ + switch (sDefault.iPrinting) + { + case PRINT_BSD: + case PRINT_AIX: + string_set(&sDefault.szLpqcommand, "lpq -P%p"); + string_set(&sDefault.szLprmcommand, "lprm -P%p %j"); + string_set(&sDefault.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"); + break; + + case PRINT_CUPS: + 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 -oraw %s; rm %s"); + string_set(&sDefault.szQueuepausecommand, + "/usr/bin/disable %p"); + string_set(&sDefault.szQueueresumecommand, + "/usr/bin/enable %p"); + 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"); +#ifndef HPUX + string_set(&sDefault.szLppausecommand, + "lp -i %p-%j -H hold"); + string_set(&sDefault.szLpresumecommand, + "lp -i %p-%j -H resume"); +#endif /* SYSV */ + 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"); + break; + + case PRINT_SOFTQ: + string_set(&sDefault.szLpqcommand, "qstat -l -d%p"); + string_set(&sDefault.szLprmcommand, + "qstat -s -j%j -c"); + string_set(&sDefault.szPrintcommand, + "lp -d%p -s %s; rm %s"); + string_set(&sDefault.szLppausecommand, + "qstat -s -j%j -h"); + string_set(&sDefault.szLpresumecommand, + "qstat -s -j%j -r"); + break; + + } +} /*************************************************************************** Initialise the global parameter structure. @@ -1009,9 +1095,10 @@ static void init_globals(void) string_set(parm_table[i].ptr, ""); string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); - string_set(&sDefault.szPrinterDriver, ""); string_set(&sDefault.fstype, FSTYPE_STRING); + init_printer_values(); + done_init = True; } @@ -1173,92 +1260,6 @@ static void init_globals(void) interpret_coding_system(KANJI); } -/*************************************************************************** -Initialise the sDefault parameter structure. -***************************************************************************/ -static void init_locals(void) -{ - string_set(&sDefault.szDriverFile, DRIVERFILE); - - /* choose defaults depending on the type of printing */ - switch (sDefault.iPrinting) - { - case PRINT_BSD: - case PRINT_AIX: - string_set(&sDefault.szLpqcommand, "lpq -P%p"); - string_set(&sDefault.szLprmcommand, "lprm -P%p %j"); - string_set(&sDefault.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"); - break; - - case PRINT_CUPS: - 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 -oraw %s; rm %s"); - string_set(&sDefault.szQueuepausecommand, - "/usr/bin/disable %p"); - string_set(&sDefault.szQueueresumecommand, - "/usr/bin/enable %p"); - 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"); -#ifndef HPUX - string_set(&sDefault.szLppausecommand, - "lp -i %p-%j -H hold"); - string_set(&sDefault.szLpresumecommand, - "lp -i %p-%j -H resume"); -#endif /* SYSV */ - 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"); - break; - - case PRINT_SOFTQ: - string_set(&sDefault.szLpqcommand, "qstat -l -d%p"); - string_set(&sDefault.szLprmcommand, - "qstat -s -j%j -c"); - string_set(&sDefault.szPrintcommand, - "lp -d%p -s %s; rm %s"); - string_set(&sDefault.szLppausecommand, - "qstat -s -j%j -h"); - string_set(&sDefault.szLpresumecommand, - "qstat -s -j%j -r"); - break; - - } -} - static TALLOC_CTX *lp_talloc; /******************************************************************* a @@ -2654,6 +2655,15 @@ static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) return (False); } +/*************************************************************************** + Initialize any local varients in the sDefault table. +***************************************************************************/ + +void init_locals(void) +{ + /* None as yet. */ +} + /*************************************************************************** Process a new section (service). At this stage all sections are services. Later we'll have special sections that permit server parameters to be set. -- cgit From 5be845af6bea3d4795dc50fe9ee880527be5ecc0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 Sep 2000 00:54:18 +0000 Subject: Changes from John Reilly to add a parameter "show add printer wizard" that allows Samba to turn off the display of APW (hmmm. This should probably be a share specific parameter, I'll fix that in another commit). Also a few small changes to JF's code to fix compiler warnings about missing return statements and also change '//' comments (C++) to /* .. */ comments (C). Jeremy. (This used to be commit 0a9ccc99b335650d235eb747d803d059f7828fd7) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 883d03f6a4..c03e1025b1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -219,6 +219,7 @@ typedef struct BOOL sslReqServerCert; BOOL sslCompatibility; #endif /* WITH_SSL */ + BOOL bMsAddPrinterWizard; BOOL bDNSproxy; BOOL bWINSsupport; BOOL bWINSproxy; @@ -806,6 +807,7 @@ static struct parm_struct parm_table[] = { {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, + {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, @@ -1231,6 +1233,7 @@ static void init_globals(void) */ + Globals.bMsAddPrinterWizard = True; Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */ Globals.os_level = 20; Globals.bLocalMaster = True; @@ -1406,6 +1409,7 @@ FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert); FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility); #endif /* WITH_SSL */ +FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_we_are_a_wins_server, &Globals.bWINSsupport) -- cgit From b43b2e4f8a4be30e3f7aca6f570f5376fd508e3d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Sep 2000 19:09:59 +0000 Subject: Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector them through the VFS. All file access/directory access code in smbd should now go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl() vfs_set_nt_acl() call API design. Jeremy. (This used to be commit f96625ec124adb6e110dc54632e006b3620a962b) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c03e1025b1..64e5908b19 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -92,7 +92,7 @@ pstring global_scope = ""; #define VALID(i) iSERVICE(i).valid int keepalive = DEFAULT_KEEPALIVE; -extern BOOL use_getwd_cache; +BOOL use_getwd_cache; extern int extra_time_offset; -- cgit From 3ad2ee22bb4ecee24d069bb7efadff18c25044d1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Oct 2000 02:12:14 +0000 Subject: utf-8 and EUC3 patch from Hiroshi Miura Samba User Group Japan staff. mkdir high bits patch from Robert Dahlem" . jeremy. (This used to be commit b40191d27180ab1e59935086073c4d312552f717) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 64e5908b19..525c1931cc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2243,6 +2243,7 @@ static BOOL handle_client_code_page(char *pszParmValue, char **ptr) if (saved_character_set != NULL) interpret_character_set(saved_character_set, lp_client_code_page()); + codepage_initialise(lp_client_code_page()); return (True); } -- cgit From 077c41cc60316c44d2f3f85e14fe15acd22ccc1f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2000 23:35:55 +0000 Subject: Fix for printf attribute from Mattias Gronlund Added "codepage directory" patch from Peter.Polkinghorne@brunel.ac.uk Jeremy. (This used to be commit e49566c2e21fcd16980e5110495645c5ae5a36da) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 525c1931cc..452c207dfb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -135,6 +135,7 @@ typedef struct char *szGroupnameMap; #endif /* USING_GROUPNAME_MAP */ char *szCharacterSet; + char *szCodePageDir; char *szLogonScript; char *szLogonPath; char *szLogonDrive; @@ -627,6 +628,7 @@ static struct parm_struct parm_table[] = { {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, + {"code page directory", P_STRING, P_GLOBAL, &Globals.szCodePageDir, NULL, NULL, 0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, @@ -1136,6 +1138,7 @@ static void init_globals(void) string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); + string_set(&Globals.szCodePageDir, CODEPAGEDIR); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; @@ -1384,6 +1387,7 @@ FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) +FN_GLOBAL_STRING(lp_codepagedir,&Globals.szCodePageDir) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer); FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix); -- cgit From 5d4f5cdddc23819bfab0961a013ed5593b2b2d30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Oct 2000 00:48:27 +0000 Subject: Integrated support for NT and OS/2 lpq parsing. Code from Jim McDonough Infoprint Manager Development Linux Technology Center IBM Boulder Jeremy. (This used to be commit d9eedd5db1728be8e23d73c954db13bbbcadf3fb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 452c207dfb..09ecdf83fa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -549,6 +549,8 @@ static struct enum_list enum_printing[] = { {PRINT_LPRNG, "lprng"}, {PRINT_SOFTQ, "softq"}, {PRINT_CUPS, "cups"}, + {PRINT_LPRNT, "nt"}, + {PRINT_LPROS2, "os2"}, {-1, NULL} }; @@ -1005,6 +1007,8 @@ static void init_printer_values(void) { 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, -- cgit From 26a4a34d36aff371b2b03506b4e7544847dd1d69 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Oct 2000 02:26:27 +0000 Subject: Fix for growing printing.tdb by adding check on job creation. This also updates the printing.tdb db version to 2. Jeremy. (This used to be commit 13395514c632341e7be36eb9589011bb0949b075) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 09ecdf83fa..bad2ad2fdb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -316,6 +316,7 @@ typedef struct char *szVfsObjectFile; char *szVfsOptions; int iMinPrintSpace; + int iMaxPrintJobs; int iWriteCacheSize; int iCreate_mask; int iCreate_force_mode; @@ -429,6 +430,7 @@ static service sDefault = { NULL, /* vfs object */ NULL, /* vfs options */ 0, /* iMinPrintSpace */ + 1000, /* iMaxPrintJobs */ 0, /* iWriteCacheSize */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ @@ -793,6 +795,7 @@ static struct parm_struct parm_table[] = { {"Printing Options", P_SEP, P_SEPARATOR}, + {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, @@ -1578,6 +1581,7 @@ FN_LOCAL_INTEGER(_lp_force_dir_security_mode, iDir_Security_force_mode) FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase, iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) +FN_LOCAL_INTEGER(lp_maxprintjobs, iMaxPrintJobs) FN_LOCAL_INTEGER(lp_printing, iPrinting) FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) -- cgit From f0bd621a504082e9b16ff1b5a56c8987e6f94e30 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 18 Oct 2000 01:36:26 +0000 Subject: Bug report that on some systems extended characters are being returned as negative values from the mygetc() function. I've modified the return line so that it should return values in the 0..255 range for legitimate characters. This change should probably be copied into SAMBA_2_2 but I haven't checked that tree out yet. Chris -)----- (This used to be commit e2ce5ce0fdaca0e38d953baa2da4c3542b0503ee) --- source3/param/params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 1cf3aa9eb1..9cb6412b96 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -114,7 +114,8 @@ typedef struct { static int mygetc(myFILE *f) { if (f->p >= f->buf+f->size) return EOF; - return (int)*(f->p++); + /* be sure to return chars >127 as positive values */ + return (int)( *(f->p++) & 0x00FF ); } static void myfile_close(myFILE *f) -- cgit From af33ececd950174a63334632c109cd1db90e3523 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Oct 2000 19:44:02 +0000 Subject: Yeah - not setting getwd_cache to True as default, that'd do it for a 5x performance hit..... :-) :-). Jeremy. PS. Yes this was my fault for everyone who wants to throw rotten fruit... (This used to be commit 4f5bbc38ce492baa6e2b4d94758e9247756ae9ba) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bad2ad2fdb..13454641fb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -92,7 +92,7 @@ pstring global_scope = ""; #define VALID(i) iSERVICE(i).valid int keepalive = DEFAULT_KEEPALIVE; -BOOL use_getwd_cache; +BOOL use_getwd_cache = True; extern int extra_time_offset; -- cgit From 01e0d3879ef5de24a6addd0ce00bf3d4de518f7f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 26 Oct 2000 03:31:41 +0000 Subject: TDB password backend support written by Simo Sorce Marked as an experimental compile time option (defaults to off) for now. jerry (This used to be commit 0435af4417b876c2ea1dd4591ae7647784c28e30) --- source3/param/loadparm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 13454641fb..3fa3773276 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,7 +119,11 @@ typedef struct char *szPasswdChat; char *szLogFile; char *szConfigFile; +/*#ifdef WITH_TDBPWD + char *szTDBPasswdFile; +#else*/ char *szSMBPasswdFile; +/* #endif */ char *szPasswordServer; char *szSocketOptions; char *szValidChars; @@ -657,7 +661,11 @@ static struct parm_struct parm_table[] = { {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, +/* #ifdef WITH_TDBPWD + {"tdb passwd file", P_STRING, P_GLOBAL, &Globals.szTDBPasswdFile, NULL, NULL, 0}, +#else */ {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, +/* #endif */ {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -1116,7 +1124,14 @@ static void init_globals(void) DEBUG(3, ("Initialising global parameters\n")); +/* #ifdef WITH_TDBPWD + string_set(&Globals.szTDBPasswdFile, TDB_PASSWD_FILE); +#else */ +#ifdef WITH_TDBPWD + string_set(&Globals.szSMBPasswdFile, TDB_PASSWD_FILE); +#else string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); +#endif /* * Allow the default PASSWD_CHAT to be overridden in local.h. */ @@ -1342,7 +1357,11 @@ static char *lp_string(const char *s) FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) +/* #ifdef WITH_TDBPWD +FN_GLOBAL_STRING(lp_tdb_passwd_file, &Globals.szTDBPasswdFile) +#else */ FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) +/* #endif */ FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) -- cgit From 1cb444057a7894ca97706fb65a756e5fdb635f81 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 28 Oct 2000 19:38:39 +0000 Subject: David Lee's utmp patch (finally). Thanks David ! Jeremy. (This used to be commit b809a2d0c81c54e917ccc0c99b3e70ea8d7ceab1) --- source3/param/loadparm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3fa3773276..43b0c62f17 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -168,6 +168,9 @@ typedef struct char *szWINSHook; #ifdef WITH_UTMP char *szUtmpDir; + char *szWtmpDir; + char *szUtmpHostname; + BOOL bUtmpConsolidate; #endif /* WITH_UTMP */ char *szSourceEnv; char *szWinbindUID; @@ -939,6 +942,10 @@ static struct parm_struct parm_table[] = { #ifdef WITH_UTMP {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + {"wtmp dir", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, + {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, + {"utmp hostname", P_STRING, P_GLOBAL, &Globals.szUtmpHostname, NULL, NULL, 0}, + {"utmp consolidate", P_BOOL, P_GLOBAL, &Globals.bUtmpConsolidate, NULL, NULL, 0}, #endif /* WITH_UTMP */ {"default service", P_STRING, P_GLOBAL, @@ -1142,6 +1149,9 @@ static void init_globals(void) string_set(&Globals.szLockDir, LOCKDIR); #ifdef WITH_UTMP string_set(&Globals.szUtmpDir, ""); + string_set(&Globals.szWtmpDir, ""); + string_set(&Globals.szUtmpHostname, "%m"); + Globals.bUtmpConsolidate = False; #endif /* WITH_UTMP */ string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); @@ -1370,6 +1380,9 @@ FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) +FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) +FN_GLOBAL_STRING(lp_utmp_hostname, &Globals.szUtmpHostname) +FN_GLOBAL_BOOL(lp_utmp_consolidate, &Globals.bUtmpConsolidate) #endif /* WITH_UTMP */ FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) FN_GLOBAL_STRING(lp_source_environment, &Globals.szSourceEnv) -- cgit From 9fede0dc0dbad51528cd1384023d24549c3f0ba4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 13 Nov 2000 23:03:34 +0000 Subject: Large commit which restructures the local password storage API. Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+) are broken, but they were somewhat broken before. :) The following functions implement the storage manipulation interface /*The following definitions come from passdb/pdb_smbpasswd.c */ BOOL pdb_setsampwent (BOOL update); void pdb_endsampwent (void); SAM_ACCOUNT* pdb_getsampwent (void); SAM_ACCOUNT* pdb_getsampwnam (char *username); SAM_ACCOUNT* pdb_getsampwuid (uid_t uid); SAM_ACCOUNT* pdb_getsampwrid (uint32 rid); BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass); BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override); BOOL pdb_delete_sam_account (char* username); There is also a host of pdb_set..() and pdb_get..() functions for manipulating SAM_ACCOUNT struct members. Note that the struct passdb_ops {} has gone away. Also notice that struct smb_passwd (formally in smb.h) has been moved to passdb/pdb_smbpasswd.c and is not accessed outisde of static internal functions in this file. All local password searches should make use of the the SAM_ACCOUNT struct and the previously mentioned functions. I'll write some documentation for this later. The next step is to fix the TDB passdb backend, then work on spliting the backends out into share libraries, and finally get the LDAP backend going. What works and may not: o domain logons from Win9x works o domain logons from WinNT 4 works o user and group enumeration as implemented by Tim works o file and print access works o changing password from Win9x & NT ummm...i'll fix this tonight :) If I broke anything else, just yell and I'll fix it. I think it should be fairly quite. -- jerry (This used to be commit 0b92d0838ebdbe24f34f17e313ecbf61a0301389) --- source3/param/loadparm.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 43b0c62f17..dc2082423b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,11 +119,12 @@ typedef struct char *szPasswdChat; char *szLogFile; char *szConfigFile; -/*#ifdef WITH_TDBPWD +#ifdef WITH_TDBPWD char *szTDBPasswdFile; -#else*/ +#else char *szSMBPasswdFile; -/* #endif */ +#endif + char *szPassdbModulePath; char *szPasswordServer; char *szSocketOptions; char *szValidChars; @@ -669,6 +670,7 @@ static struct parm_struct parm_table[] = { #else */ {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, /* #endif */ + {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -1131,14 +1133,13 @@ static void init_globals(void) DEBUG(3, ("Initialising global parameters\n")); -/* #ifdef WITH_TDBPWD - string_set(&Globals.szTDBPasswdFile, TDB_PASSWD_FILE); -#else */ #ifdef WITH_TDBPWD - string_set(&Globals.szSMBPasswdFile, TDB_PASSWD_FILE); + string_set(&Globals.szTDBPasswdFile, TDB_PASSWD_FILE); #else string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); #endif + string_set(&Globals.szPassdbModulePath, ""); + /* * Allow the default PASSWD_CHAT to be overridden in local.h. */ @@ -1256,7 +1257,8 @@ static void init_globals(void) Globals.sslCompatibility = False; #endif /* WITH_SSL */ -/* these parameters are set to defaults that are more appropriate +/* + these parameters are set to defaults that are more appropriate for the increasing samba install base: as a member of the workgroup, that will possibly become a @@ -1265,7 +1267,6 @@ static void init_globals(void) doesn't provide WINS server service by default (wsupp = False), and doesn't provide domain master browser services by default, either. - */ Globals.bMsAddPrinterWizard = True; @@ -1367,11 +1368,12 @@ static char *lp_string(const char *s) FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) -/* #ifdef WITH_TDBPWD +#ifdef WITH_TDBPWD FN_GLOBAL_STRING(lp_tdb_passwd_file, &Globals.szTDBPasswdFile) -#else */ +#else FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) -/* #endif */ +#endif +FN_GLOBAL_STRING(lp_passdb_module_path, &Globals.szPassdbModulePath) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) -- cgit From f9680a444bcba72540ab5e23bb44677ef74a9f13 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Tue, 14 Nov 2000 15:26:53 +0000 Subject: Changes from APPLIANCE_HEAD: - merged Tim's vlp (virtual lp) test program. Enable it with -DDEVELOPER or by using ./configure.developer (source/include/smb.h source/configure.developer source/printing/lpq_parse.c source/param/loadparm.c testsuite/printing/.cvsignore testsuite/printing/Makefile.vlp testsuite/printing/vlp.c) (This used to be commit fbcf83140da1823e74f63227f0a95d07c6e76764) --- source3/param/loadparm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dc2082423b..9dcd7bbc2e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -561,6 +561,10 @@ static struct enum_list enum_printing[] = { {PRINT_CUPS, "cups"}, {PRINT_LPRNT, "nt"}, {PRINT_LPROS2, "os2"}, +#ifdef DEVELOPER + {PRINT_TEST, "test"}, + {PRINT_TEST, "vlp"}, +#endif /* DEVELOPER */ {-1, NULL} }; @@ -1099,6 +1103,18 @@ static void init_printer_values(void) string_set(&sDefault.szLpresumecommand, "qstat -s -j%j -r"); 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"); + break; +#endif /* DEVELOPER */ } } -- cgit From e8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Nov 2000 01:11:38 +0000 Subject: Tuyrn debug timestamps on by default. Add Tim's lpq race fix. Jeremy. (This used to be commit d43405bc47c95bf8c906035cba23bf95d252d13b) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9dcd7bbc2e..cb90f16f6d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1213,7 +1213,7 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; - Globals.bTimestampLogs = False; + Globals.bTimestampLogs = True; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; -- cgit From 0dcbafe2b97035df779f2e0742a130c4c79e3241 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 21 Nov 2000 05:55:16 +0000 Subject: Another large patch for the passdb rewrite. o added BOOL own_memory flag in SAM_ACCOUNT so we could use static memory for string pointer assignment or allocate a new string o added a reference TDB passdb backend. This is only a reference and should not be used in production because - RID's are generated using the same algorithm as with smbpasswd - a TDB can only have one key (w/o getting into problems) and we need three. Therefore the pdb_sam-getpwuid() and pdb_getsampwrid() functions are interative searches :-( we need transaction support, multiple indexes, and a nice open source DBM. The Berkeley DB (from sleepycat.com seems to fit this criteria now) o added a new parameter "private dir" as many places in the code were using lp_smb_passwd_file() and chopping off the filename part. This makes more sense to me and I will docuement it in the man pages o Ran through Insure-lite and corrected memory leaks. Need for a public flogging this time Jeremy (-: -- jerry (This used to be commit 4792029a2991bd84251d152a62b1033dec62cee2) --- source3/param/loadparm.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cb90f16f6d..b666cd3cf4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -119,11 +119,8 @@ typedef struct char *szPasswdChat; char *szLogFile; char *szConfigFile; -#ifdef WITH_TDBPWD - char *szTDBPasswdFile; -#else char *szSMBPasswdFile; -#endif + char *szPrivateDir; char *szPassdbModulePath; char *szPasswordServer; char *szSocketOptions; @@ -669,11 +666,8 @@ static struct parm_struct parm_table[] = { {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, -/* #ifdef WITH_TDBPWD - {"tdb passwd file", P_STRING, P_GLOBAL, &Globals.szTDBPasswdFile, NULL, NULL, 0}, -#else */ {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, -/* #endif */ + {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -1149,11 +1143,8 @@ static void init_globals(void) DEBUG(3, ("Initialising global parameters\n")); -#ifdef WITH_TDBPWD - string_set(&Globals.szTDBPasswdFile, TDB_PASSWD_FILE); -#else string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); -#endif + string_set(&Globals.szPrivateDir, PRIVATE_DIR); string_set(&Globals.szPassdbModulePath, ""); /* @@ -1384,11 +1375,8 @@ static char *lp_string(const char *s) FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) -#ifdef WITH_TDBPWD -FN_GLOBAL_STRING(lp_tdb_passwd_file, &Globals.szTDBPasswdFile) -#else FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) -#endif +FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) FN_GLOBAL_STRING(lp_passdb_module_path, &Globals.szPassdbModulePath) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) -- cgit From cf5b71994d6cdb2f81c390579f4a0e676926c6b9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Dec 2000 19:26:04 +0000 Subject: file_lines_load/file_lines_pload can now optionally convert unix_to_dos() on read. Jeremy. (This used to be commit 76b8dd376d13eb4469417be217c966d54d333367) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b666cd3cf4..4a6ec83607 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2217,11 +2217,11 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) if (*p == '|') { - lines = file_lines_pload(p + 1, NULL); + lines = file_lines_pload(p + 1, NULL, True); } else { - lines = file_lines_load(fname, NULL); + lines = file_lines_load(fname, NULL, True); } if (!lines) -- cgit From 2e87e6e8c88bde725bbd73e9ca1b31384128a299 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Wed, 13 Dec 2000 21:24:06 +0000 Subject: Changes from APPLIANCE_HEAD: - trivial typo in definition of enum_printing[] (source/param/loadparm.c) - fixed printer status display bug. When no jobs existed in queue, the clients were not properly notified of printer status. This caused native tools for pausing/unpausing a print queue to not work. (source/printing/printing.c) (This used to be commit c533e77f1912618230a938458980a9339924fe06) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4a6ec83607..d5a032c26b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -560,7 +560,7 @@ static struct enum_list enum_printing[] = { {PRINT_LPROS2, "os2"}, #ifdef DEVELOPER {PRINT_TEST, "test"}, - {PRINT_TEST, "vlp"}, + {PRINT_VLP, "vlp"}, #endif /* DEVELOPER */ {-1, NULL} }; -- cgit From 615af12cf2171001bc7da716cea25eab57ec3f4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jan 2001 20:34:37 +0000 Subject: Fix from "B.V.Dean" to add "dos filemode" parameter to allow a chmod to be done if the user has write access to a file, just like Windows allows. Off by default (compare with "dos filetimes" parameter). Jeremy. (This used to be commit 8abdf0e29fdb02a7929aa4395947b5023a7194a0) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d5a032c26b..716511cb8b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -375,6 +375,7 @@ typedef struct BOOL bDeleteReadonly; BOOL bFakeOplocks; BOOL bDeleteVetoFiles; + BOOL bDosFilemode; BOOL bDosFiletimes; BOOL bDosFiletimeResolution; BOOL bFakeDirCreateTimes; @@ -489,6 +490,7 @@ static service sDefault = { False, /* bDeleteReadonly */ False, /* bFakeOplocks */ False, /* bDeleteVetoFiles */ + False, /* bDosFilemode */ False, /* bDosFiletimes */ False, /* bDosFiletimeResolution */ False, /* bFakeDirCreateTimes */ @@ -984,6 +986,7 @@ static struct parm_struct parm_table[] = { {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -1603,6 +1606,7 @@ FN_LOCAL_BOOL(lp_map_system, bMap_system) FN_LOCAL_BOOL(lp_delete_readonly, bDeleteReadonly) FN_LOCAL_BOOL(lp_fake_oplocks, bFakeOplocks) FN_LOCAL_BOOL(lp_recursive_veto_delete, bDeleteVetoFiles) +FN_LOCAL_BOOL(lp_dos_filemode, bDosFilemode) FN_LOCAL_BOOL(lp_dos_filetimes, bDosFiletimes) FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) -- cgit From 17ab0c2acc1321d8228f604d207deacb1bdd3575 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Wed, 10 Jan 2001 16:05:41 +0000 Subject: Changes from APPLIANCE_HEAD: source/include/proto.h source/param/loadparm.c source/passdb/passdb.c source/rpc_server/srv_samr.c - add support for "hide local users" option to HEAD. (This used to be commit 44dc339fe757b2b5578b30e74aad8c1b12c23f5f) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 716511cb8b..9a6f5e946d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -263,6 +263,7 @@ typedef struct BOOL bDebugPid; BOOL bDebugUid; BOOL bHostMSDfs; + BOOL bHideLocalUsers; } global; @@ -992,6 +993,8 @@ static struct parm_struct parm_table[] = { {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, + NULL, 0}, {"VFS options", P_SEP, P_SEPARATOR}, @@ -1629,7 +1632,10 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) +FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) + /* local prototypes */ + static int map_parameter(char *pszParmName); static BOOL set_boolean(BOOL *pb, char *pszParmValue); static int getservicebyname(char *pszServiceName, -- cgit From b85d1ecc2661cd2db8e7992dc2aa587a24392bb1 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Tue, 16 Jan 2001 18:17:55 +0000 Subject: Changes from APPLIANCE_HEAD: source/param/loadparm.c - changed lp_add_printer() to convert szPrintername and comment from unix to DOS codepage. (This used to be commit 6a1f55b3255f216a5ddc73f94c6cb5a2490c3bbb) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9a6f5e946d..57e8f17189 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1834,7 +1834,9 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) /* the printer name is set to the service name. */ string_set(&iSERVICE(i).szPrintername, pszPrintername); + unix_to_dos(iSERVICE(i).szPrintername, True); string_set(&iSERVICE(i).comment, comment); + unix_to_dos(iSERVICE(i).comment, True); iSERVICE(i).bBrowseable = sDefault.bBrowseable; /* Printers cannot be read_only. */ iSERVICE(i).bRead_only = False; -- cgit From 792ca5d98938c3c52ff4e598bcb55056565dc202 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Wed, 17 Jan 2001 18:47:46 +0000 Subject: Changes from APPLIANCE_HEAD: source/rpc_server/srv_spoolss_nt.c - Unrolled construct_notify_jobs_info() loop to only fetch printer info_2 structure once rather than num_print_jobs times. - convert command to unix codepage. - remove lp_remove_service() call as it prevents lp_killservice() from working. - Modified some DEBUG and DEBUGADD statements. source/param/loadparm.c source/param/params.c - change printer, preload, auto services to FLAG_DOS_STRING, reverted earlier changes to szPrintername et al, add comments. source/printing/load.c - fix bug with lp_auto_services() and strtok() source/printing/nt_printing.c source/printing/printing.c - remove redundant test that used SERVICE(snum) source/printing/pcap.c - add unix_to_dos() calls, add notes wrt FIXMEs for xxx_printer_fn() functions. source/web/swat.c - added FIXME comment. source/smbd/service.c - added comment re: dos codepage (This used to be commit 7b774b72c2857af9519012106714a9e2cb099da3) --- source3/param/loadparm.c | 29 ++++++++++++++--------------- source3/param/params.c | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 57e8f17189..7750cb7ac7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -830,8 +830,8 @@ static struct parm_struct parm_table[] = { {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT|FLAG_DOS_STRING}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_DOS_STRING}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -938,8 +938,8 @@ static struct parm_struct parm_table[] = { {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING}, {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP @@ -1270,8 +1270,7 @@ static void init_globals(void) Globals.sslCompatibility = False; #endif /* WITH_SSL */ -/* - these parameters are set to defaults that are more appropriate +/* these parameters are set to defaults that are more appropriate for the increasing samba install base: as a member of the workgroup, that will possibly become a @@ -1280,6 +1279,7 @@ static void init_globals(void) doesn't provide WINS server service by default (wsupp = False), and doesn't provide domain master browser services by default, either. + */ Globals.bMsAddPrinterWizard = True; @@ -1690,7 +1690,7 @@ static void free_service(service * pservice) /*************************************************************************** add a new service to the services array initialising it with the given -service +service. name must be in DOS codepage. ***************************************************************************/ static int add_a_service(service * pservice, char *name) { @@ -1739,14 +1739,13 @@ static int add_a_service(service * pservice, char *name) if (name) { string_set(&iSERVICE(i).szService, name); - unix_to_dos(iSERVICE(i).szService, True); } return (i); } /*************************************************************************** add a new home service, with the specified home directory, defaults coming -from service ifrom +from service ifrom. homename must be in DOS codepage. ***************************************************************************/ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) { @@ -1775,7 +1774,7 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) } /*************************************************************************** -add a new service, based on an old one +add a new service, based on an old one. pszService must be in DOS codepage. ***************************************************************************/ int lp_add_service(char *pszService, int iDefaultService) { @@ -1817,7 +1816,8 @@ static BOOL lp_add_ipc(void) /*************************************************************************** -add a new printer service, with defaults coming from service iFrom +add a new printer service, with defaults coming from service iFrom. +printername must be in DOS codepage. ***************************************************************************/ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) { @@ -1834,9 +1834,7 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) /* the printer name is set to the service name. */ string_set(&iSERVICE(i).szPrintername, pszPrintername); - unix_to_dos(iSERVICE(i).szPrintername, True); string_set(&iSERVICE(i).comment, comment); - unix_to_dos(iSERVICE(i).comment, True); iSERVICE(i).bBrowseable = sDefault.bBrowseable; /* Printers cannot be read_only. */ iSERVICE(i).bRead_only = False; @@ -2734,7 +2732,7 @@ void init_locals(void) /*************************************************************************** Process a new section (service). At this stage all sections are services. Later we'll have special sections that permit server parameters to be set. -Returns True on success, False on failure. +Returns True on success, False on failure. SectionName must be in DOS codepage. ***************************************************************************/ static BOOL do_section(char *pszSectionName) { @@ -3037,6 +3035,7 @@ void lp_add_one_printer(char *name, char *comment) if ((i = lp_servicenumber(name)) >= 0) { string_set(&iSERVICE(i).comment, comment); + unix_to_dos(iSERVICE(i).comment, True); iSERVICE(i).autoloaded = True; } } @@ -3448,7 +3447,7 @@ void lp_remove_service(int snum) } /******************************************************************* -copy a service +copy a service. new_name must be in dos codepage ********************************************************************/ void lp_copy_service(int snum, char *new_name) { diff --git a/source3/param/params.c b/source3/param/params.c index 9cb6412b96..b359b269d4 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -271,7 +271,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) DEBUG(0, ("%s Empty section name in configuration file.\n", func )); return( False ); } - if( !sfunc( bufr ) ) /* Got a valid name. Deal with it. */ + if( !sfunc( unix_to_dos(bufr,True) ) ) /* Got a valid name. Deal with it. */ return( False ); (void)EatComment( InFile ); /* Finish off the line. */ return( True ); -- cgit From 3d153ef9fba79e9843d886fc4b9629503fed4e29 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Mon, 22 Jan 2001 15:30:38 +0000 Subject: Small bugfix from Kenichi Okuyama : -FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.max_wins_ttl) +FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.min_wins_ttl) (This used to be commit 0233ba442643ad13b3707b63046691287fd2b449) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7750cb7ac7..b1f63c0cf8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1504,7 +1504,7 @@ FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) 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_min_wins_ttl, &Globals.max_wins_ttl) +FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.min_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size, &Globals.max_log_size) FN_GLOBAL_INTEGER(lp_max_open_files, &Globals.max_open_files) FN_GLOBAL_INTEGER(lp_maxxmit, &Globals.max_xmit) -- cgit From eee29958f5cacc753f3fa324327e0d8b14ac3006 Mon Sep 17 00:00:00 2001 From: David O'Neill Date: Tue, 23 Jan 2001 20:25:25 +0000 Subject: Changes from APPLIANCE_HEAD: source/rpc_server/srv_spoolss_nt.c - add an access check to _spoolss_deleteprinter() to stop random users and passers by from deleting printers. source/lib/messages.c - converted global msg_all struct to a local in message_send_all() function. source/include/smb.h - added a success error code to the spoolss return codes. source/include/proto.h source/param/loadparm.c source/printing/printing.c - Added new parameter "total print jobs" to limit the total number of print jobs across all queues. Currently individual queues are limited by "max print jobs". (This used to be commit 02f154e729b0e8465d3e1e2ac794e6ab3844ce57) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b1f63c0cf8..359918c675 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -189,6 +189,7 @@ typedef struct int security; int maxdisksize; int lpqcachetime; + int iTotalPrintJobs; int syslog; int os_level; int max_ttl; @@ -809,6 +810,7 @@ static struct parm_struct parm_table[] = { {"Printing Options", P_SEP, P_SEPARATOR}, + {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, @@ -1193,6 +1195,7 @@ static void init_globals(void) Globals.max_xmit = 65535; Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; + Globals.iTotalPrintJobs = 0; /* no limit specified */ Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; @@ -1517,6 +1520,7 @@ FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) +FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) -- cgit From 8e18bd58f7706ffa17f826074689a6354c0f15ba Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 30 Jan 2001 00:37:12 +0000 Subject: Fix inspited by Alan Romeril. 50% speedup in domain logins with this change to default break response time of 10ms -> 0ms. Jeremy. (This used to be commit 541c7df16fff03f98c253a46b501574cafb4469f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 359918c675..7130cf0f49 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1248,7 +1248,7 @@ static void init_globals(void) Globals.bRestrictAnonymous = False; Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ - Globals.oplock_break_wait_time = 10; /* By Default, 10 msecs. */ + Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ #ifdef WITH_LDAP /* default values for ldap */ -- cgit From 94fc44a93c46cece9b9fa947bff62087dbcd89fa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 12 Feb 2001 16:18:02 +0000 Subject: Merge of JohnR's changes to appliance-head, JF's changes to 2.2, updated the POSIX_ACL code to be in sync. Jeremy. (This used to be commit c0517d6f4e3079feca1309fd1ea7b21e83f0de02) --- source3/param/loadparm.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7130cf0f49..b4cf4930cd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -68,7 +68,7 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; -extern int DEBUGLEVEL; +extern int DEBUGLEVEL_CLASS[DBGC_LAST]; extern pstring user_socket_options; extern pstring global_myname; pstring global_scope = ""; @@ -189,6 +189,7 @@ typedef struct int security; int maxdisksize; int lpqcachetime; + int iMaxSmbdProcesses; int iTotalPrintJobs; int syslog; int os_level; @@ -528,6 +529,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); static BOOL handle_winbind_id(char *pszParmValue, char **ptr); static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); +static BOOL handle_debug_list( char *pszParmValue, char **ptr ); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -750,8 +752,8 @@ static struct parm_struct parm_table[] = { #endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, FLAG_BASIC}, - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL, NULL, NULL, 0}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, @@ -796,6 +798,7 @@ static struct parm_struct parm_table[] = { {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, @@ -1195,6 +1198,7 @@ static void init_globals(void) Globals.max_xmit = 65535; Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; + Globals.iMaxSmbdProcesses = 0;/* no limit specified */ Globals.iTotalPrintJobs = 0; /* no limit specified */ Globals.pwordlevel = 0; Globals.unamelevel = 0; @@ -1520,6 +1524,7 @@ FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) +FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) @@ -2442,6 +2447,18 @@ static BOOL handle_wins_server_list( char *pszParmValue, char **ptr ) } +/*************************************************************************** + Handle the DEBUG level list +***************************************************************************/ +static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) +{ + pstring pszParmValue; + + pstrcpy(pszParmValue, pszParmValueIn); + return debug_parse_levels( pszParmValue ); +} + + /*************************************************************************** initialise a copymap ***************************************************************************/ -- cgit From 0bfc10011bd5cacecda8b59c36e80f676e5c7fa3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 9 Mar 2001 18:59:16 +0000 Subject: merge of 'lanman auth' and 'min protocol' from 2.2 (This used to be commit 1d84da779a0fe3219d77686a493d2b2fa1f8072a) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b4cf4930cd..0593d2d190 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -186,6 +186,7 @@ typedef struct int unamelevel; int deadtime; int maxprotocol; + int minprotocol; int security; int maxdisksize; int lpqcachetime; @@ -261,6 +262,7 @@ typedef struct BOOL bKernelOplocks; BOOL bAllowTrustedDomains; BOOL bRestrictAnonymous; + BOOL bLanmanAuth; BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; @@ -687,6 +689,7 @@ static struct parm_struct parm_table[] = { {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, + {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, @@ -770,6 +773,8 @@ static struct parm_struct parm_table[] = { {"Protocol Options", P_SEP, P_SEPARATOR}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, @@ -1206,6 +1211,7 @@ static void init_globals(void) Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; Globals.maxprotocol = PROTOCOL_NT1; + Globals.minprotocol = PROTOCOL_CORE; Globals.security = SEC_USER; Globals.bEncryptPasswords = False; Globals.bUpdateEncrypt = False; @@ -1250,6 +1256,7 @@ static void init_globals(void) Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ Globals.bStatCache = True; /* use stat cache by default */ Globals.bRestrictAnonymous = False; + Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ @@ -1506,6 +1513,7 @@ FN_GLOBAL_BOOL(lp_nt_acl_support, &Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) +FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level) @@ -1521,6 +1529,7 @@ 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_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) -- cgit From d3ec09326b27dd00b1f67a7ce48bc9817a313735 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 13 Mar 2001 00:31:07 +0000 Subject: Added ADMIN$ share as alias for IPC$ except no guest connect. AS/U wants to do RPC calls down this treeid. Jeremy. (This used to be commit 83133bab0ed59e303a183fd91812165f08e88484) --- source3/param/loadparm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0593d2d190..eafed8172a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1803,10 +1803,10 @@ int lp_add_service(char *pszService, int iDefaultService) /*************************************************************************** add the IPC service ***************************************************************************/ -static BOOL lp_add_ipc(void) +static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) { pstring comment; - int i = add_a_service(&sDefault, "IPC$"); + int i = add_a_service(&sDefault, ipc_name); if (i < 0) return (False); @@ -1823,7 +1823,7 @@ static BOOL lp_add_ipc(void) iSERVICE(i).bAvailable = True; iSERVICE(i).bRead_only = True; iSERVICE(i).bGuest_only = False; - iSERVICE(i).bGuest_ok = True; + iSERVICE(i).bGuest_ok = guest_ok; iSERVICE(i).bPrint_ok = False; iSERVICE(i).bBrowseable = sDefault.bBrowseable; @@ -3244,8 +3244,10 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, lp_add_auto_services(lp_auto_services()); - if (add_ipc) - lp_add_ipc(); + if (add_ipc) { + lp_add_ipc("IPC$", True); + lp_add_ipc("ADMIN$", False); + } set_server_role(); set_default_server_announce_type(); -- cgit From c9b8da47a68c98d72d59d25d1e2d8f3069300f40 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Mar 2001 02:31:24 +0000 Subject: enable unicode on the wire by default in smbd the unicode support isn't complete, but it is good enough to be usable for a test server. (This used to be commit e787fc1daf4a46c182e87bf0697eec80ff0ce87a) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index eafed8172a..8ea1d2e816 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -268,6 +268,7 @@ typedef struct BOOL bDebugUid; BOOL bHostMSDfs; BOOL bHideLocalUsers; + BOOL bUnicode; } global; @@ -775,6 +776,7 @@ static struct parm_struct parm_table[] = { {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, + {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, @@ -1251,6 +1253,7 @@ static void init_globals(void) Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; Globals.bPasswdChatDebug = False; + Globals.bUnicode = True; /* Do unicode on the wire by default */ Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ @@ -1508,6 +1511,7 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_nt_smb_support, &Globals.bNTSmbSupport) +FN_GLOBAL_BOOL(lp_unicode, &Globals.bUnicode) FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport) FN_GLOBAL_BOOL(lp_nt_acl_support, &Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) -- cgit From 65d35749b721b76ae826a9423bdefd2f673f35c6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Mar 2001 05:55:30 +0000 Subject: Added Michael Sweet's CUPS patch to call directly into the CUPS backend. Parameterises the printing functions so other backends can be plugged directly in (this is a good thing :-). Jeremy. (This used to be commit c0345bbaed5d1aac777f1a33ff84ad1899f2ed6d) --- source3/param/loadparm.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8ea1d2e816..85329e8c53 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1068,16 +1068,22 @@ static void init_printer_values(void) break; case PRINT_CUPS: - 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 -oraw %s; rm %s"); - string_set(&sDefault.szQueuepausecommand, - "/usr/bin/disable %p"); - string_set(&sDefault.szQueueresumecommand, - "/usr/bin/enable %p"); + string_set(&Globals.szPrintcapname, "cups"); +#ifdef HAVE_LIBCUPS + 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, ""); +#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 -oraw %s; rm %s"); + string_set(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); + string_set(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); +#endif /* HAVE_LIBCUPS */ break; case PRINT_SYSV: -- cgit From 853b5c87ec5ac499a8320edb7b3bc2672a5a49e4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Mar 2001 06:17:11 +0000 Subject: fixed volume_name(). It used dos_to_unix() which uses a static buffer, and that buffer got clobbered in the trans2 QFS_VOLUME_INFO call, so the volume label always showed as "." from NT clients. (This used to be commit 2131d8bf76733d7cf046aa651d11bf3dade0913d) --- source3/param/loadparm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 85329e8c53..aebf43c9a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3361,7 +3361,10 @@ char *volume_label(int snum) /* lp_volume returns a unix charset - lp_servicename returns a dos codepage - convert so volume_label() always returns UNIX. */ - return (dos_to_unix(lp_servicename(snum), False)); + char *p = dos_to_unix(lp_servicename(snum), False); + int len = strlen(p)+1; + ret = (char *)talloc(lp_talloc, len); + memcpy(ret, p, len); } return (ret); } -- cgit From dfcfdf72507ec627e68a7e4e771f2bdc0fa29830 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Mar 2001 19:10:55 +0000 Subject: Updated defaults for CUPS printing from Michael Sweet. Jeremy. (This used to be commit 2e3ec2b4fc02f3acb47a67ebd000b99a918a9967) --- source3/param/loadparm.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index aebf43c9a5..64393b4082 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1068,7 +1068,6 @@ static void init_printer_values(void) break; case PRINT_CUPS: - string_set(&Globals.szPrintcapname, "cups"); #ifdef HAVE_LIBCUPS string_set(&sDefault.szLpqcommand, ""); string_set(&sDefault.szLprmcommand, ""); @@ -1077,12 +1076,24 @@ static void init_printer_values(void) string_set(&sDefault.szLpresumecommand, ""); string_set(&sDefault.szQueuepausecommand, ""); string_set(&sDefault.szQueueresumecommand, ""); + + string_set(&Globals.szPrintcapname, "cups"); #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 -oraw %s; rm %s"); - string_set(&sDefault.szQueuepausecommand, "/usr/bin/disable %p"); - string_set(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); + 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"); #endif /* HAVE_LIBCUPS */ break; -- cgit From 0f2b15707ad0e41b786f0078f334b7782d63b8af Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Mar 2001 04:12:36 +0000 Subject: added option "enhanced browsing" this allows users to disable the cross-subnet browse extensions that I added to Samba a couple of years ago. This may be useful for getting rid of empty workgroups. (This used to be commit 978980050e599d3830d0474bc9a8003bfe227719) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 64393b4082..ccc967234b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -194,6 +194,7 @@ typedef struct int iTotalPrintJobs; int syslog; int os_level; + int enhanced_browsing; int max_ttl; int max_wins_ttl; int min_wins_ttl; @@ -908,6 +909,7 @@ static struct parm_struct parm_table[] = { {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, {"WINS Options", P_SEP, P_SEPARATOR}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, @@ -1280,6 +1282,7 @@ static void init_globals(void) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ + Globals.enhanced_browsing = True; #ifdef WITH_LDAP /* default values for ldap */ @@ -1537,6 +1540,7 @@ FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) +FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) 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) -- cgit From 0053bd8b80cc08d65948c97f8ab0b4e2b829f083 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Fri, 23 Mar 2001 00:50:31 +0000 Subject: first pass of the new group mapping code J.F. (This used to be commit 7154deb026d53cb0cd503562174c3332a372be63) --- source3/param/loadparm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ccc967234b..f930cf2f09 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -163,6 +163,10 @@ typedef struct char *szPanicAction; char *szAddUserScript; char *szDelUserScript; + char *szAddGroupScript; + char *szDelGroupScript; + char *szAddUserToGroupScript; + char *szDelUserToGroupScript; char *szWINSHook; #ifdef WITH_UTMP char *szUtmpDir; @@ -891,6 +895,11 @@ static struct parm_struct parm_table[] = { {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, + {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, + {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, + {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, + {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_DOS_STRING}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_DOS_STRING}, {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, @@ -1464,6 +1473,12 @@ FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) + +FN_GLOBAL_STRING(lp_addgroup_script, &Globals.szAddGroupScript) +FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) +FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) +FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) + FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_STRING(lp_domain_groups, &Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) -- cgit From a44721750944af9beb46f169a49a439b614a8622 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 23 Mar 2001 03:12:58 +0000 Subject: Two OS/2 printer fixes from Jim McDonough @ IBM. First one adds a new info level into the lanman printing and an ioctl to the trans2 code. Andrew - this uses ASCII only. It looks ok to me but please check ! Second one adds a parameter "os2 driver map" that allows OS/2 driver names to be mapped. Jeremy. (This used to be commit da79b519e0b6b4317d7fb5260d74e0e74a7e0b46) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f930cf2f09..d35ca97292 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -107,6 +107,7 @@ typedef struct char *szEnumPortsCommand; char *szAddPrinterCommand; char *szDeletePrinterCommand; + char *szOs2DriverMap; char *szLockDir; char *szRootdir; char *szDefaultService; @@ -846,6 +847,7 @@ static struct parm_struct parm_table[] = { {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, + {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT|FLAG_DOS_STRING}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_DOS_STRING}, @@ -1435,6 +1437,7 @@ FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) 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_os2_driver_map, &Globals.szOs2DriverMap) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) -- cgit From 1452c2d8c4a2124e4c97bb51a1e58bcfda620ef0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 26 Mar 2001 23:13:02 +0000 Subject: Fix from Ryo Kawahara to make SWAT correctly write and smb.conf file in utf8. Jeremy. (This used to be commit 42052d6079479452aa43eb37ad3d679d28337779) --- source3/param/loadparm.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d35ca97292..bec5f03cd8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2694,7 +2694,7 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) +static void print_parameter(struct parm_struct *p, void *ptr, FILE * f, char *(*dos_to_ext)(char *, BOOL)) { int i; switch (p->type) @@ -2733,14 +2733,22 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) case P_GSTRING: case P_UGSTRING: - if ((char *)ptr) - fprintf(f, "%s", (char *)ptr); + if ((char *)ptr) { + if (p->flags & FLAG_DOS_STRING) + fprintf(f, "%s", dos_to_ext((char *)ptr, False)); + else + fprintf(f, "%s", (char *)ptr); + } break; case P_STRING: case P_USTRING: - if (*(char **)ptr) - fprintf(f, "%s", *(char **)ptr); + if (*(char **)ptr) { + if(p->flags & FLAG_DOS_STRING) + fprintf(f,"%s",dos_to_ext(*(char **)ptr, False)); + else + fprintf(f, "%s", *(char **)ptr); + } break; case P_SEP: break; @@ -2895,7 +2903,7 @@ static BOOL is_default(int i) /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ -static void dump_globals(FILE * f) +static void dump_globals(FILE *f, char *(*dos_to_ext)(char *, BOOL)) { int i; fprintf(f, "# Global parameters\n[global]\n"); @@ -2908,7 +2916,7 @@ static void dump_globals(FILE * f) if (defaults_saved && is_default(i)) continue; fprintf(f, "\t%s = ", parm_table[i].label); - print_parameter(&parm_table[i], parm_table[i].ptr, f); + print_parameter(&parm_table[i], parm_table[i].ptr, f, dos_to_ext); fprintf(f, "\n"); } } @@ -2929,7 +2937,7 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ -static void dump_a_service(service * pService, FILE * f) +static void dump_a_service(service * pService, FILE * f, char *(*dos_to_ext)(char *, BOOL)) { int i; if (pService != &sDefault) @@ -2960,7 +2968,7 @@ static void dump_a_service(service * pService, FILE * f) fprintf(f, "\t%s = ", parm_table[i].label); print_parameter(&parm_table[i], - ((char *)pService) + pdiff, f); + ((char *)pService) + pdiff, f, dos_to_ext); fprintf(f, "\n"); } } @@ -3330,7 +3338,7 @@ int lp_numservices(void) /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE * f, BOOL show_defaults, int maxtoprint) +void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint, char *(*dos_to_ext)(char *, BOOL)) { int iService; @@ -3339,24 +3347,24 @@ void lp_dump(FILE * f, BOOL show_defaults, int maxtoprint) defaults_saved = False; } - dump_globals(f); + dump_globals(f, dos_to_ext); - dump_a_service(&sDefault, f); + dump_a_service(&sDefault, f, dos_to_ext); for (iService = 0; iService < maxtoprint; iService++) - lp_dump_one(f, show_defaults, iService); + lp_dump_one(f, show_defaults, iService, dos_to_ext); } /*************************************************************************** Display the contents of one service in human-readable form. ***************************************************************************/ -void lp_dump_one(FILE * f, BOOL show_defaults, int snum) +void lp_dump_one(FILE * f, BOOL show_defaults, int snum, char *(*dos_to_ext)(char *, BOOL)) { if (VALID(snum)) { if (iSERVICE(snum).szService[0] == '\0') return; - dump_a_service(pSERVICE(snum), f); + dump_a_service(pSERVICE(snum), f, dos_to_ext); } } -- cgit From 950f1d9605179d75ab0755cecffbabbde769beb9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Apr 2001 00:36:38 +0000 Subject: Added 3 params to manipulate shares. "add share command/change share command/ delete share command". Implemented "delete" - more work to come on add and change. Jeremy. (This used to be commit 2e6b1759e14456421066ee131af70a495f862f2b) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bec5f03cd8..59e66d8ce1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -181,6 +181,9 @@ typedef struct char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; + char *szAddShareCommand; + char *szChangeShareCommand; + char *szDeleteShareCommand; int max_log_size; int mangled_stack; int max_xmit; @@ -960,6 +963,9 @@ static struct parm_struct parm_table[] = { #endif /* WITH_LDAP */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, + {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, + {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, @@ -1501,6 +1507,9 @@ FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter); FN_GLOBAL_STRING(lp_ldap_root, &Globals.szLdapRoot); FN_GLOBAL_STRING(lp_ldap_rootpasswd, &Globals.szLdapRootPassword); #endif /* WITH_LDAP */ +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); #ifdef WITH_SSL FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion); -- cgit From faf49bbe8c0a46a708c5f48387570abb37ab9cc3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Apr 2001 21:03:48 +0000 Subject: Fixup warnings about extra ';' from SGI compiler. Jeremy. (This used to be commit 7ee448d83263714676bd250ecc3805b08198e916) --- source3/param/loadparm.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 59e66d8ce1..5407db5024 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1501,31 +1501,31 @@ FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_STRING(lp_codepagedir,&Globals.szCodePageDir) #ifdef WITH_LDAP -FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer); -FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix); -FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter); -FN_GLOBAL_STRING(lp_ldap_root, &Globals.szLdapRoot); -FN_GLOBAL_STRING(lp_ldap_rootpasswd, &Globals.szLdapRootPassword); +FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) +FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) +FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) +FN_GLOBAL_STRING(lp_ldap_root, &Globals.szLdapRoot) +FN_GLOBAL_STRING(lp_ldap_rootpasswd, &Globals.szLdapRootPassword) #endif /* WITH_LDAP */ -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_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) #ifdef WITH_SSL -FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion); -FN_GLOBAL_STRING(lp_ssl_hosts, &Globals.sslHostsRequire); -FN_GLOBAL_STRING(lp_ssl_hosts_resign, &Globals.sslHostsResign); -FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir); -FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile); -FN_GLOBAL_STRING(lp_ssl_cert, &Globals.sslCert); -FN_GLOBAL_STRING(lp_ssl_privkey, &Globals.sslPrivKey); -FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert); -FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey); -FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers); -FN_GLOBAL_BOOL(lp_ssl_enabled, &Globals.sslEnabled); -FN_GLOBAL_BOOL(lp_ssl_reqClientCert, &Globals.sslReqClientCert); -FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert); -FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility); +FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion) +FN_GLOBAL_STRING(lp_ssl_hosts, &Globals.sslHostsRequire) +FN_GLOBAL_STRING(lp_ssl_hosts_resign, &Globals.sslHostsResign) +FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir) +FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile) +FN_GLOBAL_STRING(lp_ssl_cert, &Globals.sslCert) +FN_GLOBAL_STRING(lp_ssl_privkey, &Globals.sslPrivKey) +FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert) +FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey) +FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers) +FN_GLOBAL_BOOL(lp_ssl_enabled, &Globals.sslEnabled) +FN_GLOBAL_BOOL(lp_ssl_reqClientCert, &Globals.sslReqClientCert) +FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert) +FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility) #endif /* WITH_SSL */ FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) -- cgit From 2ef68c7e92d4661664f0410509f7cb551e74a198 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 13 Apr 2001 19:12:06 +0000 Subject: Merge of Andrew's changes in 2.2. Jeremy. (This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5407db5024..022154f1d8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -966,7 +966,6 @@ static struct parm_struct parm_table[] = { {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, - {"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING}, @@ -1433,7 +1432,6 @@ static char *lp_string(const char *s) int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) -FN_GLOBAL_STRING(lp_smbrun, &Globals.szSmbrun) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) -- cgit From 4355098a757885462dd44b94b616014c30eea2bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 16 Apr 2001 15:16:31 +0000 Subject: hide unreadable patch from idra (This used to be commit 7b6cfe243002a92f5dfb52413e9b3550c61cecfb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 022154f1d8..11697b5044 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -359,6 +359,7 @@ typedef struct BOOL bCaseMangle; BOOL status; BOOL bHideDotFiles; + BOOL bHideUnReadable; BOOL bBrowseable; BOOL bAvailable; BOOL bRead_only; @@ -474,6 +475,7 @@ static service sDefault = { False, /* case mangle */ True, /* status */ True, /* bHideDotFiles */ + False, /* bHideUnReadable */ True, /* bBrowseable */ True, /* bAvailable */ True, /* bRead_only */ @@ -871,6 +873,7 @@ static struct parm_struct parm_table[] = { {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, @@ -1649,6 +1652,7 @@ FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve) FN_LOCAL_BOOL(lp_casemangle, bCaseMangle) FN_LOCAL_BOOL(lp_status, status) FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles) +FN_LOCAL_BOOL(lp_hideunreadable, bHideUnReadable) FN_LOCAL_BOOL(lp_browseable, bBrowseable) FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) -- cgit From 9ce5a03ccbcc21c60a3dbc39b1dbd06b30655852 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 18 Apr 2001 16:41:04 +0000 Subject: merge from 2.2 (This used to be commit f52a5014ee325f9d91f266f88eac51b6136a75b9) --- source3/param/loadparm.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 11697b5044..c29418ee87 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -173,8 +173,8 @@ typedef struct char *szUtmpDir; char *szWtmpDir; char *szUtmpHostname; - BOOL bUtmpConsolidate; -#endif /* WITH_UTMP */ + BOOL bUtmp; +#endif char *szSourceEnv; char *szWinbindUID; char *szWinbindGID; @@ -257,7 +257,6 @@ typedef struct BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; - BOOL bUnixRealname; BOOL bNISHomeMap; BOOL bTimeServer; BOOL bBindInterfacesOnly; @@ -374,9 +373,6 @@ typedef struct BOOL bLocking; BOOL bStrictLocking; BOOL bPosixLocking; -#ifdef WITH_UTMP - BOOL bUtmp; -#endif BOOL bShareModes; BOOL bOpLocks; BOOL bLevel2OpLocks; @@ -490,9 +486,6 @@ static service sDefault = { True, /* bLocking */ False, /* bStrictLocking */ True, /* bPosixLocking */ -#ifdef WITH_UTMP - False, /* bUtmp */ -#endif True, /* bShareModes */ True, /* bOpLocks */ True, /* bLevel2OpLocks */ @@ -942,9 +935,6 @@ static struct parm_struct parm_table[] = { {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, -#ifdef WITH_UTMP - {"utmp", P_BOOL, P_LOCAL, &sDefault.bUtmp, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, -#endif {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -976,16 +966,13 @@ static struct parm_struct parm_table[] = { {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP - {"utmp dir", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - {"wtmp dir", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, {"utmp hostname", P_STRING, P_GLOBAL, &Globals.szUtmpHostname, NULL, NULL, 0}, - {"utmp consolidate", P_BOOL, P_GLOBAL, &Globals.bUtmpConsolidate, NULL, NULL, 0}, -#endif /* WITH_UTMP */ + {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, +#endif - {"default service", P_STRING, P_GLOBAL, - &Globals.szDefaultService, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, @@ -995,7 +982,6 @@ static struct parm_struct parm_table[] = { {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {"unix realname", P_BOOL, P_GLOBAL, &Globals.bUnixRealname, NULL, NULL, 0}, {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, @@ -1215,8 +1201,8 @@ static void init_globals(void) string_set(&Globals.szUtmpDir, ""); string_set(&Globals.szWtmpDir, ""); string_set(&Globals.szUtmpHostname, "%m"); - Globals.bUtmpConsolidate = False; -#endif /* WITH_UTMP */ + Globals.bUtmp = False; +#endif string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); @@ -1277,7 +1263,6 @@ static void init_globals(void) Globals.lm_interval = 60; Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ Globals.announce_as = ANNOUNCE_AS_NT_SERVER; - Globals.bUnixRealname = True; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; #ifdef WITH_NISPLUS_HOME @@ -1450,8 +1435,8 @@ FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) FN_GLOBAL_STRING(lp_utmp_hostname, &Globals.szUtmpHostname) -FN_GLOBAL_BOOL(lp_utmp_consolidate, &Globals.bUtmpConsolidate) -#endif /* WITH_UTMP */ +FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp) +#endif FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) FN_GLOBAL_STRING(lp_source_environment, &Globals.szSourceEnv) FN_GLOBAL_STRING(lp_defaultservice, &Globals.szDefaultService) @@ -1552,7 +1537,6 @@ FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) -FN_GLOBAL_BOOL(lp_unix_realname, &Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) @@ -1665,9 +1649,6 @@ FN_LOCAL_BOOL(lp_map_archive, bMap_archive) FN_LOCAL_BOOL(lp_locking, bLocking) FN_LOCAL_BOOL(lp_strict_locking, bStrictLocking) FN_LOCAL_BOOL(lp_posix_locking, bPosixLocking) -#ifdef WITH_UTMP -FN_LOCAL_BOOL(lp_utmp, bUtmp) -#endif FN_LOCAL_BOOL(lp_share_modes, bShareModes) FN_LOCAL_BOOL(lp_oplocks, bOpLocks) FN_LOCAL_BOOL(lp_level2_oplocks, bLevel2OpLocks) -- cgit From 70b55a9abc109df0e15e3aa6f01c03d9acea154a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 23 Apr 2001 20:43:20 +0000 Subject: Added "obey pam restrictions" parameter - default to "off". Only set this to "on" if you know you have your PAM set up correctly..... NB. Doesn't apply to plaintext password authentication, which must use pam when compiled in. Jeremy. (This used to be commit 59aa99f3901d098b7afbe675021bda53b62ee496) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c29418ee87..042963d9e5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -249,6 +249,7 @@ typedef struct BOOL bUpdateEncrypt; BOOL bStripDot; BOOL bNullPasswords; + BOOL bObeyPamRestrictions; BOOL bLoadPrinters; BOOL bUseRhosts; BOOL bReadRaw; @@ -678,6 +679,7 @@ static struct parm_struct parm_table[] = { {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, @@ -1246,6 +1248,7 @@ static void init_globals(void) Globals.bReadPrediction = False; Globals.bReadbmpx = False; Globals.bNullPasswords = False; + Globals.bObeyPamRestrictions = False; Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; @@ -1528,6 +1531,7 @@ FN_GLOBAL_BOOL(lp_readbmpx, &Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw) FN_GLOBAL_BOOL(lp_writeraw, &Globals.bWriteRaw) FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) +FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) -- cgit From a4ab60a616a10538c5ece7dea6ac91d08a935f14 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 24 Apr 2001 16:24:36 +0000 Subject: set "vfs object" and "vfs options" to be setable by SWAT on advanced page change "host msdfs" to be strictly a global parameter on advanced page change "printer admin" to be on printers page not share page (caught by Ingo Kilian ) (This used to be commit 93034985e02bdb9a00a9c509b851442561f4ad68) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 042963d9e5..d5c8799f87 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -709,7 +709,7 @@ static struct parm_struct parm_table[] = { {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_STRING, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"printer admin", P_STRING, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, @@ -1019,12 +1019,12 @@ static struct parm_struct parm_table[] = { {"VFS options", P_SEP, P_SEPARATOR}, - {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, 0}, - {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, 0}, + {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, + {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_GLOBAL}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, {"Winbind options", P_SEP, P_SEPARATOR}, -- cgit From f0d22b5413e7a44b54123308161e1c08e98c0124 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 26 Apr 2001 13:25:46 +0000 Subject: removed references to SMBRUN (This used to be commit 822511eb3c8daa89e96b3fab7573555312415262) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d5c8799f87..2068e8e1ee 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -143,7 +143,6 @@ typedef struct char *szLogonPath; char *szLogonDrive; char *szLogonHome; - char *szSmbrun; char *szWINSserver; char *szCodingSystem; char *szInterfaces; @@ -1205,7 +1204,6 @@ static void init_globals(void) string_set(&Globals.szUtmpHostname, "%m"); Globals.bUtmp = False; #endif - string_set(&Globals.szSmbrun, SMBRUN); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); pstrcat(s, VERSION); -- cgit From aac630b382fefff2e3ead291d2d838832a180925 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 2 May 2001 23:32:09 +0000 Subject: Had to add a "pam password change" parameter (defaults to "off") and inlined the pam password change code to ensure that existing and working password chat scripts don't break with 2.2.1. PAM password changing has to be explicitly requested. Allowed wildcards in pam password change matching (matches password chat script matching). Had to add const (sorry Tim :-) to ms_fnmatch() to stop warnings. Don't worry - the const changes are isolated and don't cause any other warnings :-). Jeremy. (This used to be commit 47b4d82536c09bffe3a0d9917fa31d935f1be7d8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2068e8e1ee..75468ab074 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -260,6 +260,7 @@ typedef struct BOOL bNISHomeMap; BOOL bTimeServer; BOOL bBindInterfacesOnly; + BOOL bPamPasswordChange; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; BOOL bTimestampLogs; @@ -687,6 +688,7 @@ static struct parm_struct parm_table[] = { {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, @@ -1276,6 +1278,7 @@ static void init_globals(void) Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; + Globals.bPamPasswordChange = False; Globals.bPasswdChatDebug = False; Globals.bUnicode = True; /* Do unicode on the wire by default */ Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ @@ -1542,6 +1545,7 @@ FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) +FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange) FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_nt_smb_support, &Globals.bNTSmbSupport) -- cgit From 548d16869acffdec899121906a7bcd88f58d9b6f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 May 2001 19:47:30 +0000 Subject: Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h and using autoconf tests. Added "restrict acl with mask" parameter. Jeremy. (This used to be commit 7792e32ba7fd734cc68b354f31c382ac11521fe8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 75468ab074..50e2450684 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -395,6 +395,7 @@ typedef struct BOOL bBlockingLocks; BOOL bInheritPerms; BOOL bMSDfsRoot; + BOOL bRestrictAclWithMask; char dummy[3]; /* for alignment */ } @@ -508,6 +509,7 @@ static service sDefault = { True, /* bBlockingLocks */ False, /* bInheritPerms */ False, /* bMSDfsRoot */ + False, /* bRestrictAclWithMask */ "" /* dummy */ }; @@ -791,6 +793,7 @@ static struct parm_struct parm_table[] = { {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, + {"restrict acl with mask", P_BOOL, P_LOCAL, &sDefault.bRestrictAclWithMask, NULL, NULL, FLAG_SHARE}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -1674,6 +1677,7 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) +FN_LOCAL_BOOL(lp_restrict_acl_with_mask, bRestrictAclWithMask) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(_lp_security_mask, iSecurity_mask) -- cgit From d7387f8fb5786680c7c321bcb440217c95493da3 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 4 May 2001 07:32:28 +0000 Subject: Added some missing winbind parameters. Yes they're already documented. (-: (This used to be commit 657f95c89e593e6cdfc6fb9c7a9e67f9a518c1a5) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 50e2450684..793cbf7951 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -180,6 +180,8 @@ typedef struct char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; + BOOL bWinbindEnumUsers; + BOOL bWinbindEnumGroups; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1038,6 +1040,8 @@ static struct parm_struct parm_table[] = { {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, + {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, + {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1350,7 +1354,10 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); string_set(&Globals.szWinbindSeparator, "\\"); + Globals.winbind_cache_time = 15; + Globals.bWinbindEnumUsers = True; + Globals.bWinbindEnumGroups = True; /* * This must be done last as it checks the value in @@ -1492,6 +1499,8 @@ FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) +FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers); +FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups); FN_GLOBAL_STRING(lp_codepagedir,&Globals.szCodePageDir) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -- cgit From 495f6e678774b013ec9da268fb69543ec9fc6cc6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 7 May 2001 22:10:38 +0000 Subject: merge from 2.2 removing the 'domain XXX' parameters. (This used to be commit 9aefc86e355bf160300580acb85a58a18207ccdf) --- source3/param/loadparm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 793cbf7951..d166d8c048 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -153,7 +153,6 @@ typedef struct char *szAnnounceVersion; /* This is initialised in init_globals */ char *szNetbiosAliases; char *szDomainOtherSIDs; - char *szDomainGroups; char *szNameResolveOrder; char *szLdapServer; char *szLdapSuffix; @@ -888,13 +887,10 @@ static struct parm_struct parm_table[] = { {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain groups", P_STRING, P_GLOBAL, &Globals.szDomainGroups, NULL, NULL, 0}, {"domain admin group", P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, {"domain guest group", P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, - {"domain admin users", P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, - {"domain guest users", P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, + #ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, #endif /* USING_GROUPNAME_MAP */ @@ -1489,11 +1485,8 @@ FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) -FN_GLOBAL_STRING(lp_domain_groups, &Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group, &Globals.szDomainGuestGroup) -FN_GLOBAL_STRING(lp_domain_admin_users, &Globals.szDomainAdminUsers) -FN_GLOBAL_STRING(lp_domain_guest_users, &Globals.szDomainGuestUsers) FN_GLOBAL_STRING(lp_winbind_uid, &Globals.szWinbindUID) FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) -- cgit From f5243954faee5380d43f00cdb2fa820da5d50ebd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 May 2001 01:03:44 +0000 Subject: Made "security XXX" masks apply to ACL set. By default they have no effect. Removed "restrict acl with mask" - redundent. Jeremy. (This used to be commit 0db8a61d71f25ffa0e5c585e02e2fce973867156) --- source3/param/loadparm.c | 57 +++++++----------------------------------------- 1 file changed, 8 insertions(+), 49 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d166d8c048..c843489596 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -396,7 +396,6 @@ typedef struct BOOL bBlockingLocks; BOOL bInheritPerms; BOOL bMSDfsRoot; - BOOL bRestrictAclWithMask; char dummy[3]; /* for alignment */ } @@ -455,12 +454,12 @@ static service sDefault = { 0, /* iWriteCacheSize */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ - -1, /* iSecurity_mask */ - -1, /* iSecurity_force_mode */ + 0777, /* iSecurity_mask */ + 0, /* iSecurity_force_mode */ 0755, /* iDir_mask */ 0000, /* iDir_force_mode */ - -1, /* iDir_Security_mask */ - -1, /* iDir_Security_force_mode */ + 777, /* iDir_Security_mask */ + 0, /* iDir_Security_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ DEFAULT_PRINTING, /* iPrinting */ @@ -510,7 +509,6 @@ static service sDefault = { True, /* bBlockingLocks */ False, /* bInheritPerms */ False, /* bMSDfsRoot */ - False, /* bRestrictAclWithMask */ "" /* dummy */ }; @@ -794,7 +792,6 @@ static struct parm_struct parm_table[] = { {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, - {"restrict acl with mask", P_BOOL, P_LOCAL, &sDefault.bRestrictAclWithMask, NULL, NULL, FLAG_SHARE}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -1679,15 +1676,14 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) -FN_LOCAL_BOOL(lp_restrict_acl_with_mask, bRestrictAclWithMask) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) -FN_LOCAL_INTEGER(_lp_security_mask, iSecurity_mask) -FN_LOCAL_INTEGER(_lp_force_security_mode, iSecurity_force_mode) +FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) +FN_LOCAL_INTEGER(lp_force_security_mode, iSecurity_force_mode) FN_LOCAL_INTEGER(lp_dir_mask, iDir_mask) FN_LOCAL_INTEGER(lp_force_dir_mode, iDir_force_mode) -FN_LOCAL_INTEGER(_lp_dir_security_mask, iDir_Security_mask) -FN_LOCAL_INTEGER(_lp_force_dir_security_mode, iDir_Security_force_mode) +FN_LOCAL_INTEGER(lp_dir_security_mask, iDir_Security_mask) +FN_LOCAL_INTEGER(lp_force_dir_security_mode, iDir_Security_force_mode) FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase, iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) @@ -3616,43 +3612,6 @@ void lp_set_name_resolve_order(char *new_order) Globals.szNameResolveOrder = new_order; } -/*********************************************************** - Functions to return the current security masks/modes. If - set to -1 then return the create mask/mode instead. -************************************************************/ - -int lp_security_mask(int snum) -{ - int val = _lp_security_mask(snum); - if (val == -1) - return lp_create_mask(snum); - return val; -} - -int lp_force_security_mode(int snum) -{ - int val = _lp_force_security_mode(snum); - if (val == -1) - return lp_force_create_mode(snum); - return val; -} - -int lp_dir_security_mask(int snum) -{ - int val = _lp_dir_security_mask(snum); - if (val == -1) - return lp_dir_mask(snum); - return val; -} - -int lp_force_dir_security_mode(int snum) -{ - int val = _lp_force_dir_security_mode(snum); - if (val == -1) - return lp_force_dir_mode(snum); - return val; -} - char *lp_printername(int snum) { char *ret = _lp_printername(snum); -- cgit From 89798ef71c43d176229812066cb5d651c65d1744 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 May 2001 20:58:38 +0000 Subject: free_service() was never setting the valid field to False. This is a bug that's been here since 2.0.x and before.... This would cause a memleak. Jeremy. (This used to be commit 3412950dbd5b70f28ffdbe1a79488a409ca1a051) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c843489596..8888c45933 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1740,6 +1740,8 @@ static void free_service(service * pservice) pservice->copymap = NULL; } + pservice->valid = False; + for (i = 0; parm_table[i].label; i++) if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && -- cgit From 3e125823cf967988a51a06644febbf164c8596d3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 May 2001 22:10:31 +0000 Subject: Got rid of iSERVICE/pSERVICE (Hungarian inspired obfuscation). Now use ServicePtrs[i] when we're indirecting so we can see what's going on. ZERO_STRUCTP(ServicePtrs[i]) on free_service. Jeremy. (This used to be commit 95dfc4a60a80ea5d55ac4775dd875e1283ecdaec) --- source3/param/loadparm.c | 164 +++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 84 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8888c45933..2aa24b8d10 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -86,10 +86,8 @@ pstring global_scope = ""; #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).valid +#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && ServicePtrs[(i)]->valid) +#define VALID(i) ServicePtrs[i]->valid int keepalive = DEFAULT_KEEPALIVE; BOOL use_getwd_cache = True; @@ -1418,13 +1416,13 @@ static char *lp_string(const char *s) int fn_name(void) {return(*(int *)(ptr));} #define FN_LOCAL_STRING(fn_name,val) \ - char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i)&&pSERVICE(i)->val)?pSERVICE(i)->val : sDefault.val));} + char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));} #define FN_LOCAL_BOOL(fn_name,val) \ - BOOL fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} + BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_CHAR(fn_name,val) \ - char fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} + char fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_INTEGER(fn_name,val) \ - int fn_name(int i) {return(LP_SNUM_OK(i)? pSERVICE(i)->val : sDefault.val);} + int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) @@ -1740,8 +1738,6 @@ static void free_service(service * pservice) pservice->copymap = NULL; } - pservice->valid = False; - for (i = 0; parm_table[i].label; i++) if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && @@ -1749,6 +1745,8 @@ static void free_service(service * pservice) string_free((char **) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); + + ZERO_STRUCTP(pservice); } /*************************************************************************** @@ -1773,7 +1771,7 @@ static int add_a_service(service * pservice, char *name) /* find an invalid one */ for (i = 0; i < iNumServices; i++) - if (!pSERVICE(i)->valid) + if (!ServicePtrs[i]->valid) break; /* if not, then create one */ @@ -1784,24 +1782,24 @@ static int add_a_service(service * pservice, char *name) sizeof(service *) * num_to_alloc); if (ServicePtrs) - pSERVICE(iNumServices) = + ServicePtrs[iNumServices] = (service *) malloc(sizeof(service)); - if (!ServicePtrs || !pSERVICE(iNumServices)) + if (!ServicePtrs || !ServicePtrs[iNumServices]) return (-1); iNumServices++; } else - free_service(pSERVICE(i)); + free_service(ServicePtrs[i]); - pSERVICE(i)->valid = True; + ServicePtrs[i]->valid = True; - init_service(pSERVICE(i)); - copy_service(pSERVICE(i), &tservice, NULL); + init_service(ServicePtrs[i]); + copy_service(ServicePtrs[i], &tservice, NULL); if (name) { - string_set(&iSERVICE(i).szService, name); + string_set(&ServicePtrs[i]->szService, name); } return (i); } @@ -1812,23 +1810,23 @@ from service ifrom. homename must be in DOS codepage. ***************************************************************************/ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) { - int i = add_a_service(pSERVICE(iDefaultService), pszHomename); + int i = add_a_service(ServicePtrs[iDefaultService], pszHomename); if (i < 0) return (False); - if (!(*(iSERVICE(i).szPath)) - || strequal(iSERVICE(i).szPath, lp_pathname(-1))) - string_set(&iSERVICE(i).szPath, pszHomedir); - if (!(*(iSERVICE(i).comment))) + if (!(*(ServicePtrs[i]->szPath)) + || strequal(ServicePtrs[i]->szPath, lp_pathname(-1))) + string_set(&ServicePtrs[i]->szPath, pszHomedir); + if (!(*(ServicePtrs[i]->comment))) { pstring comment; slprintf(comment, sizeof(comment) - 1, "Home directory of %s", pszHomename); - string_set(&iSERVICE(i).comment, comment); + string_set(&ServicePtrs[i]->comment, comment); } - iSERVICE(i).bAvailable = sDefault.bAvailable; - iSERVICE(i).bBrowseable = sDefault.bBrowseable; + ServicePtrs[i]->bAvailable = sDefault.bAvailable; + ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; DEBUG(3, ("adding home directory %s at %s\n", pszHomename, pszHomedir)); @@ -1841,7 +1839,7 @@ add a new service, based on an old one. pszService must be in DOS codepage. ***************************************************************************/ int lp_add_service(char *pszService, int iDefaultService) { - return (add_a_service(pSERVICE(iDefaultService), pszService)); + return (add_a_service(ServicePtrs[iDefaultService], pszService)); } @@ -1859,18 +1857,18 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) slprintf(comment, sizeof(comment) - 1, "IPC Service (%s)", Globals.szServerString); - string_set(&iSERVICE(i).szPath, tmpdir()); - string_set(&iSERVICE(i).szUsername, ""); - string_set(&iSERVICE(i).comment, comment); - string_set(&iSERVICE(i).fstype, "IPC"); - iSERVICE(i).status = False; - iSERVICE(i).iMaxConnections = 0; - iSERVICE(i).bAvailable = True; - iSERVICE(i).bRead_only = True; - iSERVICE(i).bGuest_only = False; - iSERVICE(i).bGuest_ok = guest_ok; - iSERVICE(i).bPrint_ok = False; - iSERVICE(i).bBrowseable = sDefault.bBrowseable; + string_set(&ServicePtrs[i]->szPath, tmpdir()); + string_set(&ServicePtrs[i]->szUsername, ""); + string_set(&ServicePtrs[i]->comment, comment); + string_set(&ServicePtrs[i]->fstype, "IPC"); + ServicePtrs[i]->status = False; + ServicePtrs[i]->iMaxConnections = 0; + ServicePtrs[i]->bAvailable = True; + ServicePtrs[i]->bRead_only = True; + ServicePtrs[i]->bGuest_only = False; + ServicePtrs[i]->bGuest_ok = guest_ok; + ServicePtrs[i]->bPrint_ok = False; + ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; DEBUG(3, ("adding IPC service\n")); @@ -1885,7 +1883,7 @@ printername must be in DOS codepage. BOOL lp_add_printer(char *pszPrintername, int iDefaultService) { char *comment = "From Printcap"; - int i = add_a_service(pSERVICE(iDefaultService), pszPrintername); + int i = add_a_service(ServicePtrs[iDefaultService], pszPrintername); if (i < 0) return (False); @@ -1896,17 +1894,17 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) /* entry (if/when the 'available' keyword is implemented!). */ /* the printer name is set to the service name. */ - string_set(&iSERVICE(i).szPrintername, pszPrintername); - string_set(&iSERVICE(i).comment, comment); - iSERVICE(i).bBrowseable = sDefault.bBrowseable; + string_set(&ServicePtrs[i]->szPrintername, pszPrintername); + string_set(&ServicePtrs[i]->comment, comment); + ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; /* Printers cannot be read_only. */ - iSERVICE(i).bRead_only = False; + ServicePtrs[i]->bRead_only = False; /* No share modes on printer services. */ - iSERVICE(i).bShareModes = False; + ServicePtrs[i]->bShareModes = False; /* No oplocks on printer services. */ - iSERVICE(i).bOpLocks = False; + ServicePtrs[i]->bOpLocks = False; /* Printer services must be printable. */ - iSERVICE(i).bPrint_ok = True; + ServicePtrs[i]->bPrint_ok = True; DEBUG(3, ("adding printer service %s\n", pszPrintername)); @@ -1971,12 +1969,10 @@ static int getservicebyname(char *pszServiceName, service * pserviceDest) for (iService = iNumServices - 1; iService >= 0; iService--) if (VALID(iService) && - strwicmp(iSERVICE(iService).szService, - pszServiceName) == 0) + strwicmp(ServicePtrs[iService]->szService, pszServiceName) == 0) { if (pserviceDest != NULL) - copy_service(pserviceDest, pSERVICE(iService), - NULL); + copy_service(pserviceDest, ServicePtrs[iService], NULL); break; } @@ -2059,7 +2055,7 @@ static BOOL service_ok(int iService) BOOL bRetval; bRetval = True; - if (iSERVICE(iService).szService[0] == '\0') + if (ServicePtrs[iService]->szService[0] == '\0') { DEBUG(0, ("The following message indicates an internal error:\n")); @@ -2069,31 +2065,31 @@ static BOOL service_ok(int iService) /* The [printers] entry MUST be printable. I'm all for flexibility, but */ /* I can't see why you'd want a non-printable printer service... */ - if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) { - if (!iSERVICE(iService).bPrint_ok) { + if (strwicmp(ServicePtrs[iService]->szService, PRINTERS_NAME) == 0) { + if (!ServicePtrs[iService]->bPrint_ok) { DEBUG(0, ("WARNING: [%s] service MUST be printable!\n", - iSERVICE(iService).szService)); - iSERVICE(iService).bPrint_ok = True; + ServicePtrs[iService]->szService)); + ServicePtrs[iService]->bPrint_ok = True; } /* [printers] service must also be non-browsable. */ - if (iSERVICE(iService).bBrowseable) - iSERVICE(iService).bBrowseable = False; + if (ServicePtrs[iService]->bBrowseable) + ServicePtrs[iService]->bBrowseable = False; } - if (iSERVICE(iService).szPath[0] == '\0' && - strwicmp(iSERVICE(iService).szService, HOMES_NAME) != 0) + if (ServicePtrs[iService]->szPath[0] == '\0' && + strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) { DEBUG(0, ("No path in service %s - using %s\n", - iSERVICE(iService).szService, tmpdir())); - string_set(&iSERVICE(iService).szPath, tmpdir()); + ServicePtrs[iService]->szService, tmpdir())); + string_set(&ServicePtrs[iService]->szPath, tmpdir()); } /* If a service is flagged unavailable, log the fact at level 0. */ - if (!iSERVICE(iService).bAvailable) + if (!ServicePtrs[iService]->bAvailable) DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n", - iSERVICE(iService).szService)); + ServicePtrs[iService]->szService)); return (bRetval); } @@ -2439,9 +2435,9 @@ static BOOL handle_copy(char *pszParmValue, char **ptr) } else { - copy_service(pSERVICE(iServiceIndex), + copy_service(ServicePtrs[iServiceIndex], &serviceTemp, - iSERVICE(iServiceIndex).copymap); + ServicePtrs[iServiceIndex]->copymap); bRetval = True; } } @@ -2538,7 +2534,7 @@ static void init_copymap(service * pservice) ***************************************************************************/ void *lp_local_ptr(int snum, void *ptr) { - return (void *)(((char *)pSERVICE(snum)) + PTR_DIFF(ptr, &sDefault)); + return (void *)(((char *)ServicePtrs[snum]) + PTR_DIFF(ptr, &sDefault)); } /*************************************************************************** @@ -2583,20 +2579,20 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) return (True); } parm_ptr = - ((char *)pSERVICE(snum)) + PTR_DIFF(def_ptr, + ((char *)ServicePtrs[snum]) + PTR_DIFF(def_ptr, &sDefault); } if (snum >= 0) { - if (!iSERVICE(snum).copymap) - init_copymap(pSERVICE(snum)); + if (!ServicePtrs[snum]->copymap) + init_copymap(ServicePtrs[snum]); /* this handles the aliases - set the copymap for other entries with the same data pointer */ for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr == parm_table[parmnum].ptr) - iSERVICE(snum).copymap[i] = False; + ServicePtrs[snum]->copymap[i] = False; } /* if it is a special case then go ahead */ @@ -2931,7 +2927,7 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) int pdiff = PTR_DIFF(parm->ptr, &sDefault); return equal_parameter(parm->type, - ((char *)pSERVICE(snum)) + pdiff, + ((char *)ServicePtrs[snum]) + pdiff, ((char *)&sDefault) + pdiff); } @@ -3005,7 +3001,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) } else { - service *pService = pSERVICE(snum); + service *pService = ServicePtrs[snum]; for (; parm_table[*i].label; (*i)++) { @@ -3067,7 +3063,7 @@ Return TRUE if the passed service number is within range. ***************************************************************************/ BOOL lp_snum_ok(int iService) { - return (LP_SNUM_OK(iService) && iSERVICE(iService).bAvailable); + return (LP_SNUM_OK(iService) && ServicePtrs[iService]->bAvailable); } @@ -3117,9 +3113,9 @@ void lp_add_one_printer(char *name, char *comment) lp_add_printer(name, printers); if ((i = lp_servicenumber(name)) >= 0) { - string_set(&iSERVICE(i).comment, comment); - unix_to_dos(iSERVICE(i).comment, True); - iSERVICE(i).autoloaded = True; + string_set(&ServicePtrs[i]->comment, comment); + unix_to_dos(ServicePtrs[i]->comment, True); + ServicePtrs[i]->autoloaded = True; } } } @@ -3145,8 +3141,8 @@ void lp_killunused(BOOL (*snumused) (int)) if (!snumused || !snumused(i)) { - iSERVICE(i).valid = False; - free_service(pSERVICE(i)); + ServicePtrs[i]->valid = False; + free_service(ServicePtrs[i]); } } } @@ -3159,8 +3155,8 @@ void lp_killservice(int iServiceIn) { if (VALID(iServiceIn)) { - iSERVICE(iServiceIn).valid = False; - free_service(pSERVICE(iServiceIn)); + ServicePtrs[iServiceIn]->valid = False; + free_service(ServicePtrs[iServiceIn]); } } @@ -3364,9 +3360,9 @@ void lp_dump_one(FILE * f, BOOL show_defaults, int snum, char *(*dos_to_ext)(cha { if (VALID(snum)) { - if (iSERVICE(snum).szService[0] == '\0') + if (ServicePtrs[snum]->szService[0] == '\0') return; - dump_a_service(pSERVICE(snum), f, dos_to_ext); + dump_a_service(ServicePtrs[snum], f, dos_to_ext); } } @@ -3531,7 +3527,7 @@ remove a service ********************************************************************/ void lp_remove_service(int snum) { - pSERVICE(snum)->valid = False; + ServicePtrs[snum]->valid = False; } /******************************************************************* -- cgit From 62b02758809fb91b25d909f83d3e68f8ab75eac7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 14 May 2001 20:06:28 +0000 Subject: Stupidity by me..... 777 != 0777 ARGGGHHHHHHHHHH. (Sorry). Jeremy. (This used to be commit 4306eff6f77b95eeaaa4f8375356a81ad3497c67) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2aa24b8d10..8094f17547 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -456,7 +456,7 @@ static service sDefault = { 0, /* iSecurity_force_mode */ 0755, /* iDir_mask */ 0000, /* iDir_force_mode */ - 777, /* iDir_Security_mask */ + 0777, /* iDir_Security_mask */ 0, /* iDir_Security_force_mode */ 0, /* iMaxConnections */ CASE_LOWER, /* iDefaultCase */ -- cgit From af5a6bb85e095aef48e4720eef3b605c726b765c Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 15 May 2001 02:00:15 +0000 Subject: Removed extraneous semicolons from some lp_ parameter definitions. (This used to be commit 34d527240086b135a24c7329d45bff715ae50485) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8094f17547..476a10f881 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1487,8 +1487,8 @@ FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers); -FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups); +FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) +FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_STRING(lp_codepagedir,&Globals.szCodePageDir) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -- cgit From 3414c71f6de04d0ba26841bceac381498f43ecad Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Jun 2001 03:02:34 +0000 Subject: Extra stuff for large readwrite support. Jeremy. (This used to be commit 4338ee78c3d7bcf4b9fac383ff2f572d882ab97c) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 476a10f881..98dddda02f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -250,6 +250,7 @@ typedef struct BOOL bObeyPamRestrictions; BOOL bLoadPrinters; BOOL bUseRhosts; + BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; BOOL bReadPrediction; @@ -780,6 +781,7 @@ static struct parm_struct parm_table[] = { {"Protocol Options", P_SEP, P_SEPARATOR}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, @@ -1234,6 +1236,7 @@ static void init_globals(void) Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; + Globals.bLargeReadwrite = False; Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; Globals.maxprotocol = PROTOCOL_NT1; @@ -1530,6 +1533,7 @@ FN_GLOBAL_BOOL(lp_use_rhosts, &Globals.bUseRhosts) 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_writeraw, &Globals.bWriteRaw) FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) -- cgit From 82970b833cca505fcb5013c0264edde5a79cbd2e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 20 Jun 2001 16:54:32 +0000 Subject: initial support for paramter type P_LIST it will avoid problems with lists being longer than 1024 bytes just now only ip list parameters have been converted to the new type (hosts allow, hosts deny, ssl hosts, ssl hosts resign) (This used to be commit e1572f85d6247b760db10825b2fa688d7ed50bd3) --- source3/param/loadparm.c | 198 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 182 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 98dddda02f..edda04c36b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -221,8 +221,8 @@ typedef struct #endif /* WITH_LDAP */ #ifdef WITH_SSL int sslVersion; - char *sslHostsRequire; - char *sslHostsResign; + char **sslHostsRequire; + char **sslHostsResign; char *sslCaCertDir; char *sslCaCertFile; char *sslCert; @@ -317,8 +317,8 @@ typedef struct char *szPrinterDriverLocation; char *szDriverFile; char *szDontdescend; - char *szHostsallow; - char *szHostsdeny; + char **szHostsallow; + char **szHostsdeny; char *szMagicScript; char *szMagicOutput; char *szMangledMap; @@ -738,17 +738,17 @@ static struct parm_struct parm_table[] = { {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {"hosts allow", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"allow hosts", P_STRING, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"deny hosts", P_STRING, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, #ifdef WITH_SSL {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, - {"ssl hosts", P_STRING, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, - {"ssl hosts resign", P_STRING, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, + {"ssl hosts", P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, + {"ssl hosts resign", P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0}, @@ -1301,8 +1301,8 @@ static void init_globals(void) #ifdef WITH_SSL Globals.sslVersion = SMB_SSL_V23; - string_set(&Globals.sslHostsRequire, ""); - string_set(&Globals.sslHostsResign, ""); + /* Globals.sslHostsRequire = NULL; + Globals.sslHostsResign = NULL; */ string_set(&Globals.sslCaCertDir, ""); string_set(&Globals.sslCaCertFile, ""); string_set(&Globals.sslCert, ""); @@ -1411,6 +1411,8 @@ static char *lp_string(const char *s) #define FN_GLOBAL_STRING(fn_name,ptr) \ char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));} +#define FN_GLOBAL_LIST(fn_name,ptr) \ + char **fn_name(void) {return(*(char ***)(ptr));} #define FN_GLOBAL_BOOL(fn_name,ptr) \ BOOL fn_name(void) {return(*(BOOL *)(ptr));} #define FN_GLOBAL_CHAR(fn_name,ptr) \ @@ -1420,6 +1422,8 @@ static char *lp_string(const char *s) #define FN_LOCAL_STRING(fn_name,val) \ char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));} +#define FN_LOCAL_LIST(fn_name,val) \ + char **fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_BOOL(fn_name,val) \ BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_CHAR(fn_name,val) \ @@ -1506,8 +1510,8 @@ FN_GLOBAL_STRING(lp_delete_share_cmd, &Globals.szDeleteShareCommand) #ifdef WITH_SSL FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion) -FN_GLOBAL_STRING(lp_ssl_hosts, &Globals.sslHostsRequire) -FN_GLOBAL_STRING(lp_ssl_hosts_resign, &Globals.sslHostsResign) +FN_GLOBAL_LIST(lp_ssl_hosts, &Globals.sslHostsRequire) +FN_GLOBAL_LIST(lp_ssl_hosts_resign, &Globals.sslHostsResign) FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir) FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile) FN_GLOBAL_STRING(lp_ssl_cert, &Globals.sslCert) @@ -1618,8 +1622,8 @@ FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) static FN_LOCAL_STRING(_lp_printername, szPrintername) FN_LOCAL_STRING(lp_driverfile, szDriverFile) FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) -FN_LOCAL_STRING(lp_hostsallow, szHostsallow) -FN_LOCAL_STRING(lp_hostsdeny, szHostsdeny) +FN_LOCAL_LIST(lp_hostsallow, szHostsallow) +FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny) FN_LOCAL_STRING(lp_magicscript, szMagicScript) FN_LOCAL_STRING(lp_magicoutput, szMagicOutput) FN_LOCAL_STRING(lp_comment, comment) @@ -1743,12 +1747,20 @@ static void free_service(service * pservice) } for (i = 0; parm_table[i].label; i++) + { if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].class == P_LOCAL) string_free((char **) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); + else if (parm_table[i].type == P_LIST && + parm_table[i].class == P_LOCAL) + lp_list_free(*(char ***) + (((char *)pservice) + + PTR_DIFF(parm_table[i].ptr, &sDefault))); + } + ZERO_STRUCTP(pservice); } @@ -2035,6 +2047,9 @@ static void copy_service(service * pserviceDest, *(char **)src_ptr); strupper(*(char **)dest_ptr); break; + case P_LIST: + lp_list_copy((char ***)dest_ptr, *(char ***)src_ptr); + break; default: break; } @@ -2630,6 +2645,10 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) sscanf(pszParmValue, "%o", (int *)parm_ptr); break; + case P_LIST: + *(char ***)parm_ptr = lp_list_make(pszParmValue); + break; + case P_STRING: string_set(parm_ptr, pszParmValue); if (parm_table[parmnum].flags & FLAG_DOS_STRING) @@ -2733,6 +2752,21 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f, char *( fprintf(f, "%s", octal_string(*(int *)ptr)); break; + case P_LIST: + if ((char ***)ptr && *(char ***)ptr) { + char **list = *(char ***)ptr; + + if (p->flags & FLAG_DOS_STRING) + for (; *list; list++) + fprintf(f, "%s%s", dos_to_ext(*list, False), + ((*(list+1))?", ":"")); + else + for (; *list; list++) + fprintf(f, "%s%s", *list, + ((*(list+1))?", ":"")); + } + break; + case P_GSTRING: case P_UGSTRING: if ((char *)ptr) { @@ -2776,6 +2810,9 @@ static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_CHAR: return (*((char *)ptr1) == *((char *)ptr2)); + + case P_LIST: + return lp_list_compare(*(char ***)ptr1, *(char ***)ptr2); case P_GSTRING: case P_UGSTRING: @@ -2875,6 +2912,9 @@ static BOOL is_default(int i) return False; switch (parm_table[i].type) { + case P_LIST: + return lp_list_compare (parm_table[i].def.lvalue, + *(char ***)parm_table[i].ptr); case P_STRING: case P_USTRING: return strequal(parm_table[i].def.svalue, @@ -3178,6 +3218,10 @@ static void lp_save_defaults(void) continue; switch (parm_table[i].type) { + case P_LIST: + lp_list_copy(&(parm_table[i].def.lvalue), + *(char ***)parm_table[i].ptr); + break; case P_STRING: case P_USTRING: parm_table[i].def.svalue = @@ -3622,3 +3666,125 @@ char *lp_printername(int snum) return ret; } + + +/*********************************************************** + List Parameters manipulation functions +***********************************************************/ + +#define P_LIST_ABS 16 /* P_LIST Allocation Block Size */ + +char **lp_list_make(char *string) +{ + char **list, **rlist; + char *str; + char *tok; + int num, lsize; + + if (!string || !*string) return NULL; + str = strdup(string); + if (!str || !*str) return NULL; + + list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); + if (!list) { + free (str); + return NULL; + } + memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); + lsize = P_LIST_ABS; + + num = 0; + + for (tok = strtok(str, LIST_SEP); tok; tok = strtok(NULL, LIST_SEP)) + { + if (!*tok) continue; + + if ((num +1) == lsize) { + lsize += P_LIST_ABS; + rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); + if (!rlist) { + lp_list_free (list); + free (str); + return NULL; + } + else list = rlist; + memset (&list[num], 0, ((sizeof(char**)) * P_LIST_ABS)); + } + + list[num] = strdup(tok); + if (!list[num]) { + lp_list_free (list); + free (str); + return NULL; + } + + num++; + } + + free (str); + return list; +} + +BOOL lp_list_copy(char ***dest, char **src) +{ + char **list, **rlist; + char *tok; + int num, lsize; + + *dest = NULL; + if (!src) return False; + + list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); + if (!list) return False; + memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); + lsize = P_LIST_ABS; + + for (num = 0; src[num]; num++) + { + if ((num +1) == lsize) { + lsize += P_LIST_ABS; + rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); + if (!rlist) { + lp_list_free (list); + return False; + } + else list = rlist; + memset (&list[num], 0, ((sizeof(char**)) * P_LIST_ABS)); + } + + list[num] = strdup(src[num]); + if (!list[num]) { + lp_list_free (list); + return False; + } + } + + *dest = list; + return True; +} + +/* return true if all the elemnts of the list matches exactly */ +BOOL lp_list_compare(char **list1, char **list2) +{ + int num; + + if (!list1 || !list2) return (list1 == list2); + + for (num = 0; list1[num]; num++) { + if (!list2[num]) return False; + if (!strcsequal(list1[num], list2[num])) return False; + } + if (list2[num]) return False; /* if list2 has more elements than list1 fail */ + + return True; +} + +void lp_list_free(char **list) +{ + char **tlist = list; + + if (!list) return; + for(; *tlist; tlist++) free(*tlist); + free (list); +} + -- cgit From 2e20f1147c70a86b1583613ac99fdb01af042256 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 21 Jun 2001 23:33:12 +0000 Subject: use next_token instead of strtok. single elemnts of list cannot be longer than a pstring (1024B now) (This used to be commit 72b749ec89fa3642c0b3330a5331be645f84e24c) --- source3/param/loadparm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index edda04c36b..1527dd1e69 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3677,13 +3677,14 @@ char *lp_printername(int snum) char **lp_list_make(char *string) { char **list, **rlist; - char *str; - char *tok; + char *str, *s; int num, lsize; + pstring tok; if (!string || !*string) return NULL; - str = strdup(string); + s = strdup(string); if (!str || !*str) return NULL; + str = s; list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); if (!list) { @@ -3695,9 +3696,9 @@ char **lp_list_make(char *string) num = 0; - for (tok = strtok(str, LIST_SEP); tok; tok = strtok(NULL, LIST_SEP)) + while (*str) { - if (!*tok) continue; + if (!next_token(&str, tok, LIST_SEP, sizeof(pstring))) continue; if ((num +1) == lsize) { lsize += P_LIST_ABS; @@ -3721,7 +3722,7 @@ char **lp_list_make(char *string) num++; } - free (str); + free (s); return list; } -- cgit From fe136fe6232c8f877e04cf302344d80f3cefb476 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 22 Jun 2001 22:05:47 +0000 Subject: Fix for multibyte default service parameter from TAKAHASHI Motonobu, Samba Users Group Japan Jeremy (This used to be commit a2da1f91c1b08414592d5f014c8539575d0e9637) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1527dd1e69..4ae2cadfcb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -973,8 +973,8 @@ static struct parm_struct parm_table[] = { {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DOS_STRING}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DOS_STRING}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, -- cgit From d56e091694cd48607c389158951e1278053da111 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 23 Jun 2001 14:13:32 +0000 Subject: fix compiler warnings (This used to be commit 7420e2f7898f1d141ba2af3eda07a67862fee842) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ae2cadfcb..72856ddafe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3729,7 +3729,6 @@ char **lp_list_make(char *string) BOOL lp_list_copy(char ***dest, char **src) { char **list, **rlist; - char *tok; int num, lsize; *dest = NULL; -- cgit From cc6bf9a06f0629f16ab455ad30b6c7b1a76ac0c2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 24 Jun 2001 01:41:38 +0000 Subject: fixed error using wrong pointer to test and free s/str/s/ (This used to be commit 7e5a9860fad92fee79bcc20f2ea2a3728080dba2) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 72856ddafe..4ba219adbf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3683,12 +3683,11 @@ char **lp_list_make(char *string) if (!string || !*string) return NULL; s = strdup(string); - if (!str || !*str) return NULL; - str = s; + if (!s || !*s) return NULL; list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); if (!list) { - free (str); + free (s); return NULL; } memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); @@ -3696,6 +3695,7 @@ char **lp_list_make(char *string) num = 0; + str = s; while (*str) { if (!next_token(&str, tok, LIST_SEP, sizeof(pstring))) continue; @@ -3705,7 +3705,7 @@ char **lp_list_make(char *string) rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); if (!rlist) { lp_list_free (list); - free (str); + free (s); return NULL; } else list = rlist; @@ -3715,7 +3715,7 @@ char **lp_list_make(char *string) list[num] = strdup(tok); if (!list[num]) { lp_list_free (list); - free (str); + free (s); return NULL; } -- cgit From 95d1969e7ee38380b82f250ae4e6ec9e78e79216 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Jun 2001 23:21:43 +0000 Subject: param/loadparm.c: Fix for bad volume label, found by TAKAHASHI Motonobu Samba Users Group Japan. Ensure same as in 2.2.x codebase. Jeremy. (This used to be commit 5a5d33b9464fe6289e55dbfd229d2859914b9293) --- source3/param/loadparm.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ba219adbf..a6bfab880a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -997,7 +997,7 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE | FLAG_DOS_STRING}, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, @@ -3439,20 +3439,14 @@ int lp_servicenumber(char *pszServiceName) } /******************************************************************* - a useful volume label function - ******************************************************************/ + A useful volume label function. Returns a string in DOS codepage. +********************************************************************/ + char *volume_label(int snum) { char *ret = lp_volume(snum); - if (!*ret) { - /* lp_volume returns a unix charset - lp_servicename returns a - dos codepage - convert so volume_label() always returns UNIX. - */ - char *p = dos_to_unix(lp_servicename(snum), False); - int len = strlen(p)+1; - ret = (char *)talloc(lp_talloc, len); - memcpy(ret, p, len); - } + if (!*ret) + return lp_servicename(snum); return (ret); } -- cgit From ef6c9d7425be907230eb533fbbe2e6ac150a0bbd Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 1 Jul 2001 23:24:08 +0000 Subject: "netbios aliases" and "interfaces" options change from P_STRING to P_LIST (This used to be commit db36ed1d80fcbee16d0a0b5f226e56961f3bf1ec) --- source3/param/loadparm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a6bfab880a..ba201e33b1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -143,13 +143,13 @@ typedef struct char *szLogonHome; char *szWINSserver; char *szCodingSystem; - char *szInterfaces; + char **szInterfaces; char *szRemoteAnnounce; char *szRemoteBrowseSync; char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ - char *szNetbiosAliases; + char **szNetbiosAliases; char *szDomainOtherSIDs; char *szNameResolveOrder; char *szLdapServer; @@ -661,10 +661,10 @@ static struct parm_struct parm_table[] = { {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, {"Security Options", P_SEP, P_SEPARATOR}, @@ -1472,11 +1472,11 @@ FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync) FN_GLOBAL_STRING(lp_wins_server, &Globals.szWINSserver) -FN_GLOBAL_STRING(lp_interfaces, &Globals.szInterfaces) +FN_GLOBAL_LIST(lp_interfaces, &Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) -FN_GLOBAL_STRING(lp_netbios_aliases, &Globals.szNetbiosAliases) +FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) -- cgit From 87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2001 07:15:53 +0000 Subject: The big character set handling changeover! This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a) --- source3/param/loadparm.c | 232 +++++++++++------------------------------------ source3/param/params.c | 27 ++---- 2 files changed, 59 insertions(+), 200 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ba201e33b1..4b89387abf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -49,22 +49,6 @@ #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; @@ -101,6 +85,8 @@ static BOOL defaults_saved = False; */ typedef struct { + char *dos_charset; + char *unix_charset; char *szPrintcapname; char *szEnumPortsCommand; char *szAddPrinterCommand; @@ -123,7 +109,6 @@ typedef struct char *szPassdbModulePath; char *szPasswordServer; char *szSocketOptions; - char *szValidChars; char *szWorkGroup; char *szDomainAdminGroup; char *szDomainGuestGroup; @@ -135,14 +120,11 @@ typedef struct #ifdef USING_GROUPNAME_MAP char *szGroupnameMap; #endif /* USING_GROUPNAME_MAP */ - char *szCharacterSet; - char *szCodePageDir; char *szLogonScript; char *szLogonPath; char *szLogonDrive; char *szLogonHome; char *szWINSserver; - char *szCodingSystem; char **szInterfaces; char *szRemoteAnnounce; char *szRemoteBrowseSync; @@ -207,7 +189,6 @@ typedef struct int ReadSize; int lm_announce; int lm_interval; - int client_code_page; int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; int change_notify_timeout; @@ -526,12 +507,8 @@ static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ -static BOOL handle_valid_chars(char *pszParmValue, char **ptr); static BOOL handle_include(char *pszParmValue, char **ptr); static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_character_set(char *pszParmValue, char **ptr); -static BOOL handle_coding_system(char *pszParmValue, char **ptr); -static BOOL handle_client_code_page(char *pszParmValue, char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); @@ -652,18 +629,17 @@ static struct enum_list enum_ssl_version[] = { /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - - {"coding system", P_STRING, P_GLOBAL, &Globals.szCodingSystem, handle_coding_system, NULL, 0}, - {"client code page", P_INTEGER, P_GLOBAL, &Globals.client_code_page, handle_client_code_page, NULL, 0}, - {"code page directory", P_STRING, P_GLOBAL, &Globals.szCodePageDir, NULL, NULL, 0}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_DOS_STRING}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_DOS_STRING}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_DOS_STRING}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_DOS_STRING}, - {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_DOS_STRING}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_DOS_STRING}, + + {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, + {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, @@ -851,8 +827,8 @@ static struct parm_struct parm_table[] = { {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT|FLAG_DOS_STRING}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_DOS_STRING}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -860,7 +836,6 @@ static struct parm_struct parm_table[] = { {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -872,9 +847,9 @@ static struct parm_struct parm_table[] = { {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, - {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_DOS_STRING}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -902,10 +877,10 @@ static struct parm_struct parm_table[] = { {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_DOS_STRING}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_DOS_STRING}, + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_DOS_STRING}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, {"Browse Options", P_SEP, P_SEPARATOR}, @@ -962,8 +937,8 @@ static struct parm_struct parm_table[] = { {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP @@ -973,11 +948,10 @@ static struct parm_struct parm_table[] = { {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DOS_STRING}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DOS_STRING}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars, NULL, 0}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, @@ -997,7 +971,7 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE | FLAG_DOS_STRING}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, @@ -1222,7 +1196,6 @@ static void init_globals(void) string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); - string_set(&Globals.szCodePageDir, CODEPAGEDIR); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; @@ -1275,7 +1248,6 @@ static void init_globals(void) string_set(&Globals.szNISHomeMapName, "auto.home"); #endif #endif - Globals.client_code_page = DEFAULT_CLIENT_CODE_PAGE; Globals.bTimeServer = False; Globals.bBindInterfacesOnly = False; Globals.bUnixPasswdSync = False; @@ -1352,13 +1324,6 @@ static void init_globals(void) Globals.winbind_cache_time = 15; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; - - /* - * This must be done last as it checks the value in - * client_code_page. - */ - - interpret_coding_system(KANJI); } static TALLOC_CTX *lp_talloc; @@ -1496,7 +1461,6 @@ FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) -FN_GLOBAL_STRING(lp_codepagedir,&Globals.szCodePageDir) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) @@ -1587,7 +1551,6 @@ FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) -FN_GLOBAL_INTEGER(lp_client_code_page, &Globals.client_code_page) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) @@ -1767,7 +1730,7 @@ static void free_service(service * pservice) /*************************************************************************** add a new service to the services array initialising it with the given -service. name must be in DOS codepage. +service. ***************************************************************************/ static int add_a_service(service * pservice, char *name) { @@ -1822,7 +1785,7 @@ static int add_a_service(service * pservice, char *name) /*************************************************************************** add a new home service, with the specified home directory, defaults coming -from service ifrom. homename must be in DOS codepage. +from service ifrom. ***************************************************************************/ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) { @@ -1851,7 +1814,7 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) } /*************************************************************************** -add a new service, based on an old one. pszService must be in DOS codepage. +add a new service, based on an old one. ***************************************************************************/ int lp_add_service(char *pszService, int iDefaultService) { @@ -1894,7 +1857,6 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) /*************************************************************************** add a new printer service, with defaults coming from service iFrom. -printername must be in DOS codepage. ***************************************************************************/ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) { @@ -2209,11 +2171,6 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) standard_sub_basic(netbios_name); strupper(netbios_name); - /* - * Convert from UNIX to DOS string - the UNIX to DOS converter - * isn't called on the special handlers. - */ - unix_to_dos(netbios_name, True); pstrcpy(global_myname, netbios_name); DEBUG(4, @@ -2305,11 +2262,11 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) if (*p == '|') { - lines = file_lines_pload(p + 1, NULL, True); + lines = file_lines_pload(p + 1, NULL); } else { - lines = file_lines_load(fname, NULL, True); + lines = file_lines_load(fname, NULL); } if (!lines) @@ -2341,67 +2298,6 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) return True; } -/*************************************************************************** - handle the interpretation of the coding system parameter - *************************************************************************/ -static BOOL handle_coding_system(char *pszParmValue, char **ptr) -{ - string_set(ptr, pszParmValue); - interpret_coding_system(pszParmValue); - return (True); -} - -/*************************************************************************** - Handle the interpretation of the character set system parameter. -***************************************************************************/ - -static char *saved_character_set = NULL; - -static BOOL handle_character_set(char *pszParmValue, char **ptr) -{ - /* A dependency here is that the parameter client code page should be - set before this is called. - */ - string_set(ptr, pszParmValue); - strupper(*ptr); - saved_character_set = strdup(*ptr); - interpret_character_set(*ptr, lp_client_code_page()); - return (True); -} - -/*************************************************************************** - Handle the interpretation of the client code page parameter. - We handle this separately so that we can reset the character set - parameter in case this came before 'client code page' in the smb.conf. -***************************************************************************/ - -static BOOL handle_client_code_page(char *pszParmValue, char **ptr) -{ - Globals.client_code_page = atoi(pszParmValue); - if (saved_character_set != NULL) - interpret_character_set(saved_character_set, - lp_client_code_page()); - codepage_initialise(lp_client_code_page()); - return (True); -} - -/*************************************************************************** -handle the valid chars lines -***************************************************************************/ - -static BOOL handle_valid_chars(char *pszParmValue, char **ptr) -{ - string_set(ptr, pszParmValue); - - /* A dependency here is that the parameter client code page must be - set before this is called - as calling codepage_initialise() - would overwrite the valid char lines. - */ - codepage_initialise(lp_client_code_page()); - - add_char_string(pszParmValue); - return (True); -} /*************************************************************************** handle the include operation @@ -2651,27 +2547,19 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) case P_STRING: string_set(parm_ptr, pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); break; case P_USTRING: string_set(parm_ptr, pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos(*(char **)parm_ptr, True); strupper(*(char **)parm_ptr); break; case P_GSTRING: pstrcpy((char *)parm_ptr, pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); break; case P_UGSTRING: pstrcpy((char *)parm_ptr, pszParmValue); - if (parm_table[parmnum].flags & FLAG_DOS_STRING) - unix_to_dos((char *)parm_ptr, True); strupper((char *)parm_ptr); break; @@ -2715,7 +2603,7 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) /*************************************************************************** print a parameter of the specified type ***************************************************************************/ -static void print_parameter(struct parm_struct *p, void *ptr, FILE * f, char *(*dos_to_ext)(char *, BOOL)) +static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) { int i; switch (p->type) @@ -2756,34 +2644,23 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f, char *( if ((char ***)ptr && *(char ***)ptr) { char **list = *(char ***)ptr; - if (p->flags & FLAG_DOS_STRING) - for (; *list; list++) - fprintf(f, "%s%s", dos_to_ext(*list, False), - ((*(list+1))?", ":"")); - else - for (; *list; list++) - fprintf(f, "%s%s", *list, - ((*(list+1))?", ":"")); + for (; *list; list++) + fprintf(f, "%s%s", *list, + ((*(list+1))?", ":"")); } break; case P_GSTRING: case P_UGSTRING: if ((char *)ptr) { - if (p->flags & FLAG_DOS_STRING) - fprintf(f, "%s", dos_to_ext((char *)ptr, False)); - else - fprintf(f, "%s", (char *)ptr); + fprintf(f, "%s", (char *)ptr); } break; case P_STRING: case P_USTRING: if (*(char **)ptr) { - if(p->flags & FLAG_DOS_STRING) - fprintf(f,"%s",dos_to_ext(*(char **)ptr, False)); - else - fprintf(f, "%s", *(char **)ptr); + fprintf(f, "%s", *(char **)ptr); } break; case P_SEP: @@ -2852,7 +2729,7 @@ void init_locals(void) /*************************************************************************** Process a new section (service). At this stage all sections are services. Later we'll have special sections that permit server parameters to be set. -Returns True on success, False on failure. SectionName must be in DOS codepage. +Returns True on success, False on failure. ***************************************************************************/ static BOOL do_section(char *pszSectionName) { @@ -2945,7 +2822,7 @@ static BOOL is_default(int i) /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ -static void dump_globals(FILE *f, char *(*dos_to_ext)(char *, BOOL)) +static void dump_globals(FILE *f) { int i; fprintf(f, "# Global parameters\n[global]\n"); @@ -2958,7 +2835,7 @@ static void dump_globals(FILE *f, char *(*dos_to_ext)(char *, BOOL)) if (defaults_saved && is_default(i)) continue; fprintf(f, "\t%s = ", parm_table[i].label); - print_parameter(&parm_table[i], parm_table[i].ptr, f, dos_to_ext); + print_parameter(&parm_table[i], parm_table[i].ptr, f); fprintf(f, "\n"); } } @@ -2979,7 +2856,7 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ -static void dump_a_service(service * pService, FILE * f, char *(*dos_to_ext)(char *, BOOL)) +static void dump_a_service(service * pService, FILE * f) { int i; if (pService != &sDefault) @@ -3010,7 +2887,7 @@ static void dump_a_service(service * pService, FILE * f, char *(*dos_to_ext)(cha fprintf(f, "\t%s = ", parm_table[i].label); print_parameter(&parm_table[i], - ((char *)pService) + pdiff, f, dos_to_ext); + ((char *)pService) + pdiff, f); fprintf(f, "\n"); } } @@ -3158,7 +3035,6 @@ void lp_add_one_printer(char *name, char *comment) if ((i = lp_servicenumber(name)) >= 0) { string_set(&ServicePtrs[i]->comment, comment); - unix_to_dos(ServicePtrs[i]->comment, True); ServicePtrs[i]->autoloaded = True; } } @@ -3353,14 +3229,12 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ /* if bWINSsupport is true and we are in the client */ - - if (in_client && Globals.bWINSsupport) - { - + if (in_client && Globals.bWINSsupport) { string_set(&Globals.szWINSserver, "127.0.0.1"); - } + init_iconv(Globals.unix_charset, Globals.dos_charset); + return (bRetval); } @@ -3384,7 +3258,7 @@ int lp_numservices(void) /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint, char *(*dos_to_ext)(char *, BOOL)) +void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) { int iService; @@ -3393,24 +3267,24 @@ void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint, char *(*dos_to_ext)(ch defaults_saved = False; } - dump_globals(f, dos_to_ext); + dump_globals(f); - dump_a_service(&sDefault, f, dos_to_ext); + dump_a_service(&sDefault, f); for (iService = 0; iService < maxtoprint; iService++) - lp_dump_one(f, show_defaults, iService, dos_to_ext); + lp_dump_one(f, show_defaults, iService); } /*************************************************************************** Display the contents of one service in human-readable form. ***************************************************************************/ -void lp_dump_one(FILE * f, BOOL show_defaults, int snum, char *(*dos_to_ext)(char *, BOOL)) +void lp_dump_one(FILE * f, BOOL show_defaults, int snum) { if (VALID(snum)) { if (ServicePtrs[snum]->szService[0] == '\0') return; - dump_a_service(ServicePtrs[snum], f, dos_to_ext); + dump_a_service(ServicePtrs[snum], f); } } @@ -3429,7 +3303,6 @@ int lp_servicenumber(char *pszServiceName) if (VALID(iService) && strequal(lp_servicename(iService), pszServiceName)) break; - if (iService < 0) DEBUG(7, ("lp_servicenumber: couldn't find %s\n", @@ -3573,7 +3446,7 @@ void lp_remove_service(int snum) } /******************************************************************* -copy a service. new_name must be in dos codepage +copy a service. ********************************************************************/ void lp_copy_service(int snum, char *new_name) { @@ -3781,4 +3654,3 @@ void lp_list_free(char **list) for(; *tlist; tlist++) free(*tlist); free (list); } - diff --git a/source3/param/params.c b/source3/param/params.c index b359b269d4..4e74953889 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -195,25 +195,12 @@ static int EatComment( myFILE *InFile ) static int Continuation( char *line, int pos ) { - int pos2 = 0; - - pos--; - while( (pos >= 0) && isspace(line[pos]) ) - pos--; - - /* we should recognize if `\` is part of a multibyte character or not. */ - while(pos2 <= pos) { - size_t skip = 0; - skip = get_character_len(line[pos2]); - if (skip) { - pos2 += skip; - } else if (pos == pos2) { - return( ((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); - } else { - pos2++; - } - } - return (-1); + pos--; + while( (pos >= 0) && isspace(line[pos]) ) + pos--; + + return (((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); + return (-1); } @@ -271,7 +258,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) DEBUG(0, ("%s Empty section name in configuration file.\n", func )); return( False ); } - if( !sfunc( unix_to_dos(bufr,True) ) ) /* Got a valid name. Deal with it. */ + if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ return( False ); (void)EatComment( InFile ); /* Finish off the line. */ return( True ); -- cgit From 527e824293ee934ca5da0ef5424efe5ab7757248 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2001 07:36:09 +0000 Subject: strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4b89387abf..da25d526a1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2211,7 +2211,7 @@ static BOOL source_env(char **lines) strncpy(varval, line, len); varval[len] = '\0'; - p = strchr(line, (int)'='); + p = strchr_m(line, (int)'='); if (p == NULL) { DEBUG(4, ("source_env: missing '=': %s\n", line)); @@ -3486,7 +3486,7 @@ int lp_major_announce_version(void) if ((vers = lp_announce_version()) == NULL) return major_version; - if ((p = strchr(vers, '.')) == 0) + if ((p = strchr_m(vers, '.')) == 0) return major_version; *p = '\0'; @@ -3508,7 +3508,7 @@ int lp_minor_announce_version(void) if ((vers = lp_announce_version()) == NULL) return minor_version; - if ((p = strchr(vers, '.')) == 0) + if ((p = strchr_m(vers, '.')) == 0) return minor_version; p++; -- cgit From ca3b64fca4ffaec307fe8f37ffe27aded4fde0b1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 Jul 2001 11:46:36 +0000 Subject: removed an unreachable statement (This used to be commit 6503f53abe2642b002d8c9c64a2e0534c2b39b8c) --- source3/param/params.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 4e74953889..61baf9517c 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -200,7 +200,6 @@ static int Continuation( char *line, int pos ) pos--; return (((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); - return (-1); } -- cgit From 28a53730a9c321eed6b833e3b0da69254b5bc08c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 7 Jul 2001 08:45:39 +0000 Subject: Add a new paramater: add machine script This allows the administrator to define different scripts for adding unix users and automaticly adding machines. If it is not defined, it falls back to the value of 'add user script'. Andrew Bartlett (This used to be commit 7a478e050f3ab33bd0141a58c698d748f0d2b204) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da25d526a1..7df701e1d3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -146,6 +146,7 @@ typedef struct char *szDelGroupScript; char *szAddUserToGroupScript; char *szDelUserToGroupScript; + char *szAddMachineScript; char *szWINSHook; #ifdef WITH_UTMP char *szUtmpDir; @@ -876,6 +877,7 @@ static struct parm_struct parm_table[] = { {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, + {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, @@ -1451,6 +1453,8 @@ FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) +FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) + FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group, &Globals.szDomainGuestGroup) -- cgit From 04932c05bf9b876aa059195100633e7c56dbce71 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 8 Jul 2001 13:02:16 +0000 Subject: Fix the loading of configuration files using the include syntax. We had a problem where if a % macro in the smb.conf could be ignored if the various files it pointed to had the same time-stamp. This changes the code to insted check that the both the time-stamp and the substituted filename are the same over each change. This was picked up only becouse the build-farm automaticly generates its config files, and hence gets identical timestamps. (Why this doesn't happen all the time I'm not entirly sure, somthing to do with the 'test' paramater to reload_services(), but this fixes this problem). Andrew Bartlett (This used to be commit ebd2f9b07c89cce505e821f1caaa6817bbb26db9) --- source3/param/loadparm.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7df701e1d3..9a41060f3f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2083,6 +2083,7 @@ static struct file_lists { struct file_lists *next; char *name; + char *subfname; time_t modtime; } *file_lists = NULL; @@ -2091,7 +2092,7 @@ static struct file_lists keep a linked list of all config files so we know when one has changed it's date and needs to be reloaded ********************************************************************/ -static void add_to_file_list(char *fname) +static void add_to_file_list(char *fname, char *subfname) { struct file_lists *f = file_lists; @@ -2114,15 +2115,16 @@ static void add_to_file_list(char *fname) free(f); return; } + f->subfname = strdup(subfname); + if (!f->subfname) + { + free(f); + return; + } file_lists = f; } - { - pstring n2; - pstrcpy(n2, fname); - standard_sub_basic(n2); - f->modtime = file_modtime(n2); - } + f->modtime = file_modtime(subfname); } @@ -2147,12 +2149,14 @@ BOOL lp_file_list_changed(void) mod_time = file_modtime(n2); - if (f->modtime != mod_time) + if ((f->modtime != mod_time) || (f->subfname == NULL) || (strcmp(n2, f->subfname) != 0)) { DEBUGADD(6, ("file %s modified: %s\n", n2, ctime(&mod_time))); f->modtime = mod_time; + free(f->subfname); + f->subfname = strdup(n2); return (True); } f = f->next; @@ -2312,10 +2316,10 @@ static BOOL handle_include(char *pszParmValue, char **ptr) pstring fname; pstrcpy(fname, pszParmValue); - add_to_file_list(fname); - standard_sub_basic(fname); + add_to_file_list(pszParmValue, fname); + string_set(ptr, fname); if (file_exist(fname, NULL)) @@ -2785,7 +2789,7 @@ static BOOL do_section(char *pszSectionName) /*************************************************************************** -determine if a partcular base parameter is currently set to the default value. +determine if a partcular base parameter is currentl set to the default value. ***************************************************************************/ static BOOL is_default(int i) { @@ -3191,7 +3195,10 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, pstring n2; BOOL bRetval; - add_to_file_list(pszFname); + pstrcpy(n2, pszFname); + standard_sub_basic(n2); + + add_to_file_list(pszFname, n2); bRetval = False; @@ -3206,9 +3213,6 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, lp_save_defaults(); } - pstrcpy(n2, pszFname); - standard_sub_basic(n2); - /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter); -- cgit From 1cbae7315f99835ee294ce96858f73b5f8a18cfe Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 24 Jul 2001 20:02:48 +0000 Subject: Convert other parameters (read list, write list, valid users...) to the P_LIST format. changed functions to use list instead of strings addedd lp_list_substitute function (This used to be commit 7257d07563ba21bd88733d5d2b4ec4829fab2507) --- source3/param/loadparm.c | 151 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 112 insertions(+), 39 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9a41060f3f..079711cab8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5,6 +5,8 @@ Copyright (C) Karl Auer 1993-1998 Largely re-written by Andrew Tridgell, September 1994 + + Copyright (C) Simo Sorce 2001 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 @@ -110,12 +112,8 @@ typedef struct char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; - char *szDomainAdminGroup; - char *szDomainGuestGroup; - char *szDomainAdminUsers; - char *szDomainGuestUsers; - char *szDomainHostsallow; - char *szDomainHostsdeny; + char **szDomainAdminGroup; + char **szDomainGuestGroup; char *szUsernameMap; #ifdef USING_GROUPNAME_MAP char *szGroupnameMap; @@ -278,9 +276,9 @@ typedef struct char *szPath; char *szUsername; char *szGuestaccount; - char *szInvalidUsers; - char *szValidUsers; - char *szAdminUsers; + char **szInvalidUsers; + char **szValidUsers; + char **szAdminUsers; char *szCopy; char *szInclude; char *szPreExec; @@ -310,9 +308,9 @@ typedef struct char *comment; char *force_user; char *force_group; - char *readlist; - char *writelist; - char *printer_admin; + char **readlist; + char **writelist; + char **printer_admin; char *volume; char *fstype; char *szVfsObjectFile; @@ -682,12 +680,12 @@ static struct parm_struct parm_table[] = { {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, - {"invalid users", P_STRING, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"valid users", P_STRING, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"admin users", P_STRING, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"read list", P_STRING, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"write list", P_STRING, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_STRING, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, + {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, @@ -860,8 +858,8 @@ static struct parm_struct parm_table[] = { {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain admin group", P_STRING, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group", P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {"domain admin group", P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group", P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, #ifdef USING_GROUPNAME_MAP {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, @@ -1456,8 +1454,8 @@ FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) -FN_GLOBAL_STRING(lp_domain_admin_group, &Globals.szDomainAdminGroup) -FN_GLOBAL_STRING(lp_domain_guest_group, &Globals.szDomainGuestGroup) +FN_GLOBAL_LIST(lp_domain_admin_group, &Globals.szDomainAdminGroup) +FN_GLOBAL_LIST(lp_domain_guest_group, &Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_winbind_uid, &Globals.szWinbindUID) FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) @@ -1576,9 +1574,9 @@ FN_LOCAL_STRING(lp_pathname, szPath) FN_LOCAL_STRING(lp_dontdescend, szDontdescend) FN_LOCAL_STRING(lp_username, szUsername) FN_LOCAL_STRING(lp_guestaccount, szGuestaccount) -FN_LOCAL_STRING(lp_invalid_users, szInvalidUsers) -FN_LOCAL_STRING(lp_valid_users, szValidUsers) -FN_LOCAL_STRING(lp_admin_users, szAdminUsers) +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_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) @@ -1596,9 +1594,9 @@ FN_LOCAL_STRING(lp_magicoutput, szMagicOutput) FN_LOCAL_STRING(lp_comment, comment) FN_LOCAL_STRING(lp_force_user, force_user) FN_LOCAL_STRING(lp_force_group, force_group) -FN_LOCAL_STRING(lp_readlist, readlist) -FN_LOCAL_STRING(lp_writelist, writelist) -FN_LOCAL_STRING(lp_printer_admin, printer_admin) +FN_LOCAL_LIST(lp_readlist, readlist) +FN_LOCAL_LIST(lp_writelist, writelist) +FN_LOCAL_LIST(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) static FN_LOCAL_STRING(lp_volume, volume) @@ -1723,7 +1721,7 @@ static void free_service(service * pservice) PTR_DIFF(parm_table[i].ptr, &sDefault))); else if (parm_table[i].type == P_LIST && parm_table[i].class == P_LOCAL) - lp_list_free(*(char ***) + lp_list_free((char ***) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); } @@ -3558,10 +3556,14 @@ char **lp_list_make(char *string) if (!string || !*string) return NULL; s = strdup(string); - if (!s || !*s) return NULL; + if (!s || !*s) { + DEBUG(0,("ERROR: Unable to allocate memory")); + return NULL; + } list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); if (!list) { + DEBUG(0,("ERROR: Unable to allocate memory")); free (s); return NULL; } @@ -3579,7 +3581,8 @@ char **lp_list_make(char *string) lsize += P_LIST_ABS; rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); if (!rlist) { - lp_list_free (list); + DEBUG(0,("ERROR: Unable to allocate memory")); + lp_list_free (&list); free (s); return NULL; } @@ -3589,7 +3592,8 @@ char **lp_list_make(char *string) list[num] = strdup(tok); if (!list[num]) { - lp_list_free (list); + DEBUG(0,("ERROR: Unable to allocate memory")); + lp_list_free (&list); free (s); return NULL; } @@ -3610,7 +3614,10 @@ BOOL lp_list_copy(char ***dest, char **src) if (!src) return False; list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); - if (!list) return False; + if (!list) { + DEBUG(0,("ERROR: Unable to allocate memory")); + return False; + } memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); lsize = P_LIST_ABS; @@ -3620,7 +3627,8 @@ BOOL lp_list_copy(char ***dest, char **src) lsize += P_LIST_ABS; rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); if (!rlist) { - lp_list_free (list); + DEBUG(0,("ERROR: Unable to allocate memory")); + lp_list_free (&list); return False; } else list = rlist; @@ -3629,7 +3637,8 @@ BOOL lp_list_copy(char ***dest, char **src) list[num] = strdup(src[num]); if (!list[num]) { - lp_list_free (list); + DEBUG(0,("ERROR: Unable to allocate memory")); + lp_list_free (&list); return False; } } @@ -3654,11 +3663,75 @@ BOOL lp_list_compare(char **list1, char **list2) return True; } -void lp_list_free(char **list) +void lp_list_free(char ***list) { - char **tlist = list; + char **tlist; - if (!list) return; + if (!list || !*list) return; + tlist = *list; for(; *tlist; tlist++) free(*tlist); - free (list); + free (*list); + *list = NULL; +} + +BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) +{ + char *p, *s, *t; + ssize_t ls, lp, li, ld, i, d; + + if (!list || !*list) return False; + if (!pattern) return False; + if (!insert) return False; + + lp = (ssize_t)strlen(pattern); + li = (ssize_t)strlen(insert); + ld = li -lp; + + while (*list) + { + s = *list; + ls = (ssize_t)strlen(s); + + while ((p = strstr(s, pattern))) + { + t = *list; + d = p -t; + if (ld) + { + t = (char *) malloc(ls +ld +1); + if (!t) { + DEBUG(0,("ERROR: Unable to allocate memory")); + return False; + } + memcpy(t, *list, d); + memcpy(t +d +li, p +lp, ls -d -lp +1); + free (*list); + *list = t; + ls += ld; + s = t +d +li; + } + + for (i = 0; i < li; i++) { + switch (insert[i]) { + case '`': + case '"': + case '\'': + case ';': + case '$': + case '%': + case '\r': + case '\n': + t[d +i] = '_'; + break; + default: + t[d +i] = insert[i]; + } + } + } + + list++; + } + + return True; } + -- cgit From 996719cce26700c68ff0e456e6a25d20085d091f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Jul 2001 22:21:31 +0000 Subject: Added "use mmap" for HPUX. Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 079711cab8..a1871437ac 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -258,6 +258,7 @@ typedef struct BOOL bHostMSDfs; BOOL bHideLocalUsers; BOOL bUnicode; + BOOL bUseMmap; } global; @@ -799,6 +800,7 @@ static struct parm_struct parm_table[] = { {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, + {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, {"Printing Options", P_SEP, P_SEPARATOR}, @@ -1264,6 +1266,7 @@ static void init_globals(void) Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; + Globals.bUseMmap = True; #ifdef WITH_LDAP /* default values for ldap */ @@ -1533,6 +1536,7 @@ FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) +FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) 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) -- cgit From 819a9117354e22a26608ea31fd75e6eb13a15d8e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 1 Aug 2001 22:13:50 +0000 Subject: Added "strict allocate" per share parameter. This causes actual on-disk allocation to be done. Without it just does the ftruncate. Jeremy. (This used to be commit 0b052f103e82369088bc30724b86d8892c395cdb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a1871437ac..e4cd3a7982 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -363,6 +363,7 @@ typedef struct BOOL bWidelinks; BOOL bSymlinks; BOOL bSyncAlways; + BOOL bStrictAllocate; BOOL bStrictSync; char magic_char; BOOL *copymap; @@ -476,6 +477,7 @@ static service sDefault = { True, /* bWidelinks */ True, /* bSymlinks */ False, /* bSyncAlways */ + False, /* bStrictAllocate */ False, /* bStrictSync */ '~', /* magic char */ NULL, /* copymap */ @@ -798,6 +800,7 @@ static struct parm_struct parm_table[] = { {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, + {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, @@ -1640,6 +1643,7 @@ FN_LOCAL_BOOL(lp_manglednames, bMangledNames) FN_LOCAL_BOOL(lp_widelinks, bWidelinks) FN_LOCAL_BOOL(lp_symlinks, bSymlinks) FN_LOCAL_BOOL(lp_syncalways, bSyncAlways) +FN_LOCAL_BOOL(lp_strict_allocate, bStrictAllocate) FN_LOCAL_BOOL(lp_strict_sync, bStrictSync) FN_LOCAL_BOOL(lp_map_system, bMap_system) FN_LOCAL_BOOL(lp_delete_readonly, bDeleteReadonly) -- cgit From ad4144d81d14b83b7331f38335f1da2a30e43da2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Aug 2001 20:52:57 +0000 Subject: Put HPUX on mmap blacklist. Jeremy. (This used to be commit 4d5fe9ed4fc2c3bb7830ab14eead8d12eed37de9) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e4cd3a7982..c4073569a3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1269,7 +1269,11 @@ static void init_globals(void) Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; +#ifdef MMAP_BLACKLIST + Globals.bUseMmap = False; +#else Globals.bUseMmap = True; +#endif #ifdef WITH_LDAP /* default values for ldap */ -- cgit From 986372901e85a79343ba32f590a4a3e7658d2565 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 3 Aug 2001 13:09:23 +0000 Subject: This is my 'Authentication Rewrite' version 1.01, mostly as submitted to samba-technical a few weeks ago. The idea here is to standardize the checking of user names and passwords, thereby ensuring that all authtentications pass the same standards. The interface currently implemented in as nt_status = check_password(user_info, server_info) where user_info contains (mostly) the authentication data, and server_info contains things like the user-id they got, and their resolved user name. The current ugliness with the way the structures are created will be killed the next revision, when they will be created and malloced by creator functions. This patch also includes the first implementation of NTLMv2 in HEAD, but which needs some more testing. We also add a hack to allow plaintext passwords to be compared with smbpasswd, not the system password database. Finally, this patch probably reintroduces the PAM accounts bug we had in 2.2.0, I'll fix that once this hits the tree. (I've just finished testing it on a wide variety of platforms, so I want to get this patch in). (This used to be commit b30b6202f31d339b48d51c0d38174cafd1cfcd42) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c4073569a3..3fdb884a51 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -252,6 +252,8 @@ typedef struct BOOL bAllowTrustedDomains; BOOL bRestrictAnonymous; BOOL bLanmanAuth; + BOOL bNTLMAuth; + BOOL bPlaintextToSmbpasswd; BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; @@ -676,6 +678,8 @@ static struct parm_struct parm_table[] = { {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, + {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, + {"plaintext to smbpasswd", P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, @@ -1265,6 +1269,8 @@ static void init_globals(void) Globals.bStatCache = True; /* use stat cache by default */ Globals.bRestrictAnonymous = False; Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ + Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ + Globals.bPlaintextToSmbpasswd = False; /* Check the passwords with smbpasswd, even if in plaintext */ Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ @@ -1540,6 +1546,8 @@ FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) +FN_GLOBAL_BOOL(lp_ntlm_auth, &Globals.bNTLMAuth) +FN_GLOBAL_BOOL(lp_plaintext_to_smbpasswd, &Globals.bPlaintextToSmbpasswd) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) -- cgit From b026e6edf290ec4cd77c2bb9a378630ddf7bc450 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 Aug 2001 22:39:51 +0000 Subject: Added Gerald's lanman printing only change to HEAD. Jeremy. (This used to be commit b7bd512d9a9b543b9caf93c264776db6852c03ea) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3fdb884a51..6b3ded8c60 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -178,6 +178,7 @@ typedef struct int maxdisksize; int lpqcachetime; int iMaxSmbdProcesses; + BOOL bLanmanPrinting; int iTotalPrintJobs; int syslog; int os_level; @@ -822,6 +823,7 @@ static struct parm_struct parm_table[] = { {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lanman printing only", P_BOOL, P_GLOBAL, &Globals.bLanmanPrinting, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -1213,6 +1215,7 @@ static void init_globals(void) Globals.max_xmit = 65535; Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; + Globals.bLanmanPrinting = False; Globals.iMaxSmbdProcesses = 0;/* no limit specified */ Globals.iTotalPrintJobs = 0; /* no limit specified */ Globals.pwordlevel = 0; @@ -1570,6 +1573,7 @@ FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) +FN_GLOBAL_INTEGER(lp_lanman_printing_only, &Globals.bLanmanPrinting) FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) -- cgit From 2f844bf447a98b802daa4b8d552ea4530e7f6108 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 8 Aug 2001 16:54:16 +0000 Subject: Change all realloc() statements to Realloc() (ecxept for tdb.c) changed some code to exploit the fact that Realloc(NULL, size) == malloc(size) fixed some possible mem leaks, or seg faults. thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c) (This used to be commit 7f33c01688b825ab2fa9bbb2730bff4f2fa352be) --- source3/param/loadparm.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6b3ded8c60..f3e3dcc31c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3585,25 +3585,17 @@ char **lp_list_make(char *string) return NULL; } - list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); - if (!list) { - DEBUG(0,("ERROR: Unable to allocate memory")); - free (s); - return NULL; - } - memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); - lsize = P_LIST_ABS; - - num = 0; + num = lsize = 0; + list = NULL; str = s; while (*str) { if (!next_token(&str, tok, LIST_SEP, sizeof(pstring))) continue; - if ((num +1) == lsize) { + if (num == lsize) { lsize += P_LIST_ABS; - rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); + rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { DEBUG(0,("ERROR: Unable to allocate memory")); lp_list_free (&list); @@ -3611,7 +3603,7 @@ char **lp_list_make(char *string) return NULL; } else list = rlist; - memset (&list[num], 0, ((sizeof(char**)) * P_LIST_ABS)); + memset (&list[num], 0, ((sizeof(char**)) * (P_LIST_ABS +1))); } list[num] = strdup(tok); @@ -3637,26 +3629,21 @@ BOOL lp_list_copy(char ***dest, char **src) *dest = NULL; if (!src) return False; - list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); - if (!list) { - DEBUG(0,("ERROR: Unable to allocate memory")); - return False; - } - memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); - lsize = P_LIST_ABS; + num = lsize = 0; + list = NULL; - for (num = 0; src[num]; num++) + while (src[num]) { - if ((num +1) == lsize) { + if (num == lsize) { lsize += P_LIST_ABS; - rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); + rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { DEBUG(0,("ERROR: Unable to allocate memory")); lp_list_free (&list); return False; } else list = rlist; - memset (&list[num], 0, ((sizeof(char**)) * P_LIST_ABS)); + memset (&list[num], 0, ((sizeof(char **)) * (P_LIST_ABS +1))); } list[num] = strdup(src[num]); @@ -3665,6 +3652,8 @@ BOOL lp_list_copy(char ***dest, char **src) lp_list_free (&list); return False; } + + num++; } *dest = list; @@ -3758,4 +3747,3 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) return True; } - -- cgit From de5f42c9d9172592779fa2504d44544e3b6b1c0d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 10 Aug 2001 04:27:26 +0000 Subject: merge from 2.2 (This used to be commit 6ab0e949d18b97ea7177175a4e6abb5ba076db98) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f3e3dcc31c..c110139e21 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -178,7 +178,7 @@ typedef struct int maxdisksize; int lpqcachetime; int iMaxSmbdProcesses; - BOOL bLanmanPrinting; + BOOL bDisableSpoolss; int iTotalPrintJobs; int syslog; int os_level; @@ -823,7 +823,7 @@ static struct parm_struct parm_table[] = { {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lanman printing only", P_BOOL, P_GLOBAL, &Globals.bLanmanPrinting, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -1215,7 +1215,7 @@ static void init_globals(void) Globals.max_xmit = 65535; Globals.max_mux = 50; /* This is *needed* for profile support. */ Globals.lpqcachetime = 10; - Globals.bLanmanPrinting = False; + Globals.bDisableSpoolss = False; Globals.iMaxSmbdProcesses = 0;/* no limit specified */ Globals.iTotalPrintJobs = 0; /* no limit specified */ Globals.pwordlevel = 0; @@ -1573,7 +1573,7 @@ FN_GLOBAL_INTEGER(lp_security, &Globals.security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) -FN_GLOBAL_INTEGER(lp_lanman_printing_only, &Globals.bLanmanPrinting) +FN_GLOBAL_INTEGER(lp_disable_spoolss, &Globals.bDisableSpoolss) FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) -- cgit From acc149c427e780b35ebe3028722ed0c42c4c3854 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 10 Aug 2001 09:52:10 +0000 Subject: - avoid possible mem leaks in rpcclient/cmd_*.c (talloc_destroy not performed) - ported two rpc back from TNG (WINREG: shutdown and abort shutdown) - some optimizations and changed some DEBUG statement in loadparm.c - changed rpcclient a bit moved from non reentrant next_token_nr to next_token - in cmd_reg.c not sure if getopt will work ok on all platforms only setting optind=0 (This used to be commit fd54412ce9c3504a547e232602d6129e08dd9d4d) --- source3/param/loadparm.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c110139e21..cb7f9f35c3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3580,8 +3580,8 @@ char **lp_list_make(char *string) if (!string || !*string) return NULL; s = strdup(string); - if (!s || !*s) { - DEBUG(0,("ERROR: Unable to allocate memory")); + if (!s) { + DEBUG(0,("lp_list_make: Unable to allocate memory")); return NULL; } @@ -3589,15 +3589,13 @@ char **lp_list_make(char *string) list = NULL; str = s; - while (*str) - { - if (!next_token(&str, tok, LIST_SEP, sizeof(pstring))) continue; - + while (next_token(&str, tok, LIST_SEP, sizeof(pstring))) + { if (num == lsize) { lsize += P_LIST_ABS; rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { - DEBUG(0,("ERROR: Unable to allocate memory")); + DEBUG(0,("lp_list_make: Unable to allocate memory")); lp_list_free (&list); free (s); return NULL; @@ -3608,7 +3606,7 @@ char **lp_list_make(char *string) list[num] = strdup(tok); if (!list[num]) { - DEBUG(0,("ERROR: Unable to allocate memory")); + DEBUG(0,("lp_list_make: Unable to allocate memory")); lp_list_free (&list); free (s); return NULL; @@ -3638,7 +3636,7 @@ BOOL lp_list_copy(char ***dest, char **src) lsize += P_LIST_ABS; rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { - DEBUG(0,("ERROR: Unable to allocate memory")); + DEBUG(0,("lp_list_copy: Unable to allocate memory")); lp_list_free (&list); return False; } @@ -3648,7 +3646,7 @@ BOOL lp_list_copy(char ***dest, char **src) list[num] = strdup(src[num]); if (!list[num]) { - DEBUG(0,("ERROR: Unable to allocate memory")); + DEBUG(0,("lp_list_copy: Unable to allocate memory")); lp_list_free (&list); return False; } @@ -3713,7 +3711,7 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) { t = (char *) malloc(ls +ld +1); if (!t) { - DEBUG(0,("ERROR: Unable to allocate memory")); + DEBUG(0,("lp_list_substitute: Unable to allocate memory")); return False; } memcpy(t, *list, d); -- cgit From 2e783a47076bd0994b6ce86df7ec967bc1c2da63 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 12 Aug 2001 17:30:01 +0000 Subject: this is a big global fix for the ptr = Realloc(ptr, size) bug. many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9) --- source3/param/loadparm.c | 23 ++++++++++++++++------- source3/param/params.c | 27 ++++++++++++++++++--------- 2 files changed, 34 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cb7f9f35c3..b004265261 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1782,16 +1782,25 @@ static int add_a_service(service * pservice, char *name) /* if not, then create one */ if (i == iNumServices) { - ServicePtrs = - (service **) Realloc(ServicePtrs, - sizeof(service *) * - num_to_alloc); - if (ServicePtrs) + service **tsp; + + tsp = (service **) Realloc(ServicePtrs, + sizeof(service *) * + num_to_alloc); + + if (!tsp) { + DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n")); + return (-1); + } + else { + ServicePtrs = tsp; ServicePtrs[iNumServices] = (service *) malloc(sizeof(service)); - - if (!ServicePtrs || !ServicePtrs[iNumServices]) + } + if (!ServicePtrs[iNumServices]) { + DEBUG(0,("add_a_service: out of memory!\n")); return (-1); + } iNumServices++; } diff --git a/source3/param/params.c b/source3/param/params.c index 61baf9517c..9416965919 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -238,13 +238,16 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) /* Check that the buffer is big enough for the next character. */ if( i > (bSize - 2) ) { - bSize += BUFR_INC; - bufr = Realloc( bufr, bSize ); - if( NULL == bufr ) + char *tb; + + tb = Realloc( bufr, bSize +BUFR_INC ); + if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return( False ); } + bufr = tb; + bSize += BUFR_INC; } /* Handle a single character. */ @@ -332,13 +335,16 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) if( i > (bSize - 2) ) /* Ensure there's space for next char. */ { - bSize += BUFR_INC; - bufr = Realloc( bufr, bSize ); - if( NULL == bufr ) + char *tb; + + tb = Realloc( bufr, bSize + BUFR_INC ); + if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return( False ); } + bufr = tb; + bSize += BUFR_INC; } switch( c ) @@ -397,13 +403,16 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) if( i > (bSize - 2) ) /* Make sure there's enough room. */ { - bSize += BUFR_INC; - bufr = Realloc( bufr, bSize ); - if( NULL == bufr ) + char *tb; + + tb = Realloc( bufr, bSize + BUFR_INC ); + if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return( False ); } + bufr = tb; + bSize += BUFR_INC; } switch( c ) -- cgit From 26ceb74063b78abc58f773641da66b9043a5518a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 13 Aug 2001 21:30:27 +0000 Subject: merge from 2.2 (This used to be commit 7049217eb40dbe3de6c05fe43742d2f684501723) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b004265261..992083df72 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -380,6 +380,7 @@ typedef struct BOOL bBlockingLocks; BOOL bInheritPerms; BOOL bMSDfsRoot; + BOOL bUseClientDriver; char dummy[3]; /* for alignment */ } @@ -494,6 +495,7 @@ static service sDefault = { True, /* bBlockingLocks */ False, /* bInheritPerms */ False, /* bMSDfsRoot */ + False, /* bUseClientDriver */ "" /* dummy */ }; @@ -839,6 +841,7 @@ static struct parm_struct parm_table[] = { {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -1671,6 +1674,7 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) +FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From 252742f2b021e8d7a06c8c86e099e616511f9996 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 21 Aug 2001 02:58:07 +0000 Subject: Add a new option to disable our paranoid server check. Defaults to ON, ie checking (This used to be commit bd3010263be24425206587abfdb41164089e2157) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 992083df72..543e9bab9f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -175,6 +175,7 @@ typedef struct int maxprotocol; int minprotocol; int security; + BOOL paranoid_server_security; int maxdisksize; int lpqcachetime; int iMaxSmbdProcesses; @@ -800,6 +801,7 @@ static struct parm_struct parm_table[] = { {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, + {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, @@ -1230,6 +1232,7 @@ static void init_globals(void) Globals.maxprotocol = PROTOCOL_NT1; Globals.minprotocol = PROTOCOL_CORE; Globals.security = SEC_USER; + Globals.paranoid_server_security = True; Globals.bEncryptPasswords = False; Globals.bUpdateEncrypt = False; Globals.bReadRaw = True; @@ -1573,6 +1576,7 @@ FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) +FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) -- cgit From 8ca7ec6389b6785478eb1138ab2dc90fc6362a58 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 22 Aug 2001 01:48:45 +0000 Subject: merge from 2.2 (This used to be commit a50c3df15b3a82b4363fde0442c98edea067b4ae) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 543e9bab9f..df08c9693e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3085,6 +3085,9 @@ void lp_add_one_printer(char *name, char *comment) ServicePtrs[i]->autoloaded = True; } } + + /* free up temporary memory */ + lp_talloc_free(); } /*************************************************************************** -- cgit From 3b39c36edeae8e02a05937404a95fcc798d7450f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Aug 2001 04:39:37 +0000 Subject: Remove unneeded lp_talloc_free(). Jeremy. (This used to be commit 072a5bca2b8fbd6e0ac3f1259c426ebd1f3fb551) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index df08c9693e..543e9bab9f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3085,9 +3085,6 @@ void lp_add_one_printer(char *name, char *comment) ServicePtrs[i]->autoloaded = True; } } - - /* free up temporary memory */ - lp_talloc_free(); } /*************************************************************************** -- cgit From 2051bb7d0366e07c5ecda5e5f7cfedc4153d6228 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Aug 2001 19:11:55 +0000 Subject: A few changes: drop paramaters: status utmp hostname change session code to always record each vuid current on the server. The sessionid struct is no longer packed, as I couldn't get that to work ;-) change smbstatus to show this info and less of the connections.tdb info (its not actualy that accurate). I'll get swat doing some of this shortly. (This used to be commit b068ad300527c44673bbee0aede7849199c89de7) --- source3/param/loadparm.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 543e9bab9f..85bcd52ff1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -149,7 +149,6 @@ typedef struct #ifdef WITH_UTMP char *szUtmpDir; char *szWtmpDir; - char *szUtmpHostname; BOOL bUtmp; #endif char *szSourceEnv; @@ -342,7 +341,6 @@ typedef struct BOOL bCasePreserve; BOOL bShortCasePreserve; BOOL bCaseMangle; - BOOL status; BOOL bHideDotFiles; BOOL bHideUnReadable; BOOL bBrowseable; @@ -457,7 +455,6 @@ static service sDefault = { True, /* case preserve */ True, /* short case preserve */ False, /* case mangle */ - True, /* status */ True, /* bHideDotFiles */ False, /* bHideUnReadable */ True, /* bBrowseable */ @@ -762,8 +759,6 @@ static struct parm_struct parm_table[] = { {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, - {"status", P_BOOL, P_LOCAL, &sDefault.status, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_PRINT}, - {"Protocol Options", P_SEP, P_SEPARATOR}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, @@ -960,7 +955,6 @@ static struct parm_struct parm_table[] = { #ifdef WITH_UTMP {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, - {"utmp hostname", P_STRING, P_GLOBAL, &Globals.szUtmpHostname, NULL, NULL, 0}, {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif @@ -1193,7 +1187,6 @@ static void init_globals(void) #ifdef WITH_UTMP string_set(&Globals.szUtmpDir, ""); string_set(&Globals.szWtmpDir, ""); - string_set(&Globals.szUtmpHostname, "%m"); Globals.bUtmp = False; #endif string_set(&Globals.szSocketAddress, "0.0.0.0"); @@ -1436,7 +1429,6 @@ FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) -FN_GLOBAL_STRING(lp_utmp_hostname, &Globals.szUtmpHostname) FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp) #endif FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) @@ -1643,7 +1635,6 @@ FN_LOCAL_BOOL(lp_casesensitive, bCaseSensitive) FN_LOCAL_BOOL(lp_preservecase, bCasePreserve) FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve) FN_LOCAL_BOOL(lp_casemangle, bCaseMangle) -FN_LOCAL_BOOL(lp_status, status) FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles) FN_LOCAL_BOOL(lp_hideunreadable, bHideUnReadable) FN_LOCAL_BOOL(lp_browseable, bBrowseable) @@ -1883,7 +1874,6 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) string_set(&ServicePtrs[i]->szUsername, ""); string_set(&ServicePtrs[i]->comment, comment); string_set(&ServicePtrs[i]->fstype, "IPC"); - ServicePtrs[i]->status = False; ServicePtrs[i]->iMaxConnections = 0; ServicePtrs[i]->bAvailable = True; ServicePtrs[i]->bRead_only = True; -- cgit From d1f53e404496dff10df7dc5e5b58ed676982c955 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 23 Aug 2001 19:06:20 +0000 Subject: Fixed detection of CUPS. We need to check for the presence of the cups header files as well as libcups. (This used to be commit 2dbb41a7b88e7fad63579111aaab4a1cd28c54d5) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 85bcd52ff1..4ade750543 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1062,7 +1062,7 @@ static void init_printer_values(void) break; case PRINT_CUPS: -#ifdef HAVE_LIBCUPS +#ifdef HAVE_CUPS string_set(&sDefault.szLpqcommand, ""); string_set(&sDefault.szLprmcommand, ""); string_set(&sDefault.szPrintcommand, ""); @@ -1088,7 +1088,7 @@ static void init_printer_values(void) string_set(&sDefault.szQueueresumecommand, "/usr/bin/enable %p"); string_set(&Globals.szPrintcapname, "lpstat"); -#endif /* HAVE_LIBCUPS */ +#endif /* HAVE_CUPS */ break; case PRINT_SYSV: -- cgit From 8ef7ddba65f326df69d3ff247491a0df1fa89578 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 23 Aug 2001 23:25:34 +0000 Subject: so let admins shutdown their samba servers remotely if they want :-) (This used to be commit 6391fd7bdab07c83e9eed02e761db09918e60302) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ade750543..682ac7054c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -145,6 +145,7 @@ typedef struct char *szAddUserToGroupScript; char *szDelUserToGroupScript; char *szAddMachineScript; + char *szShutdownScript; char *szWINSHook; #ifdef WITH_UTMP char *szUtmpDir; @@ -887,6 +888,7 @@ static struct parm_struct parm_table[] = { {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, + {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, @@ -1470,6 +1472,8 @@ FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) +FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript) + FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_LIST(lp_domain_admin_group, &Globals.szDomainAdminGroup) FN_GLOBAL_LIST(lp_domain_guest_group, &Globals.szDomainGuestGroup) -- cgit From 0174ccc0d6f34e84b201031a4c3eb58763a19770 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 24 Aug 2001 07:51:59 +0000 Subject: let admins also abort a shutdown (This used to be commit 3b40ec4f149a8813c1d68f184858e2ddd605d8fd) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 682ac7054c..a8365af0eb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -146,6 +146,7 @@ typedef struct char *szDelUserToGroupScript; char *szAddMachineScript; char *szShutdownScript; + char *szAbortShutdownScript; char *szWINSHook; #ifdef WITH_UTMP char *szUtmpDir; @@ -889,6 +890,7 @@ static struct parm_struct parm_table[] = { {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, + {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, @@ -1473,6 +1475,7 @@ FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript) +FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_LIST(lp_domain_admin_group, &Globals.szDomainAdminGroup) -- cgit From b7c11f6295efc8c1dca141f3b7a9910d4708d52b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 26 Aug 2001 18:26:40 +0000 Subject: Change default 'name resolve order' to WINS before DNS. Volker (This used to be commit 5fc8c51983f36b0b2bbb2704a522026dc64d0b65) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a8365af0eb..c69e236408 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1208,7 +1208,7 @@ static void init_globals(void) string_set(&Globals.szLogonHome, "\\\\%N\\%U"); string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); - string_set(&Globals.szNameResolveOrder, "lmhosts host wins bcast"); + string_set(&Globals.szNameResolveOrder, "lmhosts wins host bcast"); Globals.bLoadPrinters = True; Globals.bUseRhosts = False; -- cgit From 10d1c6a35fed84e84d03d8dda3ecfd6c2eabca8f Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 29 Aug 2001 02:49:14 +0000 Subject: lp_wins_server() is now lp_wins_server_list(). This should make it clear that the meaning of the parameter value has changed. It no longer represents *the* WINS server, but a list of WINS servers. I have made other changes in the code such that the lp_wins_server() function is no longer necessary. Whenever smb.conf is reloaded the list managed by lib/wins_srv.c is refreshed. The wins_srv_count() function returns the number of entries in the list so, if the list is empty, it will return 0 (which can be interpreted as "false" in an if() statement). Chris -)----- (This used to be commit 968c947e8bb35cf2441f3ebbb234429f5c1733c6) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c69e236408..2a991466a1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1457,7 +1457,7 @@ FN_GLOBAL_STRING(lp_logon_drive, &Globals.szLogonDrive) FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync) -FN_GLOBAL_STRING(lp_wins_server, &Globals.szWINSserver) +FN_GLOBAL_STRING(lp_wins_server_list, &Globals.szWINSserver) FN_GLOBAL_LIST(lp_interfaces, &Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) -- cgit From e3d79bb0c8c35c309125b0886399b31c6407a099 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Sep 2001 01:22:17 +0000 Subject: enable strict locking by default. This will be slow, so now we just need to fiind a way to make it fast (This used to be commit 42b147d1f26093c45110077a309c5e0d3010a28d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2a991466a1..98bb5abd09 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -471,7 +471,7 @@ static service sDefault = { False, /* bMap_hidden */ True, /* bMap_archive */ True, /* bLocking */ - False, /* bStrictLocking */ + True, /* bStrictLocking */ True, /* bPosixLocking */ True, /* bShareModes */ True, /* bOpLocks */ -- cgit From a92f02a0a05b5309644befe57119e799be08177f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 Sep 2001 15:48:29 +0000 Subject: Fixed O(N^2) talloc loop when allocating printer name memory - fix from Richard Bollinger . Jeremy. (This used to be commit 408c0595bbeafca87795e5278656471fbe0540e8) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 98bb5abd09..95ba076977 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3344,8 +3344,8 @@ int lp_servicenumber(char *pszServiceName) int iService; for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && - strequal(lp_servicename(iService), pszServiceName)) + if (VALID(iService) && ServicePtrs[iService]->szService && + strequal(ServicePtrs[iService]->szService, pszServiceName)) break; if (iService < 0) DEBUG(7, -- cgit From 5573a1c7394362f5e46c58b8cfaf6bf7a080c391 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Sep 2001 14:14:57 +0000 Subject: added "display charset" option in smb.conf, along with d_printf() which should now be used instead of DEBUG(0) or printf() for interactive messages I have only converted client.c to use d_printf(), and the code hasn't had much testing yet. Eventually we want all interactive code to use d_printf(), plus SWAT (This used to be commit 266d8e67669adb329f25676c4bc4d4c50f223428) --- source3/param/loadparm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 95ba076977..5e7bb60f69 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -89,6 +89,7 @@ typedef struct { char *dos_charset; char *unix_charset; + char *display_charset; char *szPrintcapname; char *szEnumPortsCommand; char *szAddPrinterCommand; @@ -639,6 +640,7 @@ static struct parm_struct parm_table[] = { {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, + {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, @@ -1418,6 +1420,9 @@ static char *lp_string(const char *s) #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} +FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset) +FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset) +FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset) FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) @@ -3277,7 +3282,7 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, string_set(&Globals.szWINSserver, "127.0.0.1"); } - init_iconv(Globals.unix_charset, Globals.dos_charset); + init_iconv(); return (bRetval); } -- cgit From 5366c4c542b2a1c7bcc268daba02af25ce6eab6e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Sep 2001 00:30:47 +0000 Subject: added a new global option "hostname lookups = yes/no" This should finally kill off the remaining places where we attempt reverse lookups of the IP of the client. It may be that some pam modules called via the session code will need "hostname lookups = yes" but I've left it off by default as most sites don't need it and so many sites have broken reverse maps (This used to be commit 2b83ad03965d00bba88fe56452d2990099b75ef1) --- source3/param/loadparm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5e7bb60f69..951bfa5ec2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -265,6 +265,7 @@ typedef struct BOOL bHideLocalUsers; BOOL bUnicode; BOOL bUseMmap; + BOOL bHostnameLookups; } global; @@ -812,6 +813,7 @@ static struct parm_struct parm_table[] = { {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, + {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, {"Printing Options", P_SEP, P_SEPARATOR}, @@ -1289,6 +1291,10 @@ static void init_globals(void) Globals.bUseMmap = True; #endif + /* hostname lookups can be very expensive and are broken on + a large number of sites (tridge) */ + Globals.bHostnameLookups = False; + #ifdef WITH_LDAP /* default values for ldap */ string_set(&Globals.szLdapServer, "localhost"); @@ -1565,6 +1571,7 @@ FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) +FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups) 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) -- cgit From 41432074f56307cd3043ec5ed1ef6359a1a01cea Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 16 Sep 2001 00:07:04 +0000 Subject: Kill off the dangerous passwd program default, as its both very system-dependent and can allow (when unix password sync = yes) the 'syncronisation' of root's password by a normal user :-( Andrew Bartlett (This used to be commit eecda11eef8bff73286c6a3c9f89ed0d1dcd7f73) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 951bfa5ec2..4e057929b0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1189,7 +1189,7 @@ static void init_globals(void) */ string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT); string_set(&Globals.szWorkGroup, WORKGROUP); - string_set(&Globals.szPasswdProgram, PASSWD_PROGRAM); + string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szLockDir, LOCKDIR); #ifdef WITH_UTMP -- cgit From 84ab9d2cb369dc0b2af0da4d2dc66c03c0a3f0a2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 17 Sep 2001 04:58:38 +0000 Subject: move to SAFE_FREE() (This used to be commit fb0984e60fd69100d9866304b83b4f3c85e9aea2) --- source3/param/loadparm.c | 38 ++++++++++++++++---------------------- source3/param/params.c | 8 ++++---- 2 files changed, 20 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4e057929b0..2856eaf75b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1747,11 +1747,7 @@ static void free_service(service * pservice) pservice->szService)); string_free(&pservice->szService); - if (pservice->copymap) - { - free(pservice->copymap); - pservice->copymap = NULL; - } + SAFE_FREE(pservice->copymap); for (i = 0; parm_table[i].label; i++) { @@ -2160,13 +2156,13 @@ static void add_to_file_list(char *fname, char *subfname) f->name = strdup(fname); if (!f->name) { - free(f); + SAFE_FREE(f); return; } f->subfname = strdup(subfname); if (!f->subfname) { - free(f); + SAFE_FREE(f); return; } file_lists = f; @@ -2203,7 +2199,7 @@ BOOL lp_file_list_changed(void) ("file %s modified: %s\n", n2, ctime(&mod_time))); f->modtime = mod_time; - free(f->subfname); + SAFE_FREE(f->subfname); f->subfname = strdup(n2); return (True); } @@ -2486,8 +2482,7 @@ initialise a copymap static void init_copymap(service * pservice) { int i; - if (pservice->copymap) - free(pservice->copymap); + SAFE_FREE(pservice->copymap); pservice->copymap = (BOOL *)malloc(sizeof(BOOL) * NUMPARAMETERS); if (!pservice->copymap) DEBUG(0, @@ -3074,7 +3069,7 @@ static void lp_add_auto_services(char *str) lp_add_home(p, homes, home); } } - free(s); + SAFE_FREE(s); } /*************************************************************************** @@ -3622,8 +3617,8 @@ char **lp_list_make(char *string) rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { DEBUG(0,("lp_list_make: Unable to allocate memory")); - lp_list_free (&list); - free (s); + lp_list_free(&list); + SAFE_FREE(s); return NULL; } else list = rlist; @@ -3633,15 +3628,15 @@ char **lp_list_make(char *string) list[num] = strdup(tok); if (!list[num]) { DEBUG(0,("lp_list_make: Unable to allocate memory")); - lp_list_free (&list); - free (s); + lp_list_free(&list); + SAFE_FREE(s); return NULL; } num++; } - free (s); + SAFE_FREE(s); return list; } @@ -3663,7 +3658,7 @@ BOOL lp_list_copy(char ***dest, char **src) rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); if (!rlist) { DEBUG(0,("lp_list_copy: Unable to allocate memory")); - lp_list_free (&list); + lp_list_free(&list); return False; } else list = rlist; @@ -3673,7 +3668,7 @@ BOOL lp_list_copy(char ***dest, char **src) list[num] = strdup(src[num]); if (!list[num]) { DEBUG(0,("lp_list_copy: Unable to allocate memory")); - lp_list_free (&list); + lp_list_free(&list); return False; } @@ -3706,9 +3701,8 @@ void lp_list_free(char ***list) if (!list || !*list) return; tlist = *list; - for(; *tlist; tlist++) free(*tlist); - free (*list); - *list = NULL; + for(; *tlist; tlist++) SAFE_FREE(*tlist); + SAFE_FREE(*list); } BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) @@ -3742,7 +3736,7 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) } memcpy(t, *list, d); memcpy(t +d +li, p +lp, ls -d -lp +1); - free (*list); + SAFE_FREE(*list); *list = t; ls += ld; s = t +d +li; diff --git a/source3/param/params.c b/source3/param/params.c index 9416965919..d12081fb32 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -121,8 +121,8 @@ static int mygetc(myFILE *f) static void myfile_close(myFILE *f) { if (!f) return; - if (f->buf) free(f->buf); - free(f); + SAFE_FREE(f->buf); + SAFE_FREE(f); } /* -------------------------------------------------------------------------- ** @@ -532,7 +532,7 @@ static myFILE *OpenConfFile( char *FileName ) DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n", func, FileName, strerror(errno)) ); - free(ret); + SAFE_FREE(ret); return NULL; } @@ -582,7 +582,7 @@ BOOL pm_process( char *FileName, return( False ); } result = Parse( InFile, sfunc, pfunc ); - free( bufr ); + SAFE_FREE( bufr ); bufr = NULL; bSize = 0; } -- cgit From d9c1da5b0cfc1dad173b4fc8b48d74c8007e8111 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Sep 2001 05:41:51 +0000 Subject: *llist being NULL is not an error (This used to be commit c4d8ad2c2e48ff31dae7477ff02e5bfc013832a9) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2856eaf75b..e8831f652a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3710,7 +3710,7 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) char *p, *s, *t; ssize_t ls, lp, li, ld, i, d; - if (!list || !*list) return False; + if (!list) return False; if (!pattern) return False; if (!insert) return False; -- cgit From 4eb7ef6b612a98e1d71a2a0dfde7d695223a4360 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 23 Sep 2001 05:16:03 +0000 Subject: Fix up NT_STATUS return for session setups, Win2k objects to anything other than NT_STATUS_LOGON_FAILURE. This also brings us (almost) back in line with their implementation. Kill off SMBENCRYPT() macro Kill off 'nt smb support' paramater - tridge okayed this one. Andrew Bartlett (This used to be commit 67947bf6e31ee9758f8a2186f83031ba21b716f2) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e8831f652a..1ead342ebe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -775,7 +775,6 @@ static struct parm_struct parm_table[] = { {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, @@ -1273,7 +1272,6 @@ static void init_globals(void) Globals.bPamPasswordChange = False; Globals.bPasswdChatDebug = False; Globals.bUnicode = True; /* Do unicode on the wire by default */ - Globals.bNTSmbSupport = True; /* Do NT SMB's by default. */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ Globals.bStatCache = True; /* use stat cache by default */ @@ -1557,7 +1555,6 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange) FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) -FN_GLOBAL_BOOL(lp_nt_smb_support, &Globals.bNTSmbSupport) FN_GLOBAL_BOOL(lp_unicode, &Globals.bUnicode) FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport) FN_GLOBAL_BOOL(lp_nt_acl_support, &Globals.bNTAclSupport) -- cgit From 96db4b1ba3a48f50b80b2cfbf0b940e073b7843c Mon Sep 17 00:00:00 2001 From: Motonobu Takahashi Date: Mon, 24 Sep 2001 15:55:09 +0000 Subject: Added SWAT i18n feature: TO enable configure with --with-i18n-swat to support this gettext is integrated and a new directories name "po" and "intl" are created. now these languages are supported: en - English (default) ja - Japanese po - Polish tr - Turkish To add your language, to create ${your_language}.po by translating source/po/en.po into your language is needed. some of html and image files of various language version are not included yet, though message catalogue files are installed. you need to copy files manually under ${swatdir}/lang/$ln/{help,images,included,using_samba} And also added a option to intall manual pages: of various lang version To enable configure with --with-manlangs but manual pages themself are not included yet. (This used to be commit 486b79a6fc4ba20a751aab544bd0f7ccff2b3d19) --- source3/param/loadparm.c | 677 ++++++++++++++++++++++++----------------------- 1 file changed, 339 insertions(+), 338 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1ead342ebe..9b0759b2d5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -50,6 +50,7 @@ */ #include "includes.h" +#include "webintl.h" BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; @@ -637,395 +638,395 @@ static struct enum_list enum_ssl_version[] = { /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { - {"Base Options", P_SEP, P_SEPARATOR}, - - {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, - {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, - {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, - {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, - {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, - {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, - {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, - - {"Security Options", P_SEP, P_SEPARATOR}, + {N_("Base Options"), P_SEP, P_SEPARATOR}, + + {N_("dos charset"), P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, + {N_("unix charset"), P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, + {N_("display charset"), P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, + {N_("comment"), P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("path"), P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("directory"), P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {N_("workgroup"), P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {N_("netbios name"), P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, + {N_("netbios aliases"), P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {N_("netbios scope"), P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, + {N_("server string"), P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, + {N_("interfaces"), P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {N_("bind interfaces only"), P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, + + {N_("Security Options"), P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, - {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, - {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, - {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, - {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, - {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, - {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {N_("security"), P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {N_("encrypt passwords"), P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {N_("update encrypted"), P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, + {N_("allow trusted domains"), P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, + {N_("alternate permissions"), P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, + {N_("hosts equiv"), P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {N_("min passwd length"), P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {N_("min password length"), P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {N_("map to guest"), P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, + {N_("null passwords"), P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {N_("obey pam restrictions"), P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, + {N_("password server"), P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, + {N_("smb passwd file"), P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {N_("private dir"), P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, + {N_("passdb module path"), P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, + {N_("root directory"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {N_("root dir"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {N_("root"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, - {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, - {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, - {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, - {"plaintext to smbpasswd", P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {N_("pam password change"), P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, + {N_("passwd program"), P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, + {N_("passwd chat"), P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {N_("passwd chat debug"), P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, + {N_("username map"), P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {N_("password level"), P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {N_("username level"), P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {N_("unix password sync"), P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, + {N_("restrict anonymous"), P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, + {N_("lanman auth"), P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, + {N_("ntlm auth"), P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, + {N_("plaintext to smbpasswd"), P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, + {N_("use rhosts"), P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {N_("username"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("user"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {N_("users"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, - {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {N_("guest account"), P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, + {N_("invalid users"), P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("valid users"), P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("admin users"), P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("read list"), P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("write list"), P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("printer admin"), P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, + {N_("force user"), P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, + {N_("force group"), P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, + {N_("group"), P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {N_("read only"), P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, + {N_("write ok"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {N_("writeable"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {N_("writable"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, - {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {N_("create mask"), P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("create mode"), P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {N_("force create mode"), P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("security mask"), P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("force security mode"), P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("directory mask"), P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("directory mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {N_("force directory mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("directory security mask"), P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("force directory security mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {N_("inherit permissions"), P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, + {N_("guest only"), P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, + {N_("only guest"), P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + + {N_("guest ok"), P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("public"), P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {N_("only user"), P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, + {N_("hosts allow"), P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("allow hosts"), P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {N_("hosts deny"), P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("deny hosts"), P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, #ifdef WITH_SSL - {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, - {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, + {N_("Secure Socket Layer Options"), P_SEP, P_SEPARATOR}, + {N_("ssl"), P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, - {"ssl hosts", P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, - {"ssl hosts resign", P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, - {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, - {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, - {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0}, - {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0}, - {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, - {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, - {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, - {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, - {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, - {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, - {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, + {N_("ssl hosts"), P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, + {N_("ssl hosts resign"), P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, + {N_("ssl CA certDir"), P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, + {N_("ssl CA certFile"), P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, + {N_("ssl server cert"), P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0}, + {N_("ssl server key"), P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0}, + {N_("ssl client cert"), P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, + {N_("ssl client key"), P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, + {N_("ssl require clientcert"), P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, + {N_("ssl require servercert"), P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, + {N_("ssl ciphers"), P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, + {N_("ssl version"), P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, + {N_("ssl compatibility"), P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, #endif /* WITH_SSL */ - {"Logging Options", P_SEP, P_SEPARATOR}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {N_("Logging Options"), P_SEP, P_SEPARATOR}, + {N_("log level"), P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {N_("debuglevel"), P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {N_("syslog"), P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {N_("syslog only"), P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {N_("log file"), P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, - {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, - {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, - {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, + {N_("max log size"), P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {N_("timestamp logs"), P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {N_("debug timestamp"), P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {N_("debug hires timestamp"), P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, + {N_("debug pid"), P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, + {N_("debug uid"), P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, - {"Protocol Options", P_SEP, P_SEPARATOR}, + {N_("Protocol Options"), P_SEP, P_SEPARATOR}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, - {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, - {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {N_("protocol"), P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {N_("large readwrite"), P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, + {N_("max protocol"), P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {N_("min protocol"), P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, + {N_("unicode"), P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, + {N_("read bmpx"), P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {N_("read raw"), P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {N_("write raw"), P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {N_("nt pipe support"), P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, + {N_("nt acl support"), P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, + {N_("announce version"), P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {N_("announce as"), P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, + {N_("max mux"), P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {N_("max xmit"), P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, - - {"Tuning Options", P_SEP, P_SEPARATOR}, + {N_("name resolve order"), P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, + {N_("max packet"), P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {N_("packet size"), P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {N_("max ttl"), P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {N_("max wins ttl"), P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {N_("min wins ttl"), P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {N_("time server"), P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + + {N_("Tuning Options"), P_SEP, P_SEPARATOR}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {N_("change notify timeout"), P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, + {N_("deadtime"), P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {N_("getwd cache"), P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {N_("keepalive"), P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, - {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {N_("lpq cache time"), P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {N_("max smbd processes"), P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, + {N_("max connections"), P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, + {N_("paranoid server security"), P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, + {N_("max disk size"), P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {N_("max open files"), P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, + {N_("min print space"), P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, + {N_("read size"), P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, - {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, - {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, - {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, - {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, - - {"Printing Options", P_SEP, P_SEPARATOR}, + {N_("socket options"), P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {N_("stat cache size"), P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, + {N_("strict allocate"), P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, + {N_("strict sync"), P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, + {N_("sync always"), P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, + {N_("use mmap"), P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, + {N_("hostname lookups"), P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, + {N_("write cache size"), P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, + + {N_("Printing Options"), P_SEP, P_SEPARATOR}, - {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, - {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, - {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - - {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, - {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, - {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, - {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, - {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, + {N_("total print jobs"), P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, + {N_("max print jobs"), P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, + {N_("load printers"), P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, + {N_("printcap name"), P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, + {N_("printcap"), P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {N_("printable"), P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, + {N_("print ok"), P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {N_("postscript"), P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {N_("printing"), P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, + {N_("print command"), P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("disable spoolss"), P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("lpq command"), P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("lprm command"), P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("lppause command"), P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("lpresume command"), P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("queuepause command"), P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {N_("queueresume command"), P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + + {N_("enumports command"), P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, + {N_("addprinter command"), P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, + {N_("deleteprinter command"), P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, + {N_("show add printer wizard"), P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, + {N_("os2 driver map"), P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, - {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, - {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - - {"Filename Handling", P_SEP, P_SEPARATOR}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {N_("printer name"), P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {N_("printer"), P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {N_("use client driver"), P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, + {N_("printer driver"), P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, + {N_("printer driver file"), P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, + {N_("printer driver location"), P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + + {N_("Filename Handling"), P_SEP, P_SEPARATOR}, + {N_("strip dot"), P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, - - {"Domain Options", P_SEP, P_SEPARATOR}, + {N_("mangled stack"), P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {N_("default case"), P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, + {N_("case sensitive"), P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("casesignames"), P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {N_("preserve case"), P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("short preserve case"), P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("mangle case"), P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("mangling char"), P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("hide dot files"), P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("hide unreadable"), P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("delete veto files"), P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("veto files"), P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {N_("hide files"), P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {N_("veto oplock files"), P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {N_("map system"), P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("map hidden"), P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("map archive"), P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("mangled names"), P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("mangled map"), P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("stat cache"), P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, + + {N_("Domain Options"), P_SEP, P_SEPARATOR}, - {"domain admin group", P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group", P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {N_("domain admin group"), P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {N_("domain guest group"), P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, #ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, + {N_("groupname map"), P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, #endif /* USING_GROUPNAME_MAP */ - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, + {N_("machine password timeout"), P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, - {"Logon Options", P_SEP, P_SEPARATOR}, + {N_("Logon Options"), P_SEP, P_SEPARATOR}, - {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, - {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, - {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, - {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, - {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, - {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, - {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, - {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, - {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, - - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, - - {"Browse Options", P_SEP, P_SEPARATOR}, + {N_("add user script"), P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, + {N_("delete user script"), P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, + {N_("add group script"), P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, + {N_("delete group script"), P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, + {N_("add user to group script"), P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, + {N_("delete user from group script"), P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, + {N_("add machine script"), P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, + {N_("shutdown script"), P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, + {N_("abort shutdown script"), P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, + + {N_("logon script"), P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, + {N_("logon path"), P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, + {N_("logon drive"), P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, + {N_("logon home"), P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, + {N_("domain logons"), P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + + {N_("Browse Options"), P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, - {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, - - {"WINS Options", P_SEP, P_SEPARATOR}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {N_("os level"), P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, + {N_("lm announce"), P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, + {N_("lm interval"), P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, + {N_("preferred master"), P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {N_("prefered master"), P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {N_("local master"), P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, + {N_("domain master"), P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {N_("browse list"), P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {N_("browseable"), P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("browsable"), P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {N_("enhanced browsing"), P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, + + {N_("WINS Options"), P_SEP, P_SEPARATOR}, + {N_("dns proxy"), P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {N_("wins proxy"), P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, - {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, + {N_("wins server"), P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, + {N_("wins support"), P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {N_("wins hook"), P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, - {"Locking Options", P_SEP, P_SEPARATOR}, + {N_("Locking Options"), P_SEP, P_SEPARATOR}, - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, - {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("blocking locks"), P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("fake oplocks"), P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, + {N_("kernel oplocks"), P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, + {N_("locking"), P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"oplock break wait time", P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, - {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("oplocks"), P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("level2 oplocks"), P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("oplock break wait time"), P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, + {N_("oplock contention limit"), P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("posix locking"), P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("strict locking"), P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("share modes"), P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_LDAP - {"Ldap Options", P_SEP, P_SEPARATOR}, + {N_("Ldap Options"), P_SEP, P_SEPARATOR}, - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, - {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, - {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, + {N_("ldap server"), P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, + {N_("ldap port"), P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + {N_("ldap suffix"), P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, + {N_("ldap filter"), P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, + {N_("ldap root"), P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, + {N_("ldap root passwd"), P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, #endif /* WITH_LDAP */ - {"Miscellaneous Options", P_SEP, P_SEPARATOR}, - {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, - {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, - {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, + {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, + {N_("add share command"), P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, + {N_("change share command"), P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, + {N_("delete share command"), P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {N_("config file"), P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, + {N_("preload"), P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {N_("auto services"), P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {N_("lock dir"), P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {N_("lock directory"), P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, - {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, + {N_("utmp directory"), P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + {N_("wtmp directory"), P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, + {N_("utmp"), P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, - {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, - {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, + {N_("default service"), P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {N_("default"), P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {N_("message command"), P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {N_("dfree command"), P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {N_("remote announce"), P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {N_("remote browse sync"), P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, + {N_("socket address"), P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {N_("homedir map"), P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {N_("time offset"), P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, + {N_("NIS homedir"), P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, + {N_("-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_SHARE | FLAG_PRINT}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {N_("copy"), P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL, FLAG_HIDE}, + {N_("include"), P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE}, + {N_("exec"), P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {N_("preexec"), P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, - {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, - {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - - {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, - {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, + {N_("preexec close"), P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, + {N_("postexec"), P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {N_("root preexec"), P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {N_("root preexec close"), P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, + {N_("root postexec"), P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {N_("available"), P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {N_("volume"), P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, + {N_("fstype"), P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, + {N_("set directory"), P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, + {N_("source environment"), P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, + {N_("wide links"), P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("follow symlinks"), P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("dont descend"), P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, + {N_("magic script"), P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, + {N_("magic output"), P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, + {N_("delete readonly"), P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("dos filemode"), P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("dos filetimes"), P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("dos filetime resolution"), P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + + {N_("fake directory create times"), P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {N_("panic action"), P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {N_("hide local users"), P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, 0}, - {"VFS options", P_SEP, P_SEPARATOR}, + {N_("VFS options"), P_SEP, P_SEPARATOR}, - {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, - {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, + {N_("vfs object"), P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, + {N_("vfs options"), P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, - {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, - - {"Winbind options", P_SEP, P_SEPARATOR}, - - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, - {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, - {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, - {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, - {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, - {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, + {N_("msdfs root"), P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, + {N_("host msdfs"), P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, + + {N_("Winbind options"), P_SEP, P_SEPARATOR}, + + {N_("winbind uid"), P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, + {N_("winbind gid"), P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, + {N_("template homedir"), P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, + {N_("template shell"), P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, + {N_("winbind separator"), P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, + {N_("winbind cache time"), P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, + {N_("winbind enum users"), P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, + {N_("winbind enum groups"), P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; -- cgit From 6ddcd8a3bcef32694d9d753ff91cced71f5ca3a8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 25 Sep 2001 20:21:21 +0000 Subject: Fixup passdb stuff to add new nisplus and ldap backends. Jeremy. (This used to be commit 611bf806d569b70edabbc04a2f5408142370a550) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9b0759b2d5..9366af5e78 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3763,3 +3763,12 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) return True; } + +/**************************************************************** + Compatibility fn. for 2.2.2 code..... +*****************************************************************/ + +void get_private_directory(pstring privdir) +{ + pstrcpy (privdir, lp_private_dir()); +} -- cgit From 2c4d1d39b148b8587deb8fca2db4113354165989 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 26 Sep 2001 17:29:53 +0000 Subject: OpenSSL merge from 2.2 (This used to be commit efc6df5a3914da9e7b792ccaccd1403c72c09f78) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9366af5e78..bf0b941545 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -215,6 +215,9 @@ typedef struct char *sslClientCert; char *sslClientPrivKey; char *sslCiphers; + char *sslEgdSocket; + char *sslEntropyFile; + int sslEntropyBytes; BOOL sslEnabled; BOOL sslReqClientCert; BOOL sslReqServerCert; @@ -744,6 +747,9 @@ static struct parm_struct parm_table[] = { {N_("ssl server key"), P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0}, {N_("ssl client cert"), P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, {N_("ssl client key"), P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, + {N_("ssl egd socket"), P_STRING, P_GLOBAL, &Globals.sslEgdSocket, NULL, NULL, 0}, + {N_("ssl entropy file"), P_STRING, P_GLOBAL, &Globals.sslEntropyFile, NULL, NULL, 0}, + {N_("ssl entropy bytes"), P_INTEGER, P_GLOBAL, &Globals.sslEntropyBytes, NULL, NULL, 0}, {N_("ssl require clientcert"), P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, {N_("ssl require servercert"), P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, {N_("ssl ciphers"), P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, @@ -1311,6 +1317,9 @@ static void init_globals(void) string_set(&Globals.sslClientCert, ""); string_set(&Globals.sslClientPrivKey, ""); string_set(&Globals.sslCiphers, ""); + string_set(&Globals.sslEgdSocket, ""); + string_set(&Globals.sslEntropyFile, ""); + Globals.sslEntropyBytes = 256; Globals.sslEnabled = False; Globals.sslReqClientCert = False; Globals.sslReqServerCert = False; @@ -1519,6 +1528,9 @@ FN_GLOBAL_STRING(lp_ssl_privkey, &Globals.sslPrivKey) FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert) FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey) FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers) +FN_GLOBAL_STRING(lp_ssl_egdsocket, &Globals.sslEgdSocket) +FN_GLOBAL_STRING(lp_ssl_entropyfile, &Globals.sslEntropyFile) +FN_GLOBAL_INTEGER(lp_ssl_entropybytes, &Globals.sslEntropyBytes) FN_GLOBAL_BOOL(lp_ssl_enabled, &Globals.sslEnabled) FN_GLOBAL_BOOL(lp_ssl_reqClientCert, &Globals.sslReqClientCert) FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert) -- cgit From dc1fc3ee8ec2199bc73bb5d7ec711c6800f61d65 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 2 Oct 2001 04:29:50 +0000 Subject: Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e) --- source3/param/params.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index d12081fb32..7aceb1b9da 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -98,8 +98,6 @@ * bSize - The size of the global buffer . */ -extern int DEBUGLEVEL; - static char *bufr = NULL; static int bSize = 0; -- cgit From cf167fe3c5890986caea50ef2ddfabf257749058 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 11 Oct 2001 16:44:17 +0000 Subject: merge from 2.2 (This used to be commit 062bba07f2faedfce7612c8b4a16072fa200349e) --- source3/param/loadparm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bf0b941545..63bc16e394 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -210,8 +210,8 @@ typedef struct char **sslHostsResign; char *sslCaCertDir; char *sslCaCertFile; - char *sslCert; - char *sslPrivKey; + char *sslServerCert; + char *sslServerPrivKey; char *sslClientCert; char *sslClientPrivKey; char *sslCiphers; @@ -743,8 +743,8 @@ static struct parm_struct parm_table[] = { {N_("ssl hosts resign"), P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, {N_("ssl CA certDir"), P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, {N_("ssl CA certFile"), P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, - {N_("ssl server cert"), P_STRING, P_GLOBAL, &Globals.sslCert, NULL, NULL, 0}, - {N_("ssl server key"), P_STRING, P_GLOBAL, &Globals.sslPrivKey, NULL, NULL, 0}, + {N_("ssl server cert"), P_STRING, P_GLOBAL, &Globals.sslServerCert, NULL, NULL, 0}, + {N_("ssl server key"), P_STRING, P_GLOBAL, &Globals.sslServerPrivKey, NULL, NULL, 0}, {N_("ssl client cert"), P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, {N_("ssl client key"), P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, {N_("ssl egd socket"), P_STRING, P_GLOBAL, &Globals.sslEgdSocket, NULL, NULL, 0}, @@ -1312,8 +1312,8 @@ static void init_globals(void) Globals.sslHostsResign = NULL; */ string_set(&Globals.sslCaCertDir, ""); string_set(&Globals.sslCaCertFile, ""); - string_set(&Globals.sslCert, ""); - string_set(&Globals.sslPrivKey, ""); + string_set(&Globals.sslServerCert, ""); + string_set(&Globals.sslServerPrivKey, ""); string_set(&Globals.sslClientCert, ""); string_set(&Globals.sslClientPrivKey, ""); string_set(&Globals.sslCiphers, ""); @@ -1523,8 +1523,8 @@ FN_GLOBAL_LIST(lp_ssl_hosts, &Globals.sslHostsRequire) FN_GLOBAL_LIST(lp_ssl_hosts_resign, &Globals.sslHostsResign) FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir) FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile) -FN_GLOBAL_STRING(lp_ssl_cert, &Globals.sslCert) -FN_GLOBAL_STRING(lp_ssl_privkey, &Globals.sslPrivKey) +FN_GLOBAL_STRING(lp_ssl_server_cert, &Globals.sslServerCert) +FN_GLOBAL_STRING(lp_ssl_server_privkey, &Globals.sslServerPrivKey) FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert) FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey) FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers) -- cgit From 812dcab195504301faea7443f1cb900dea57a823 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 12 Oct 2001 22:00:38 +0000 Subject: Made nt acl support a local parameter for w2ksp2 profile fix. Jeremy. (This used to be commit ebba334c15619610475a5c8242a55ed4fcdedf7c) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 63bc16e394..e011f47df6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -254,7 +254,6 @@ typedef struct BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; - BOOL bNTAclSupport; BOOL bStatCache; BOOL bKernelOplocks; BOOL bAllowTrustedDomains; @@ -388,6 +387,7 @@ typedef struct BOOL bInheritPerms; BOOL bMSDfsRoot; BOOL bUseClientDriver; + BOOL bNTAclSupport; char dummy[3]; /* for alignment */ } @@ -502,6 +502,7 @@ static service sDefault = { False, /* bInheritPerms */ False, /* bMSDfsRoot */ False, /* bUseClientDriver */ + True, /* bNTAclSupport */ "" /* dummy */ }; @@ -783,7 +784,7 @@ static struct parm_struct parm_table[] = { {N_("write raw"), P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, {N_("nt pipe support"), P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {N_("nt acl support"), P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0}, + {N_("nt acl support"), P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, 0}, {N_("announce version"), P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {N_("announce as"), P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {N_("max mux"), P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -1280,7 +1281,6 @@ static void init_globals(void) Globals.bPasswdChatDebug = False; Globals.bUnicode = True; /* Do unicode on the wire by default */ Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ - Globals.bNTAclSupport = True; /* Use NT ACLs by default. */ Globals.bStatCache = True; /* use stat cache by default */ Globals.bRestrictAnonymous = False; Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ @@ -1570,7 +1570,6 @@ FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) FN_GLOBAL_BOOL(lp_unicode, &Globals.bUnicode) FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport) -FN_GLOBAL_BOOL(lp_nt_acl_support, &Globals.bNTAclSupport) FN_GLOBAL_BOOL(lp_stat_cache, &Globals.bStatCache) FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) @@ -1699,6 +1698,7 @@ FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) +FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From a689b24db14436ab1faa2f2f79b9f27b777b1fdb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Oct 2001 12:10:29 +0000 Subject: the next step in the intl changeover. This should get us compiling agian, and also completes the switch to lang_tdb.c. SWAT should now work with a po file in the lib/ directory also removed useless SYSLOG defines in many files (This used to be commit 5296b20ad85d7519c870768455cb4d8df048c55a) --- source3/param/loadparm.c | 683 +++++++++++++++++++++++------------------------ 1 file changed, 341 insertions(+), 342 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e011f47df6..8b1c9494a3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -50,7 +50,6 @@ */ #include "includes.h" -#include "webintl.h" BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; @@ -642,398 +641,398 @@ static struct enum_list enum_ssl_version[] = { /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { - {N_("Base Options"), P_SEP, P_SEPARATOR}, - - {N_("dos charset"), P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, - {N_("unix charset"), P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, - {N_("display charset"), P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, - {N_("comment"), P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("path"), P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("directory"), P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, - {N_("workgroup"), P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, - {N_("netbios name"), P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, - {N_("netbios aliases"), P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, - {N_("netbios scope"), P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, - {N_("server string"), P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, - {N_("interfaces"), P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, - {N_("bind interfaces only"), P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, - - {N_("Security Options"), P_SEP, P_SEPARATOR}, + {"Base Options", P_SEP, P_SEPARATOR}, + + {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, + {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, + {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, + {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, + {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, + {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, + + {"Security Options", P_SEP, P_SEPARATOR}, - {N_("security"), P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, - {N_("encrypt passwords"), P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, - {N_("update encrypted"), P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {N_("allow trusted domains"), P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, - {N_("alternate permissions"), P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, - {N_("hosts equiv"), P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, - {N_("min passwd length"), P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {N_("min password length"), P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {N_("map to guest"), P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, - {N_("null passwords"), P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, - {N_("obey pam restrictions"), P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, - {N_("password server"), P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, - {N_("smb passwd file"), P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, - {N_("private dir"), P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, - {N_("passdb module path"), P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, - {N_("root directory"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {N_("root dir"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {N_("root"), P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, + {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, + {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, + {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, + {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, + {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, + {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, + {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {N_("pam password change"), P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, - {N_("passwd program"), P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, - {N_("passwd chat"), P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, - {N_("passwd chat debug"), P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, - {N_("username map"), P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, - {N_("password level"), P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, - {N_("username level"), P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, - {N_("unix password sync"), P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {N_("restrict anonymous"), P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, - {N_("lanman auth"), P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, - {N_("ntlm auth"), P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, - {N_("plaintext to smbpasswd"), P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, - {N_("use rhosts"), P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, + {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, + {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, + {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, + {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, + {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, + {"plaintext to smbpasswd", P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, + {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, - {N_("username"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("user"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {N_("users"), P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {N_("guest account"), P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, - {N_("invalid users"), P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("valid users"), P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("admin users"), P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("read list"), P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("write list"), P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("printer admin"), P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, - {N_("force user"), P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, - {N_("force group"), P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, - {N_("group"), P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, + {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, - {N_("read only"), P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, - {N_("write ok"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {N_("writeable"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {N_("writable"), P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {N_("create mask"), P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("create mode"), P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, - {N_("force create mode"), P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("security mask"), P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("force security mode"), P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("directory mask"), P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("directory mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, - {N_("force directory mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("directory security mask"), P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("force directory security mode"), P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {N_("inherit permissions"), P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, - {N_("guest only"), P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, - {N_("only guest"), P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, - - {N_("guest ok"), P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("public"), P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, + {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, + {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, + {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, + {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, - {N_("only user"), P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {N_("hosts allow"), P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("allow hosts"), P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {N_("hosts deny"), P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("deny hosts"), P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, + {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, + {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, #ifdef WITH_SSL - {N_("Secure Socket Layer Options"), P_SEP, P_SEPARATOR}, - {N_("ssl"), P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, + {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, + {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, - {N_("ssl hosts"), P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, - {N_("ssl hosts resign"), P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, - {N_("ssl CA certDir"), P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, - {N_("ssl CA certFile"), P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, - {N_("ssl server cert"), P_STRING, P_GLOBAL, &Globals.sslServerCert, NULL, NULL, 0}, - {N_("ssl server key"), P_STRING, P_GLOBAL, &Globals.sslServerPrivKey, NULL, NULL, 0}, - {N_("ssl client cert"), P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, - {N_("ssl client key"), P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, - {N_("ssl egd socket"), P_STRING, P_GLOBAL, &Globals.sslEgdSocket, NULL, NULL, 0}, - {N_("ssl entropy file"), P_STRING, P_GLOBAL, &Globals.sslEntropyFile, NULL, NULL, 0}, - {N_("ssl entropy bytes"), P_INTEGER, P_GLOBAL, &Globals.sslEntropyBytes, NULL, NULL, 0}, - {N_("ssl require clientcert"), P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, - {N_("ssl require servercert"), P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, - {N_("ssl ciphers"), P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, - {N_("ssl version"), P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, - {N_("ssl compatibility"), P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, + {"ssl hosts", P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, + {"ssl hosts resign", P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, + {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, + {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, + {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslServerCert, NULL, NULL, 0}, + {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslServerPrivKey, NULL, NULL, 0}, + {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, + {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, + {"ssl egd socket", P_STRING, P_GLOBAL, &Globals.sslEgdSocket, NULL, NULL, 0}, + {"ssl entropy file", P_STRING, P_GLOBAL, &Globals.sslEntropyFile, NULL, NULL, 0}, + {"ssl entropy bytes", P_INTEGER, P_GLOBAL, &Globals.sslEntropyBytes, NULL, NULL, 0}, + {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, + {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, + {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, + {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, + {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, #endif /* WITH_SSL */ - {N_("Logging Options"), P_SEP, P_SEPARATOR}, - {N_("log level"), P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, - {N_("debuglevel"), P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, - {N_("syslog"), P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, - {N_("syslog only"), P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, - {N_("log file"), P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {"Logging Options", P_SEP, P_SEPARATOR}, + {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, - {N_("max log size"), P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, - {N_("timestamp logs"), P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {N_("debug timestamp"), P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {N_("debug hires timestamp"), P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, - {N_("debug pid"), P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, - {N_("debug uid"), P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, + {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, + {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, + {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, + {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, - {N_("Protocol Options"), P_SEP, P_SEPARATOR}, + {"Protocol Options", P_SEP, P_SEPARATOR}, - {N_("protocol"), P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {N_("large readwrite"), P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, - {N_("max protocol"), P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {N_("min protocol"), P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, - {N_("unicode"), P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, - {N_("read bmpx"), P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, - {N_("read raw"), P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, - {N_("write raw"), P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, + {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, + {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, + {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {N_("nt pipe support"), P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {N_("nt acl support"), P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, 0}, - {N_("announce version"), P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, - {N_("announce as"), P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, - {N_("max mux"), P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, - {N_("max xmit"), P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, - {N_("name resolve order"), P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, - {N_("max packet"), P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {N_("packet size"), P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {N_("max ttl"), P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - {N_("max wins ttl"), P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, - {N_("min wins ttl"), P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, - {N_("time server"), P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, - - {N_("Tuning Options"), P_SEP, P_SEPARATOR}, + {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, + {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + + {"Tuning Options", P_SEP, P_SEPARATOR}, - {N_("change notify timeout"), P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, - {N_("deadtime"), P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {N_("getwd cache"), P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {N_("keepalive"), P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, - {N_("lpq cache time"), P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {N_("max smbd processes"), P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, - {N_("max connections"), P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, - {N_("paranoid server security"), P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, - {N_("max disk size"), P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {N_("max open files"), P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, - {N_("min print space"), P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, - {N_("read size"), P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, + {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, + {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, + {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, + {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, - {N_("socket options"), P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, - {N_("stat cache size"), P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, - {N_("strict allocate"), P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, - {N_("strict sync"), P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, - {N_("sync always"), P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, - {N_("use mmap"), P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, - {N_("hostname lookups"), P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, - {N_("write cache size"), P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, - - {N_("Printing Options"), P_SEP, P_SEPARATOR}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, + {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, + {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, + {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, + {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, + + {"Printing Options", P_SEP, P_SEPARATOR}, - {N_("total print jobs"), P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, - {N_("max print jobs"), P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, - {N_("load printers"), P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, - {N_("printcap name"), P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, - {N_("printcap"), P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, - {N_("printable"), P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, - {N_("print ok"), P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {N_("postscript"), P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, - {N_("printing"), P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, - {N_("print command"), P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("disable spoolss"), P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("lpq command"), P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("lprm command"), P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("lppause command"), P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("lpresume command"), P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("queuepause command"), P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {N_("queueresume command"), P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - - {N_("enumports command"), P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, - {N_("addprinter command"), P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, - {N_("deleteprinter command"), P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, - {N_("show add printer wizard"), P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, - {N_("os2 driver map"), P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, + {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, + {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, + {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, + {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + + {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, + {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, + {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, + {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, + {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, - {N_("printer name"), P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {N_("printer"), P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, - {N_("use client driver"), P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, - {N_("printer driver"), P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, - {N_("printer driver file"), P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, - {N_("printer driver location"), P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - - {N_("Filename Handling"), P_SEP, P_SEPARATOR}, - {N_("strip dot"), P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, + {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + + {"Filename Handling", P_SEP, P_SEPARATOR}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {N_("mangled stack"), P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, - {N_("default case"), P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, - {N_("case sensitive"), P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("casesignames"), P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, - {N_("preserve case"), P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("short preserve case"), P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("mangle case"), P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("mangling char"), P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("hide dot files"), P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("hide unreadable"), P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("delete veto files"), P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("veto files"), P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {N_("hide files"), P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {N_("veto oplock files"), P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {N_("map system"), P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("map hidden"), P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("map archive"), P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("mangled names"), P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("mangled map"), P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("stat cache"), P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, - - {N_("Domain Options"), P_SEP, P_SEPARATOR}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, + {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, + + {"Domain Options", P_SEP, P_SEPARATOR}, - {N_("domain admin group"), P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {N_("domain guest group"), P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, + {"domain admin group", P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, + {"domain guest group", P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, #ifdef USING_GROUPNAME_MAP - {N_("groupname map"), P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, + {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, #endif /* USING_GROUPNAME_MAP */ - {N_("machine password timeout"), P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, + {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, - {N_("Logon Options"), P_SEP, P_SEPARATOR}, + {"Logon Options", P_SEP, P_SEPARATOR}, - {N_("add user script"), P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, - {N_("delete user script"), P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, - {N_("add group script"), P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, - {N_("delete group script"), P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, - {N_("add user to group script"), P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, - {N_("delete user from group script"), P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, - {N_("add machine script"), P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, - {N_("shutdown script"), P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, - {N_("abort shutdown script"), P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, - - {N_("logon script"), P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, - {N_("logon path"), P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, - {N_("logon drive"), P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {N_("logon home"), P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, - {N_("domain logons"), P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, - - {N_("Browse Options"), P_SEP, P_SEPARATOR}, + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, + {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, + {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, + {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, + {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, + {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, + {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, + {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, + {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, + + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + + {"Browse Options", P_SEP, P_SEPARATOR}, - {N_("os level"), P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {N_("lm announce"), P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, - {N_("lm interval"), P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {N_("preferred master"), P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {N_("prefered master"), P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, - {N_("local master"), P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {N_("domain master"), P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {N_("browse list"), P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, - {N_("browseable"), P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("browsable"), P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, - {N_("enhanced browsing"), P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, - - {N_("WINS Options"), P_SEP, P_SEPARATOR}, - {N_("dns proxy"), P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {N_("wins proxy"), P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, + {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, + + {"WINS Options", P_SEP, P_SEPARATOR}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {N_("wins server"), P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, - {N_("wins support"), P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, - {N_("wins hook"), P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, + {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, + {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, - {N_("Locking Options"), P_SEP, P_SEPARATOR}, + {"Locking Options", P_SEP, P_SEPARATOR}, - {N_("blocking locks"), P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("fake oplocks"), P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, - {N_("kernel oplocks"), P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, - {N_("locking"), P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, + {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("oplocks"), P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("level2 oplocks"), P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("oplock break wait time"), P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, - {N_("oplock contention limit"), P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("posix locking"), P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("strict locking"), P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("share modes"), P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"oplock break wait time", P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, + {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, #ifdef WITH_LDAP - {N_("Ldap Options"), P_SEP, P_SEPARATOR}, + {"Ldap Options", P_SEP, P_SEPARATOR}, - {N_("ldap server"), P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, - {N_("ldap port"), P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, - {N_("ldap suffix"), P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, - {N_("ldap filter"), P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {N_("ldap root"), P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - {N_("ldap root passwd"), P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, + {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, + {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, + {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, #endif /* WITH_LDAP */ - {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, - {N_("add share command"), P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, - {N_("change share command"), P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, - {N_("delete share command"), P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, + {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, + {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, + {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, - {N_("config file"), P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {N_("preload"), P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {N_("auto services"), P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {N_("lock dir"), P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {N_("lock directory"), P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, #ifdef WITH_UTMP - {N_("utmp directory"), P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - {N_("wtmp directory"), P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, - {N_("utmp"), P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, + {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, + {"utmp"), P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif - {N_("default service"), P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {N_("default"), P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {N_("message command"), P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, - {N_("dfree command"), P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {N_("remote announce"), P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, - {N_("remote browse sync"), P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, - {N_("socket address"), P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, - {N_("homedir map"), P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, - {N_("time offset"), P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {N_("NIS homedir"), P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, - {N_("-valid"), P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, + {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, + {"-valid", P_BOOL, P_LOCAL, &sDefault.valid, NULL, NULL, FLAG_HIDE}, - {N_("copy"), P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL, FLAG_HIDE}, - {N_("include"), P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE}, - {N_("exec"), P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {N_("preexec"), P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {"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_SHARE | FLAG_PRINT}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, - {N_("preexec close"), P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, - {N_("postexec"), P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {N_("root preexec"), P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {N_("root preexec close"), P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, - {N_("root postexec"), P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {N_("available"), P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {N_("volume"), P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, - {N_("fstype"), P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, - {N_("set directory"), P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, - {N_("source environment"), P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, - {N_("wide links"), P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("follow symlinks"), P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("dont descend"), P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, - {N_("magic script"), P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, - {N_("magic output"), P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, - {N_("delete readonly"), P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("dos filemode"), P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("dos filetimes"), P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("dos filetime resolution"), P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - - {N_("fake directory create times"), P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {N_("panic action"), P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, - {N_("hide local users"), P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, + {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, + {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, + {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, + {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, + {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, + {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + + {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, + {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, 0}, - {N_("VFS options"), P_SEP, P_SEPARATOR}, + {"VFS options", P_SEP, P_SEPARATOR}, - {N_("vfs object"), P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, - {N_("vfs options"), P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, + {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, + {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, - {N_("msdfs root"), P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {N_("host msdfs"), P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, - - {N_("Winbind options"), P_SEP, P_SEPARATOR}, - - {N_("winbind uid"), P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, - {N_("winbind gid"), P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, - {N_("template homedir"), P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, - {N_("template shell"), P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, - {N_("winbind separator"), P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, - {N_("winbind cache time"), P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, - {N_("winbind enum users"), P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, - {N_("winbind enum groups"), P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, + + {"Winbind options", P_SEP, P_SEPARATOR}, + + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, + {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, + {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, + {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, + {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, + {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; -- cgit From 189cf0d3a024cabf80c05b33461d0789ceb6e37d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Oct 2001 13:06:30 +0000 Subject: fixed typo (This used to be commit bef729741e5151574710286f7406852981580945) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b1c9494a3..80c9411fb0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -969,7 +969,7 @@ static struct parm_struct parm_table[] = { #ifdef WITH_UTMP {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, - {"utmp"), P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, + {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, #endif {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, -- cgit From b728042334f67738fd1a6fdd03e619bdb78fe06a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Oct 2001 08:54:19 +0000 Subject: added basic NTLMSSP support in smbd. This is still quite rough, and loses things like username mapping. I wanted to get this in then discuss it a bit to see how we want to split up the existing session setup code (This used to be commit b74fda69bf23207c26d8b2af23910d8f2eb89875) --- source3/param/loadparm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 80c9411fb0..f6abda4ac9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -113,6 +113,7 @@ typedef struct char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; + char *szRealm; char **szDomainAdminGroup; char **szDomainGuestGroup; char *szUsernameMap; @@ -650,6 +651,7 @@ static struct parm_struct parm_table[] = { {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, + {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC}, {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, @@ -1198,11 +1200,6 @@ static void init_globals(void) string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szLockDir, LOCKDIR); -#ifdef WITH_UTMP - string_set(&Globals.szUtmpDir, ""); - string_set(&Globals.szWtmpDir, ""); - Globals.bUtmp = False; -#endif string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); pstrcat(s, VERSION); @@ -1465,6 +1462,7 @@ FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver, &Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) +FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) #ifdef USING_GROUPNAME_MAP FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) -- cgit From 6ab678d42b46eccee080de415985a8a1e3c29dc3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 31 Oct 2001 06:22:19 +0000 Subject: Small 'const' updates ahead of some AuthRewrite merging. (This used to be commit 3b5e72bda3263c6bdf81dfface4fae4f06b71032) --- source3/param/loadparm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f6abda4ac9..f9355ed14f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1719,10 +1719,10 @@ FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) static int map_parameter(char *pszParmName); static BOOL set_boolean(BOOL *pb, char *pszParmValue); -static int getservicebyname(char *pszServiceName, - service * pserviceDest); +static int getservicebyname(const char *pszServiceName, + service * pserviceDest); static void copy_service(service * pserviceDest, - service * pserviceSource, BOOL *pcopymapDest); + service * pserviceSource, BOOL *pcopymapDest); static BOOL service_ok(int iService); static BOOL do_parameter(char *pszParmName, char *pszParmValue); static BOOL do_section(char *pszSectionName); @@ -1779,7 +1779,7 @@ static void free_service(service * pservice) add a new service to the services array initialising it with the given service. ***************************************************************************/ -static int add_a_service(service * pservice, char *name) +static int add_a_service(const service * pservice, const char *name) { int i; service tservice; @@ -1843,7 +1843,7 @@ static int add_a_service(service * pservice, char *name) add a new home service, with the specified home directory, defaults coming from service ifrom. ***************************************************************************/ -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) +BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHomedir) { int i = add_a_service(ServicePtrs[iDefaultService], pszHomename); @@ -1996,7 +1996,7 @@ static BOOL set_boolean(BOOL *pb, char *pszParmValue) /*************************************************************************** Find a service by name. Otherwise works like get_service. ***************************************************************************/ -static int getservicebyname(char *pszServiceName, service * pserviceDest) +static int getservicebyname(const char *pszServiceName, service * pserviceDest) { int iService; @@ -3353,7 +3353,7 @@ exist. Note that this is a DIFFERENT ANIMAL from the internal function getservicebyname()! This works ONLY if all services have been loaded, and does not copy the found service. ***************************************************************************/ -int lp_servicenumber(char *pszServiceName) +int lp_servicenumber(const char *pszServiceName) { int iService; -- cgit From e9ba1dff09968c4fcbf701e194517356c701d65e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 5 Nov 2001 05:28:03 +0000 Subject: old merge from 2.2 (This used to be commit 292a0265a9de7f5fa06140768ecf27056d59f6c1) --- source3/param/loadparm.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f9355ed14f..cf5f31953d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1845,7 +1845,15 @@ from service ifrom. ***************************************************************************/ BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHomedir) { - int i = add_a_service(ServicePtrs[iDefaultService], pszHomename); + int i; + SMB_STRUCT_STAT buf; + + /* if the user's home directory doesn't exist, then don't + add it to the list of available shares */ + if (sys_stat(pszHomedir, &buf)) + return False; + + i = add_a_service(ServicePtrs[iDefaultService], pszHomename); if (i < 0) return (False); @@ -3356,15 +3364,26 @@ does not copy the found service. int lp_servicenumber(const char *pszServiceName) { int iService; - + fstring serviceName; + + for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && ServicePtrs[iService]->szService && - strequal(ServicePtrs[iService]->szService, pszServiceName)) - break; + { + if (VALID(iService) && ServicePtrs[iService]->szService) + { + /* + * The substitution here is used to support %U is + * service names + */ + fstrcpy(serviceName, ServicePtrs[iService]->szService); + standard_sub_basic(serviceName); + if (strequal(serviceName, pszServiceName)) + break; + } + } + if (iService < 0) - DEBUG(7, - ("lp_servicenumber: couldn't find %s\n", - pszServiceName)); + DEBUG(7,("lp_servicenumber: couldn't find %s\n", pszServiceName)); return (iService); } -- cgit From 395aa946cd4fb9d5e07dd2fee418045a8064dfab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 9 Nov 2001 11:16:06 +0000 Subject: This change updates lp_guestaccount() to be a *global* paramater, rather than per-share. I beleive that almost all the things that this could have done on a per-share basis can be done with other tools, like 'force user'. Almost all the user's of this paramater used it as a global anyway... While this is one step at a time, I hope it will allow me to considerably simplfy the make_connection() code, particularly for the user-level security case. This already removes an absolute truckload of extra attempted password lookups on the guest account. Andrew Bartlett (This used to be commit 8e708332eded210c1d1fe0cebca3c9c19f054b71) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cf5f31953d..f1ee1803f3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -166,6 +166,7 @@ typedef struct char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; + char *szGuestaccount; int max_log_size; int mangled_stack; int max_xmit; @@ -286,7 +287,6 @@ typedef struct char *szService; char *szPath; char *szUsername; - char *szGuestaccount; char **szInvalidUsers; char **szValidUsers; char **szAdminUsers; @@ -401,7 +401,6 @@ static service sDefault = { NULL, /* szService */ NULL, /* szPath */ NULL, /* szUsername */ - NULL, /* szGuestAccount - this is set in init_globals() */ NULL, /* szInvalidUsers */ NULL, /* szValidUsers */ NULL, /* szAdminUsers */ @@ -679,6 +678,7 @@ static struct parm_struct parm_table[] = { {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, + {"guest account", P_STRING, P_GLOBAL, &Globals.szGuestaccount, NULL, NULL, FLAG_BASIC}, {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, @@ -698,7 +698,6 @@ static struct parm_struct parm_table[] = { {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"guest account", P_STRING, P_LOCAL, &sDefault.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT | FLAG_GLOBAL}, {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, @@ -1177,7 +1176,6 @@ static void init_globals(void) parm_table[i].ptr) string_set(parm_table[i].ptr, ""); - string_set(&sDefault.szGuestaccount, GUEST_ACCOUNT); string_set(&sDefault.fstype, FSTYPE_STRING); init_printer_values(); @@ -1191,6 +1189,8 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, PRIVATE_DIR); string_set(&Globals.szPassdbModulePath, ""); + + string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); /* * Allow the default PASSWD_CHAT to be overridden in local.h. @@ -1483,6 +1483,7 @@ FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) +FN_GLOBAL_STRING(lp_guestaccount, &Globals.szGuestaccount) FN_GLOBAL_STRING(lp_addgroup_script, &Globals.szAddGroupScript) FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) @@ -1620,7 +1621,6 @@ FN_LOCAL_STRING(lp_servicename, szService) FN_LOCAL_STRING(lp_pathname, szPath) FN_LOCAL_STRING(lp_dontdescend, szDontdescend) FN_LOCAL_STRING(lp_username, szUsername) -FN_LOCAL_STRING(lp_guestaccount, szGuestaccount) FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers) FN_LOCAL_LIST(lp_valid_users, szValidUsers) FN_LOCAL_LIST(lp_admin_users, szAdminUsers) -- cgit From caef2d2884fb202bd6184f9a676ecff94c7ab600 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 19 Nov 2001 03:35:27 +0000 Subject: LIBDIR and LOCKDIR are dynamically configured too. (This used to be commit 868999ad3c82ad72f11d5b3208b0e42b1ed95096) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f1ee1803f3..931e07b37c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1199,7 +1199,7 @@ static void init_globals(void) string_set(&Globals.szWorkGroup, WORKGROUP); string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); - string_set(&Globals.szLockDir, LOCKDIR); + string_set(&Globals.szLockDir, dyn_LOCKDIR); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); pstrcat(s, VERSION); -- cgit From 788379830166313922fa6cb56f789a6754e27614 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 19 Nov 2001 05:49:20 +0000 Subject: Move all other paths into dynconfig (This used to be commit d51ef6bfa3d194b58c3ee7706a7d475ef042676d) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 931e07b37c..3f781be67f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1045,7 +1045,7 @@ Initialise the sDefault parameter structure for the printer values. static void init_printer_values(void) { string_set(&sDefault.szPrinterDriver, ""); - string_set(&sDefault.szDriverFile, DRIVERFILE); + string_set(&sDefault.szDriverFile, dyn_DRIVERFILE); /* choose defaults depending on the type of printing */ switch (sDefault.iPrinting) @@ -1186,8 +1186,8 @@ static void init_globals(void) DEBUG(3, ("Initialising global parameters\n")); - string_set(&Globals.szSMBPasswdFile, SMB_PASSWD_FILE); - string_set(&Globals.szPrivateDir, PRIVATE_DIR); + string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); + string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); string_set(&Globals.szPassdbModulePath, ""); string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); -- cgit From d0a2faf78d316fec200497f5f7997df4c477a1e1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 24 Nov 2001 12:12:38 +0000 Subject: This is another rather major change to the samba authenticaion subystem. The particular aim is to modularized the interface - so that we can have arbitrary password back-ends. This code adds one such back-end, a 'winbind' module to authenticate against the winbind_auth_crap functionality. While fully-functional this code is mainly useful as a demonstration, because we don't get back the info3 as we would for direct ntdomain authentication. This commit introduced the new 'auth methods' parameter, in the spirit of the 'auth order' discussed on the lists. It is renamed because not all the methods may be consulted, even if previous methods fail - they may not have a suitable challenge for example. Also, we have a 'local' authentication method, for old-style 'unix if plaintext, sam if encrypted' authentication and a 'guest' module to handle guest logins in a single place. While this current design is not ideal, I feel that it does provide a better infrastructure than the current design, and can be built upon. The following parameters have changed: - use rhosts = This has been replaced by the 'rhosts' authentication method, and can be specified like 'auth methods = guest rhosts' - hosts equiv = This needs both this parameter and an 'auth methods' entry to be effective. (auth methods = guest hostsequiv ....) - plaintext to smbpasswd = This is replaced by specifying 'sam' rather than 'local' in the auth methods. The security = parameter is unchanged, and now provides defaults for the 'auth methods' parameter. The available auth methods are: guest rhosts hostsequiv sam (passdb direct hash access) unix (PAM, crypt() etc) local (the combination of the above, based on encryption) smbserver (old security=server) ntdomain (old security=domain) winbind (use winbind to cache DC connections) Assistance in testing, or the production of new and interesting authentication modules is always appreciated. Andrew Bartlett (This used to be commit 8d31eae52a9757739711dbb82035a4dfe6b40c99) --- source3/param/loadparm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3f781be67f..ab17f90a6e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -179,6 +179,7 @@ typedef struct int maxprotocol; int minprotocol; int security; + char **AuthMethods; BOOL paranoid_server_security; int maxdisksize; int lpqcachetime; @@ -238,7 +239,6 @@ typedef struct BOOL bNullPasswords; BOOL bObeyPamRestrictions; BOOL bLoadPrinters; - BOOL bUseRhosts; BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; @@ -261,7 +261,6 @@ typedef struct BOOL bRestrictAnonymous; BOOL bLanmanAuth; BOOL bNTLMAuth; - BOOL bPlaintextToSmbpasswd; BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; @@ -661,6 +660,7 @@ static struct parm_struct parm_table[] = { {"Security Options", P_SEP, P_SEPARATOR}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, + {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC}, {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, @@ -691,8 +691,6 @@ static struct parm_struct parm_table[] = { {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, - {"plaintext to smbpasswd", P_BOOL, P_GLOBAL, &Globals.bPlaintextToSmbpasswd, NULL, NULL, 0}, - {"use rhosts", P_BOOL, P_GLOBAL, &Globals.bUseRhosts, NULL, NULL, 0}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, @@ -1191,7 +1189,7 @@ static void init_globals(void) string_set(&Globals.szPassdbModulePath, ""); string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); - + /* * Allow the default PASSWD_CHAT to be overridden in local.h. */ @@ -1218,7 +1216,6 @@ static void init_globals(void) string_set(&Globals.szNameResolveOrder, "lmhosts wins host bcast"); Globals.bLoadPrinters = True; - Globals.bUseRhosts = False; Globals.max_packet = 65535; Globals.mangled_stack = 50; Globals.max_xmit = 65535; @@ -1281,7 +1278,6 @@ static void init_globals(void) Globals.bRestrictAnonymous = False; Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ - Globals.bPlaintextToSmbpasswd = False; /* Check the passwords with smbpasswd, even if in plaintext */ Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ @@ -1543,7 +1539,6 @@ FN_GLOBAL_BOOL(lp_wins_proxy, &Globals.bWINSproxy) 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_use_rhosts, &Globals.bUseRhosts) FN_GLOBAL_BOOL(lp_readprediction, &Globals.bReadPrediction) FN_GLOBAL_BOOL(lp_readbmpx, &Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw) @@ -1573,7 +1568,6 @@ FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_ntlm_auth, &Globals.bNTLMAuth) -FN_GLOBAL_BOOL(lp_plaintext_to_smbpasswd, &Globals.bPlaintextToSmbpasswd) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) @@ -1594,6 +1588,7 @@ FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime) FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) +FN_GLOBAL_LIST(lp_auth_methods, &Globals.AuthMethods) FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) -- cgit From ad2974cd05b4d08c8b92f505bf95aa8e8533235f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 24 Nov 2001 14:16:41 +0000 Subject: added "net join" command this completes the first stage of the smbd ADS support (This used to be commit 058a5aee901e6609969ef7e1d482a720a84a4a12) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ab17f90a6e..548dd83769 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -114,6 +114,7 @@ typedef struct char *szSocketOptions; char *szWorkGroup; char *szRealm; + char *szADSserver; char **szDomainAdminGroup; char **szDomainGuestGroup; char *szUsernameMap; @@ -650,6 +651,7 @@ static struct parm_struct parm_table[] = { {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC}, + {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC}, {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, @@ -1459,6 +1461,7 @@ FN_GLOBAL_STRING(lp_passwordserver, &Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) +FN_GLOBAL_STRING(lp_ads_server, &Globals.szADSserver) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) #ifdef USING_GROUPNAME_MAP FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) -- cgit From 481c644b7b32aa876c69153760fe8a460eea0e69 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 25 Nov 2001 23:05:13 +0000 Subject: added 'security=ADS' (This used to be commit 5a735a88e472a48cd4329832998dc31c1e230ecb) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 548dd83769..b967c5b63f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -547,6 +547,7 @@ static struct enum_list enum_security[] = { {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, + {SEC_ADS, "ADS"}, {-1, NULL} }; -- cgit From 64dd6c3412f961239ad4c6989aab67250d312c9d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 26 Nov 2001 04:27:51 +0000 Subject: Another merge from appliance-head: in [ug]id_to_sid don't call the winbind function if the id is obviously going to be local. Cleanup of winbind [ug]id parameter handling. (This used to be commit 4ab9ca31a02b3388aa89a00e0390ea9e4c76283a) --- source3/param/loadparm.c | 70 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b967c5b63f..e4e3cfce81 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -525,7 +525,8 @@ static BOOL handle_copy(char *pszParmValue, char **ptr); static BOOL handle_vfs_object(char *pszParmValue, char **ptr); static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); -static BOOL handle_winbind_id(char *pszParmValue, char **ptr); +static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); +static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); @@ -1027,8 +1028,8 @@ static struct parm_struct parm_table[] = { {"Winbind options", P_SEP, P_SEPARATOR}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_id, NULL, 0}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0}, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_uid, NULL, 0}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_gid, NULL, 0}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, @@ -1497,8 +1498,6 @@ FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_LIST(lp_domain_admin_group, &Globals.szDomainAdminGroup) FN_GLOBAL_LIST(lp_domain_guest_group, &Globals.szDomainGuestGroup) -FN_GLOBAL_STRING(lp_winbind_uid, &Globals.szWinbindUID) -FN_GLOBAL_STRING(lp_winbind_gid, &Globals.szWinbindGID) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) @@ -2447,21 +2446,72 @@ static BOOL handle_copy(char *pszParmValue, char **ptr) ***************************************************************************/ -/* Do some simple checks on "winbind [ug]id" parameter value */ +/* Some lp_ routines to return winbind [ug]id information */ -static BOOL handle_winbind_id(char *pszParmValue, char **ptr) +static uid_t winbind_uid_low, winbind_uid_high; +static gid_t winbind_gid_low, winbind_gid_high; + +BOOL lp_winbind_uid(uid_t *low, uid_t *high) +{ + if (winbind_uid_low == 0 || winbind_uid_high == 0) + return False; + + if (low) + *low = winbind_uid_low; + + if (high) + *high = winbind_uid_high; + + return True; +} + +BOOL lp_winbind_gid(gid_t *low, gid_t *high) +{ + if (winbind_gid_low == 0 || winbind_gid_high == 0) + return False; + + if (low) + *low = winbind_gid_low; + + if (high) + *high = winbind_gid_high; + + return True; +} + +/* Do some simple checks on "winbind [ug]id" parameter values */ + +static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) { int low, high; - if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2) - { + if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2 || high < low) return False; - } /* Parse OK */ string_set(ptr, pszParmValue); + winbind_uid_low = low; + winbind_uid_high = high; + + return True; +} + +static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) +{ + gid_t low, high; + + if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2 || high < low) + return False; + + /* Parse OK */ + + string_set(ptr, pszParmValue); + + winbind_gid_low = low; + winbind_gid_high = high; + return True; } -- cgit From 2eb736f2c3cd79f9e00acf901d01445fd3ba7a68 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Nov 2001 06:18:09 +0000 Subject: updated server_role for ADS (This used to be commit 48df0d2b5dee3c010c88587352554220f8b92b0f) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e4e3cfce81..393c4a74a2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3265,6 +3265,7 @@ static void set_server_role(void) } case SEC_SERVER: case SEC_DOMAIN: + case SEC_ADS: { if (lp_domain_logons()) { -- cgit From 4499007e45637f172c4afb0ec2e048cf795a3cbe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 26 Nov 2001 06:47:04 +0000 Subject: A number of things to clean up the auth subsytem a bit... We now default encrypt passwords = yes We now check plaintext passwords (however aquired) with the 'sam' backend rather than unix, if encrypt passwords = yes. (this kills off the 'local' backed. The sam backend may be renamed in its place) The new 'samstrict' wrapper backend checks that the user's domain is one of our netbios aliases - this ensures that we don't get fallback crazies with security = domain. Similarly, the code in the 'ntdomain' and 'smbserver' backends now checks that the user was not local before contacting the DC. The default ordering has changed, we now check the local stuff first - but becouse of the changes above, we will really only ever contact one auth source. Andrew Bartlett (This used to be commit e89b47f65e7eaf5eb288a3d6ba2d3d115c628e7e) --- source3/param/loadparm.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 393c4a74a2..9d8a4abc5e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1238,7 +1238,7 @@ static void init_globals(void) Globals.minprotocol = PROTOCOL_CORE; Globals.security = SEC_USER; Globals.paranoid_server_security = True; - Globals.bEncryptPasswords = False; + Globals.bEncryptPasswords = True; Globals.bUpdateEncrypt = False; Globals.bReadRaw = True; Globals.bWriteRaw = True; @@ -3850,3 +3850,29 @@ void get_private_directory(pstring privdir) { pstrcpy (privdir, lp_private_dir()); } + + +/**************************************************************** + Is netbios alias or name +*****************************************************************/ + +BOOL is_netbios_alias_or_name(char *name) +{ + char **netbios_aliases = lp_netbios_aliases(); + + if (StrCaseCmp(name, global_myname) == 0) { + return True; + } + + for (netbios_aliases = lp_netbios_aliases(); + netbios_aliases && *netbios_aliases; + netbios_aliases++) { + if (StrCaseCmp(name, *netbios_aliases) == 0) { + return True; + } + } + + return False; +} + + -- cgit From f3bffe143c7987d423db6a7695aaabeb1bf7f6ee Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Sat, 1 Dec 2001 23:53:32 +0000 Subject: removed the #ifdef USING_GROUPNAME_MAP/#endif blocks that GROUPNAME_MAP has never been used. I'll delete the smbd/groupname.c file too J.F. (This used to be commit 2285e98f205752ec801d11b4bb9afa33e768fd93) --- source3/param/loadparm.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9d8a4abc5e..dd7cb49ac9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -118,9 +118,6 @@ typedef struct char **szDomainAdminGroup; char **szDomainGuestGroup; char *szUsernameMap; -#ifdef USING_GROUPNAME_MAP - char *szGroupnameMap; -#endif /* USING_GROUPNAME_MAP */ char *szLogonScript; char *szLogonPath; char *szLogonDrive; @@ -886,10 +883,6 @@ static struct parm_struct parm_table[] = { {"domain admin group", P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, {"domain guest group", P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, - -#ifdef USING_GROUPNAME_MAP - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, -#endif /* USING_GROUPNAME_MAP */ {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, @@ -1465,9 +1458,6 @@ FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) FN_GLOBAL_STRING(lp_ads_server, &Globals.szADSserver) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) -#ifdef USING_GROUPNAME_MAP -FN_GLOBAL_STRING(lp_groupname_map, &Globals.szGroupnameMap) -#endif /* USING_GROUPNAME_MAP */ FN_GLOBAL_STRING(lp_logon_script, &Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path, &Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive, &Globals.szLogonDrive) -- cgit From e0066d2dd4d9a657d1fbcb474e66a304a64e2a31 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Thu, 6 Dec 2001 13:09:15 +0000 Subject: again an intrusive patch: - removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the definition of standard_sub_basic() to cope with that. - removed the smb.conf: 'domain admin group' and 'domain guest group' parameters ! We're not playing anymore with the user's group RIDs ! - in get_domain_user_groups(), if the user's gid is a group, put it first in the group RID list. I just have to write an HOWTO now ;-) J.F. (This used to be commit fef52c4b96c987115fb1818c00c2352c67790e50) --- source3/param/loadparm.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dd7cb49ac9..038ccea782 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -54,6 +54,7 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; +extern userdom_struct current_user_info; extern int DEBUGLEVEL_CLASS[DBGC_LAST]; extern pstring user_socket_options; extern pstring global_myname; @@ -115,8 +116,6 @@ typedef struct char *szWorkGroup; char *szRealm; char *szADSserver; - char **szDomainAdminGroup; - char **szDomainGuestGroup; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -881,13 +880,10 @@ static struct parm_struct parm_table[] = { {"Domain Options", P_SEP, P_SEPARATOR}, - {"domain admin group", P_LIST, P_GLOBAL, &Globals.szDomainAdminGroup, NULL, NULL, 0}, - {"domain guest group", P_LIST, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, - + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, @@ -1391,7 +1387,7 @@ static char *lp_string(const char *s) trim_string(ret, "\"", "\""); - standard_sub_basic(ret); + standard_sub_basic(current_user_info.smb_name,ret); return (ret); } @@ -1486,8 +1482,6 @@ FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript) FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) -FN_GLOBAL_LIST(lp_domain_admin_group, &Globals.szDomainAdminGroup) -FN_GLOBAL_LIST(lp_domain_guest_group, &Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) @@ -2189,7 +2183,7 @@ BOOL lp_file_list_changed(void) time_t mod_time; pstrcpy(n2, f->name); - standard_sub_basic(n2); + standard_sub_basic(current_user_info.smb_name, n2); DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", f->name, n2, ctime(&f->modtime))); @@ -2223,7 +2217,7 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) pstrcpy(netbios_name, pszParmValue); - standard_sub_basic(netbios_name); + standard_sub_basic(current_user_info.smb_name, netbios_name); strupper(netbios_name); pstrcpy(global_myname, netbios_name); @@ -2305,7 +2299,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) pstrcpy(fname, pszParmValue); - standard_sub_basic(fname); + standard_sub_basic(current_user_info.smb_name, fname); string_set(ptr, pszParmValue); @@ -2363,7 +2357,7 @@ static BOOL handle_include(char *pszParmValue, char **ptr) pstring fname; pstrcpy(fname, pszParmValue); - standard_sub_basic(fname); + standard_sub_basic(current_user_info.smb_name, fname); add_to_file_list(pszParmValue, fname); @@ -3294,7 +3288,7 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, BOOL bRetval; pstrcpy(n2, pszFname); - standard_sub_basic(n2); + standard_sub_basic(current_user_info.smb_name, n2); add_to_file_list(pszFname, n2); @@ -3416,7 +3410,7 @@ int lp_servicenumber(const char *pszServiceName) * service names */ fstrcpy(serviceName, ServicePtrs[iService]->szService); - standard_sub_basic(serviceName); + standard_sub_basic(current_user_info.smb_name, serviceName); if (strequal(serviceName, pszServiceName)) break; } -- cgit From 99c431695ce723fcdd77c455e8363a355519929b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Dec 2001 01:01:10 +0000 Subject: added a "use spnego" option you need to set "use spnego = no" for w2k to be able to join a samba domain. Otherwise the w2k box will assume we can do kerberos as a KDC (This used to be commit b5cb57a367a6d9a82e082e2838e83e0997eb4930) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 038ccea782..44aa861940 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -266,6 +266,7 @@ typedef struct BOOL bUnicode; BOOL bUseMmap; BOOL bHostnameLookups; + BOOL bUseSpnego; } global; @@ -795,6 +796,7 @@ static struct parm_struct parm_table[] = { {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, @@ -1347,6 +1349,9 @@ static void init_globals(void) Globals.winbind_cache_time = 15; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; + + Globals.bUseSpnego = True; + } static TALLOC_CTX *lp_talloc; @@ -1559,6 +1564,7 @@ FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) +FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups) FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level) FN_GLOBAL_INTEGER(lp_max_ttl, &Globals.max_ttl) -- cgit From 9f59fc64b8c1772b6a73d1649013d2187c298868 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Thu, 13 Dec 2001 18:09:29 +0000 Subject: update the ldap support code. it compiles. Ignacio you can update your howto ;-) samsync: a small patch to try chaning challenges. J.F. (This used to be commit c99bc305599698f2291efbfe20024355cb2bcde0) --- source3/param/loadparm.c | 58 ++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 21 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 44aa861940..8a8123ed18 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -131,11 +131,6 @@ typedef struct char **szNetbiosAliases; char *szDomainOtherSIDs; char *szNameResolveOrder; - char *szLdapServer; - char *szLdapSuffix; - char *szLdapFilter; - char *szLdapRoot; - char *szLdapRootPassword; char *szPanicAction; char *szAddUserScript; char *szDelUserScript; @@ -200,9 +195,14 @@ typedef struct int min_passwd_length; int oplock_break_wait_time; int winbind_cache_time; -#ifdef WITH_LDAP +#ifdef WITH_LDAP_SAM int ldap_port; -#endif /* WITH_LDAP */ + int ldap_ssl; + char *szLdapServer; + char *szLdapSuffix; + char *szLdapFilter; + char *szLdapAdminDn; +#endif /* WITH_LDAP_SAM */ #ifdef WITH_SSL int sslVersion; char **sslHostsRequire; @@ -568,6 +568,21 @@ static struct enum_list enum_printing[] = { {-1, NULL} }; +#ifdef WITH_LDAP_SAM +static struct enum_list enum_ldap_ssl[] = { + {LDAP_SSL_ON, "Yes"}, + {LDAP_SSL_ON, "yes"}, + {LDAP_SSL_ON, "on"}, + {LDAP_SSL_ON, "On"}, + {LDAP_SSL_OFF, "no"}, + {LDAP_SSL_OFF, "No"}, + {LDAP_SSL_OFF, "off"}, + {LDAP_SSL_OFF, "Off"}, + {LDAP_SSL_START_TLS, "start tls"}, + {-1, NULL} +}; +#endif /* WITH_LDAP_SAM */ + /* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT_SERVER 1 #define ANNOUNCE_AS_WIN95 2 @@ -939,16 +954,16 @@ static struct parm_struct parm_table[] = { {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, -#ifdef WITH_LDAP +#ifdef WITH_LDAP_SAM {"Ldap Options", P_SEP, P_SEPARATOR}, {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {"ldap root", P_STRING, P_GLOBAL, &Globals.szLdapRoot, NULL, NULL, 0}, - {"ldap root passwd", P_STRING, P_GLOBAL, &Globals.szLdapRootPassword, NULL, NULL, 0}, -#endif /* WITH_LDAP */ + {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, 0}, + {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 0}, +#endif /* WITH_LDAP_SAM */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, @@ -1287,11 +1302,14 @@ static void init_globals(void) a large number of sites (tridge) */ Globals.bHostnameLookups = False; -#ifdef WITH_LDAP - /* default values for ldap */ +#ifdef WITH_LDAP_SAM string_set(&Globals.szLdapServer, "localhost"); + string_set(&Globals.szLdapSuffix, ""); + string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); + string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_port = 389; -#endif /* WITH_LDAP */ + Globals.ldap_ssl = LDAP_SSL_OFF; +#endif /* WITH_LDAP_SAM */ #ifdef WITH_SSL Globals.sslVersion = SMB_SSL_V23; @@ -1492,13 +1510,14 @@ FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) -#ifdef WITH_LDAP +#ifdef WITH_LDAP_SAM FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) -FN_GLOBAL_STRING(lp_ldap_root, &Globals.szLdapRoot) -FN_GLOBAL_STRING(lp_ldap_rootpasswd, &Globals.szLdapRootPassword) -#endif /* WITH_LDAP */ +FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) +FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) +FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) +#endif /* WITH_LDAP_SAM */ 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) @@ -1598,9 +1617,6 @@ FN_GLOBAL_INTEGER(lp_stat_cache_size, &Globals.stat_cache_size) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) -#ifdef WITH_LDAP -FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) -#endif /* WITH_LDAP */ FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) -- cgit From 89f97bb254ac71b5fff8bf6d703578ac900c7ed1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 20 Dec 2001 09:48:02 +0000 Subject: fixed sscanf() of gid_t values (This used to be commit 102af994de6bbfbe94f13c1880fc31c6414c9f8e) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8a8123ed18..f88361f7ab 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2489,9 +2489,9 @@ BOOL lp_winbind_gid(gid_t *low, gid_t *high) static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) { - int low, high; + uint32 low, high; - if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2 || high < low) + if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) return False; /* Parse OK */ @@ -2506,9 +2506,9 @@ static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) { - gid_t low, high; + uint32 low, high; - if (sscanf(pszParmValue, "%d-%d", &low, &high) != 2 || high < low) + if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) return False; /* Parse OK */ -- cgit From 0eedf59a4721d14df09e295290705b8025cdd827 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 20 Dec 2001 10:04:32 +0000 Subject: fixed more warnings on irix (This used to be commit 2ffefba86997c9d6bc2a9b6dac1e576f4b64c777) --- source3/param/params.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 7aceb1b9da..bc93a1fedf 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -191,10 +191,10 @@ static int EatComment( myFILE *InFile ) * *****************************************************************************/ -static int Continuation( char *line, int pos ) +static int Continuation(char *line, int pos ) { pos--; - while( (pos >= 0) && isspace(line[pos]) ) + while( (pos >= 0) && isspace((int)line[pos])) pos--; return (((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); @@ -425,7 +425,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) c = 0; else { - for( end = i; (end >= 0) && isspace(bufr[end]); end-- ) + for( end = i; (end >= 0) && isspace((int)bufr[end]); end-- ) ; c = mygetc( InFile ); } -- cgit From 9ed10f83d76eba1c4d4ac19842314f24db1c7a65 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Dec 2001 22:27:05 +0000 Subject: Removed global debugf. Replaced with lp_set_logfile(name). Fixed winbindd to finally stop leaving log. file droppings :-). Jeremy. (This used to be commit 0bea6cf79a44f79fa3a4f2c8381e898e79c66509) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f88361f7ab..335995b0dd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3881,4 +3881,13 @@ BOOL is_netbios_alias_or_name(char *name) return False; } +/*********************************************************** + Allow daemons such as winbindd to fix their logfile name. +************************************************************/ +void lp_set_logfile(const char *name) +{ + extern pstring debugf; + pstrcpy(Globals.szLogFile, name); + pstrcpy(debugf, name); +} -- cgit From f6e6c678ad5338264496de43e9e1ab2fe4a28e64 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 30 Dec 2001 10:54:58 +0000 Subject: Add a pile of doxygen style comments to various parts of Samba. Many of these probably will never actually be genearted, but I like the style in any case. Also fix a segfault in 'net rpc' when the login failed and a small memory leak on failure in the auth_info.c code. Andrew Bartlett (This used to be commit 2efae7cc522651c22fb120835bc800645559b63e) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 335995b0dd..d1448df8d3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3862,7 +3862,7 @@ void get_private_directory(pstring privdir) Is netbios alias or name *****************************************************************/ -BOOL is_netbios_alias_or_name(char *name) +BOOL is_netbios_alias_or_name(const char *name) { char **netbios_aliases = lp_netbios_aliases(); -- cgit From 93913173eecdcc89bdb882a824a2b312fa920b69 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 2 Jan 2002 22:44:15 +0000 Subject: sync up ldap defaults with 2.2 (This used to be commit 59174310d419aa835031c7a318d85fe25ba28227) --- source3/param/loadparm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d1448df8d3..724d10c2fa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -579,6 +579,7 @@ static struct enum_list enum_ldap_ssl[] = { {LDAP_SSL_OFF, "off"}, {LDAP_SSL_OFF, "Off"}, {LDAP_SSL_START_TLS, "start tls"}, + {LDAP_SSL_START_TLS, "start_tls"}, {-1, NULL} }; #endif /* WITH_LDAP_SAM */ @@ -1307,8 +1308,8 @@ static void init_globals(void) string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); - Globals.ldap_port = 389; - Globals.ldap_ssl = LDAP_SSL_OFF; + Globals.ldap_port = 636; + Globals.ldap_ssl = LDAP_SSL_ON; #endif /* WITH_LDAP_SAM */ #ifdef WITH_SSL -- cgit From 0b66e623f22655d43361a8f1cd2e535416670ade Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 3 Jan 2002 05:57:21 +0000 Subject: Put a name on lp_talloc pool (This used to be commit 472121749460a73f684bdbd02b828e89fad101af) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 724d10c2fa..01e5fb27aa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1397,7 +1397,7 @@ static char *lp_string(const char *s) char *ret; if (!lp_talloc) - lp_talloc = talloc_init(); + lp_talloc = talloc_init_named("lp_talloc"); ret = (char *)talloc(lp_talloc, len + 100); /* leave room for substitution */ -- cgit From 4702494dce15d4158fd17720d843ff5211ce1715 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Jan 2002 00:46:56 +0000 Subject: Added get_called_name() function, which replaces global_myname in printing code (one less global, hurrah !) - to allow NetBIOS aliasing to be used with point and print. Jeremy. (This used to be commit 10d72f0b01e5950c667f3f73dff1b4da5b675ea3) --- source3/param/loadparm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 01e5fb27aa..c900e99af4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3892,3 +3892,13 @@ void lp_set_logfile(const char *name) pstrcpy(Globals.szLogFile, name); pstrcpy(debugf, name); } + +/******************************************************************* + Return the NetBIOS called name. +********************************************************************/ + +const char *get_called_name(void) +{ + extern fstring local_machine; + return (*local_machine) ? local_machine : global_myname; +} -- cgit From bf22d9cca88498134316a2fa435e26182e5e4dd1 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 9 Jan 2002 04:17:24 +0000 Subject: For hysterical raisins you must use string_set() to set the value of a string in the loadparam Globals struct. Using pstrcpy was causing every NULL string was being set to the name of the winbindd log file. (-: (This used to be commit 24bae9f05523a7c85bf1988d349149ebeb5067f0) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c900e99af4..0f32787b12 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3889,7 +3889,7 @@ BOOL is_netbios_alias_or_name(const char *name) void lp_set_logfile(const char *name) { extern pstring debugf; - pstrcpy(Globals.szLogFile, name); + string_set(&Globals.szLogFile, name); pstrcpy(debugf, name); } -- cgit From 9964e1f9667d81fd9d85adb57586e31fc0e5cfbb Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Tue, 15 Jan 2002 01:38:05 +0000 Subject: Add constness to parameters (This used to be commit a61abaec063d00afe13ce0baa356245fb6e21bc0) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0f32787b12..461fd8f05e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2156,7 +2156,7 @@ static struct file_lists keep a linked list of all config files so we know when one has changed it's date and needs to be reloaded ********************************************************************/ -static void add_to_file_list(char *fname, char *subfname) +static void add_to_file_list(const char *fname, const char *subfname) { struct file_lists *f = file_lists; @@ -3304,7 +3304,7 @@ static void set_server_role(void) Load the services array from the services file. Return True on success, False on failure. ***************************************************************************/ -BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults, +BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, BOOL add_ipc) { pstring n2; -- cgit From fed604bfa368a2bb1fed414e368d491e4c7d7005 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 16 Jan 2002 02:42:07 +0000 Subject: Roll back PSTRING_SANCTIFY patch; just leave non-controversial type and constness changes. (This used to be commit cee0ec72746122c962e6c5278a736266a7f2c424) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 461fd8f05e..f6771b85d9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1885,7 +1885,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHo /*************************************************************************** add a new service, based on an old one. ***************************************************************************/ -int lp_add_service(char *pszService, int iDefaultService) +int lp_add_service(const char *pszService, int iDefaultService) { return (add_a_service(ServicePtrs[iDefaultService], pszService)); } -- cgit From 08019e8a337c5e378ec9dfc70698adb73b9b7676 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Jan 2002 23:53:10 +0000 Subject: Separate out get_user_home_dir() from get_user_home_service_dir(). Jeremy. (This used to be commit c1b97226db63daf64359e79083a4754e7c7f8054) --- source3/param/loadparm.c | 66 +++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 37 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f6771b85d9..d19d20f3f9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3104,15 +3104,16 @@ static void dump_copy_map(BOOL *pcopymap) /*************************************************************************** Return TRUE if the passed service number is within range. ***************************************************************************/ + BOOL lp_snum_ok(int iService) { return (LP_SNUM_OK(iService) && ServicePtrs[iService]->bAvailable); } - /*************************************************************************** -auto-load some home services + Auto-load some home services. ***************************************************************************/ + static void lp_add_auto_services(char *str) { char *s; @@ -3128,34 +3129,30 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); - for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) - { - char *home = get_user_home_dir(p); + for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) { + char *home = get_user_service_home_dir(p); if (lp_servicenumber(p) >= 0) continue; if (home && homes >= 0) - { lp_add_home(p, homes, home); - } } SAFE_FREE(s); } /*************************************************************************** -auto-load one printer + Auto-load one printer. ***************************************************************************/ + void lp_add_one_printer(char *name, char *comment) { int printers = lp_servicenumber(PRINTERS_NAME); int i; - if (lp_servicenumber(name) < 0) - { + if (lp_servicenumber(name) < 0) { lp_add_printer(name, printers); - if ((i = lp_servicenumber(name)) >= 0) - { + if ((i = lp_servicenumber(name)) >= 0) { string_set(&ServicePtrs[i]->comment, comment); ServicePtrs[i]->autoloaded = True; } @@ -3163,59 +3160,57 @@ void lp_add_one_printer(char *name, char *comment) } /*************************************************************************** -have we loaded a services file yet? + Have we loaded a services file yet? ***************************************************************************/ + BOOL lp_loaded(void) { return (bLoaded); } /*************************************************************************** -unload unused services + Unload unused services. ***************************************************************************/ + void lp_killunused(BOOL (*snumused) (int)) { int i; - for (i = 0; i < iNumServices; i++) - { + for (i = 0; i < iNumServices; i++) { if (!VALID(i)) continue; - if (!snumused || !snumused(i)) - { + if (!snumused || !snumused(i)) { ServicePtrs[i]->valid = False; free_service(ServicePtrs[i]); } } } - /*************************************************************************** -unload a service + Unload a service. ***************************************************************************/ + void lp_killservice(int iServiceIn) { - if (VALID(iServiceIn)) - { + if (VALID(iServiceIn)) { ServicePtrs[iServiceIn]->valid = False; free_service(ServicePtrs[iServiceIn]); } } /*************************************************************************** -save the curent values of all global and sDefault parameters into the -defaults union. This allows swat and testparm to show only the -changed (ie. non-default) parameters. + Save the curent values of all global and sDefault parameters into the + defaults union. This allows swat and testparm to show only the + changed (ie. non-default) parameters. ***************************************************************************/ + static void lp_save_defaults(void) { int i; - for (i = 0; parm_table[i].label; i++) - { + for (i = 0; parm_table[i].label; i++) { if (i > 0 && parm_table[i].ptr == parm_table[i - 1].ptr) continue; - switch (parm_table[i].type) - { + switch (parm_table[i].type) { case P_LIST: lp_list_copy(&(parm_table[i].def.lvalue), *(char ***)parm_table[i].ptr); @@ -3255,16 +3250,15 @@ static void lp_save_defaults(void) /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ + static void set_server_role(void) { server_role = ROLE_STANDALONE; - switch (lp_security()) - { + switch (lp_security()) { case SEC_SHARE: { - if (lp_domain_logons()) - { + if (lp_domain_logons()) { DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n")); } @@ -3274,8 +3268,7 @@ static void set_server_role(void) case SEC_DOMAIN: case SEC_ADS: { - if (lp_domain_logons()) - { + if (lp_domain_logons()) { server_role = ROLE_DOMAIN_BDC; break; } @@ -3284,8 +3277,7 @@ static void set_server_role(void) } case SEC_USER: { - if (lp_domain_logons()) - { + if (lp_domain_logons()) { server_role = ROLE_DOMAIN_PDC; break; } -- cgit From 1fb9ccc4e2a91bf7124fba076ffa5458a1cbf404 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 18 Jan 2002 02:37:55 +0000 Subject: This is the 'winbind default domain' patch from Alexander Bokovoy . The idea is the domain\username is rather harsh for unix systems - people don't expect to have to FTP, SSH and (in particular) e-mail with a username like that. This 'corrects' that - but is not without its own problems. As you can see from the changes to files like username.c and wb_client.c (smbd's winbind client code) a lot of assumptions are made in a lot of places about lp_winbind_seperator determining a users's status as a domain or local user. The main change I will shortly be making is to investigate and kill off winbind_initgroups() - as far as I know it was a workaround for an old bug in winbind itself (and a bug in RH 5.2) and should no longer be relevent. I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters to determine a user/groups's 'local' status, rather than the presence of the seperator. As such, this functionality is recommended for servers providing unix services, but is currently less than optimal for windows clients. (TODO: remove all references to lp_winbind_seperator() and lp_winbind_use_default_domain() from smbd) Andrew Bartlett (This used to be commit 07a21fcd2311d2d9b430b99303e3532a8c1159e4) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d19d20f3f9..fce5fcde49 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -155,6 +155,7 @@ typedef struct char *szWinbindSeparator; BOOL bWinbindEnumUsers; BOOL bWinbindEnumGroups; + BOOL bWinbindUseDefaultDomain; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1043,6 +1044,7 @@ static struct parm_struct parm_table[] = { {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, + {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, 0}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1368,6 +1370,7 @@ static void init_globals(void) Globals.winbind_cache_time = 15; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; + Globals.bWinbindUseDefaultDomain = False; Globals.bUseSpnego = True; @@ -1511,6 +1514,7 @@ FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) +FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) #ifdef WITH_LDAP_SAM FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -- cgit From 1a74d8d1f0758d15c5c35d20e33d9868565812cf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 20 Jan 2002 14:30:58 +0000 Subject: This is another *BIG* change... Samba now features a pluggable passdb interface, along the same lines as the one in use in the auth subsystem. In this case, only one backend may be active at a time by the 'normal' interface, and only one backend per passdb_context is permitted outside that. This pluggable interface is designed to allow any number of passdb backends to be compiled in, with the selection at runtime. The 'passdb backend' paramater has been created (and documented!) to support this. As such, configure has been modfied to allow (for example) --with-ldap and the old smbpasswd to be selected at the same time. This patch also introduces two new backends: smbpasswd_nua and tdbsam_nua. These two backends accept 'non unix accounts', where the user does *not* exist in /etc/passwd. These accounts' don't have UIDs in the unix sense, but to avoid conflicts in the algroitmic mapping of RIDs, they use the values specified in the 'non unix account range' paramter - in the same way as the winbind ranges are specifed. While I was at it, I cleaned up some of the code in pdb_tdb (code copied directly from smbpasswd and not really considered properly). Most of this was to do with % macro expansion on stored data. It isn't easy to get the macros into the tdb, and the first password change will 'expand' them. tdbsam needs to use a similar system to pdb_ldap in this regard. This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I don't have the test facilities for these. I plan to incoroprate at least pdb_ldap into this scheme after consultation with Jerry. Each (converted) passdb module now no longer has any 'static' variables, and only exports 1 init function outside its .c file. The non-unix-account support in this patch has been proven! It is now possible to join a win2k machine to a Samba PDC without an account in /etc/passwd! Other changes: Minor interface adjustments: pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*. pdb_update_sam_account() no longer takes the 'override' argument that was being ignored so often (every other passdb backend). Extra checks have been added in some places. Minor code changes: smbpasswd no longer attempts to initialise the passdb at startup, this is now done on first use. pdbedit has lost some of its 'machine account' logic, as this behaviour is now controlled by the passdb subsystem directly. The samr subsystem no longer calls 'local password change', but does the pdb interactions directly. This allow the ACB_ flags specifed to be transferred direct to the backend, without interference. Doco: I've updated the doco to reflect some of the changes, and removed some paramters no longer applicable to HEAD. (This used to be commit ff354c99c585068af6dc1ff35a1f109a806b326b) --- source3/param/loadparm.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fce5fcde49..af8a5df897 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -111,6 +111,7 @@ typedef struct char *szSMBPasswdFile; char *szPrivateDir; char *szPassdbModulePath; + char *szPassdbBackend; char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; @@ -150,6 +151,7 @@ typedef struct char *szSourceEnv; char *szWinbindUID; char *szWinbindGID; + char *szNonUnixAccountRange; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; @@ -525,6 +527,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr); static BOOL handle_netbios_name(char *pszParmValue, char **ptr); static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); +static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); @@ -693,6 +696,8 @@ static struct parm_struct parm_table[] = { {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, + {"passdb backend", P_STRING, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, 0}, + {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -1200,6 +1205,7 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); string_set(&Globals.szPassdbModulePath, ""); + string_set(&Globals.szPassdbBackend, "smbpasswd"); string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); @@ -1454,6 +1460,7 @@ FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) FN_GLOBAL_STRING(lp_passdb_module_path, &Globals.szPassdbModulePath) +FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) @@ -2444,7 +2451,7 @@ static BOOL handle_copy(char *pszParmValue, char **ptr) } /*************************************************************************** - Handle winbind uid and gid allocation parameters. The format of these + Handle winbind/non unix account uid and gid allocation parameters. The format of these parameters is: [global] @@ -2461,6 +2468,7 @@ static BOOL handle_copy(char *pszParmValue, char **ptr) static uid_t winbind_uid_low, winbind_uid_high; static gid_t winbind_gid_low, winbind_gid_high; +static uint32 non_unix_account_low, non_unix_account_high; BOOL lp_winbind_uid(uid_t *low, uid_t *high) { @@ -2490,6 +2498,20 @@ BOOL lp_winbind_gid(gid_t *low, gid_t *high) return True; } +BOOL lp_non_unix_account_range(uint32 *low, uint32 *high) +{ + if (non_unix_account_low == 0 || non_unix_account_high == 0) + return False; + + if (low) + *low = non_unix_account_low; + + if (high) + *high = non_unix_account_high; + + return True; +} + /* Do some simple checks on "winbind [ug]id" parameter values */ static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) @@ -2526,6 +2548,25 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) return True; } +/* Do some simple checks on "non unix account range" parameter values */ + +static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) +{ + uint32 low, high; + + if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) + return False; + + /* Parse OK */ + + string_set(ptr, pszParmValue); + + non_unix_account_low = low; + non_unix_account_high = high; + + return True; +} + /*************************************************************************** Handle the WINS SERVER list ***************************************************************************/ -- cgit From 528ff0d6f724f74800a5098ef2ec6106d67164a6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 22 Jan 2002 18:14:31 +0000 Subject: merge from 2.2. of * PRINTER_ATTRIBUTE's * "default devmode" parameter (This used to be commit 90a7a1840b4823d4ebe047130a95dd15a824500b) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af8a5df897..227e44e95b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -387,6 +387,7 @@ typedef struct BOOL bInheritPerms; BOOL bMSDfsRoot; BOOL bUseClientDriver; + BOOL bDefaultDevmode; BOOL bNTAclSupport; char dummy[3]; /* for alignment */ @@ -501,6 +502,7 @@ static service sDefault = { False, /* bInheritPerms */ False, /* bMSDfsRoot */ False, /* bUseClientDriver */ + False, /* bDefaultDevmode */ True, /* bNTAclSupport */ "" /* dummy */ @@ -874,6 +876,7 @@ static struct parm_struct parm_table[] = { {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, + {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -1711,6 +1714,7 @@ FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) +FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode) FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) -- cgit From 01a1516f1524881eec9f95398fd523b5e093d37e Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 25 Jan 2002 05:16:40 +0000 Subject: Initialise password server to "*" in init_globals() (This used to be commit 97b243c488e8b976e40c6d873282a153f80c06e4) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 227e44e95b..528ab6492b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1236,6 +1236,7 @@ static void init_globals(void) string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile"); string_set(&Globals.szNameResolveOrder, "lmhosts wins host bcast"); + string_set(&Globals.szPasswordServer, "*"); Globals.bLoadPrinters = True; Globals.max_packet = 65535; -- cgit From 2452515a1603dbcea03d6cbb805413c5ccb15ac7 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Fri, 25 Jan 2002 22:53:49 +0000 Subject: that's the wins replication daemon ! there are still some work to do on it but it's already functionnal. J.F. (This used to be commit 2506c98d19263bd5f367a488c2238dcdfec46ee9) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 528ab6492b..6bc1d9a14e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -143,6 +143,7 @@ typedef struct char *szShutdownScript; char *szAbortShutdownScript; char *szWINSHook; + char *szWINSPartners; #ifdef WITH_UTMP char *szUtmpDir; char *szWtmpDir; @@ -948,6 +949,7 @@ static struct parm_struct parm_table[] = { {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, + {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, 0}, {"Locking Options", P_SEP, P_SEPARATOR}, @@ -1520,6 +1522,7 @@ FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript) FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) +FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6bc1d9a14e..a44b788a5d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. Parameter loading functions Copyright (C) Karl Auer 1993-1998 -- cgit From 3e5efdb05c91dff204967d1e8dd33a86ab2602f2 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sat, 16 Feb 2002 19:34:58 +0000 Subject: Added comment in lp_string() about debugging memory problems. (This used to be commit 98e97fac17b766a6da658daa1ec40ffaf6f5bb2e) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a44b788a5d..8a9987ee1d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1410,6 +1410,15 @@ static char *lp_string(const char *s) size_t len = s ? strlen(s) : 0; char *ret; + /* The follow debug is useful for tracking down memory problems + especially if you have an inner loop that is calling a lp_*() + function that returns a string. Perhaps this debug should be + present all the time? */ + +#if 0 + DEBUG(10, ("lp_string(%s)\n", s)); +#endif + if (!lp_talloc) lp_talloc = talloc_init_named("lp_talloc"); -- cgit From aa56d46a0da465e4ecafb8325f014eea48cf2626 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Feb 2002 22:54:23 +0000 Subject: enable large readwrite by default this should improve performance with w2k clients and seems to work fine (This used to be commit 67a3135e044b40467d0d06d271ed981768700b95) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8a9987ee1d..94391dd03c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1251,7 +1251,7 @@ static void init_globals(void) Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; - Globals.bLargeReadwrite = False; + Globals.bLargeReadwrite = True; Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; Globals.maxprotocol = PROTOCOL_NT1; -- cgit From f4ab3072a6d11ce8ee6062fb4e5a1f7b4e10a0e0 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Mon, 25 Feb 2002 22:17:53 +0000 Subject: add required flags to "nt acl support" so it will show up in SWAT (This used to be commit d1ccdb5d1cb3d624285b13e662153e1e74ba3d71) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 94391dd03c..8679addcff 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -807,7 +807,7 @@ static struct parm_struct parm_table[] = { {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, 0}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE }, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, -- cgit From 2da4d64cfcf289d18d622c67d3250c51e6b88466 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Feb 2002 21:46:53 +0000 Subject: Added "nt status support" parameter. Fix offline synchronisation. Jeremy. (This used to be commit 9243a9778e52999d5c62cba484640637b24994d8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8679addcff..7548ff03a8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -255,6 +255,7 @@ typedef struct BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; + BOOL bNTStatusSupport; BOOL bStatCache; BOOL bKernelOplocks; BOOL bAllowTrustedDomains; @@ -808,6 +809,7 @@ static struct parm_struct parm_table[] = { {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE }, + {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, 0}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, @@ -1298,6 +1300,7 @@ static void init_globals(void) Globals.bPasswdChatDebug = False; 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 */ Globals.bRestrictAnonymous = False; Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ @@ -1601,6 +1604,7 @@ FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync) FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug) 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_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) -- cgit From 2ef9be9a99cbd4b3c5076433153d675aa0cd4ca2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Mar 2002 10:16:28 +0000 Subject: This patch merges my private LDAP tree into HEAD. The main change here is to move ldap into the new pluggable passdb subsystem and to take the LDAP location as a 'location' paramter on the 'passdb backend' line in the smb.conf. This is an LDAP URL, parsed by OpenLDAP where supported, and by hand where it isn't. It also adds the ldap user suffix and ldap machine suffix smb.conf options, so that machines added to the LDAP dir don't get mixed in with people. Non-unix account support is also added. This means that machines don't need to be in /etc/passwd or in nss_ldap's scope. This code has stood up well under my production environment, so it relitivly well tested. I'm commiting this now becouse others have shown interest in using it, and there is no point 'hording' the code :-). Andrew Bartlett (This used to be commit cd5234d7dd7309d88944b83d807c1f1c2ca0460a) --- source3/param/loadparm.c | 101 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 94 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7548ff03a8..6abf967cde 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -199,6 +199,8 @@ typedef struct int oplock_break_wait_time; int winbind_cache_time; #ifdef WITH_LDAP_SAM + char *szLdapMachineSuffix; + char *szLdapUserSuffix; int ldap_port; int ldap_ssl; char *szLdapServer; @@ -533,6 +535,9 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); +static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); +static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); +static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -970,9 +975,9 @@ static struct parm_struct parm_table[] = { #ifdef WITH_LDAP_SAM {"Ldap Options", P_SEP, P_SEPARATOR}, - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, - {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, - {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, NULL, NULL, 0}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, 0}, + {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_machine_suffix, NULL, 0}, + {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_user_suffix, NULL, 0}, {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, 0}, {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 0}, @@ -1315,16 +1320,16 @@ static void init_globals(void) Globals.bUseMmap = True; #endif + string_set(&Globals.szLdapMachineSuffix, ""); + string_set(&Globals.szLdapUserSuffix, ""); /* hostname lookups can be very expensive and are broken on a large number of sites (tridge) */ Globals.bHostnameLookups = False; #ifdef WITH_LDAP_SAM - string_set(&Globals.szLdapServer, "localhost"); string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); - Globals.ldap_port = 636; Globals.ldap_ssl = LDAP_SSL_ON; #endif /* WITH_LDAP_SAM */ @@ -1541,11 +1546,11 @@ FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) #ifdef WITH_LDAP_SAM -FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) +FN_GLOBAL_STRING(lp_ldap_machine_suffix, &Globals.szLdapMachineSuffix) +FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) -FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) #endif /* WITH_LDAP_SAM */ FN_GLOBAL_STRING(lp_add_share_cmd, &Globals.szAddShareCommand) @@ -2611,6 +2616,88 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) return debug_parse_levels( pszParmValue ); } +/*************************************************************************** + Handle the ldap machine suffix option +***************************************************************************/ +static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) +{ + pstring suffix; + + pstrcpy(suffix, pszParmValue); + + if (! *Globals.szLdapSuffix ) { + string_set( ptr, suffix ); + return True; + } + + if (! strstr(suffix, Globals.szLdapSuffix) ) { + if ( *pszParmValue ) + pstrcat(suffix, ","); + pstrcat(suffix, Globals.szLdapSuffix); + } + string_set( ptr, suffix ); + return True; +} + +/*************************************************************************** + Handle the ldap user suffix option +***************************************************************************/ +static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) +{ + pstring suffix; + + pstrcpy(suffix, pszParmValue); + + if (! *Globals.szLdapSuffix ) { + string_set( ptr, suffix ); + return True; + } + + if (! strstr(suffix, Globals.szLdapSuffix) ) { + if ( *pszParmValue ) + pstrcat(suffix, ","); + pstrcat(suffix, Globals.szLdapSuffix); + } + string_set( ptr, suffix ); + return True; +} + +/*************************************************************************** + Handle setting ldap suffix and determines whether ldap machine suffix needs + to be set as well +***************************************************************************/ +static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) +{ + pstring suffix; + pstring user_suffix; + pstring machine_suffix; + + pstrcpy(suffix, pszParmValue); + + if (! *Globals.szLdapMachineSuffix ) + string_set(&Globals.szLdapMachineSuffix, suffix); + if (! *Globals.szLdapUserSuffix ) + string_set(&Globals.szLdapUserSuffix, suffix); + + if (! strstr(Globals.szLdapMachineSuffix, suffix)) { + pstrcpy(machine_suffix, Globals.szLdapMachineSuffix); + if ( *Globals.szLdapMachineSuffix ) + pstrcat(machine_suffix, ","); + pstrcat(machine_suffix, suffix); + string_set(&Globals.szLdapMachineSuffix, machine_suffix); + } + + if (! strstr(Globals.szLdapUserSuffix, suffix)) { + pstrcpy(user_suffix, Globals.szLdapUserSuffix); + if ( *Globals.szLdapUserSuffix ) + pstrcat(user_suffix, ","); + pstrcat(user_suffix, suffix); + string_set(&Globals.szLdapUserSuffix, user_suffix); + } + + string_set(ptr, suffix); + return True; +} /*************************************************************************** initialise a copymap -- cgit From 72c49d2c097a9840aedf24649a725aa81a0bb2cd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Mar 2002 10:54:56 +0000 Subject: This is now unused (This used to be commit 6c5052a1a9e47c2efe0d5e84bee05ae335d79e60) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6abf967cde..5698eed20d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -203,7 +203,6 @@ typedef struct char *szLdapUserSuffix; int ldap_port; int ldap_ssl; - char *szLdapServer; char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; -- cgit From f0765f4efeb7f42d846cfd389667bf13ceced8d8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Mar 2002 12:30:06 +0000 Subject: Move these inside the #ifdef to fix the compile on non-LDAPsam systems. (This used to be commit 75f72f0b6a698e462a0567674613319dde789084) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5698eed20d..919527040d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -199,8 +199,8 @@ typedef struct int oplock_break_wait_time; int winbind_cache_time; #ifdef WITH_LDAP_SAM - char *szLdapMachineSuffix; - char *szLdapUserSuffix; + char *szLdapMachineSuffix; + char *szLdapUserSuffix; int ldap_port; int ldap_ssl; char *szLdapSuffix; @@ -1319,14 +1319,15 @@ static void init_globals(void) Globals.bUseMmap = True; #endif - string_set(&Globals.szLdapMachineSuffix, ""); - string_set(&Globals.szLdapUserSuffix, ""); /* hostname lookups can be very expensive and are broken on a large number of sites (tridge) */ Globals.bHostnameLookups = False; #ifdef WITH_LDAP_SAM string_set(&Globals.szLdapSuffix, ""); + string_set(&Globals.szLdapMachineSuffix, ""); + string_set(&Globals.szLdapUserSuffix, ""); + string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; -- cgit From 81f66464b062df5fcfed41dbace8d37836b16e34 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 2 Mar 2002 19:06:15 +0000 Subject: compile fix from vance (This used to be commit b6d62b8b2e0d72b0588fbe10b12c3877feb5ca71) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 919527040d..8d7dd5c60d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2616,6 +2616,7 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) return debug_parse_levels( pszParmValue ); } +#ifdef WITH_LDAP_SAM /*************************************************************************** Handle the ldap machine suffix option ***************************************************************************/ @@ -2698,6 +2699,7 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) string_set(ptr, suffix); return True; } +#endif /* WITH_LDAP_SAM */ /*************************************************************************** initialise a copymap -- cgit From 14b1ec7ccdf80268f062e95538ee6b8b3882786f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 3 Mar 2002 21:38:56 +0000 Subject: make default unix charset UTF8 this means that we at least support all unicode chars by default (This used to be commit 54a3f374496316ccc6d0e4aa2267963193690a23) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8d7dd5c60d..ea3894c236 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1219,6 +1219,9 @@ static void init_globals(void) string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); + /* using UTF8 by default allows us to support all chars */ + string_set(&Globals.unix_charset, "UTF8"); + /* * Allow the default PASSWD_CHAT to be overridden in local.h. */ -- cgit From db4c62d7ed2eb5503927edf7e25c5a2fc94f4174 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 11 Mar 2002 21:57:12 +0000 Subject: Implemented default ACL patch (set inherit acls = true on a per share basis). Based on code donated by Olaf Fr±czyk . Further commit will change to sending via vfs interface. Jeremy. (This used to be commit d85133e2697eb22f1573c78447b57791ae63dd6b) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ea3894c236..ec7d768023 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -387,6 +387,7 @@ typedef struct BOOL bFakeDirCreateTimes; BOOL bBlockingLocks; BOOL bInheritPerms; + BOOL bInheritACLS; BOOL bMSDfsRoot; BOOL bUseClientDriver; BOOL bDefaultDevmode; @@ -502,6 +503,7 @@ static service sDefault = { False, /* bFakeDirCreateTimes */ True, /* bBlockingLocks */ False, /* bInheritPerms */ + False, /* bInheritACLS */ False, /* bMSDfsRoot */ False, /* bUseClientDriver */ False, /* bDefaultDevmode */ @@ -752,6 +754,7 @@ static struct parm_struct parm_table[] = { {"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, + {"inherit acls", P_BOOL, P_LOCAL, &sDefault.bInheritACLS, NULL, NULL, FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, @@ -1737,6 +1740,7 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) +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_nt_acl_support, bNTAclSupport) -- cgit From 5e3b923124e82b1d19875746676df13cfdb0f918 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 13 Mar 2002 20:28:19 +0000 Subject: include/smb_macros.h: Don't round up an allocation if the size is zero. "One of these locks is not like the others... One of these locks is not quite the same" :-). When is a zero timeout lock not zero ? When it's being processed by Windows 2000 of course.. This code change, ugly though it is - completely fixes the foxpro/access multi-user file system database problems that people have been having. I used a *wonderful* test program donated by "Gerald Drouillard" which allowed me to completely reproduce this problem, and to finally determine the correct fix. This also explains why Windows 2000 is *so slow* when responding to the smbtorture lock tests. I *love* it when all these things come together and finally make sense :-). Jeremy. (This used to be commit 8aa9860ea2ea7f5aed4b6aa12794fffdfa81b0d0) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ec7d768023..12dedc7a01 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -198,6 +198,8 @@ typedef struct int min_passwd_length; int oplock_break_wait_time; int winbind_cache_time; + int iLockSpinCount; + int iLockSpinTime; #ifdef WITH_LDAP_SAM char *szLdapMachineSuffix; char *szLdapUserSuffix; @@ -965,6 +967,8 @@ static struct parm_struct parm_table[] = { {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"lock spin count", P_INTEGER, P_GLOBAL, &Globals.iLockSpinCount, NULL, NULL, FLAG_GLOBAL}, + {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -1319,6 +1323,8 @@ static void init_globals(void) Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; + Globals.iLockSpinCount = 3; /* Try 2 times. */ + Globals.iLockSpinTime = 10; /* usec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; #else @@ -1659,6 +1665,8 @@ FN_GLOBAL_INTEGER(lp_stat_cache_size, &Globals.stat_cache_size) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) +FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) +FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) -- cgit From ffadd471b9664018b3010ab5d74e6d05b8886e66 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 Mar 2002 02:32:39 +0000 Subject: Sync up vfs changes from 2.2.x. Jeremy. (This used to be commit ad1e858d8e72adf924ff435eab8da3e60842e2e6) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 12dedc7a01..7e9224dcd4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1047,7 +1047,7 @@ static struct parm_struct parm_table[] = { {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, 0}, - {"VFS options", P_SEP, P_SEPARATOR}, + {"VFS module options", P_SEP, P_SEPARATOR}, {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, @@ -1700,6 +1700,7 @@ FN_LOCAL_LIST(lp_writelist, writelist) FN_LOCAL_LIST(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) +FN_LOCAL_STRING(lp_vfs_options, szVfsOptions) static FN_LOCAL_STRING(lp_volume, volume) FN_LOCAL_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) -- cgit From 43ba0aa8d966b6523fc4f9b77767a820edc0c595 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 23 Mar 2002 08:32:25 +0000 Subject: Minor fixes: - Fix warnings in loadparm.c - Remove the unused 'passdb modules path' paramater - Make pdb_ldap use $ termination rather than the workstation trust account flag becouse some 'machine' accounts appear as normal accounts at creation time. Also covers domains etc. Andrew Bartlett (This used to be commit 8c82a3daf777bcd4cd4388d30222e370fe800819) --- source3/param/loadparm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7e9224dcd4..6144fea63b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -109,7 +109,6 @@ typedef struct char *szConfigFile; char *szSMBPasswdFile; char *szPrivateDir; - char *szPassdbModulePath; char *szPassdbBackend; char *szPasswordServer; char *szSocketOptions; @@ -538,9 +537,12 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); + +#if WITH_LDAP_SAM static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); +#endif static void set_server_role(void); static void set_default_server_announce_type(void); @@ -706,7 +708,6 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, - {"passdb module path", P_STRING, P_GLOBAL, &Globals.szPassdbModulePath, NULL, NULL, 0}, {"passdb backend", P_STRING, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, 0}, {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -882,7 +883,7 @@ static struct parm_struct parm_table[] = { {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, - {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, + {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, @@ -1221,7 +1222,6 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); - string_set(&Globals.szPassdbModulePath, ""); string_set(&Globals.szPassdbBackend, "smbpasswd"); string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); @@ -1493,7 +1493,6 @@ FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) -FN_GLOBAL_STRING(lp_passdb_module_path, &Globals.szPassdbModulePath) FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) -- cgit From 0cb0c6e90348c9e85e38b65778b93a78af7462a5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Mar 2002 23:17:50 +0000 Subject: Added sys_adminlog() system for info the appliance admins really need to know about. Different from the DEBUG system. Jeremy. (This used to be commit 74eac41c681f92a6da0ae2167f031e021862e0d8) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6144fea63b..af9ec06d95 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -247,6 +247,7 @@ typedef struct BOOL bReadPrediction; BOOL bReadbmpx; BOOL bSyslogOnly; + BOOL bAdminLog; BOOL bBrowseList; BOOL bNISHomeMap; BOOL bTimeServer; @@ -793,6 +794,8 @@ static struct parm_struct parm_table[] = { #endif /* WITH_SSL */ {"Logging Options", P_SEP, P_SEPARATOR}, + + {"admin log", P_BOOL, P_GLOBAL, &Globals.bAdminLog, NULL, NULL, 0}, {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, @@ -1285,6 +1288,7 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; + Globals.bAdminLog = False; Globals.bTimestampLogs = True; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; @@ -1607,6 +1611,7 @@ FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) +FN_GLOBAL_BOOL(lp_admin_log, &Globals.bAdminLog) FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) -- cgit From 87ea010ae14b2dc9a3e5b9d64ca9e63ec9de91f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 2 Apr 2002 19:56:54 +0000 Subject: Fix continual scanning of smb.conf if an include file doesn't exist. Found by Herb. Jeremy. (This used to be commit f4f2a62740625495fa2dae03751829a4528713cc) --- source3/param/loadparm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af9ec06d95..790d73d3cb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2242,10 +2242,12 @@ static void add_to_file_list(const char *fname, const char *subfname) return; } file_lists = f; + f->modtime = file_modtime(subfname); + } else { + time_t t = file_modtime(subfname); + if (t) + f->modtime = t; } - - f->modtime = file_modtime(subfname); - } /******************************************************************* @@ -2256,8 +2258,7 @@ BOOL lp_file_list_changed(void) struct file_lists *f = file_lists; DEBUG(6, ("lp_file_list_changed()\n")); - while (f) - { + while (f) { pstring n2; time_t mod_time; @@ -2269,8 +2270,7 @@ BOOL lp_file_list_changed(void) mod_time = file_modtime(n2); - if ((f->modtime != mod_time) || (f->subfname == NULL) || (strcmp(n2, f->subfname) != 0)) - { + if (mod_time && ((f->modtime != mod_time) || (f->subfname == NULL) || (strcmp(n2, f->subfname) != 0))) { DEBUGADD(6, ("file %s modified: %s\n", n2, ctime(&mod_time))); -- cgit From 4ad0ff29bf44e2506311f672bf912e7a2d39048a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Apr 2002 01:04:13 +0000 Subject: Added Shirish's client side caching policy change. Jeremy. (This used to be commit 16015c07eab2e57fa3771051e3e08fde21757cfa) --- source3/param/loadparm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 790d73d3cb..11c8f2c44b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -345,6 +345,7 @@ typedef struct int iDefaultCase; int iPrinting; int iOplockContentionLimit; + int iCSCPolicy; BOOL bAlternatePerm; BOOL bPreexecClose; BOOL bRootpreexecClose; @@ -461,6 +462,7 @@ static service sDefault = { CASE_LOWER, /* iDefaultCase */ DEFAULT_PRINTING, /* iPrinting */ 2, /* iOplockContentionLimit */ + 0, /* iCSCPolicy */ False, /* bAlternatePerm */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ @@ -514,8 +516,6 @@ static service sDefault = { "" /* dummy */ }; - - /* local variables */ static service **ServicePtrs = NULL; static int iNumServices = 0; @@ -634,6 +634,19 @@ static struct enum_list enum_bool_auto[] = { {-1, NULL} }; +/* Client-side offline caching policy types */ +#define CSC_POLICY_MANUAL 0 +#define CSC_POLICY_DOCUMENTS 1 +#define CSC_POLICY_PROGRAMS 2 +#define CSC_POLICY_DISABLE 3 + +static struct enum_list enum_csc_policy[] = { + {CSC_POLICY_MANUAL, "manual"}, + {CSC_POLICY_DOCUMENTS, "documents"}, + {CSC_POLICY_PROGRAMS, "programs"}, + {CSC_POLICY_DISABLE, "disable"} +}; + /* Do you want session setups at user level security with a invalid password to be rejected or allowed in as guest? WinNT rejects them @@ -968,6 +981,7 @@ static struct parm_struct parm_table[] = { {"Locking Options", P_SEP, P_SEPARATOR}, {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"csc policy", P_ENUM, P_LOCAL, &sDefault.iCSCPolicy, NULL, enum_csc_policy, FLAG_SHARE | FLAG_GLOBAL}, {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -1771,6 +1785,7 @@ FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) FN_LOCAL_INTEGER(lp_maxprintjobs, iMaxPrintJobs) FN_LOCAL_INTEGER(lp_printing, iPrinting) FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) +FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) -- cgit From 9cd0306baa1b3a78b40ab97b5d199b90a4c34aa6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Apr 2002 02:20:56 +0000 Subject: This split the mangling code up to allow for the possibility of multiple mangling implementation, selectable using "mangling method = " in smb.conf It also tidies the interface a little, although it is still nasty. (This used to be commit be23d87a178e7d0691e7d942adf89bb3d2d533c2) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 11c8f2c44b..bdd710f5fe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -161,6 +161,7 @@ typedef struct char *szChangeShareCommand; char *szDeleteShareCommand; char *szGuestaccount; + char *szManglingMethod; int max_log_size; int mangled_stack; int max_xmit; @@ -911,6 +912,7 @@ static struct parm_struct parm_table[] = { {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, + {"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, 0}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, @@ -1519,6 +1521,7 @@ FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand) FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand) FN_GLOBAL_STRING(lp_os2_driver_map, &Globals.szOs2DriverMap) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) +FN_GLOBAL_STRING(lp_mangling_method, &Globals.szManglingMethod) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) -- cgit From 4023a61892278c9e09acd035166a55ff2b3d4f30 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Apr 2002 10:18:46 +0000 Subject: merged the mangling test and passdb bugfixes into SAMBA_3_0 (This used to be commit 97eb3a121d33200ee7559b2413d6252efc04ebaf) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bdd710f5fe..462464d68f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1243,6 +1243,9 @@ static void init_globals(void) string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); string_set(&Globals.szPassdbBackend, "smbpasswd"); + /* use the new 'hash2' method by default */ + string_set(&Globals.szManglingMethod, "hash2"); + string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); /* using UTF8 by default allows us to support all chars */ -- cgit From e90b65284812aaa5ff9e9935ce9bbad7791cbbcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Jul 2002 10:35:28 +0000 Subject: updated the 3.0 branch from the head branch - ready for alpha18 (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce) --- source3/param/loadparm.c | 629 +++++++++++++++++++---------------------------- 1 file changed, 252 insertions(+), 377 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 462464d68f..6e3ce460cd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6,6 +6,7 @@ Largely re-written by Andrew Tridgell, September 1994 Copyright (C) Simo Sorce 2001 + Copyright (C) Alexander Bokovoy 2002 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 @@ -54,7 +55,6 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; extern userdom_struct current_user_info; -extern int DEBUGLEVEL_CLASS[DBGC_LAST]; extern pstring user_socket_options; extern pstring global_myname; pstring global_scope = ""; @@ -96,6 +96,7 @@ typedef struct char *szDeletePrinterCommand; char *szOs2DriverMap; char *szLockDir; + char *szPidDir; char *szRootdir; char *szDefaultService; char *szDfree; @@ -109,7 +110,7 @@ typedef struct char *szConfigFile; char *szSMBPasswdFile; char *szPrivateDir; - char *szPassdbBackend; + char **szPassdbBackend; char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; @@ -120,7 +121,7 @@ typedef struct char *szLogonPath; char *szLogonDrive; char *szLogonHome; - char *szWINSserver; + char **szWINSservers; char **szInterfaces; char *szRemoteAnnounce; char *szRemoteBrowseSync; @@ -136,7 +137,7 @@ typedef struct char *szAddGroupScript; char *szDelGroupScript; char *szAddUserToGroupScript; - char *szDelUserToGroupScript; + char *szDelUserFromGroupScript; char *szAddMachineScript; char *szShutdownScript; char *szAbortShutdownScript; @@ -151,6 +152,7 @@ typedef struct char *szWinbindUID; char *szWinbindGID; char *szNonUnixAccountRange; + BOOL bAlgorithmicRidBase; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; @@ -200,7 +202,6 @@ typedef struct int winbind_cache_time; int iLockSpinCount; int iLockSpinTime; -#ifdef WITH_LDAP_SAM char *szLdapMachineSuffix; char *szLdapUserSuffix; int ldap_port; @@ -208,26 +209,6 @@ typedef struct char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; -#endif /* WITH_LDAP_SAM */ -#ifdef WITH_SSL - int sslVersion; - char **sslHostsRequire; - char **sslHostsResign; - char *sslCaCertDir; - char *sslCaCertFile; - char *sslServerCert; - char *sslServerPrivKey; - char *sslClientCert; - char *sslClientPrivKey; - char *sslCiphers; - char *sslEgdSocket; - char *sslEntropyFile; - int sslEntropyBytes; - BOOL sslEnabled; - BOOL sslReqClientCert; - BOOL sslReqServerCert; - BOOL sslCompatibility; -#endif /* WITH_SSL */ BOOL bMsAddPrinterWizard; BOOL bDNSproxy; BOOL bWINSsupport; @@ -263,7 +244,6 @@ typedef struct BOOL bStatCache; BOOL bKernelOplocks; BOOL bAllowTrustedDomains; - BOOL bRestrictAnonymous; BOOL bLanmanAuth; BOOL bNTLMAuth; BOOL bDebugHiresTimestamp; @@ -275,6 +255,8 @@ typedef struct BOOL bUseMmap; BOOL bHostnameLookups; BOOL bUseSpnego; + BOOL bUnixExtensions; + int restrict_anonymous; } global; @@ -347,6 +329,7 @@ typedef struct int iPrinting; int iOplockContentionLimit; int iCSCPolicy; + int iBlock_size; BOOL bAlternatePerm; BOOL bPreexecClose; BOOL bRootpreexecClose; @@ -464,6 +447,7 @@ static service sDefault = { DEFAULT_PRINTING, /* iPrinting */ 2, /* iOplockContentionLimit */ 0, /* iCSCPolicy */ + 1024, /* iBlock_size */ False, /* bAlternatePerm */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ @@ -537,14 +521,11 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr); static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); -static BOOL handle_wins_server_list(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); -#if WITH_LDAP_SAM static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); -#endif static void set_server_role(void); static void set_default_server_announce_type(void); @@ -587,7 +568,6 @@ static struct enum_list enum_printing[] = { {-1, NULL} }; -#ifdef WITH_LDAP_SAM static struct enum_list enum_ldap_ssl[] = { {LDAP_SSL_ON, "Yes"}, {LDAP_SSL_ON, "yes"}, @@ -601,7 +581,6 @@ static struct enum_list enum_ldap_ssl[] = { {LDAP_SSL_START_TLS, "start_tls"}, {-1, NULL} }; -#endif /* WITH_LDAP_SAM */ /* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT_SERVER 1 @@ -645,7 +624,8 @@ static struct enum_list enum_csc_policy[] = { {CSC_POLICY_MANUAL, "manual"}, {CSC_POLICY_DOCUMENTS, "documents"}, {CSC_POLICY_PROGRAMS, "programs"}, - {CSC_POLICY_DISABLE, "disable"} + {CSC_POLICY_DISABLE, "disable"}, + {-1, NULL} }; /* @@ -676,16 +656,6 @@ static struct enum_list enum_map_to_guest[] = { {-1, NULL} }; -#ifdef WITH_SSL -static struct enum_list enum_ssl_version[] = { - {SMB_SSL_V2, "ssl2"}, - {SMB_SSL_V3, "ssl3"}, - {SMB_SSL_V23, "ssl2or3"}, - {SMB_SSL_TLS1, "tls1"}, - {-1, NULL} -}; -#endif - /* note that we do not initialise the defaults union - it is not allowed in ANSI C */ static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, @@ -723,8 +693,9 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, - {"passdb backend", P_STRING, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, 0}, + {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, 0}, {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, 0}, + {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, 0}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, @@ -738,7 +709,7 @@ static struct parm_struct parm_table[] = { {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"restrict anonymous", P_BOOL, P_GLOBAL, &Globals.bRestrictAnonymous, NULL, NULL, 0}, + {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, 0}, {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, @@ -785,33 +756,11 @@ static struct parm_struct parm_table[] = { {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, -#ifdef WITH_SSL - {"Secure Socket Layer Options", P_SEP, P_SEPARATOR}, - {"ssl", P_BOOL, P_GLOBAL, &Globals.sslEnabled, NULL, NULL, 0}, - - {"ssl hosts", P_LIST, P_GLOBAL, &Globals.sslHostsRequire, NULL, NULL, 0}, - {"ssl hosts resign", P_LIST, P_GLOBAL, &Globals.sslHostsResign, NULL, NULL, 0}, - {"ssl CA certDir", P_STRING, P_GLOBAL, &Globals.sslCaCertDir, NULL, NULL, 0}, - {"ssl CA certFile", P_STRING, P_GLOBAL, &Globals.sslCaCertFile, NULL, NULL, 0}, - {"ssl server cert", P_STRING, P_GLOBAL, &Globals.sslServerCert, NULL, NULL, 0}, - {"ssl server key", P_STRING, P_GLOBAL, &Globals.sslServerPrivKey, NULL, NULL, 0}, - {"ssl client cert", P_STRING, P_GLOBAL, &Globals.sslClientCert, NULL, NULL, 0}, - {"ssl client key", P_STRING, P_GLOBAL, &Globals.sslClientPrivKey, NULL, NULL, 0}, - {"ssl egd socket", P_STRING, P_GLOBAL, &Globals.sslEgdSocket, NULL, NULL, 0}, - {"ssl entropy file", P_STRING, P_GLOBAL, &Globals.sslEntropyFile, NULL, NULL, 0}, - {"ssl entropy bytes", P_INTEGER, P_GLOBAL, &Globals.sslEntropyBytes, NULL, NULL, 0}, - {"ssl require clientcert", P_BOOL, P_GLOBAL, &Globals.sslReqClientCert, NULL, NULL, 0}, - {"ssl require servercert", P_BOOL, P_GLOBAL, &Globals.sslReqServerCert, NULL, NULL, 0}, - {"ssl ciphers", P_STRING, P_GLOBAL, &Globals.sslCiphers, NULL, NULL, 0}, - {"ssl version", P_ENUM, P_GLOBAL, &Globals.sslVersion, NULL, enum_ssl_version, 0}, - {"ssl compatibility", P_BOOL, P_GLOBAL, &Globals.sslCompatibility, NULL, NULL, 0}, -#endif /* WITH_SSL */ - {"Logging Options", P_SEP, P_SEPARATOR}, {"admin log", P_BOOL, P_GLOBAL, &Globals.bAdminLog, NULL, NULL, 0}, - {"log level", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, - {"debuglevel", P_INTEGER, P_GLOBAL, &DEBUGLEVEL_CLASS[DBGC_ALL], handle_debug_list, NULL, 0}, + {"log level", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0}, + {"debuglevel", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, @@ -849,10 +798,12 @@ static struct parm_struct parm_table[] = { {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, + {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, 0}, {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, 0}, {"Tuning Options", P_SEP, P_SEPARATOR}, + {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, @@ -885,7 +836,7 @@ static struct parm_struct parm_table[] = { {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT}, + {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -906,9 +857,9 @@ static struct parm_struct parm_table[] = { {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT}, - {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, + {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, + {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, + {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL | FLAG_DEPRECATED}, {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, @@ -946,7 +897,7 @@ static struct parm_struct parm_table[] = { {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, - {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserToGroupScript, NULL, NULL, 0}, + {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, 0}, {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, @@ -975,7 +926,7 @@ static struct parm_struct parm_table[] = { {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, - {"wins server", P_STRING, P_GLOBAL, &Globals.szWINSserver, handle_wins_server_list, NULL, FLAG_BASIC}, + {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, 0}, @@ -996,9 +947,8 @@ static struct parm_struct parm_table[] = { {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, -#ifdef WITH_LDAP_SAM {"Ldap Options", P_SEP, P_SEPARATOR}, {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, 0}, @@ -1007,7 +957,6 @@ static struct parm_struct parm_table[] = { {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, 0}, {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 0}, -#endif /* WITH_LDAP_SAM */ {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, @@ -1019,6 +968,7 @@ static struct parm_struct parm_table[] = { {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, + {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, 0}, #ifdef WITH_UTMP {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, @@ -1241,7 +1191,7 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); - string_set(&Globals.szPassdbBackend, "smbpasswd"); + Globals.szPassdbBackend = str_list_make("smbpasswd unixsam"); /* use the new 'hash2' method by default */ string_set(&Globals.szManglingMethod, "hash2"); @@ -1258,6 +1208,7 @@ static void init_globals(void) string_set(&Globals.szWorkGroup, 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"); pstrcpy(s, "Samba "); @@ -1277,6 +1228,8 @@ static void init_globals(void) string_set(&Globals.szNameResolveOrder, "lmhosts wins host bcast"); string_set(&Globals.szPasswordServer, "*"); + Globals.bAlgorithmicRidBase = BASE_RID; + Globals.bLoadPrinters = True; Globals.max_packet = 65535; Globals.mangled_stack = 50; @@ -1339,7 +1292,7 @@ static void init_globals(void) Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTStatusSupport = True; /* Use NT status by default. */ Globals.bStatCache = True; /* use stat cache by default */ - Globals.bRestrictAnonymous = False; + Globals.restrict_anonymous = 0; Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ Globals.map_to_guest = 0; /* By Default, "Never" */ @@ -1353,12 +1306,12 @@ static void init_globals(void) #else Globals.bUseMmap = True; #endif + Globals.bUnixExtensions = False; /* hostname lookups can be very expensive and are broken on a large number of sites (tridge) */ Globals.bHostnameLookups = False; -#ifdef WITH_LDAP_SAM string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); @@ -1366,27 +1319,6 @@ static void init_globals(void) string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; -#endif /* WITH_LDAP_SAM */ - -#ifdef WITH_SSL - Globals.sslVersion = SMB_SSL_V23; - /* Globals.sslHostsRequire = NULL; - Globals.sslHostsResign = NULL; */ - string_set(&Globals.sslCaCertDir, ""); - string_set(&Globals.sslCaCertFile, ""); - string_set(&Globals.sslServerCert, ""); - string_set(&Globals.sslServerPrivKey, ""); - string_set(&Globals.sslClientCert, ""); - string_set(&Globals.sslClientPrivKey, ""); - string_set(&Globals.sslCiphers, ""); - string_set(&Globals.sslEgdSocket, ""); - string_set(&Globals.sslEntropyFile, ""); - Globals.sslEntropyBytes = 256; - Globals.sslEnabled = False; - Globals.sslReqClientCert = False; - Globals.sslReqServerCert = False; - Globals.sslCompatibility = False; -#endif /* WITH_SSL */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1477,7 +1409,7 @@ static char *lp_string(const char *s) trim_string(ret, "\"", "\""); - standard_sub_basic(current_user_info.smb_name,ret); + standard_sub_basic(current_user_info.smb_name,ret,len+100); return (ret); } @@ -1489,6 +1421,8 @@ static char *lp_string(const char *s) #define FN_GLOBAL_STRING(fn_name,ptr) \ char *fn_name(void) {return(lp_string(*(char **)(ptr) ? *(char **)(ptr) : ""));} +#define FN_GLOBAL_CONST_STRING(fn_name,ptr) \ + const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : "");} #define FN_GLOBAL_LIST(fn_name,ptr) \ char **fn_name(void) {return(*(char ***)(ptr));} #define FN_GLOBAL_BOOL(fn_name,ptr) \ @@ -1500,6 +1434,8 @@ static char *lp_string(const char *s) #define FN_LOCAL_STRING(fn_name,val) \ char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val));} +#define FN_LOCAL_CONST_STRING(fn_name,val) \ + const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_LIST(fn_name,val) \ char **fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_BOOL(fn_name,val) \ @@ -1516,7 +1452,6 @@ FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) -FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) @@ -1524,6 +1459,7 @@ FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand) FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand) FN_GLOBAL_STRING(lp_os2_driver_map, &Globals.szOs2DriverMap) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) +FN_GLOBAL_STRING(lp_piddir, &Globals.szPidDir) FN_GLOBAL_STRING(lp_mangling_method, &Globals.szManglingMethod) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) @@ -1545,18 +1481,19 @@ FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) FN_GLOBAL_STRING(lp_ads_server, &Globals.szADSserver) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) -FN_GLOBAL_STRING(lp_logon_script, &Globals.szLogonScript) -FN_GLOBAL_STRING(lp_logon_path, &Globals.szLogonPath) -FN_GLOBAL_STRING(lp_logon_drive, &Globals.szLogonDrive) -FN_GLOBAL_STRING(lp_logon_home, &Globals.szLogonHome) +FN_GLOBAL_CONST_STRING(lp_logon_script, &Globals.szLogonScript) +FN_GLOBAL_CONST_STRING(lp_logon_path, &Globals.szLogonPath) +FN_GLOBAL_CONST_STRING(lp_logon_drive, &Globals.szLogonDrive) +FN_GLOBAL_CONST_STRING(lp_logon_home, &Globals.szLogonHome) FN_GLOBAL_STRING(lp_remote_announce, &Globals.szRemoteAnnounce) FN_GLOBAL_STRING(lp_remote_browse_sync, &Globals.szRemoteBrowseSync) -FN_GLOBAL_STRING(lp_wins_server_list, &Globals.szWINSserver) +FN_GLOBAL_LIST(lp_wins_server_list, &Globals.szWINSservers) FN_GLOBAL_LIST(lp_interfaces, &Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) +FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) @@ -1565,7 +1502,7 @@ FN_GLOBAL_STRING(lp_guestaccount, &Globals.szGuestaccount) FN_GLOBAL_STRING(lp_addgroup_script, &Globals.szAddGroupScript) FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) -FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserToGroupScript) +FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserFromGroupScript) FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) @@ -1580,38 +1517,16 @@ FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) -#ifdef WITH_LDAP_SAM FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) FN_GLOBAL_STRING(lp_ldap_machine_suffix, &Globals.szLdapMachineSuffix) FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) -#endif /* WITH_LDAP_SAM */ 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) -#ifdef WITH_SSL -FN_GLOBAL_INTEGER(lp_ssl_version, &Globals.sslVersion) -FN_GLOBAL_LIST(lp_ssl_hosts, &Globals.sslHostsRequire) -FN_GLOBAL_LIST(lp_ssl_hosts_resign, &Globals.sslHostsResign) -FN_GLOBAL_STRING(lp_ssl_cacertdir, &Globals.sslCaCertDir) -FN_GLOBAL_STRING(lp_ssl_cacertfile, &Globals.sslCaCertFile) -FN_GLOBAL_STRING(lp_ssl_server_cert, &Globals.sslServerCert) -FN_GLOBAL_STRING(lp_ssl_server_privkey, &Globals.sslServerPrivKey) -FN_GLOBAL_STRING(lp_ssl_client_cert, &Globals.sslClientCert) -FN_GLOBAL_STRING(lp_ssl_client_privkey, &Globals.sslClientPrivKey) -FN_GLOBAL_STRING(lp_ssl_ciphers, &Globals.sslCiphers) -FN_GLOBAL_STRING(lp_ssl_egdsocket, &Globals.sslEgdSocket) -FN_GLOBAL_STRING(lp_ssl_entropyfile, &Globals.sslEntropyFile) -FN_GLOBAL_INTEGER(lp_ssl_entropybytes, &Globals.sslEntropyBytes) -FN_GLOBAL_BOOL(lp_ssl_enabled, &Globals.sslEnabled) -FN_GLOBAL_BOOL(lp_ssl_reqClientCert, &Globals.sslReqClientCert) -FN_GLOBAL_BOOL(lp_ssl_reqServerCert, &Globals.sslReqServerCert) -FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility) -#endif /* WITH_SSL */ - FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport) @@ -1648,13 +1563,14 @@ 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_allow_trusted_domains, &Globals.bAllowTrustedDomains) -FN_GLOBAL_BOOL(lp_restrict_anonymous, &Globals.bRestrictAnonymous) +FN_GLOBAL_INTEGER(lp_restrict_anonymous, &Globals.restrict_anonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_ntlm_auth, &Globals.bNTLMAuth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) +FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions) FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups) FN_GLOBAL_INTEGER(lp_os_level, &Globals.os_level) @@ -1696,6 +1612,7 @@ FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) FN_LOCAL_STRING(lp_rootpostexec, szRootPostExec) FN_LOCAL_STRING(lp_servicename, szService) +FN_LOCAL_CONST_STRING(lp_const_servicename, szService) FN_LOCAL_STRING(lp_pathname, szPath) FN_LOCAL_STRING(lp_dontdescend, szDontdescend) FN_LOCAL_STRING(lp_username, szUsername) @@ -1793,9 +1710,53 @@ FN_LOCAL_INTEGER(lp_printing, iPrinting) FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) +FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) +FN_GLOBAL_BOOL(lp_algorithmic_rid_base, &Globals.bAlgorithmicRidBase) + +typedef struct _param_opt_struct param_opt_struct; +struct _param_opt_struct { + char *key; + char *value; + param_opt_struct *prev, *next; +}; + +static param_opt_struct *param_opt = NULL; + +/* Return parametric option from given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ +/* Returned value is allocated in 'lp_talloc' context */ +char *lp_parm_string(const char *servicename, const char *type, const char *option) +{ + param_opt_struct *data; + pstring vfskey; + + if (param_opt != NULL) { + ZERO_STRUCT(vfskey); + pstr_sprintf(vfskey, "%s:%s:%s", (servicename==NULL) ? "global" : servicename, + type, option); + data = param_opt; + while (data) { + if (strcmp(data->key, vfskey) == 0) { + return lp_string(data->value); + } + data = data->next; + } + /* Try to fetch the same option but from globals */ + pstr_sprintf(vfskey, "global:%s:%s", type, option); + data = param_opt; + while (data) { + if (strcmp(data->key, vfskey) == 0) { + return lp_string(data->value); + } + data = data->next; + } + + } + return NULL; +} /* local prototypes */ @@ -1848,7 +1809,7 @@ static void free_service(service * pservice) PTR_DIFF(parm_table[i].ptr, &sDefault))); else if (parm_table[i].type == P_LIST && parm_table[i].class == P_LOCAL) - lp_list_free((char ***) + str_list_free((char ***) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); } @@ -1925,9 +1886,12 @@ static int add_a_service(const service * pservice, const char *name) add a new home service, with the specified home directory, defaults coming from service ifrom. ***************************************************************************/ -BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHomedir) +BOOL lp_add_home(const char *pszHomename, int iDefaultService, + const char *user, const char *pszHomedir) { int i; + pstring newHomedir; + SMB_STRUCT_STAT buf; /* if the user's home directory doesn't exist, then don't @@ -1941,21 +1905,29 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *pszHo return (False); if (!(*(ServicePtrs[i]->szPath)) - || strequal(ServicePtrs[i]->szPath, lp_pathname(-1))) - string_set(&ServicePtrs[i]->szPath, pszHomedir); + || strequal(ServicePtrs[i]->szPath, lp_pathname(-1))) { + pstrcpy(newHomedir, pszHomedir); + } else { + pstrcpy(newHomedir, lp_pathname(iDefaultService)); + string_sub(newHomedir,"%H", pszHomedir, sizeof(newHomedir)); + } + + string_set(&ServicePtrs[i]->szPath, newHomedir); + if (!(*(ServicePtrs[i]->comment))) { pstring comment; slprintf(comment, sizeof(comment) - 1, - "Home directory of %s", pszHomename); + "Home directory of %s", user); string_set(&ServicePtrs[i]->comment, comment); } ServicePtrs[i]->bAvailable = sDefault.bAvailable; ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; DEBUG(3, - ("adding home directory %s at %s\n", pszHomename, pszHomedir)); - + ("adding home's share [%s] for user %s at %s\n", pszHomename, + user, newHomedir)); + return (True); } @@ -1999,6 +1971,7 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) return (True); } +BOOL (*register_printer_fn)(const char *); /*************************************************************************** add a new printer service, with defaults coming from service iFrom. @@ -2031,6 +2004,10 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) DEBUG(3, ("adding printer service %s\n", pszPrintername)); + update_server_announce_as_printserver(); + if (register_printer_fn && (!(*register_printer_fn)(pszPrintername))) + return False; + return (True); } @@ -2049,7 +2026,12 @@ static int map_parameter(char *pszParmName) if (strwicmp(parm_table[iIndex].label, pszParmName) == 0) return (iIndex); - DEBUG(0, ("Unknown parameter encountered: \"%s\"\n", pszParmName)); + /* Warn only if it isn't parametric option */ + if (strchr(pszParmName, ':') == NULL) + DEBUG(0, ("Unknown parameter encountered: \"%s\"\n", pszParmName)); + /* We do return 'fail' for parametric options as well because they are + stored in different storage + */ return (-1); } @@ -2155,7 +2137,7 @@ static void copy_service(service * pserviceDest, strupper(*(char **)dest_ptr); break; case P_LIST: - lp_list_copy((char ***)dest_ptr, *(char ***)src_ptr); + str_list_copy((char ***)dest_ptr, *(char ***)src_ptr); break; default: break; @@ -2284,7 +2266,7 @@ BOOL lp_file_list_changed(void) time_t mod_time; pstrcpy(n2, f->name); - standard_sub_basic(current_user_info.smb_name, n2); + standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2)); DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", f->name, n2, ctime(&f->modtime))); @@ -2317,7 +2299,7 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) pstrcpy(netbios_name, pszParmValue); - standard_sub_basic(current_user_info.smb_name, netbios_name); + standard_sub_basic(current_user_info.smb_name, netbios_name,sizeof(netbios_name)); strupper(netbios_name); pstrcpy(global_myname, netbios_name); @@ -2399,7 +2381,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) pstrcpy(fname, pszParmValue); - standard_sub_basic(current_user_info.smb_name, fname); + standard_sub_basic(current_user_info.smb_name, fname,sizeof(fname)); string_set(ptr, pszParmValue); @@ -2457,7 +2439,7 @@ static BOOL handle_include(char *pszParmValue, char **ptr) pstring fname; pstrcpy(fname, pszParmValue); - standard_sub_basic(current_user_info.smb_name, fname); + standard_sub_basic(current_user_info.smb_name, fname,sizeof(fname)); add_to_file_list(pszParmValue, fname); @@ -2633,19 +2615,6 @@ static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) return True; } -/*************************************************************************** - Handle the WINS SERVER list -***************************************************************************/ -static BOOL handle_wins_server_list( char *pszParmValue, char **ptr ) - { - if( !wins_srv_load_list( pszParmValue ) ) - return( False ); /* Parse failed. */ - - string_set( ptr, pszParmValue ); - return( True ); - } - - /*************************************************************************** Handle the DEBUG level list ***************************************************************************/ @@ -2657,7 +2626,6 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) return debug_parse_levels( pszParmValue ); } -#ifdef WITH_LDAP_SAM /*************************************************************************** Handle the ldap machine suffix option ***************************************************************************/ @@ -2740,7 +2708,6 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) string_set(ptr, suffix); return True; } -#endif /* WITH_LDAP_SAM */ /*************************************************************************** initialise a copymap @@ -2775,14 +2742,32 @@ then assume we are in the globals ***************************************************************************/ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) { - int parmnum, i; + int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ void *def_ptr = NULL; + pstring vfskey; + char *sep; + param_opt_struct *paramo; parmnum = map_parameter(pszParmName); if (parmnum < 0) { + if ((sep=strchr(pszParmName, ':')) != NULL) { + *sep = 0; + ZERO_STRUCT(vfskey); + pstr_sprintf(vfskey, "%s:%s:", + (snum >= 0) ? lp_servicename(snum) : "global", pszParmName); + slen = strlen(vfskey); + safe_strcat(vfskey, sep+1, sizeof(pstring)); + trim_string(vfskey+slen, " ", " "); + paramo = smb_xmalloc(sizeof(param_opt_struct)); + paramo->key = strdup(vfskey); + paramo->value = strdup(pszParmValue); + DLIST_ADD(param_opt, paramo); + *sep = ':'; + return (True); + } DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); return (True); @@ -2790,7 +2775,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) if (parm_table[parmnum].flags & FLAG_DEPRECATED) { - DEBUG(1, ("WARNING: The \"%s\"option is deprecated\n", + DEBUG(1, ("WARNING: The \"%s\" option is deprecated\n", pszParmName)); } @@ -2859,7 +2844,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) break; case P_LIST: - *(char ***)parm_ptr = lp_list_make(pszParmValue); + *(char ***)parm_ptr = str_list_make(pszParmValue); break; case P_STRING: @@ -3006,7 +2991,7 @@ static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) return (*((char *)ptr1) == *((char *)ptr2)); case P_LIST: - return lp_list_compare(*(char ***)ptr1, *(char ***)ptr2); + return str_list_compare(*(char ***)ptr1, *(char ***)ptr2); case P_GSTRING: case P_UGSTRING: @@ -3107,7 +3092,7 @@ static BOOL is_default(int i) switch (parm_table[i].type) { case P_LIST: - return lp_list_compare (parm_table[i].def.lvalue, + return str_list_compare (parm_table[i].def.lvalue, *(char ***)parm_table[i].ptr); case P_STRING: case P_USTRING: @@ -3142,6 +3127,9 @@ Display the contents of the global structure. static void dump_globals(FILE *f) { int i; + param_opt_struct *data; + char *s; + fprintf(f, "# Global parameters\n[global]\n"); for (i = 0; parm_table[i].label; i++) @@ -3155,6 +3143,17 @@ static void dump_globals(FILE *f) print_parameter(&parm_table[i], parm_table[i].ptr, f); fprintf(f, "\n"); } + if (param_opt != NULL) { + data = param_opt; + while(data) { + if (((s=strstr(data->key, "global")) == data->key) && + (*(s+strlen("global")) == ':')) { + fprintf(f, "\t%s = %s\n", s+strlen("global")+1, data->value); + } + data = data->next; + } + } + } /*************************************************************************** @@ -3169,13 +3168,15 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) ((char *)&sDefault) + pdiff); } - /*************************************************************************** Display the contents of a single services record. ***************************************************************************/ static void dump_a_service(service * pService, FILE * f) { int i; + param_opt_struct *data; + char *s, *sn; + if (pService != &sDefault) fprintf(f, "\n[%s]\n", pService->szService); @@ -3207,6 +3208,17 @@ static void dump_a_service(service * pService, FILE * f) ((char *)pService) + pdiff, f); fprintf(f, "\n"); } + if (param_opt != NULL) { + data = param_opt; + sn = (pService == &sDefault) ? "global" : pService->szService; + while(data) { + if (((s=strstr(data->key, sn)) == data->key) && + (*(s+strlen(sn)) == ':')) { + fprintf(f, "\t%s = %s\n", s+strlen(sn)+1, data->value); + } + data = data->next; + } + } } @@ -3325,13 +3337,13 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) { - char *home = get_user_service_home_dir(p); + char *home = get_user_home_dir(p); if (lp_servicenumber(p) >= 0) continue; if (home && homes >= 0) - lp_add_home(p, homes, home); + lp_add_home(p, homes, p, home); } SAFE_FREE(s); } @@ -3354,6 +3366,13 @@ void lp_add_one_printer(char *name, char *comment) } } +/* 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? ***************************************************************************/ @@ -3407,18 +3426,24 @@ static void lp_save_defaults(void) continue; switch (parm_table[i].type) { case P_LIST: - lp_list_copy(&(parm_table[i].def.lvalue), + str_list_copy(&(parm_table[i].def.lvalue), *(char ***)parm_table[i].ptr); break; case P_STRING: case P_USTRING: - parm_table[i].def.svalue = - strdup(*(char **)parm_table[i].ptr); + if (parm_table[i].ptr) { + parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr); + } else { + parm_table[i].def.svalue = NULL; + } break; case P_GSTRING: case P_UGSTRING: - parm_table[i].def.svalue = - strdup((char *)parm_table[i].ptr); + if (parm_table[i].ptr) { + parm_table[i].def.svalue = strdup((char *)parm_table[i].ptr); + } else { + parm_table[i].def.svalue = NULL; + } break; case P_BOOL: case P_BOOLREV: @@ -3452,41 +3477,38 @@ static void set_server_role(void) switch (lp_security()) { case SEC_SHARE: - { - if (lp_domain_logons()) { - DEBUG(0, - ("Server's Role (logon server) conflicts with share-level security\n")); - } + if (lp_domain_logons()) + DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n")); + DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); break; - } case SEC_SERVER: case SEC_DOMAIN: case SEC_ADS: - { if (lp_domain_logons()) { server_role = ROLE_DOMAIN_BDC; + DEBUG(10,("set_server_role:ROLE_DOMAIN_BDC\n")); break; } server_role = ROLE_DOMAIN_MEMBER; + DEBUG(10,("set_server_role: ROLE_DOMAIN_MEMBER\n")); break; - } case SEC_USER: - { if (lp_domain_logons()) { server_role = ROLE_DOMAIN_PDC; + DEBUG(10,("set_server_role: ROLE_DOMAIN_PDC\n")); break; } + DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); break; - } default: - { - DEBUG(0, - ("Server's Role undefined due to unknown security mode\n")); - } + DEBUG(0, ("Server's Role undefined due to unknown security mode\n")); + DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); + break; } } + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. @@ -3496,14 +3518,17 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, { pstring n2; BOOL bRetval; + param_opt_struct *data, *pdata; pstrcpy(n2, pszFname); - standard_sub_basic(current_user_info.smb_name, n2); + standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2)); add_to_file_list(pszFname, n2); bRetval = False; + DEBUG(3, ("lp_load: refreshing parmaters\n")); + bInGlobalSection = True; bGlobalOnly = global_only; @@ -3515,6 +3540,18 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, lp_save_defaults(); } + if (param_opt != NULL) { + data = param_opt; + while (data) { + SAFE_FREE(data->key); + SAFE_FREE(data->value); + pdata = data->next; + SAFE_FREE(data); + data = pdata; + } + param_opt = NULL; + } + /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter); @@ -3540,7 +3577,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ /* if bWINSsupport is true and we are in the client */ if (in_client && Globals.bWINSsupport) { - string_set(&Globals.szWINSserver, "127.0.0.1"); + lp_do_parameter(-1, "wins server", "127.0.0.1"); } init_iconv(); @@ -3548,7 +3585,6 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, return (bRetval); } - /*************************************************************************** reset the max number of services ***************************************************************************/ @@ -3620,7 +3656,7 @@ int lp_servicenumber(const char *pszServiceName) * service names */ fstrcpy(serviceName, ServicePtrs[iService]->szService); - standard_sub_basic(current_user_info.smb_name, serviceName); + standard_sub_basic(current_user_info.smb_name, serviceName,sizeof(serviceName)); if (strequal(serviceName, pszServiceName)) break; } @@ -3633,7 +3669,7 @@ int lp_servicenumber(const char *pszServiceName) } /******************************************************************* - A useful volume label function. Returns a string in DOS codepage. + A useful volume label function. ********************************************************************/ char *volume_label(int snum) @@ -3654,7 +3690,6 @@ static void set_default_server_announce_type(void) default_server_announce |= SV_TYPE_WORKSTATION; default_server_announce |= SV_TYPE_SERVER; default_server_announce |= SV_TYPE_SERVER_UNIX; - default_server_announce |= SV_TYPE_PRINTQ_SERVER; switch (lp_announce_as()) { @@ -3846,196 +3881,16 @@ void lp_set_name_resolve_order(char *new_order) Globals.szNameResolveOrder = new_order; } -char *lp_printername(int snum) +const char *lp_printername(int snum) { - char *ret = _lp_printername(snum); + const char *ret = _lp_printername(snum); if (ret == NULL || (ret != NULL && *ret == '\0')) - ret = lp_servicename(snum); + ret = lp_const_servicename(snum); return ret; } -/*********************************************************** - List Parameters manipulation functions -***********************************************************/ - -#define P_LIST_ABS 16 /* P_LIST Allocation Block Size */ - -char **lp_list_make(char *string) -{ - char **list, **rlist; - char *str, *s; - int num, lsize; - pstring tok; - - if (!string || !*string) return NULL; - s = strdup(string); - if (!s) { - DEBUG(0,("lp_list_make: Unable to allocate memory")); - return NULL; - } - - num = lsize = 0; - list = NULL; - - str = s; - while (next_token(&str, tok, LIST_SEP, sizeof(pstring))) - { - if (num == lsize) { - lsize += P_LIST_ABS; - rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); - if (!rlist) { - DEBUG(0,("lp_list_make: Unable to allocate memory")); - lp_list_free(&list); - SAFE_FREE(s); - return NULL; - } - else list = rlist; - memset (&list[num], 0, ((sizeof(char**)) * (P_LIST_ABS +1))); - } - - list[num] = strdup(tok); - if (!list[num]) { - DEBUG(0,("lp_list_make: Unable to allocate memory")); - lp_list_free(&list); - SAFE_FREE(s); - return NULL; - } - - num++; - } - - SAFE_FREE(s); - return list; -} - -BOOL lp_list_copy(char ***dest, char **src) -{ - char **list, **rlist; - int num, lsize; - - *dest = NULL; - if (!src) return False; - - num = lsize = 0; - list = NULL; - - while (src[num]) - { - if (num == lsize) { - lsize += P_LIST_ABS; - rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1))); - if (!rlist) { - DEBUG(0,("lp_list_copy: Unable to allocate memory")); - lp_list_free(&list); - return False; - } - else list = rlist; - memset (&list[num], 0, ((sizeof(char **)) * (P_LIST_ABS +1))); - } - - list[num] = strdup(src[num]); - if (!list[num]) { - DEBUG(0,("lp_list_copy: Unable to allocate memory")); - lp_list_free(&list); - return False; - } - - num++; - } - - *dest = list; - return True; -} - -/* return true if all the elemnts of the list matches exactly */ -BOOL lp_list_compare(char **list1, char **list2) -{ - int num; - - if (!list1 || !list2) return (list1 == list2); - - for (num = 0; list1[num]; num++) { - if (!list2[num]) return False; - if (!strcsequal(list1[num], list2[num])) return False; - } - if (list2[num]) return False; /* if list2 has more elements than list1 fail */ - - return True; -} - -void lp_list_free(char ***list) -{ - char **tlist; - - if (!list || !*list) return; - tlist = *list; - for(; *tlist; tlist++) SAFE_FREE(*tlist); - SAFE_FREE(*list); -} - -BOOL lp_list_substitute(char **list, const char *pattern, const char *insert) -{ - char *p, *s, *t; - ssize_t ls, lp, li, ld, i, d; - - if (!list) return False; - if (!pattern) return False; - if (!insert) return False; - - lp = (ssize_t)strlen(pattern); - li = (ssize_t)strlen(insert); - ld = li -lp; - - while (*list) - { - s = *list; - ls = (ssize_t)strlen(s); - - while ((p = strstr(s, pattern))) - { - t = *list; - d = p -t; - if (ld) - { - t = (char *) malloc(ls +ld +1); - if (!t) { - DEBUG(0,("lp_list_substitute: Unable to allocate memory")); - return False; - } - memcpy(t, *list, d); - memcpy(t +d +li, p +lp, ls -d -lp +1); - SAFE_FREE(*list); - *list = t; - ls += ld; - s = t +d +li; - } - - for (i = 0; i < li; i++) { - switch (insert[i]) { - case '`': - case '"': - case '\'': - case ';': - case '$': - case '%': - case '\r': - case '\n': - t[d +i] = '_'; - break; - default: - t[d +i] = insert[i]; - } - } - } - - list++; - } - - return True; -} - /**************************************************************** Compatibility fn. for 2.2.2 code..... *****************************************************************/ @@ -4087,5 +3942,25 @@ void lp_set_logfile(const char *name) const char *get_called_name(void) { extern fstring local_machine; - return (*local_machine) ? local_machine : global_myname; + static fstring called_name; + + if (! *local_machine) + return global_myname; + + /* + * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV" + * arrggg!!! but we've already rewritten the client's + * netbios name at this point... + */ + + if (*local_machine) { + if (!StrCaseCmp(local_machine, "_SMBSERVER") || !StrCaseCmp(local_machine, "_SMBSERV")) { + 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; } -- cgit From b2edf254eda92f775e7d3d9b6793b4d77f9000b6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Aug 2002 17:00:51 +0000 Subject: sync 3.0 branch with head (This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290) --- source3/param/loadparm.c | 96 +++++++++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 34 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6e3ce460cd..b16f4483f8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -87,6 +87,7 @@ static BOOL defaults_saved = False; */ typedef struct { + char *smb_ports; char *dos_charset; char *unix_charset; char *display_charset; @@ -165,6 +166,7 @@ typedef struct char *szGuestaccount; char *szManglingMethod; int max_log_size; + char *szLogLevel; int mangled_stack; int max_xmit; int max_mux; @@ -256,7 +258,9 @@ typedef struct BOOL bHostnameLookups; BOOL bUseSpnego; BOOL bUnixExtensions; + BOOL bDisableNetbios; int restrict_anonymous; + int name_cache_timeout; } global; @@ -313,6 +317,7 @@ typedef struct char *fstype; char *szVfsObjectFile; char *szVfsOptions; + char *szVfsPath; int iMinPrintSpace; int iMaxPrintJobs; int iWriteCacheSize; @@ -339,6 +344,7 @@ typedef struct BOOL bCaseMangle; BOOL bHideDotFiles; BOOL bHideUnReadable; + BOOL bHideUnWriteableFiles; BOOL bBrowseable; BOOL bAvailable; BOOL bRead_only; @@ -431,6 +437,7 @@ static service sDefault = { NULL, /* fstype */ NULL, /* vfs object */ NULL, /* vfs options */ + NULL, /* vfs path */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ 0, /* iWriteCacheSize */ @@ -457,6 +464,7 @@ static service sDefault = { False, /* case mangle */ True, /* bHideDotFiles */ False, /* bHideUnReadable */ + False, /* bHideUnWriteableFiles */ True, /* bBrowseable */ True, /* bAvailable */ True, /* bRead_only */ @@ -545,7 +553,9 @@ static struct enum_list enum_security[] = { {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, {SEC_DOMAIN, "DOMAIN"}, +#ifdef HAVE_ADS {SEC_ADS, "ADS"}, +#endif {-1, NULL} }; @@ -759,8 +769,8 @@ static struct parm_struct parm_table[] = { {"Logging Options", P_SEP, P_SEPARATOR}, {"admin log", P_BOOL, P_GLOBAL, &Globals.bAdminLog, NULL, NULL, 0}, - {"log level", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0}, - {"debuglevel", P_STRING, P_GLOBAL, NULL, handle_debug_list, NULL, 0}, + {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0}, + {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0}, {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, @@ -774,6 +784,7 @@ static struct parm_struct parm_table[] = { {"Protocol Options", P_SEP, P_SEPARATOR}, + {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 0}, {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, @@ -782,6 +793,7 @@ static struct parm_struct parm_table[] = { {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, + {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, 0}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE }, @@ -827,6 +839,8 @@ static struct parm_struct parm_table[] = { {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, + {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, 0}, + {"Printing Options", P_SEP, P_SEPARATOR}, {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, @@ -875,6 +889,7 @@ static struct parm_struct parm_table[] = { {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, @@ -1021,6 +1036,7 @@ static struct parm_struct parm_table[] = { {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, + {"vfs path", P_STRING, P_LOCAL, &sDefault.szVfsPath, NULL, NULL, FLAG_SHARE}, {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, @@ -1057,26 +1073,26 @@ static void init_printer_values(void) 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.szLpqcommand, "lpq -P'%p'"); + string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j"); string_set(&sDefault.szPrintcommand, - "lpr -r -P%p %s"); + "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.szLpqcommand, "lpq -P'%p'"); + string_set(&sDefault.szLprmcommand, "lprm -P'%p' %j"); string_set(&sDefault.szPrintcommand, - "lpr -r -P%p %s"); + "lpr -r -P'%p' %s"); string_set(&sDefault.szQueuepausecommand, - "lpc stop %p"); + "lpc stop '%p'"); string_set(&sDefault.szQueueresumecommand, - "lpc start %p"); + "lpc start '%p'"); string_set(&sDefault.szLppausecommand, - "lpc hold %p %j"); + "lpc hold '%p' %j"); string_set(&sDefault.szLpresumecommand, - "lpc release %p %j"); + "lpc release '%p' %j"); break; case PRINT_CUPS: @@ -1092,19 +1108,19 @@ static void init_printer_values(void) string_set(&Globals.szPrintcapname, "cups"); #else string_set(&sDefault.szLpqcommand, - "/usr/bin/lpstat -o %p"); + "/usr/bin/lpstat -o '%p'"); string_set(&sDefault.szLprmcommand, - "/usr/bin/cancel %p-%j"); + "/usr/bin/cancel '%p-%j'"); string_set(&sDefault.szPrintcommand, - "/usr/bin/lp -d %p %s; rm %s"); + "/usr/bin/lp -d '%p' %s; rm %s"); string_set(&sDefault.szLppausecommand, - "lp -i %p-%j -H hold"); + "lp -i '%p-%j' -H hold"); string_set(&sDefault.szLpresumecommand, - "lp -i %p-%j -H resume"); + "lp -i '%p-%j' -H resume"); string_set(&sDefault.szQueuepausecommand, - "/usr/bin/disable %p"); + "/usr/bin/disable '%p'"); string_set(&sDefault.szQueueresumecommand, - "/usr/bin/enable %p"); + "/usr/bin/enable '%p'"); string_set(&Globals.szPrintcapname, "lpstat"); #endif /* HAVE_CUPS */ break; @@ -1191,7 +1207,7 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); - Globals.szPassdbBackend = str_list_make("smbpasswd unixsam"); + Globals.szPassdbBackend = str_list_make("smbpasswd unixsam", NULL); /* use the new 'hash2' method by default */ string_set(&Globals.szManglingMethod, "hash2"); @@ -1201,6 +1217,9 @@ static void init_globals(void) /* using UTF8 by default allows us to support all chars */ string_set(&Globals.unix_charset, "UTF8"); + /* Use codepage 850 as a default for the dos character set */ + string_set(&Globals.dos_charset, "CP850"); + /* * Allow the default PASSWD_CHAT to be overridden in local.h. */ @@ -1262,6 +1281,7 @@ static void init_globals(void) Globals.bSyslogOnly = False; Globals.bAdminLog = False; Globals.bTimestampLogs = True; + string_set(&Globals.szLogLevel, "0"); Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; @@ -1358,8 +1378,11 @@ static void init_globals(void) Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; + Globals.name_cache_timeout = 660; /* In seconds */ + Globals.bUseSpnego = True; + string_set(&Globals.smb_ports, SMB_PORTS); } static TALLOC_CTX *lp_talloc; @@ -1407,7 +1430,10 @@ static char *lp_string(const char *s) else StrnCpy(ret, s, len); - trim_string(ret, "\"", "\""); + if (trim_string(ret, "\"", "\"")) { + if (strchr(ret,'"') != NULL) + StrnCpy(ret, s, len); + } standard_sub_basic(current_user_info.smb_name,ret,len+100); return (ret); @@ -1445,6 +1471,7 @@ static char *lp_string(const char *s) #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} +FN_GLOBAL_STRING(lp_smb_ports, &Globals.smb_ports) FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset) FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset) FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset) @@ -1498,7 +1525,7 @@ FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) -FN_GLOBAL_STRING(lp_guestaccount, &Globals.szGuestaccount) +FN_GLOBAL_CONST_STRING(lp_guestaccount, &Globals.szGuestaccount) FN_GLOBAL_STRING(lp_addgroup_script, &Globals.szAddGroupScript) FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) @@ -1527,6 +1554,7 @@ 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_disable_netbios, &Globals.bDisableNetbios) FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport) @@ -1642,6 +1670,7 @@ FN_LOCAL_LIST(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) FN_LOCAL_STRING(lp_vfs_options, szVfsOptions) +FN_LOCAL_STRING(lp_vfs_path, szVfsPath) static FN_LOCAL_STRING(lp_volume, volume) FN_LOCAL_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) @@ -1658,6 +1687,7 @@ FN_LOCAL_BOOL(lp_shortpreservecase, bShortCasePreserve) FN_LOCAL_BOOL(lp_casemangle, bCaseMangle) FN_LOCAL_BOOL(lp_hide_dot_files, bHideDotFiles) FN_LOCAL_BOOL(lp_hideunreadable, bHideUnReadable) +FN_LOCAL_BOOL(lp_hideunwriteable_files, bHideUnWriteableFiles) FN_LOCAL_BOOL(lp_browseable, bBrowseable) FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) @@ -1715,6 +1745,7 @@ FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) FN_GLOBAL_BOOL(lp_algorithmic_rid_base, &Globals.bAlgorithmicRidBase) +FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) typedef struct _param_opt_struct param_opt_struct; struct _param_opt_struct { @@ -1904,8 +1935,8 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, if (i < 0) return (False); - if (!(*(ServicePtrs[i]->szPath)) - || strequal(ServicePtrs[i]->szPath, lp_pathname(-1))) { + if (!(*(ServicePtrs[iDefaultService]->szPath)) + || strequal(ServicePtrs[iDefaultService]->szPath, lp_pathname(-1))) { pstrcpy(newHomedir, pszHomedir); } else { pstrcpy(newHomedir, lp_pathname(iDefaultService)); @@ -1925,7 +1956,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; DEBUG(3, - ("adding home's share [%s] for user %s at %s\n", pszHomename, + ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, user, newHomedir)); return (True); @@ -1971,14 +2002,12 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) return (True); } -BOOL (*register_printer_fn)(const char *); - /*************************************************************************** add a new printer service, with defaults coming from service iFrom. ***************************************************************************/ -BOOL lp_add_printer(char *pszPrintername, int iDefaultService) +BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) { - char *comment = "From Printcap"; + const char *comment = "From Printcap"; int i = add_a_service(ServicePtrs[iDefaultService], pszPrintername); if (i < 0) @@ -2005,8 +2034,6 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService) DEBUG(3, ("adding printer service %s\n", pszPrintername)); update_server_announce_as_printserver(); - if (register_printer_fn && (!(*register_printer_fn)(pszPrintername))) - return False; return (True); } @@ -2623,6 +2650,7 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) pstring pszParmValue; pstrcpy(pszParmValue, pszParmValueIn); + string_set(ptr, pszParmValueIn); return debug_parse_levels( pszParmValue ); } @@ -2844,7 +2872,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) break; case P_LIST: - *(char ***)parm_ptr = str_list_make(pszParmValue); + *(char ***)parm_ptr = str_list_make(pszParmValue, NULL); break; case P_STRING: @@ -3485,8 +3513,8 @@ static void set_server_role(void) case SEC_DOMAIN: case SEC_ADS: if (lp_domain_logons()) { - server_role = ROLE_DOMAIN_BDC; - DEBUG(10,("set_server_role:ROLE_DOMAIN_BDC\n")); + server_role = ROLE_DOMAIN_PDC; + DEBUG(10,("set_server_role:ROLE_DOMAIN_PDC\n")); break; } server_role = ROLE_DOMAIN_MEMBER; -- cgit From a834a73e341059be154426390304a42e4a011f72 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Sep 2002 15:19:00 +0000 Subject: sync'ing up for 3.0alpha20 release (This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139) --- source3/param/loadparm.c | 502 ++++++++++++++++++++++++++--------------------- 1 file changed, 280 insertions(+), 222 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b16f4483f8..c484439837 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -112,6 +112,7 @@ typedef struct char *szSMBPasswdFile; char *szPrivateDir; char **szPassdbBackend; + char **szSamBackend; char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; @@ -139,6 +140,7 @@ typedef struct char *szDelGroupScript; char *szAddUserToGroupScript; char *szDelUserFromGroupScript; + char *szSetPrimaryGroupScript; char *szAddMachineScript; char *szShutdownScript; char *szAbortShutdownScript; @@ -171,7 +173,6 @@ typedef struct int max_xmit; int max_mux; int max_open_files; - int max_packet; int pwordlevel; int unamelevel; int deadtime; @@ -206,11 +207,11 @@ typedef struct int iLockSpinTime; char *szLdapMachineSuffix; char *szLdapUserSuffix; - int ldap_port; int ldap_ssl; char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; + int ldap_passwd_sync; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; BOOL bWINSsupport; @@ -231,7 +232,6 @@ typedef struct BOOL bReadPrediction; BOOL bReadbmpx; BOOL bSyslogOnly; - BOOL bAdminLog; BOOL bBrowseList; BOOL bNISHomeMap; BOOL bTimeServer; @@ -335,7 +335,6 @@ typedef struct int iOplockContentionLimit; int iCSCPolicy; int iBlock_size; - BOOL bAlternatePerm; BOOL bPreexecClose; BOOL bRootpreexecClose; BOOL bCaseSensitive; @@ -343,6 +342,7 @@ typedef struct BOOL bShortCasePreserve; BOOL bCaseMangle; BOOL bHideDotFiles; + BOOL bHideSpecialFiles; BOOL bHideUnReadable; BOOL bHideUnWriteableFiles; BOOL bBrowseable; @@ -385,6 +385,10 @@ typedef struct BOOL bUseClientDriver; BOOL bDefaultDevmode; BOOL bNTAclSupport; +#ifdef WITH_SENDFILE + BOOL bUseSendfile; +#endif + BOOL bProfileAcls; char dummy[3]; /* for alignment */ } @@ -455,7 +459,6 @@ static service sDefault = { 2, /* iOplockContentionLimit */ 0, /* iCSCPolicy */ 1024, /* iBlock_size */ - False, /* bAlternatePerm */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ False, /* case sensitive */ @@ -463,6 +466,7 @@ static service sDefault = { True, /* short case preserve */ False, /* case mangle */ True, /* bHideDotFiles */ + False, /* bHideSpecialFiles */ False, /* bHideUnReadable */ False, /* bHideUnWriteableFiles */ True, /* bBrowseable */ @@ -505,6 +509,10 @@ static service sDefault = { False, /* bUseClientDriver */ False, /* bDefaultDevmode */ True, /* bNTAclSupport */ +#ifdef WITH_SENDFILE + False, /* bUseSendfile */ +#endif + False, /* bProfileAcls */ "" /* dummy */ }; @@ -592,6 +600,22 @@ static struct enum_list enum_ldap_ssl[] = { {-1, NULL} }; +static struct enum_list enum_ldap_passwd_sync[] = { + {LDAP_PASSWD_SYNC_ON, "Yes"}, + {LDAP_PASSWD_SYNC_ON, "yes"}, + {LDAP_PASSWD_SYNC_ON, "on"}, + {LDAP_PASSWD_SYNC_ON, "On"}, + {LDAP_PASSWD_SYNC_OFF, "no"}, + {LDAP_PASSWD_SYNC_OFF, "No"}, + {LDAP_PASSWD_SYNC_OFF, "off"}, + {LDAP_PASSWD_SYNC_OFF, "Off"}, +#ifdef LDAP_EXOP_X_MODIFY_PASSWD + {LDAP_PASSWD_SYNC_ONLY, "Only"}, + {LDAP_PASSWD_SYNC_ONLY, "only"}, +#endif /* LDAP_EXOP_X_MODIFY_PASSWD */ + {-1, NULL} +}; + /* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT_SERVER 1 #define ANNOUNCE_AS_WIN95 2 @@ -666,66 +690,75 @@ static struct enum_list enum_map_to_guest[] = { {-1, NULL} }; -/* note that we do not initialise the defaults union - it is not allowed in ANSI C */ +/* Note: We do not initialise the defaults union - it is not allowed in ANSI C + * + * Note: We have a flag called FLAG_DEVELOPER but is not used at this time, it + * is implied in current control logic. This may change at some later time. A + * flag value of 0 means - show as development option only. + * + * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit + * screen in SWAT. This is used to exclude parameters as well as to squash all + * parameters that have been duplicated by pseudonyms. + */ static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, 0}, - {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, 0}, - {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, 0}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC}, - {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC}, - {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC}, - {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0}, - {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, 0}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC }, - {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC}, - {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, 0}, + {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"Security Options", P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC}, - {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC}, - {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC}, - {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, 0}, - {"alternate permissions", P_BOOL, P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL | FLAG_DEPRECATED}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 0}, - {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, 0}, - {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, 0}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 0}, - {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, 0}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, 0}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, 0}, - {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, 0}, - {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, 0}, - {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, 0}, - {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, 0}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0}, - {"guest account", P_STRING, P_GLOBAL, &Globals.szGuestaccount, NULL, NULL, FLAG_BASIC}, + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"sam backend", P_LIST, P_GLOBAL, &Globals.szSamBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE | FLAG_DEVELOPER}, + {"guest account", P_STRING, P_GLOBAL, &Globals.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, 0}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0}, - {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0}, - {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, 0}, - {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, 0}, - {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, 0}, + {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEVELOPER}, + {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, @@ -735,12 +768,12 @@ static struct parm_struct parm_table[] = { {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, 0}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_SHARE}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, 0}, + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, @@ -755,101 +788,103 @@ static struct parm_struct parm_table[] = { {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, {"inherit acls", P_BOOL, P_LOCAL, &sDefault.bInheritACLS, NULL, NULL, FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, 0}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, 0}, + {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, + {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_HIDE}, {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 0}, - {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, 0}, + {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, + {"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 | FLAG_DEVELOPER}, + {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_HIDE}, {"Logging Options", P_SEP, P_SEPARATOR}, - {"admin log", P_BOOL, P_GLOBAL, &Globals.bAdminLog, NULL, NULL, 0}, - {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0}, - {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, 0}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, 0}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, 0}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 0}, + {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_HIDE}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 0}, - {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 0}, - {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, 0}, - {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 0}, - {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 0}, + {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_DEVELOPER}, + {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, FLAG_DEVELOPER}, + {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, FLAG_DEVELOPER}, + {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, FLAG_DEVELOPER}, {"Protocol Options", P_SEP, P_SEPARATOR}, - {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 0}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 0}, - {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 0}, - {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, 0}, - {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, 0}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, 0}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, 0}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, 0}, - {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, 0}, + {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, FLAG_DEVELOPER}, + {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_DEVELOPER}, + {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, FLAG_DEVELOPER}, + {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, FLAG_DEVELOPER}, + {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, FLAG_DEVELOPER}, + {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, FLAG_DEVELOPER}, + {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER}, + {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + + {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, + {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE }, - {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, 0}, - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, 0}, + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_DEVELOPER}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_DEVELOPER}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, 0}, - {"max packet", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"packet size", P_INTEGER, P_GLOBAL, &Globals.max_packet, NULL, NULL, 0}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, 0}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, 0}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, 0}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, 0}, - {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, 0}, - {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, 0}, + {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_DEVELOPER}, {"Tuning Options", P_SEP, P_SEPARATOR}, {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, 0}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, 0}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, 0}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, 0}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, FLAG_DEVELOPER}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_DEVELOPER}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_DEVELOPER}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, 0}, - {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, 0}, + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_DEVELOPER}, + {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_DEVELOPER}, {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, - {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, 0}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, 0}, - {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, 0}, + {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, FLAG_DEVELOPER}, + {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, FLAG_DEVELOPER}, + {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, 0}, + {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, FLAG_DEVELOPER}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, 0}, - {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, 0}, + {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_DEVELOPER}, + {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, FLAG_DEVELOPER}, {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, - {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, 0}, - {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, 0}, + {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_DEVELOPER}, +#ifdef WITH_SENDFILE + {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_SHARE}, +#endif + {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, - {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, 0}, + {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Printing Options", P_SEP, P_SEPARATOR}, {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, 0}, + {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT | FLAG_DEVELOPER}, + {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_HIDE}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, - {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 0}, + {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE}, {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -861,14 +896,14 @@ static struct parm_struct parm_table[] = { {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0}, - {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0}, - {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0}, - {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0}, - {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, 0}, + {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0}, + {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_HIDE}, {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, @@ -876,18 +911,19 @@ static struct parm_struct parm_table[] = { {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL | FLAG_DEPRECATED}, {"Filename Handling", P_SEP, P_SEPARATOR}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, 0}, - {"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, 0}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, 0}, + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 0}, + {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_HIDE}, {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, + {"hide special files", P_BOOL, P_LOCAL, &sDefault.bHideSpecialFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -899,52 +935,53 @@ static struct parm_struct parm_table[] = { {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, 0}, + {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, FLAG_DEVELOPER}, {"Domain Options", P_SEP, P_SEPARATOR}, - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, + {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"Logon Options", P_SEP, P_SEPARATOR}, - {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, 0}, - {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, 0}, - {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, 0}, - {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, 0}, - {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, 0}, - {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, 0}, - {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, 0}, - {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, 0}, - {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, 0}, - - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, 0}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, 0}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, 0}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, 0}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, 0}, + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"set primary group script", P_STRING, P_GLOBAL, &Globals.szSetPrimaryGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Browse Options", P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, 0}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, 0}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC}, + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, 0}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, 0}, - {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, + {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_DEVELOPER | FLAG_ADVANCED}, {"WINS Options", P_SEP, P_SEPARATOR}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, 0}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, 0}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC}, - {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, 0}, - {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, 0}, + {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"Locking Options", P_SEP, P_SEPARATOR}, @@ -966,57 +1003,58 @@ static struct parm_struct parm_table[] = { {"Ldap Options", P_SEP, P_SEPARATOR}, - {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, 0}, - {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_machine_suffix, NULL, 0}, - {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_user_suffix, NULL, 0}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, 0}, - {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, 0}, - {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 0}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_machine_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_user_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, - {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, 0}, - {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, 0}, - {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, 0}, + {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, 0}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0}, - {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, 0}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, #ifdef WITH_UTMP - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0}, - {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, 0}, - {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, 0}, + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, #endif - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, 0}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, 0}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, 0}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, 0}, - {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, 0}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, 0}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, 0}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, 0}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, 0}, + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DEVELOPER}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, FLAG_DEVELOPER}, + {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"-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_SHARE | FLAG_PRINT}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0}, + {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, - {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, + {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, @@ -1028,9 +1066,8 @@ static struct parm_struct parm_table[] = { {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, 0}, - {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, - NULL, 0}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"VFS module options", P_SEP, P_SEPARATOR}, @@ -1040,19 +1077,19 @@ static struct parm_struct parm_table[] = { {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, 0}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Winbind options", P_SEP, P_SEPARATOR}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_uid, NULL, 0}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_gid, NULL, 0}, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0}, - {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0}, - {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0}, - {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0}, - {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, 0}, - {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, 0}, - {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, 0}, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1250,7 +1287,6 @@ static void init_globals(void) Globals.bAlgorithmicRidBase = BASE_RID; Globals.bLoadPrinters = True; - Globals.max_packet = 65535; Globals.mangled_stack = 50; Globals.max_xmit = 65535; Globals.max_mux = 50; /* This is *needed* for profile support. */ @@ -1279,7 +1315,6 @@ static void init_globals(void) Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; - Globals.bAdminLog = False; Globals.bTimestampLogs = True; string_set(&Globals.szLogLevel, "0"); Globals.bDebugHiresTimestamp = False; @@ -1339,6 +1374,7 @@ static void init_globals(void) string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; + Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1521,6 +1557,7 @@ FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) +FN_GLOBAL_LIST(lp_sam_backend, &Globals.szSamBackend) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) @@ -1530,6 +1567,7 @@ FN_GLOBAL_STRING(lp_addgroup_script, &Globals.szAddGroupScript) FN_GLOBAL_STRING(lp_delgroup_script, &Globals.szDelGroupScript) FN_GLOBAL_STRING(lp_addusertogroup_script, &Globals.szAddUserToGroupScript) FN_GLOBAL_STRING(lp_deluserfromgroup_script, &Globals.szDelUserFromGroupScript) +FN_GLOBAL_STRING(lp_setprimarygroup_script, &Globals.szSetPrimaryGroupScript) FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) @@ -1550,6 +1588,7 @@ FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) +FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) 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) @@ -1574,7 +1613,6 @@ FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) -FN_GLOBAL_BOOL(lp_admin_log, &Globals.bAdminLog) FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) @@ -1686,6 +1724,7 @@ 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_hideunwriteable_files, bHideUnWriteableFiles) FN_LOCAL_BOOL(lp_browseable, bBrowseable) @@ -1724,6 +1763,10 @@ 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_nt_acl_support, bNTAclSupport) +#ifdef WITH_SENDFILE +FN_LOCAL_BOOL(lp_use_sendfile, bUseSendfile) +#endif +FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) @@ -3507,32 +3550,46 @@ static void set_server_role(void) case SEC_SHARE: if (lp_domain_logons()) DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n")); - DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); break; case SEC_SERVER: case SEC_DOMAIN: case SEC_ADS: if (lp_domain_logons()) { server_role = ROLE_DOMAIN_PDC; - DEBUG(10,("set_server_role:ROLE_DOMAIN_PDC\n")); break; } server_role = ROLE_DOMAIN_MEMBER; - DEBUG(10,("set_server_role: ROLE_DOMAIN_MEMBER\n")); break; case SEC_USER: if (lp_domain_logons()) { - server_role = ROLE_DOMAIN_PDC; - DEBUG(10,("set_server_role: ROLE_DOMAIN_PDC\n")); - break; + + if (Globals.bDomainMaster) /* auto or yes */ + server_role = ROLE_DOMAIN_PDC; + else + server_role = ROLE_DOMAIN_BDC; } - DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); break; default: DEBUG(0, ("Server's Role undefined due to unknown security mode\n")); - DEBUG(10,("set_server_role: ROLE_STANDALONE\n")); break; } + + DEBUG(10, ("set_server_role: role = ")); + + switch(server_role) { + case ROLE_STANDALONE: + DEBUGADD(10, ("ROLE_STANDALONE\n")); + break; + case ROLE_DOMAIN_MEMBER: + DEBUGADD(10, ("ROLE_DOMAIN_MEMBER\n")); + break; + case ROLE_DOMAIN_BDC: + DEBUGADD(10, ("ROLE_DOMAIN_BDC\n")); + break; + case ROLE_DOMAIN_PDC: + DEBUGADD(10, ("ROLE_DOMAIN_PDC\n")); + break; + } } @@ -3555,12 +3612,13 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, bRetval = False; - DEBUG(3, ("lp_load: refreshing parmaters\n")); + DEBUG(3, ("lp_load: refreshing parameters\n")); bInGlobalSection = True; bGlobalOnly = global_only; init_globals(); + debug_init(); if (save_defaults) { -- cgit From ad8a22e570c8970247dc76defc9be2b768bd102d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 1 Oct 2002 13:10:57 +0000 Subject: Updates from Samba HEAD: - Fix segfaults in the 'net ads' commands when no password is provided - Readd --with-ldapsam for 2.2 compatability. This conditionally compiles the old options, but the actual code is available on all ldap systems. - Fix shadow passwords (as per work with vl) - Fix sending plaintext passwords to unicode servers (again vl) - Add a bit of const to secrets.c functions - Fix some spelling and grammer by vance. - Document the -r option in smbgroupedit. There are more changes in HEAD, I'm only merging the changes I've been involved with. Andrew Bartlett (This used to be commit 83973c389355a5cc9ca74af467dfd8b5dabd2c8f) --- source3/param/loadparm.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c484439837..67276befec 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -207,6 +207,10 @@ typedef struct int iLockSpinTime; char *szLdapMachineSuffix; char *szLdapUserSuffix; +#ifdef WITH_LDAP_SAMCONFIG + int ldap_port; + char *szLdapServer; +#endif int ldap_ssl; char *szLdapSuffix; char *szLdapFilter; @@ -596,7 +600,7 @@ static struct enum_list enum_ldap_ssl[] = { {LDAP_SSL_OFF, "off"}, {LDAP_SSL_OFF, "Off"}, {LDAP_SSL_START_TLS, "start tls"}, - {LDAP_SSL_START_TLS, "start_tls"}, + {LDAP_SSL_START_TLS, "Start_tls"}, {-1, NULL} }; @@ -1003,6 +1007,10 @@ static struct parm_struct parm_table[] = { {"Ldap Options", P_SEP, P_SEPARATOR}, +#ifdef WITH_LDAP_SAMCONFIG + {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, + {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, +#endif {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_machine_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_user_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1177,7 +1185,7 @@ static void init_printer_values(void) "lp -i %p-%j -H hold"); string_set(&sDefault.szLpresumecommand, "lp -i %p-%j -H resume"); -#endif /* SYSV */ +#endif /* HPUX */ break; case PRINT_QNX: @@ -1244,7 +1252,6 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); - Globals.szPassdbBackend = str_list_make("smbpasswd unixsam", NULL); /* use the new 'hash2' method by default */ string_set(&Globals.szManglingMethod, "hash2"); @@ -1367,6 +1374,14 @@ static void init_globals(void) a large number of sites (tridge) */ Globals.bHostnameLookups = False; +#ifdef WITH_LDAP_SAMCONFIG + string_set(&Globals.szLdapServer, "localhost"); + Globals.ldap_port = 636; + Globals.szPassdbBackend = str_list_make("ldapsam unixsam", NULL); +#else + Globals.szPassdbBackend = str_list_make("smbpasswd unixsam", NULL); +#endif /* WITH_LDAP_SAMCONFIG */ + string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); @@ -1582,6 +1597,11 @@ FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) + +#ifdef WITH_LDAP_SAMCONFIG +FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) +FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) +#endif FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) FN_GLOBAL_STRING(lp_ldap_machine_suffix, &Globals.szLdapMachineSuffix) FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) -- cgit From ab8b6bd10b8729900c30b30db55e9239aa03f7cf Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Thu, 3 Oct 2002 18:06:51 +0000 Subject: make the default printed values for boolean the same for all parameters. (This used to be commit 5f1dff89be5dca013baed062e631144bacb2067b) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 67276befec..18cba172c0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -642,11 +642,11 @@ static struct enum_list enum_case[] = { }; static struct enum_list enum_bool_auto[] = { - {False, "False"}, {False, "No"}, + {False, "False"}, {False, "0"}, - {True, "True"}, {True, "Yes"}, + {True, "True"}, {True, "1"}, {Auto, "Auto"}, {-1, NULL} -- cgit From 3665777a5bc7ffa92f64ba17daf4cc66c3607198 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Oct 2002 22:53:18 +0000 Subject: Add a timeout to tdb_lock_bystring(). Ensure we never have more than MAX_PRINT_JOBS in a queue. Jeremy. (This used to be commit 9fe3c0b90d4bff2217e3cb5a34b4683ca314c06e) --- source3/param/loadparm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 18cba172c0..ba0866883f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1798,7 +1798,6 @@ FN_LOCAL_INTEGER(lp_force_dir_security_mode, iDir_Security_force_mode) FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase, iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) -FN_LOCAL_INTEGER(lp_maxprintjobs, iMaxPrintJobs) FN_LOCAL_INTEGER(lp_printing, iPrinting) FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) @@ -4070,3 +4069,16 @@ const char *get_called_name(void) return local_machine; } + +/******************************************************************* + Return the max print jobs per queue. +********************************************************************/ + +int lp_maxprintjobs(int snum) +{ + int maxjobs = LP_SNUM_OK(snum) ? ServicePtrs[snum]->iMaxPrintJobs : sDefault.iMaxPrintJobs; + if (maxjobs <= 0 || maxjobs >= PRINT_MAX_JOBID) + maxjobs = PRINT_MAX_JOBID - 1; + + return maxjobs; +} -- cgit From d6486dff6150f79c54c0736c2c8660fe62ed49e0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 5 Oct 2002 00:40:49 +0000 Subject: Turn on sendfile detection by default in HEAD and 3.0. Jeremy. (This used to be commit a09ba463b42893dc50a9d118ee114f55f47cb610) --- source3/param/loadparm.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ba0866883f..a0c77a0421 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -389,9 +389,7 @@ typedef struct BOOL bUseClientDriver; BOOL bDefaultDevmode; BOOL bNTAclSupport; -#ifdef WITH_SENDFILE BOOL bUseSendfile; -#endif BOOL bProfileAcls; char dummy[3]; /* for alignment */ @@ -513,9 +511,7 @@ static service sDefault = { False, /* bUseClientDriver */ False, /* bDefaultDevmode */ True, /* bNTAclSupport */ -#ifdef WITH_SENDFILE False, /* bUseSendfile */ -#endif False, /* bProfileAcls */ "" /* dummy */ @@ -872,9 +868,7 @@ static struct parm_struct parm_table[] = { {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_DEVELOPER}, -#ifdef WITH_SENDFILE {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_SHARE}, -#endif {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, @@ -1783,9 +1777,7 @@ 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_nt_acl_support, bNTAclSupport) -#ifdef WITH_SENDFILE FN_LOCAL_BOOL(lp_use_sendfile, bUseSendfile) -#endif FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) -- cgit From d45a623666a9f02d02009b3b8cd093de62577fec Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 9 Oct 2002 17:42:06 +0000 Subject: removed stat() call in lp_add_home() (This used to be commit 68036f4a415d2d2ad8c27320ae58fee04eee2960) --- source3/param/loadparm.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a0c77a0421..500119575a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1977,13 +1977,6 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, int i; pstring newHomedir; - SMB_STRUCT_STAT buf; - - /* if the user's home directory doesn't exist, then don't - add it to the list of available shares */ - if (sys_stat(pszHomedir, &buf)) - return False; - i = add_a_service(ServicePtrs[iDefaultService], pszHomename); if (i < 0) -- cgit From 3d8274df34a9f7d2a1f221534f7c32bfb4450f87 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Oct 2002 21:35:46 +0000 Subject: Change default of max_xmit to match W2K. Ensure NT negprot uses it. Jeremy. (This used to be commit 0bf7187e3ba57ee2422a0f6f736266a55502123c) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 500119575a..5d1ef9b91f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1289,7 +1289,9 @@ static void init_globals(void) Globals.bLoadPrinters = True; Globals.mangled_stack = 50; - Globals.max_xmit = 65535; + /* 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.bDisableSpoolss = False; -- cgit From 6ce3e3b10c30946ebe6ce25b5be0ca03e9d5617f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 21 Oct 2002 20:11:12 +0000 Subject: removed the following parameters * postscript * printer driver * printer driver location * printer driver file also removed the get_a_printer_driver_9x_compatible() function (This used to be commit 743f2b8025effe57d8f075ff14a9357123c507a8) --- source3/param/loadparm.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5d1ef9b91f..a44cc370ac 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -299,9 +299,6 @@ typedef struct char *szQueuepausecommand; char *szQueueresumecommand; char *szPrintername; - char *szPrinterDriver; - char *szPrinterDriverLocation; - char *szDriverFile; char *szDontdescend; char **szHostsallow; char **szHostsdeny; @@ -356,7 +353,6 @@ typedef struct BOOL bGuest_only; BOOL bGuest_ok; BOOL bPrint_ok; - BOOL bPostscript; BOOL bMap_system; BOOL bMap_hidden; BOOL bMap_archive; @@ -421,9 +417,6 @@ static service sDefault = { NULL, /* szQueuepausecommand */ NULL, /* szQueueresumecommand */ NULL, /* szPrintername */ - NULL, /* szPrinterDriver - this is set in init_globals() */ - NULL, /* szPrinterDriverLocation */ - NULL, /* szDriverFile */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -478,7 +471,6 @@ static service sDefault = { False, /* bGuest_only */ False, /* bGuest_ok */ False, /* bPrint_ok */ - False, /* bPostscript */ False, /* bMap_system */ False, /* bMap_hidden */ True, /* bMap_archive */ @@ -883,7 +875,6 @@ static struct parm_struct parm_table[] = { {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_HIDE}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -904,9 +895,6 @@ static struct parm_struct parm_table[] = { {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_HIDE}, {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, - {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL | FLAG_DEPRECATED}, {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1102,9 +1090,6 @@ Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ static void init_printer_values(void) { - string_set(&sDefault.szPrinterDriver, ""); - string_set(&sDefault.szDriverFile, dyn_DRIVERFILE); - /* choose defaults depending on the type of printing */ switch (sDefault.iPrinting) { @@ -1709,8 +1694,6 @@ FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) static FN_LOCAL_STRING(_lp_printername, szPrintername) -FN_LOCAL_STRING(lp_driverfile, szDriverFile) -FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) FN_LOCAL_LIST(lp_hostsallow, szHostsallow) FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny) FN_LOCAL_STRING(lp_magicscript, szMagicScript) @@ -1730,7 +1713,6 @@ FN_LOCAL_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) -FN_LOCAL_STRING(lp_driverlocation, szPrinterDriverLocation) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) @@ -1749,7 +1731,6 @@ FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) FN_LOCAL_BOOL(lp_guest_only, bGuest_only) FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) -FN_LOCAL_BOOL(lp_postscript, bPostscript) FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) FN_LOCAL_BOOL(lp_map_archive, bMap_archive) FN_LOCAL_BOOL(lp_locking, bLocking) -- cgit From 1ef283d5c34d58389309a86e768ba52413943e9d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 21 Oct 2002 20:40:23 +0000 Subject: Merge mangle prefix code. Jeremy. (This used to be commit 83261f43326ae65af498399b5c933dfb20df1df7) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a44cc370ac..effbb7af68 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -167,6 +167,7 @@ typedef struct char *szDeleteShareCommand; char *szGuestaccount; char *szManglingMethod; + int mangle_prefix; int max_log_size; char *szLogLevel; int mangled_stack; @@ -899,6 +900,7 @@ static struct parm_struct parm_table[] = { {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"mangle prefix", P_INTEGER, P_GLOBAL, &Globals.mangle_prefix, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, @@ -1232,8 +1234,9 @@ static void init_globals(void) string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); - /* use the new 'hash2' method by default */ + /* use the new 'hash2' method by default, with a prefix of 1 */ string_set(&Globals.szManglingMethod, "hash2"); + Globals.mangle_prefix = 1; string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); @@ -1520,6 +1523,7 @@ FN_GLOBAL_STRING(lp_os2_driver_map, &Globals.szOs2DriverMap) FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) FN_GLOBAL_STRING(lp_piddir, &Globals.szPidDir) FN_GLOBAL_STRING(lp_mangling_method, &Globals.szManglingMethod) +FN_GLOBAL_INTEGER(lp_mangle_prefix, &Globals.mangle_prefix) #ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) -- cgit From f735551b9edef66b152261cf6eb2f29b7b69d65b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Oct 2002 01:22:32 +0000 Subject: First cut of new ACL mapping code from Andreas Gruenbacher . This is not 100% the same as what SuSE shipped in their Samba, there is a crash bug fix, a race condition fix, and a few logic changes I'd like to discuss with Andreas. Added Andreas to (C) notices for posix_acls.c Jeremy. (This used to be commit 40eafb9dde113af9f7f1808fda22908953f7e8c3) --- source3/param/loadparm.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index effbb7af68..c54281332b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -216,6 +216,7 @@ typedef struct char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; + char *szAclCompat; int ldap_passwd_sync; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; @@ -536,6 +537,8 @@ static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); +static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr); + static void set_server_role(void); static void set_default_server_announce_type(void); @@ -820,8 +823,9 @@ static struct parm_struct parm_table[] = { {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER}, {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_ADVANCED}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, @@ -1407,6 +1411,7 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); string_set(&Globals.szWinbindSeparator, "\\"); + string_set(&Globals.szAclCompat, ""); Globals.winbind_cache_time = 15; Globals.bWinbindEnumUsers = True; @@ -1579,6 +1584,7 @@ FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) +FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) @@ -2771,6 +2777,19 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) return True; } +static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr) +{ + if (strequal(pszParmValue, "auto")) + string_set(ptr, ""); + else if (strequal(pszParmValue, "winnt")) + string_set(ptr, "winnt"); + else if (strequal(pszParmValue, "win2k")) + string_set(ptr, "win2k"); + else + return False; + + return True; +} /*************************************************************************** initialise a copymap ***************************************************************************/ -- cgit From 6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Nov 2002 03:47:48 +0000 Subject: Merge passdb from HEAD -> 3.0 The work here includes: - metze' set/changed patch, which avoids making changes to ldap on unmodified attributes. - volker's group mapping in passdb patch - volker's samsync stuff - volkers SAMR changes. - mezte's connection caching patch - my recent changes (fix magic root check, ldap ssl) Andrew Bartlett (This used to be commit 2044d60bbe0043cdbb9aba931115672bde975d2f) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c54281332b..7c87a51684 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -583,10 +583,12 @@ static struct enum_list enum_printing[] = { }; static struct enum_list enum_ldap_ssl[] = { +#ifdef WITH_LDAP_SAMCONFIG {LDAP_SSL_ON, "Yes"}, {LDAP_SSL_ON, "yes"}, {LDAP_SSL_ON, "on"}, {LDAP_SSL_ON, "On"}, +#endif {LDAP_SSL_OFF, "no"}, {LDAP_SSL_OFF, "No"}, {LDAP_SSL_OFF, "off"}, -- cgit From b3b24fb6904770e9bb211b42c7745e85b98d9a2b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Nov 2002 12:13:44 +0000 Subject: Merge of my 'ldap trust ids' patch from HEAD. This hopefully provides a peformance boost by not hitting getpwnam() for every entry in an enumeration, instead reteriving entries directly (if available). idra has reviewed this patch. Andrew Bartlett (This used to be commit 8abe71c4d7a796001c5765f4dd88c2e6f5637802) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7c87a51684..883d271980 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -216,6 +216,7 @@ typedef struct char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; + BOOL ldap_trust_ids; char *szAclCompat; int ldap_passwd_sync; BOOL bMsAddPrinterWizard; @@ -1008,6 +1009,7 @@ static struct parm_struct parm_table[] = { {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1602,6 +1604,7 @@ FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) +FN_GLOBAL_BOOL(lp_ldap_trust_ids, &Globals.ldap_trust_ids) 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) -- cgit From 44847694737255fc9184b5e5c113d4e786b76afd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 4 Nov 2002 15:58:03 +0000 Subject: remove 'sam backend' (This used to be commit 373f8bcd29fec254a563161d9d0897ad810ef682) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 883d271980..1a3c739f6c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -112,7 +112,6 @@ typedef struct char *szSMBPasswdFile; char *szPrivateDir; char **szPassdbBackend; - char **szSamBackend; char *szPasswordServer; char *szSocketOptions; char *szWorkGroup; @@ -735,7 +734,6 @@ static struct parm_struct parm_table[] = { {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"sam backend", P_LIST, P_GLOBAL, &Globals.szSamBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1566,7 +1564,6 @@ FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) -FN_GLOBAL_LIST(lp_sam_backend, &Globals.szSamBackend) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) -- cgit From 2f194322d419350f35a48dff750066894d68eccf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 Nov 2002 23:20:50 +0000 Subject: Removed global_myworkgroup, global_myname, global_myscope. Added liberal dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89) --- source3/param/loadparm.c | 536 +++++++++++++++++++---------------------------- 1 file changed, 220 insertions(+), 316 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1a3c739f6c..57318d03ca 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -56,8 +56,6 @@ BOOL bLoaded = False; extern userdom_struct current_user_info; extern pstring user_socket_options; -extern pstring global_myname; -pstring global_scope = ""; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -114,7 +112,6 @@ typedef struct char **szPassdbBackend; char *szPasswordServer; char *szSocketOptions; - char *szWorkGroup; char *szRealm; char *szADSserver; char *szUsernameMap; @@ -272,8 +269,6 @@ global; static global Globals; - - /* * This structure describes a single service. */ @@ -532,6 +527,9 @@ static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); static BOOL handle_debug_list( char *pszParmValue, char **ptr ); +static BOOL handle_workgroup( char *pszParmValue, char **ptr ); +static BOOL handle_netbios_aliases( char *pszParmValue, char **ptr ); +static BOOL handle_netbios_scope( char *pszParmValue, char **ptr ); static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); @@ -707,12 +705,12 @@ static struct parm_struct parm_table[] = { {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"workgroup", P_USTRING, P_GLOBAL, NULL, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios name", P_UGSTRING, P_GLOBAL, global_myname, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios scope", P_UGSTRING, P_GLOBAL, global_scope, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"netbios name", P_UGSTRING, P_GLOBAL, NULL, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios scope", P_UGSTRING, P_GLOBAL, NULL, handle_netbios_scope, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, @@ -1092,15 +1090,14 @@ static struct parm_struct parm_table[] = { {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; - /*************************************************************************** -Initialise the sDefault parameter structure for the printer values. + Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ + static void init_printer_values(void) { /* choose defaults depending on the type of printing */ - switch (sDefault.iPrinting) - { + switch (sDefault.iPrinting) { case PRINT_BSD: case PRINT_AIX: case PRINT_LPRNT: @@ -1209,15 +1206,15 @@ static void init_printer_values(void) } /*************************************************************************** -Initialise the global parameter structure. + Initialise the global parameter structure. ***************************************************************************/ + static void init_globals(void) { static BOOL done_init = False; pstring s; - if (!done_init) - { + if (!done_init) { int i; memset((void *)&Globals, '\0', sizeof(Globals)); @@ -1256,7 +1253,7 @@ static void init_globals(void) * Allow the default PASSWD_CHAT to be overridden in local.h. */ string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT); - string_set(&Globals.szWorkGroup, WORKGROUP); + set_global_myworkgroup(WORKGROUP); string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szPidDir, dyn_PIDDIR); @@ -1430,8 +1427,9 @@ static void init_globals(void) static TALLOC_CTX *lp_talloc; /******************************************************************* a -free up temporary memory - called from the main loop + Free up temporary memory - called from the main loop. ********************************************************************/ + void lp_talloc_free(void) { if (!lp_talloc) @@ -1441,10 +1439,11 @@ void lp_talloc_free(void) } /******************************************************************* -convenience routine to grab string parameters into temporary memory -and run standard_sub_basic on them. The buffers can be written to by -callers without affecting the source string. + Convenience routine to grab string parameters into temporary memory + and run standard_sub_basic on them. The buffers can be written to by + callers without affecting the source string. ********************************************************************/ + static char *lp_string(const char *s) { size_t len = s ? strlen(s) : 0; @@ -1481,7 +1480,6 @@ static char *lp_string(const char *s) return (ret); } - /* In this section all the functions that are used to access the parameters from the rest of the program are defined @@ -1492,7 +1490,7 @@ static char *lp_string(const char *s) #define FN_GLOBAL_CONST_STRING(fn_name,ptr) \ const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : "");} #define FN_GLOBAL_LIST(fn_name,ptr) \ - char **fn_name(void) {return(*(char ***)(ptr));} + const char **fn_name(void) {return(*(const char ***)(ptr));} #define FN_GLOBAL_BOOL(fn_name,ptr) \ BOOL fn_name(void) {return(*(BOOL *)(ptr));} #define FN_GLOBAL_CHAR(fn_name,ptr) \ @@ -1505,7 +1503,7 @@ static char *lp_string(const char *s) #define FN_LOCAL_CONST_STRING(fn_name,val) \ const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i) && ServicePtrs[(i)]->val) ? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_LIST(fn_name,val) \ - char **fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} + const char **fn_name(int i) {return(const char **)(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_BOOL(fn_name,val) \ BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_CHAR(fn_name,val) \ @@ -1547,7 +1545,6 @@ FN_GLOBAL_STRING(lp_passwd_program, &Globals.szPasswdProgram) FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) FN_GLOBAL_STRING(lp_passwordserver, &Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) -FN_GLOBAL_STRING(lp_workgroup, &Globals.szWorkGroup) FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) FN_GLOBAL_STRING(lp_ads_server, &Globals.szADSserver) FN_GLOBAL_STRING(lp_username_map, &Globals.szUsernameMap) @@ -1808,6 +1805,7 @@ static param_opt_struct *param_opt = NULL; /* Return parametric option from given service. Type is a part of option before ':' */ /* Parametric option has following syntax: 'Type: option = value' */ /* Returned value is allocated in 'lp_talloc' context */ + char *lp_parm_string(const char *servicename, const char *type, const char *option) { param_opt_struct *data; @@ -1853,34 +1851,33 @@ static void init_copymap(service * pservice); /*************************************************************************** -initialise a service to the defaults + Initialise a service to the defaults. ***************************************************************************/ + static void init_service(service * pservice) { memset((char *)pservice, '\0', sizeof(service)); copy_service(pservice, &sDefault, NULL); } - /*************************************************************************** -free the dynamically allocated parts of a service struct + Free the dynamically allocated parts of a service struct. ***************************************************************************/ -static void free_service(service * pservice) + +static void free_service(service *pservice) { int i; if (!pservice) return; if (pservice->szService) - DEBUG(5, - ("free_service: Freeing service %s\n", + DEBUG(5, ("free_service: Freeing service %s\n", pservice->szService)); string_free(&pservice->szService); SAFE_FREE(pservice->copymap); - for (i = 0; parm_table[i].label; i++) - { + for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].class == P_LOCAL) @@ -1899,10 +1896,11 @@ static void free_service(service * pservice) } /*************************************************************************** -add a new service to the services array initialising it with the given -service. + Add a new service to the services array initialising it with the given + service. ***************************************************************************/ -static int add_a_service(const service * pservice, const char *name) + +static int add_a_service(const service *pservice, const char *name) { int i; service tservice; @@ -1911,8 +1909,7 @@ static int add_a_service(const service * pservice, const char *name) tservice = *pservice; /* it might already exist */ - if (name) - { + if (name) { i = getservicebyname(name, NULL); if (i >= 0) return (i); @@ -1924,8 +1921,7 @@ static int add_a_service(const service * pservice, const char *name) break; /* if not, then create one */ - if (i == iNumServices) - { + if (i == iNumServices) { service **tsp; tsp = (service **) Realloc(ServicePtrs, @@ -1947,8 +1943,7 @@ static int add_a_service(const service * pservice, const char *name) } iNumServices++; - } - else + } else free_service(ServicePtrs[i]); ServicePtrs[i]->valid = True; @@ -1956,16 +1951,15 @@ static int add_a_service(const service * pservice, const char *name) init_service(ServicePtrs[i]); copy_service(ServicePtrs[i], &tservice, NULL); if (name) - { string_set(&ServicePtrs[i]->szService, name); - } return (i); } /*************************************************************************** -add a new home service, with the specified home directory, defaults coming -from service ifrom. + Add a new home service, with the specified home directory, defaults coming + from service ifrom. ***************************************************************************/ + BOOL lp_add_home(const char *pszHomename, int iDefaultService, const char *user, const char *pszHomedir) { @@ -1987,8 +1981,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, string_set(&ServicePtrs[i]->szPath, newHomedir); - if (!(*(ServicePtrs[i]->comment))) - { + if (!(*(ServicePtrs[i]->comment))) { pstring comment; slprintf(comment, sizeof(comment) - 1, "Home directory of %s", user); @@ -1997,25 +1990,25 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, ServicePtrs[i]->bAvailable = sDefault.bAvailable; ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; - DEBUG(3, - ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, + DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, user, newHomedir)); return (True); } /*************************************************************************** -add a new service, based on an old one. + Add a new service, based on an old one. ***************************************************************************/ + int lp_add_service(const char *pszService, int iDefaultService) { return (add_a_service(ServicePtrs[iDefaultService], pszService)); } - /*************************************************************************** -add the IPC service + Add the IPC service. ***************************************************************************/ + static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) { pstring comment; @@ -2045,8 +2038,9 @@ static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) } /*************************************************************************** -add a new printer service, with defaults coming from service iFrom. + Add a new printer service, with defaults coming from service iFrom. ***************************************************************************/ + BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) { const char *comment = "From Printcap"; @@ -2081,9 +2075,10 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) } /*************************************************************************** -Map a parameter's string representation to something we can use. -Returns False if the parameter string is not recognised, else TRUE. + Map a parameter's string representation to something we can use. + Returns False if the parameter string is not recognised, else TRUE. ***************************************************************************/ + static int map_parameter(char *pszParmName) { int iIndex; @@ -2104,12 +2099,12 @@ static int map_parameter(char *pszParmName) return (-1); } - /*************************************************************************** -Set a boolean variable from the text value stored in the passed string. -Returns True in success, False if the passed string does not correctly -represent a boolean. + Set a boolean variable from the text value stored in the passed string. + Returns True in success, False if the passed string does not correctly + represent a boolean. ***************************************************************************/ + static BOOL set_boolean(BOOL *pb, char *pszParmValue) { BOOL bRetval; @@ -2119,13 +2114,11 @@ static BOOL set_boolean(BOOL *pb, char *pszParmValue) strwicmp(pszParmValue, "true") == 0 || strwicmp(pszParmValue, "1") == 0) *pb = True; - else - if (strwicmp(pszParmValue, "no") == 0 || + else if (strwicmp(pszParmValue, "no") == 0 || strwicmp(pszParmValue, "False") == 0 || strwicmp(pszParmValue, "0") == 0) *pb = False; - else - { + else { DEBUG(0, ("ERROR: Badly formed boolean in configuration file: \"%s\".\n", pszParmValue)); @@ -2137,14 +2130,14 @@ static BOOL set_boolean(BOOL *pb, char *pszParmValue) /*************************************************************************** Find a service by name. Otherwise works like get_service. ***************************************************************************/ + static int getservicebyname(const char *pszServiceName, service * pserviceDest) { int iService; for (iService = iNumServices - 1; iService >= 0; iService--) if (VALID(iService) && - strwicmp(ServicePtrs[iService]->szService, pszServiceName) == 0) - { + strwicmp(ServicePtrs[iService]->szService, pszServiceName) == 0) { if (pserviceDest != NULL) copy_service(pserviceDest, ServicePtrs[iService], NULL); break; @@ -2153,23 +2146,19 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) return (iService); } - - /*************************************************************************** -Copy a service structure to another - -If pcopymapDest is NULL then copy all fields + Copy a service structure to another. + If pcopymapDest is NULL then copy all fields ***************************************************************************/ -static void copy_service(service * pserviceDest, - service * pserviceSource, BOOL *pcopymapDest) + +static void copy_service(service * pserviceDest, service * pserviceSource, BOOL *pcopymapDest) { int i; BOOL bcopyall = (pcopymapDest == NULL); for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && - (bcopyall || pcopymapDest[i])) - { + (bcopyall || pcopymapDest[i])) { void *def_ptr = parm_table[i].ptr; void *src_ptr = ((char *)pserviceSource) + PTR_DIFF(def_ptr, @@ -2178,8 +2167,7 @@ static void copy_service(service * pserviceDest, ((char *)pserviceDest) + PTR_DIFF(def_ptr, &sDefault); - switch (parm_table[i].type) - { + switch (parm_table[i].type) { case P_BOOL: case P_BOOLREV: *(BOOL *)dest_ptr = *(BOOL *)src_ptr; @@ -2206,15 +2194,14 @@ static void copy_service(service * pserviceDest, strupper(*(char **)dest_ptr); break; case P_LIST: - str_list_copy((char ***)dest_ptr, *(char ***)src_ptr); + str_list_copy((char ***)dest_ptr, *(const char ***)src_ptr); break; default: break; } } - if (bcopyall) - { + if (bcopyall) { init_copymap(pserviceDest); if (pserviceSource->copymap) memcpy((void *)pserviceDest->copymap, @@ -2227,15 +2214,14 @@ static void copy_service(service * pserviceDest, Check a service for consistency. Return False if the service is in any way incomplete or faulty, else True. ***************************************************************************/ + static BOOL service_ok(int iService) { BOOL bRetval; bRetval = True; - if (ServicePtrs[iService]->szService[0] == '\0') - { - DEBUG(0, - ("The following message indicates an internal error:\n")); + if (ServicePtrs[iService]->szService[0] == '\0') { + DEBUG(0, ("The following message indicates an internal error:\n")); DEBUG(0, ("No service name in service entry.\n")); bRetval = False; } @@ -2244,8 +2230,7 @@ static BOOL service_ok(int iService) /* I can't see why you'd want a non-printable printer service... */ if (strwicmp(ServicePtrs[iService]->szService, PRINTERS_NAME) == 0) { if (!ServicePtrs[iService]->bPrint_ok) { - DEBUG(0, - ("WARNING: [%s] service MUST be printable!\n", + DEBUG(0, ("WARNING: [%s] service MUST be printable!\n", ServicePtrs[iService]->szService)); ServicePtrs[iService]->bPrint_ok = True; } @@ -2255,10 +2240,8 @@ static BOOL service_ok(int iService) } if (ServicePtrs[iService]->szPath[0] == '\0' && - strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) - { - DEBUG(0, - ("No path in service %s - using %s\n", + strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) { + DEBUG(0, ("No path in service %s - using %s\n", ServicePtrs[iService]->szService, tmpdir())); string_set(&ServicePtrs[iService]->szPath, tmpdir()); } @@ -2271,45 +2254,40 @@ static BOOL service_ok(int iService) return (bRetval); } -static struct file_lists -{ +static struct file_lists { struct file_lists *next; char *name; char *subfname; time_t modtime; -} - *file_lists = NULL; +} *file_lists = NULL; /******************************************************************* -keep a linked list of all config files so we know when one has changed -it's date and needs to be reloaded + Keep a linked list of all config files so we know when one has changed + it's date and needs to be reloaded. ********************************************************************/ + static void add_to_file_list(const char *fname, const char *subfname) { struct file_lists *f = file_lists; - while (f) - { + while (f) { if (f->name && !strcmp(f->name, fname)) break; f = f->next; } - if (!f) - { + if (!f) { f = (struct file_lists *)malloc(sizeof(file_lists[0])); if (!f) return; f->next = file_lists; f->name = strdup(fname); - if (!f->name) - { + if (!f->name) { SAFE_FREE(f); return; } f->subfname = strdup(subfname); - if (!f->subfname) - { + if (!f->subfname) { SAFE_FREE(f); return; } @@ -2323,8 +2301,9 @@ static void add_to_file_list(const char *fname, const char *subfname) } /******************************************************************* -check if a config file has changed date + Check if a config file has changed date. ********************************************************************/ + BOOL lp_file_list_changed(void) { struct file_lists *f = file_lists; @@ -2369,17 +2348,31 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) pstrcpy(netbios_name, pszParmValue); standard_sub_basic(current_user_info.smb_name, netbios_name,sizeof(netbios_name)); - strupper(netbios_name); - pstrcpy(global_myname, netbios_name); + set_global_myname(netbios_name); - DEBUG(4, - ("handle_netbios_name: set global_myname to: %s\n", - global_myname)); + DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n", + global_myname())); return (True); } +static BOOL handle_workgroup(char *pszParmValue, char **ptr) +{ + return set_global_myworkgroup(pszParmValue); +} + +static BOOL handle_netbios_scope(char *pszParmValue, char **ptr) +{ + return set_global_scope(pszParmValue); +} + +static BOOL handle_netbios_aliases(char *pszParmValue, char **ptr) +{ + 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. ***************************************************************************/ @@ -2391,8 +2384,7 @@ static BOOL source_env(char **lines) int i; char *p; - for (i = 0; lines[i]; i++) - { + for (i = 0; lines[i]; i++) { char *line = lines[i]; if ((len = strlen(line)) == 0) @@ -2401,8 +2393,7 @@ static BOOL source_env(char **lines) if (line[len - 1] == '\n') line[--len] = '\0'; - if ((varval = malloc(len + 1)) == NULL) - { + if ((varval = malloc(len + 1)) == NULL) { DEBUG(0, ("source_env: Not enough memory!\n")); return (False); } @@ -2412,25 +2403,20 @@ static BOOL source_env(char **lines) varval[len] = '\0'; p = strchr_m(line, (int)'='); - if (p == NULL) - { + 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", + 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: getting var %s = %s\n", line, getenv(line))); } DEBUG(4, ("source_env: returning successfully\n")); @@ -2438,7 +2424,7 @@ static BOOL source_env(char **lines) } /*************************************************************************** - Handle the source environment operation + Handle the source environment operation. ***************************************************************************/ static BOOL handle_source_env(char *pszParmValue, char **ptr) @@ -2461,18 +2447,12 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) */ 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", + if (!lines) { + DEBUG(0, ("handle_source_env: Failed to open file %s, Error was %s\n", fname, strerror(errno))); return (False); } @@ -2484,8 +2464,9 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) } /*************************************************************************** - handle the interpretation of the vfs object parameter - *************************************************************************/ + Handle the interpretation of the vfs object parameter. +*************************************************************************/ + static BOOL handle_vfs_object(char *pszParmValue, char **ptr) { /* Set string value */ @@ -2498,9 +2479,8 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) return True; } - /*************************************************************************** -handle the include operation + Handle the include operation. ***************************************************************************/ static BOOL handle_include(char *pszParmValue, char **ptr) @@ -2522,10 +2502,10 @@ static BOOL handle_include(char *pszParmValue, char **ptr) return (False); } - /*************************************************************************** -handle the interpretation of the copy parameter + Handle the interpretation of the copy parameter. ***************************************************************************/ + static BOOL handle_copy(char *pszParmValue, char **ptr) { BOOL bRetval; @@ -2540,26 +2520,17 @@ static BOOL handle_copy(char *pszParmValue, char **ptr) DEBUG(3, ("Copying service from service %s\n", pszParmValue)); - if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) - { - if (iTemp == iServiceIndex) - { - DEBUG(0, - ("Can't copy service %s - unable to copy self!\n", - pszParmValue)); - } - else - { + if ((iTemp = getservicebyname(pszParmValue, &serviceTemp)) >= 0) { + if (iTemp == iServiceIndex) { + DEBUG(0, ("Can't copy service %s - unable to copy self!\n", pszParmValue)); + } else { copy_service(ServicePtrs[iServiceIndex], &serviceTemp, ServicePtrs[iServiceIndex]->copymap); bRetval = True; } - } - else - { - DEBUG(0, ("Unable to copy service - source not found: %s\n", - pszParmValue)); + } else { + DEBUG(0, ("Unable to copy service - source not found: %s\n", pszParmValue)); bRetval = False; } @@ -2665,7 +2636,9 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) return True; } -/* Do some simple checks on "non unix account range" parameter values */ +/*************************************************************************** + Do some simple checks on "non unix account range" parameter values. +***************************************************************************/ static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) { @@ -2685,8 +2658,9 @@ static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) } /*************************************************************************** - Handle the DEBUG level list + Handle the DEBUG level list. ***************************************************************************/ + static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) { pstring pszParmValue; @@ -2697,8 +2671,9 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) } /*************************************************************************** - Handle the ldap machine suffix option + Handle the ldap machine suffix option. ***************************************************************************/ + static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) { pstring suffix; @@ -2720,8 +2695,9 @@ static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) } /*************************************************************************** - Handle the ldap user suffix option + Handle the ldap user suffix option. ***************************************************************************/ + static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) { pstring suffix; @@ -2744,8 +2720,9 @@ static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) /*************************************************************************** Handle setting ldap suffix and determines whether ldap machine suffix needs - to be set as well + to be set as well. ***************************************************************************/ + static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) { pstring suffix; @@ -2793,8 +2770,9 @@ static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr) return True; } /*************************************************************************** -initialise a copymap + Initialise a copymap. ***************************************************************************/ + static void init_copymap(service * pservice) { int i; @@ -2809,20 +2787,21 @@ static void init_copymap(service * pservice) pservice->copymap[i] = True; } - /*************************************************************************** - return the local pointer to a parameter given the service number and the - pointer into the default structure + Return the local pointer to a parameter given the service number and the + pointer into the default structure. ***************************************************************************/ + void *lp_local_ptr(int snum, void *ptr) { return (void *)(((char *)ServicePtrs[snum]) + PTR_DIFF(ptr, &sDefault)); } /*************************************************************************** -Process a parameter for a particular service number. If snum < 0 -then assume we are in the globals + Process a parameter for a particular service number. If snum < 0 + then assume we are in the globals. ***************************************************************************/ + BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) { int parmnum, i, slen; @@ -2834,8 +2813,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) parmnum = map_parameter(pszParmName); - if (parmnum < 0) - { + if (parmnum < 0) { if ((sep=strchr(pszParmName, ':')) != NULL) { *sep = 0; ZERO_STRUCT(vfskey); @@ -2851,13 +2829,11 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) *sep = ':'; return (True); } - DEBUG(0, - ("Ignoring unknown parameter \"%s\"\n", pszParmName)); + DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); return (True); } - if (parm_table[parmnum].flags & FLAG_DEPRECATED) - { + if (parm_table[parmnum].flags & FLAG_DEPRECATED) { DEBUG(1, ("WARNING: The \"%s\" option is deprecated\n", pszParmName)); } @@ -2865,14 +2841,10 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) def_ptr = parm_table[parmnum].ptr; /* we might point at a service, the default service or a global */ - if (snum < 0) - { + if (snum < 0) { parm_ptr = def_ptr; - } - else - { - if (parm_table[parmnum].class == P_GLOBAL) - { + } else { + if (parm_table[parmnum].class == P_GLOBAL) { DEBUG(0, ("Global parameter %s found in service section!\n", pszParmName)); @@ -2883,8 +2855,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) &sDefault); } - if (snum >= 0) - { + if (snum >= 0) { if (!ServicePtrs[snum]->copymap) init_copymap(ServicePtrs[snum]); @@ -2896,8 +2867,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) } /* if it is a special case then go ahead */ - if (parm_table[parmnum].special) - { + if (parm_table[parmnum].special) { parm_table[parmnum].special(pszParmValue, (char **)parm_ptr); return (True); } @@ -2949,13 +2919,10 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) break; case P_ENUM: - for (i = 0; parm_table[parmnum].enum_list[i].name; - i++) - { + for (i = 0; parm_table[parmnum].enum_list[i].name; i++) { if (strequal (pszParmValue, - parm_table[parmnum].enum_list[i].name)) - { + parm_table[parmnum].enum_list[i].name)) { *(int *)parm_ptr = parm_table[parmnum]. enum_list[i].value; @@ -2971,8 +2938,9 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) } /*************************************************************************** -Process a parameter. + Process a parameter. ***************************************************************************/ + static BOOL do_parameter(char *pszParmName, char *pszParmValue) { if (!bInGlobalSection && bGlobalOnly) @@ -2984,20 +2952,18 @@ static BOOL do_parameter(char *pszParmName, char *pszParmValue) pszParmName, pszParmValue)); } - /*************************************************************************** -print a parameter of the specified type + Print a parameter of the specified type. ***************************************************************************/ + static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) { int i; switch (p->type) { case P_ENUM: - for (i = 0; p->enum_list[i].name; i++) - { - if (*(int *)ptr == p->enum_list[i].value) - { + for (i = 0; p->enum_list[i].name; i++) { + if (*(int *)ptr == p->enum_list[i].value) { fprintf(f, "%s", p->enum_list[i].name); break; @@ -3053,14 +3019,13 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) } } - /*************************************************************************** -check if two parameters are equal + Check if two parameters are equal. ***************************************************************************/ + static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) { - switch (type) - { + switch (type) { case P_BOOL: case P_BOOLREV: return (*((BOOL *)ptr1) == *((BOOL *)ptr2)); @@ -3112,10 +3077,11 @@ void init_locals(void) } /*************************************************************************** -Process a new section (service). At this stage all sections are services. -Later we'll have special sections that permit server parameters to be set. -Returns True on success, False on failure. + Process a new section (service). At this stage all sections are services. + Later we'll have special sections that permit server parameters to be set. + Returns True on success, False on failure. ***************************************************************************/ + static BOOL do_section(char *pszSectionName) { BOOL bRetval; @@ -3131,8 +3097,7 @@ static BOOL do_section(char *pszSectionName) bInGlobalSection = isglobal; /* check for multiple global sections */ - if (bInGlobalSection) - { + if (bInGlobalSection) { DEBUG(3, ("Processing section \"[%s]\"\n", pszSectionName)); return (True); } @@ -3147,15 +3112,13 @@ static BOOL do_section(char *pszSectionName) bRetval = service_ok(iServiceIndex); /* if all is still well, move to the next record in the services array */ - if (bRetval) - { + if (bRetval) { /* We put this here to avoid an odd message order if messages are */ /* issued by the post-processing of a previous section. */ DEBUG(2, ("Processing section \"[%s]\"\n", pszSectionName)); if ((iServiceIndex = add_a_service(&sDefault, pszSectionName)) - < 0) - { + < 0) { DEBUG(0, ("Failed to add a new service\n")); return (False); } @@ -3166,14 +3129,14 @@ static BOOL do_section(char *pszSectionName) /*************************************************************************** -determine if a partcular base parameter is currentl set to the default value. + Determine if a partcular base parameter is currentl set to the default value. ***************************************************************************/ + static BOOL is_default(int i) { if (!defaults_saved) return False; - switch (parm_table[i].type) - { + switch (parm_table[i].type) { case P_LIST: return str_list_compare (parm_table[i].def.lvalue, *(char ***)parm_table[i].ptr); @@ -3203,10 +3166,10 @@ static BOOL is_default(int i) return False; } - /*************************************************************************** Display the contents of the global structure. ***************************************************************************/ + static void dump_globals(FILE *f) { int i; @@ -3218,14 +3181,13 @@ static void dump_globals(FILE *f) for (i = 0; parm_table[i].label; i++) if (parm_table[i].class == P_GLOBAL && parm_table[i].ptr && - (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) - { + (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { if (defaults_saved && is_default(i)) continue; fprintf(f, "\t%s = ", parm_table[i].label); print_parameter(&parm_table[i], parm_table[i].ptr, f); fprintf(f, "\n"); - } + } if (param_opt != NULL) { data = param_opt; while(data) { @@ -3240,8 +3202,9 @@ static void dump_globals(FILE *f) } /*************************************************************************** -return True if a local parameter is currently set to the global default + Return True if a local parameter is currently set to the global default. ***************************************************************************/ + BOOL lp_is_default(int snum, struct parm_struct *parm) { int pdiff = PTR_DIFF(parm->ptr, &sDefault); @@ -3252,8 +3215,9 @@ BOOL lp_is_default(int snum, struct parm_struct *parm) } /*************************************************************************** -Display the contents of a single services record. + Display the contents of a single services record. ***************************************************************************/ + static void dump_a_service(service * pService, FILE * f) { int i; @@ -3267,17 +3231,13 @@ static void dump_a_service(service * pService, FILE * f) 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) - { + if (pService == &sDefault) { if (defaults_saved && is_default(i)) continue; - } - else - { + } else { if (equal_parameter(parm_table[i].type, ((char *)pService) + pdiff, @@ -3290,7 +3250,7 @@ static void dump_a_service(service * pService, FILE * f) print_parameter(&parm_table[i], ((char *)pService) + pdiff, f); fprintf(f, "\n"); - } + } if (param_opt != NULL) { data = param_opt; sn = (pService == &sDefault) ? "global" : pService->szService; @@ -3306,17 +3266,15 @@ static void dump_a_service(service * pService, FILE * f) /*************************************************************************** -return info about the next service in a service. snum==-1 gives the globals - -return NULL when out of parameters + Return info about the next service in a service. snum==-1 gives the globals. + Return NULL when out of parameters. ***************************************************************************/ + struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { - if (snum == -1) - { + if (snum == -1) { /* do the globals */ - for (; parm_table[*i].label; (*i)++) - { + for (; parm_table[*i].label; (*i)++) { if (parm_table[*i].class == P_SEPARATOR) return &parm_table[(*i)++]; @@ -3331,13 +3289,10 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) return &parm_table[(*i)++]; } - } - else - { + } else { service *pService = ServicePtrs[snum]; - for (; parm_table[*i].label; (*i)++) - { + for (; parm_table[*i].label; (*i)++) { if (parm_table[*i].class == P_SEPARATOR) return &parm_table[(*i)++]; @@ -3371,7 +3326,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) #if 0 /*************************************************************************** -Display the contents of a single copy structure. + Display the contents of a single copy structure. ***************************************************************************/ static void dump_copy_map(BOOL *pcopymap) { @@ -3392,7 +3347,7 @@ static void dump_copy_map(BOOL *pcopymap) #endif /*************************************************************************** -Return TRUE if the passed service number is within range. + Return TRUE if the passed service number is within range. ***************************************************************************/ BOOL lp_snum_ok(int iService) @@ -3449,7 +3404,9 @@ void lp_add_one_printer(char *name, char *comment) } } -/* Announce ourselves as a print server */ +/*************************************************************************** + Announce ourselves as a print server. +***************************************************************************/ void update_server_announce_as_printserver(void) { @@ -3510,7 +3467,7 @@ static void lp_save_defaults(void) switch (parm_table[i].type) { case P_LIST: str_list_copy(&(parm_table[i].def.lvalue), - *(char ***)parm_table[i].ptr); + *(const char ***)parm_table[i].ptr); break; case P_STRING: case P_USTRING: @@ -3604,12 +3561,11 @@ static void set_server_role(void) } } - - /*************************************************************************** -Load the services array from the services file. Return True on success, -False on failure. + Load the services array from the services file. Return True on success, + False on failure. ***************************************************************************/ + BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, BOOL add_ipc) { @@ -3684,16 +3640,18 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, } /*************************************************************************** -reset the max number of services + Reset the max number of services. ***************************************************************************/ + void lp_resetnumservices(void) { iNumServices = 0; } /*************************************************************************** -return the max number of services + Return the max number of services. ***************************************************************************/ + int lp_numservices(void) { return (iNumServices); @@ -3702,14 +3660,13 @@ int lp_numservices(void) /*************************************************************************** Display the contents of the services array in human-readable form. ***************************************************************************/ + void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) { int iService; if (show_defaults) - { defaults_saved = False; - } dump_globals(f); @@ -3722,33 +3679,31 @@ void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) /*************************************************************************** Display the contents of one service in human-readable form. ***************************************************************************/ + void lp_dump_one(FILE * f, BOOL show_defaults, int snum) { - if (VALID(snum)) - { + if (VALID(snum)) { if (ServicePtrs[snum]->szService[0] == '\0') return; dump_a_service(ServicePtrs[snum], f); } } - /*************************************************************************** Return the number of the service with the given name, or -1 if it doesn't exist. Note that this is a DIFFERENT ANIMAL from the internal function getservicebyname()! This works ONLY if all services have been loaded, and does not copy the found service. ***************************************************************************/ + int lp_servicenumber(const char *pszServiceName) { int iService; fstring serviceName; - for (iService = iNumServices - 1; iService >= 0; iService--) - { - if (VALID(iService) && ServicePtrs[iService]->szService) - { + for (iService = iNumServices - 1; iService >= 0; iService--) { + if (VALID(iService) && ServicePtrs[iService]->szService) { /* * The substitution here is used to support %U is * service names @@ -3782,6 +3737,7 @@ char *volume_label(int snum) /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ + static void set_default_server_announce_type(void) { default_server_announce = 0; @@ -3789,67 +3745,42 @@ static void set_default_server_announce_type(void) default_server_announce |= SV_TYPE_SERVER; default_server_announce |= SV_TYPE_SERVER_UNIX; - switch (lp_announce_as()) - { + switch (lp_announce_as()) { case ANNOUNCE_AS_NT_SERVER: - { default_server_announce |= SV_TYPE_SERVER_NT; /* fall through... */ - } case ANNOUNCE_AS_NT_WORKSTATION: - { default_server_announce |= SV_TYPE_NT; break; - } case ANNOUNCE_AS_WIN95: - { default_server_announce |= SV_TYPE_WIN95_PLUS; break; - } case ANNOUNCE_AS_WFW: - { default_server_announce |= SV_TYPE_WFW; break; - } default: - { break; - } } - switch (lp_server_role()) - { + switch (lp_server_role()) { case ROLE_DOMAIN_MEMBER: - { default_server_announce |= SV_TYPE_DOMAIN_MEMBER; break; - } case ROLE_DOMAIN_PDC: - { default_server_announce |= SV_TYPE_DOMAIN_CTRL; break; - } case ROLE_DOMAIN_BDC: - { default_server_announce |= SV_TYPE_DOMAIN_BAKCTRL; break; - } case ROLE_STANDALONE: default: - { break; - } } - if (lp_time_server()) - { default_server_announce |= SV_TYPE_TIME_SOURCE; - } if (lp_host_msdfs()) - { default_server_announce |= SV_TYPE_DFS_SERVER; - } } /*********************************************************** @@ -3868,9 +3799,7 @@ int lp_server_role(void) BOOL lp_domain_master(void) { if (Globals.bDomainMaster == Auto) - { return (lp_server_role() == ROLE_DOMAIN_PDC); - } return Globals.bDomainMaster; } @@ -3882,32 +3811,29 @@ BOOL lp_domain_master(void) BOOL lp_preferred_master(void) { if (Globals.bPreferredMaster == Auto) - { return (lp_local_master() && lp_domain_master()); - } return Globals.bPreferredMaster; } - - /******************************************************************* -remove a service + Remove a service. ********************************************************************/ + void lp_remove_service(int snum) { ServicePtrs[snum]->valid = False; } /******************************************************************* -copy a service. + Copy a service. ********************************************************************/ + void lp_copy_service(int snum, char *new_name) { char *oldname = lp_servicename(snum); do_section(new_name); - if (snum >= 0) - { + if (snum >= 0) { snum = lp_servicenumber(new_name); if (snum >= 0) lp_do_parameter(snum, "copy", oldname); @@ -3918,6 +3844,7 @@ void lp_copy_service(int snum, char *new_name) /******************************************************************* Get the default server type we will announce as via nmbd. ********************************************************************/ + int lp_default_server_announce(void) { return default_server_announce; @@ -3926,6 +3853,7 @@ int lp_default_server_announce(void) /******************************************************************* Split the announce version into major and minor numbers. ********************************************************************/ + int lp_major_announce_version(void) { static BOOL got_major = False; @@ -3998,30 +3926,6 @@ void get_private_directory(pstring privdir) pstrcpy (privdir, lp_private_dir()); } - -/**************************************************************** - Is netbios alias or name -*****************************************************************/ - -BOOL is_netbios_alias_or_name(const char *name) -{ - char **netbios_aliases = lp_netbios_aliases(); - - if (StrCaseCmp(name, global_myname) == 0) { - return True; - } - - for (netbios_aliases = lp_netbios_aliases(); - netbios_aliases && *netbios_aliases; - netbios_aliases++) { - if (StrCaseCmp(name, *netbios_aliases) == 0) { - return True; - } - } - - return False; -} - /*********************************************************** Allow daemons such as winbindd to fix their logfile name. ************************************************************/ @@ -4043,7 +3947,7 @@ const char *get_called_name(void) static fstring called_name; if (! *local_machine) - return global_myname; + return global_myname(); /* * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV" -- cgit From 8213a05d6751f55af8dfbe282b22d9fd193eeff4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 22 Nov 2002 02:53:42 +0000 Subject: Restrict anonymous=2 support merged from HEAD (This used to be commit 8b156ed0db3e54aa3265a2579e72c50c39b5beef) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 57318d03ca..88d5dfed9d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3619,7 +3619,9 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, lp_add_auto_services(lp_auto_services()); if (add_ipc) { - lp_add_ipc("IPC$", True); + /* When 'restrict anonymous = 2' guest connections to ipc$ + are denied */ + lp_add_ipc("IPC$", (lp_restrict_anonymous() < 2)); lp_add_ipc("ADMIN$", False); } -- cgit From d0fe43f918eae56d60398231f53266698d732fd7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 12 Dec 2002 02:01:56 +0000 Subject: Added "kernel change notify" boolean to allow easier valgrind testing. Jeremy. (This used to be commit faf89f214f326bc07f728b354062b2287cda1208) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 88d5dfed9d..de91e7e2a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -262,6 +262,7 @@ typedef struct BOOL bUseSpnego; BOOL bUnixExtensions; BOOL bDisableNetbios; + BOOL bKernelChangeNotify; int restrict_anonymous; int name_cache_timeout; } @@ -848,6 +849,7 @@ static struct parm_struct parm_table[] = { {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_DEVELOPER}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_DEVELOPER}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_DEVELOPER}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_DEVELOPER}, {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_DEVELOPER}, @@ -1319,6 +1321,7 @@ static void init_globals(void) Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */ 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; @@ -1649,6 +1652,7 @@ FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions) FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups) +FN_GLOBAL_BOOL(lp_kernel_change_notify, &Globals.bKernelChangeNotify) 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) -- cgit From 71647364a03eb2014bdcee0c99974ec019cf287d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 20 Dec 2002 01:23:58 +0000 Subject: Merge from HEAD. lp_winbind_separator() is now a const string. (This used to be commit 1f2622f5ccae3ac2102a736cdc60b44d5aad5b07) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index de91e7e2a5..831aab0305 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1584,7 +1584,7 @@ FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) -FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) +FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) -- cgit From ef8bd7c4f7ae8192ea05db070962ecf0ff3615f3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Dec 2002 20:21:31 +0000 Subject: Forward port the change to talloc_init() to make all talloc contexts named. Ensure we can query them. Jeremy. (This used to be commit 09a218a9f6fb0bd922940467bf8500eb4f1bcf84) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 831aab0305..42de1c62bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1462,7 +1462,7 @@ static char *lp_string(const char *s) #endif if (!lp_talloc) - lp_talloc = talloc_init_named("lp_talloc"); + lp_talloc = talloc_init("lp_talloc"); ret = (char *)talloc(lp_talloc, len + 100); /* leave room for substitution */ -- cgit From 8701eb8db2ba534f5666c1b1187200d143f0c3bc Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Fri, 27 Dec 2002 20:08:35 +0000 Subject: Add msdfs proxy functionality; a CIFS share can directly be a stand-in for another share, and when clients connect to the first share, they will be redirected to the proxied share. (This used to be commit 514f548b183b73e1970989d47fb9e6a87e440748) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 42de1c62bf..ba6e3f9e47 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -317,6 +317,7 @@ typedef struct char *szVfsObjectFile; char *szVfsOptions; char *szVfsPath; + char *szMSDfsProxy; int iMinPrintSpace; int iMaxPrintJobs; int iWriteCacheSize; @@ -435,6 +436,7 @@ static service sDefault = { NULL, /* vfs object */ NULL, /* vfs options */ NULL, /* vfs path */ + NULL, /* szMSDfsProxy */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ 0, /* iWriteCacheSize */ @@ -1075,6 +1077,7 @@ static struct parm_struct parm_table[] = { {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, + {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_SHARE}, {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Winbind options", P_SEP, P_SEPARATOR}, @@ -1721,6 +1724,7 @@ FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) FN_LOCAL_STRING(lp_vfs_options, szVfsOptions) FN_LOCAL_STRING(lp_vfs_path, szVfsPath) +FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy) static FN_LOCAL_STRING(lp_volume, volume) FN_LOCAL_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) -- cgit From 634c54310c92c48dd4eceec602e230a021bdcfc5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 3 Jan 2003 08:28:12 +0000 Subject: Merge from HEAD - make Samba compile with -Wwrite-strings without additional warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c) --- source3/param/loadparm.c | 106 +++++++++++++++++++++++------------------------ source3/param/params.c | 24 +++++------ 2 files changed, 65 insertions(+), 65 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ba6e3f9e47..837fc87fac 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -521,29 +521,29 @@ static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ -static BOOL handle_include(char *pszParmValue, char **ptr); -static BOOL handle_copy(char *pszParmValue, char **ptr); -static BOOL handle_vfs_object(char *pszParmValue, char **ptr); -static BOOL handle_source_env(char *pszParmValue, char **ptr); -static BOOL handle_netbios_name(char *pszParmValue, char **ptr); -static BOOL handle_winbind_uid(char *pszParmValue, char **ptr); -static BOOL handle_winbind_gid(char *pszParmValue, char **ptr); -static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr); -static BOOL handle_debug_list( char *pszParmValue, char **ptr ); -static BOOL handle_workgroup( char *pszParmValue, char **ptr ); -static BOOL handle_netbios_aliases( char *pszParmValue, char **ptr ); -static BOOL handle_netbios_scope( char *pszParmValue, char **ptr ); - -static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); -static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); -static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); - -static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr); +static BOOL handle_include(const char *pszParmValue, char **ptr); +static BOOL handle_copy(const char *pszParmValue, char **ptr); +static BOOL handle_vfs_object(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_winbind_uid(const char *pszParmValue, char **ptr); +static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr); +static BOOL handle_non_unix_account_range(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_ldap_machine_suffix ( const char *pszParmValue, char **ptr ); +static BOOL handle_ldap_user_suffix ( const char *pszParmValue, char **ptr ); +static BOOL handle_ldap_suffix ( const char *pszParmValue, char **ptr ); + +static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); -static struct enum_list enum_protocol[] = { +static const struct enum_list enum_protocol[] = { {PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, {PROTOCOL_LANMAN1, "LANMAN1"}, @@ -553,7 +553,7 @@ static struct enum_list enum_protocol[] = { {-1, NULL} }; -static struct enum_list enum_security[] = { +static const struct enum_list enum_security[] = { {SEC_SHARE, "SHARE"}, {SEC_USER, "USER"}, {SEC_SERVER, "SERVER"}, @@ -564,7 +564,7 @@ static struct enum_list enum_security[] = { {-1, NULL} }; -static struct enum_list enum_printing[] = { +static const struct enum_list enum_printing[] = { {PRINT_SYSV, "sysv"}, {PRINT_AIX, "aix"}, {PRINT_HPUX, "hpux"}, @@ -583,7 +583,7 @@ static struct enum_list enum_printing[] = { {-1, NULL} }; -static struct enum_list enum_ldap_ssl[] = { +static const struct enum_list enum_ldap_ssl[] = { #ifdef WITH_LDAP_SAMCONFIG {LDAP_SSL_ON, "Yes"}, {LDAP_SSL_ON, "yes"}, @@ -599,7 +599,7 @@ static struct enum_list enum_ldap_ssl[] = { {-1, NULL} }; -static struct enum_list enum_ldap_passwd_sync[] = { +static const struct enum_list enum_ldap_passwd_sync[] = { {LDAP_PASSWD_SYNC_ON, "Yes"}, {LDAP_PASSWD_SYNC_ON, "yes"}, {LDAP_PASSWD_SYNC_ON, "on"}, @@ -621,7 +621,7 @@ static struct enum_list enum_ldap_passwd_sync[] = { #define ANNOUNCE_AS_WFW 3 #define ANNOUNCE_AS_NT_WORKSTATION 4 -static struct enum_list enum_announce_as[] = { +static const struct enum_list enum_announce_as[] = { {ANNOUNCE_AS_NT_SERVER, "NT"}, {ANNOUNCE_AS_NT_SERVER, "NT Server"}, {ANNOUNCE_AS_NT_WORKSTATION, "NT Workstation"}, @@ -630,13 +630,13 @@ static struct enum_list enum_announce_as[] = { {-1, NULL} }; -static struct enum_list enum_case[] = { +static const struct enum_list enum_case[] = { {CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, {-1, NULL} }; -static struct enum_list enum_bool_auto[] = { +static const struct enum_list enum_bool_auto[] = { {False, "No"}, {False, "False"}, {False, "0"}, @@ -653,7 +653,7 @@ static struct enum_list enum_bool_auto[] = { #define CSC_POLICY_PROGRAMS 2 #define CSC_POLICY_DISABLE 3 -static struct enum_list enum_csc_policy[] = { +static const struct enum_list enum_csc_policy[] = { {CSC_POLICY_MANUAL, "manual"}, {CSC_POLICY_DOCUMENTS, "documents"}, {CSC_POLICY_PROGRAMS, "programs"}, @@ -682,7 +682,7 @@ static struct enum_list enum_csc_policy[] = { level security. */ -static struct enum_list enum_map_to_guest[] = { +static const struct enum_list enum_map_to_guest[] = { {NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, @@ -1846,15 +1846,15 @@ char *lp_parm_string(const char *servicename, const char *type, const char *opti /* local prototypes */ -static int map_parameter(char *pszParmName); +static int map_parameter(const char *pszParmName); static BOOL set_boolean(BOOL *pb, char *pszParmValue); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, service * pserviceSource, BOOL *pcopymapDest); static BOOL service_ok(int iService); -static BOOL do_parameter(char *pszParmName, char *pszParmValue); -static BOOL do_section(char *pszSectionName); +static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); +static BOOL do_section(const char *pszSectionName); static void init_copymap(service * pservice); @@ -2017,7 +2017,7 @@ int lp_add_service(const char *pszService, int iDefaultService) Add the IPC service. ***************************************************************************/ -static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok) +static BOOL lp_add_ipc(const char *ipc_name, BOOL guest_ok) { pstring comment; int i = add_a_service(&sDefault, ipc_name); @@ -2087,7 +2087,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) Returns False if the parameter string is not recognised, else TRUE. ***************************************************************************/ -static int map_parameter(char *pszParmName) +static int map_parameter(const char *pszParmName) { int iIndex; @@ -2349,7 +2349,7 @@ BOOL lp_file_list_changed(void) Note: We must *NOT* use string_set() here as ptr points to global_myname. ***************************************************************************/ -static BOOL handle_netbios_name(char *pszParmValue, char **ptr) +static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) { pstring netbios_name; @@ -2365,17 +2365,17 @@ static BOOL handle_netbios_name(char *pszParmValue, char **ptr) return (True); } -static BOOL handle_workgroup(char *pszParmValue, char **ptr) +static BOOL handle_workgroup(const char *pszParmValue, char **ptr) { return set_global_myworkgroup(pszParmValue); } -static BOOL handle_netbios_scope(char *pszParmValue, char **ptr) +static BOOL handle_netbios_scope(const char *pszParmValue, char **ptr) { return set_global_scope(pszParmValue); } -static BOOL handle_netbios_aliases(char *pszParmValue, char **ptr) +static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) { Globals.szNetbiosAliases = str_list_make(pszParmValue, NULL); return set_netbios_aliases((const char **)Globals.szNetbiosAliases); @@ -2435,7 +2435,7 @@ static BOOL source_env(char **lines) Handle the source environment operation. ***************************************************************************/ -static BOOL handle_source_env(char *pszParmValue, char **ptr) +static BOOL handle_source_env(const char *pszParmValue, char **ptr) { pstring fname; char *p = fname; @@ -2475,7 +2475,7 @@ static BOOL handle_source_env(char *pszParmValue, char **ptr) Handle the interpretation of the vfs object parameter. *************************************************************************/ -static BOOL handle_vfs_object(char *pszParmValue, char **ptr) +static BOOL handle_vfs_object(const char *pszParmValue, char **ptr) { /* Set string value */ @@ -2491,7 +2491,7 @@ static BOOL handle_vfs_object(char *pszParmValue, char **ptr) Handle the include operation. ***************************************************************************/ -static BOOL handle_include(char *pszParmValue, char **ptr) +static BOOL handle_include(const char *pszParmValue, char **ptr) { pstring fname; pstrcpy(fname, pszParmValue); @@ -2514,7 +2514,7 @@ static BOOL handle_include(char *pszParmValue, char **ptr) Handle the interpretation of the copy parameter. ***************************************************************************/ -static BOOL handle_copy(char *pszParmValue, char **ptr) +static BOOL handle_copy(const char *pszParmValue, char **ptr) { BOOL bRetval; int iTemp; @@ -2610,7 +2610,7 @@ BOOL lp_non_unix_account_range(uint32 *low, uint32 *high) /* Do some simple checks on "winbind [ug]id" parameter values */ -static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) +static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2627,7 +2627,7 @@ static BOOL handle_winbind_uid(char *pszParmValue, char **ptr) return True; } -static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) +static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2648,7 +2648,7 @@ static BOOL handle_winbind_gid(char *pszParmValue, char **ptr) Do some simple checks on "non unix account range" parameter values. ***************************************************************************/ -static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) +static BOOL handle_non_unix_account_range(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2669,7 +2669,7 @@ static BOOL handle_non_unix_account_range(char *pszParmValue, char **ptr) Handle the DEBUG level list. ***************************************************************************/ -static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) +static BOOL handle_debug_list( const char *pszParmValueIn, char **ptr ) { pstring pszParmValue; @@ -2682,7 +2682,7 @@ static BOOL handle_debug_list( char *pszParmValueIn, char **ptr ) Handle the ldap machine suffix option. ***************************************************************************/ -static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_machine_suffix( const char *pszParmValue, char **ptr) { pstring suffix; @@ -2706,7 +2706,7 @@ static BOOL handle_ldap_machine_suffix( char *pszParmValue, char **ptr) Handle the ldap user suffix option. ***************************************************************************/ -static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_user_suffix( const char *pszParmValue, char **ptr) { pstring suffix; @@ -2731,7 +2731,7 @@ static BOOL handle_ldap_user_suffix( char *pszParmValue, char **ptr) to be set as well. ***************************************************************************/ -static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) +static BOOL handle_ldap_suffix( const char *pszParmValue, char **ptr) { pstring suffix; pstring user_suffix; @@ -2764,7 +2764,7 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) return True; } -static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr) +static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr) { if (strequal(pszParmValue, "auto")) string_set(ptr, ""); @@ -2810,7 +2810,7 @@ void *lp_local_ptr(int snum, void *ptr) then assume we are in the globals. ***************************************************************************/ -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) +BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue) { int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ @@ -2949,7 +2949,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue) Process a parameter. ***************************************************************************/ -static BOOL do_parameter(char *pszParmName, char *pszParmValue) +static BOOL do_parameter(const char *pszParmName, const char *pszParmValue) { if (!bInGlobalSection && bGlobalOnly) return (True); @@ -3090,7 +3090,7 @@ void init_locals(void) Returns True on success, False on failure. ***************************************************************************/ -static BOOL do_section(char *pszSectionName) +static BOOL do_section(const char *pszSectionName) { BOOL bRetval; BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || @@ -3839,7 +3839,7 @@ void lp_remove_service(int snum) Copy a service. ********************************************************************/ -void lp_copy_service(int snum, char *new_name) +void lp_copy_service(int snum, const char *new_name) { char *oldname = lp_servicename(snum); do_section(new_name); diff --git a/source3/param/params.c b/source3/param/params.c index bc93a1fedf..892e5476cc 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -201,7 +201,7 @@ static int Continuation(char *line, int pos ) } -static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) +static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) /* ------------------------------------------------------------------------ ** * Scan a section name, and pass the name to function sfunc(). * @@ -219,7 +219,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) int c; int i; int end; - char *func = "params.c:Section() -"; + const char *func = "params.c:Section() -"; i = 0; /* is the offset of the next free byte in bufr[] and */ end = 0; /* is the current "end of string" offset. In most */ @@ -297,7 +297,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) return( False ); } /* Section */ -static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) +static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *), int c ) /* ------------------------------------------------------------------------ ** * Scan a parameter name and value, and pass these two fields to pfunc(). * @@ -325,7 +325,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ int vstart = 0; /* Starting position of the parameter value. */ - char *func = "params.c:Parameter() -"; + const char *func = "params.c:Parameter() -"; /* Read the parameter name. */ while( 0 == vstart ) /* Loop until we've found the start of the value. */ @@ -445,8 +445,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) } /* Parameter */ static BOOL Parse( myFILE *InFile, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Scan & parse the input. * @@ -505,7 +505,7 @@ static BOOL Parse( myFILE *InFile, return( True ); } /* Parse */ -static myFILE *OpenConfFile( char *FileName ) +static myFILE *OpenConfFile( const char *FileName ) /* ------------------------------------------------------------------------ ** * Open a configuration file. * @@ -516,7 +516,7 @@ static myFILE *OpenConfFile( char *FileName ) * ------------------------------------------------------------------------ ** */ { - char *func = "params.c:OpenConfFile() -"; + const char *func = "params.c:OpenConfFile() -"; extern BOOL in_client; int lvl = in_client?1:0; myFILE *ret; @@ -538,9 +538,9 @@ static myFILE *OpenConfFile( char *FileName ) return( ret ); } /* OpenConfFile */ -BOOL pm_process( char *FileName, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) +BOOL pm_process( const char *FileName, + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Process the named parameter file. * @@ -557,7 +557,7 @@ BOOL pm_process( char *FileName, { int result; myFILE *InFile; - char *func = "params.c:pm_process() -"; + const char *func = "params.c:pm_process() -"; InFile = OpenConfFile( FileName ); /* Open the config file. */ if( NULL == InFile ) -- cgit From 619f9400c065a1f01cc6083e7b25619120bbd15b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 14 Jan 2003 10:47:56 +0000 Subject: Merge from HEAD - patch by metze to fill in 'workgroup' etc in testparm output, and probably SWAT too.. Andrew Bartlett (This used to be commit 1df808ac8931979000d681bd086399ef306873b6) --- source3/param/loadparm.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 837fc87fac..291bfecba0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7,6 +7,7 @@ Copyright (C) Simo Sorce 2001 Copyright (C) Alexander Bokovoy 2002 + Copyright (C) Stefan (metze) Metzmacher 2002 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 @@ -126,7 +127,10 @@ typedef struct char *szSocketAddress; char *szNISHomeMapName; char *szAnnounceVersion; /* This is initialised in init_globals */ + char *szWorkgroup; + char *szNetbiosName; char **szNetbiosAliases; + char *szNetbiosScope; char *szDomainOtherSIDs; char *szNameResolveOrder; char *szPanicAction; @@ -708,12 +712,12 @@ static struct parm_struct parm_table[] = { {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, - {"workgroup", P_USTRING, P_GLOBAL, NULL, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios name", P_UGSTRING, P_GLOBAL, NULL, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios scope", P_UGSTRING, P_GLOBAL, NULL, handle_netbios_scope, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, @@ -1258,7 +1262,13 @@ static void init_globals(void) * Allow the default PASSWD_CHAT to be overridden in local.h. */ string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT); + + set_global_myname(myhostname()); + string_set(&Globals.szNetbiosName,global_myname()); + set_global_myworkgroup(WORKGROUP); + string_set(&Globals.szWorkgroup, lp_workgroup()); + string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPrintcapname, PRINTCAP_NAME); string_set(&Globals.szPidDir, dyn_PIDDIR); @@ -1847,7 +1857,7 @@ char *lp_parm_string(const char *servicename, const char *type, const char *opti /* local prototypes */ static int map_parameter(const char *pszParmName); -static BOOL set_boolean(BOOL *pb, char *pszParmValue); +static BOOL set_boolean(BOOL *pb, const char *pszParmValue); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, @@ -2113,7 +2123,7 @@ static int map_parameter(const char *pszParmName) represent a boolean. ***************************************************************************/ -static BOOL set_boolean(BOOL *pb, char *pszParmValue) +static BOOL set_boolean(BOOL *pb, const char *pszParmValue) { BOOL bRetval; @@ -2351,28 +2361,41 @@ BOOL lp_file_list_changed(void) static BOOL handle_netbios_name(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)); - set_global_myname(netbios_name); + ret = set_global_myname(netbios_name); + string_set(&Globals.szNetbiosName,global_myname()); + DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n", global_myname())); - return (True); + return ret; } static BOOL handle_workgroup(const char *pszParmValue, char **ptr) { - return set_global_myworkgroup(pszParmValue); + BOOL ret; + + ret = set_global_myworkgroup(pszParmValue); + string_set(&Globals.szWorkgroup,lp_workgroup()); + + return ret; } static BOOL handle_netbios_scope(const char *pszParmValue, char **ptr) { - return set_global_scope(pszParmValue); + BOOL ret; + + ret = set_global_scope(pszParmValue); + string_set(&Globals.szNetbiosScope,global_scope()); + + return ret; } static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) -- cgit From 812a531f4553c8eb2df572acd4fa42a6f91b3051 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 29 Jan 2003 23:38:55 +0000 Subject: Added "passwd backend" to WIZARD section in SWAT. (This used to be commit 0104e80637fbf1cfa614043577376a073d717e94) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 291bfecba0..1455f88156 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -738,7 +738,7 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, -- cgit From d1221c9b6c369113a531063737890b58d89bf6fe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Feb 2003 02:55:00 +0000 Subject: Merge from HEAD client-side authentication changes: - new kerberos code, allowing the account to change it's own password without special SD settings required - NTLMSSP client code, now seperated from cliconnect.c - NTLMv2 client code - SMB signing fixes Andrew Bartlett (This used to be commit 837680ca517982f2e5944730581a83012d4181ae) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1455f88156..daea4ab94f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -255,6 +255,10 @@ typedef struct BOOL bAllowTrustedDomains; BOOL bLanmanAuth; BOOL bNTLMAuth; + BOOL bUseSpnego; + BOOL bClientLanManAuth; + BOOL bClientNTLMv2Auth; + BOOL bClientUseSpnego; BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; @@ -263,12 +267,12 @@ typedef struct BOOL bUnicode; BOOL bUseMmap; BOOL bHostnameLookups; - BOOL bUseSpnego; BOOL bUnixExtensions; BOOL bDisableNetbios; BOOL bKernelChangeNotify; int restrict_anonymous; int name_cache_timeout; + BOOL client_signing; } global; -- cgit From 11e98c0a4ab1d500be63a10d191c7c2939e15e45 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Feb 2003 03:22:09 +0000 Subject: Merge paramaters for client-side-auth updates. (This used to be commit 68d34711279aa5959778974018df77726b915858) --- source3/param/loadparm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index daea4ab94f..b82c1e2ec8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -761,6 +761,8 @@ static struct parm_struct parm_table[] = { {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client NTLMv2 auth", P_BOOL, P_GLOBAL, &Globals.bClientNTLMv2Auth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client lanman auth", P_BOOL, P_GLOBAL, &Globals.bClientLanManAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, @@ -851,6 +853,8 @@ static struct parm_struct parm_table[] = { {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_DEVELOPER}, + {"client signing", P_BOOL, P_GLOBAL, &Globals.client_signing, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_DEVELOPER}, {"Tuning Options", P_SEP, P_SEPARATOR}, @@ -1362,8 +1366,10 @@ static void init_globals(void) Globals.bNTStatusSupport = True; /* Use NT status by default. */ Globals.bStatCache = True; /* use stat cache by default */ Globals.restrict_anonymous = 0; + Globals.bClientLanManAuth = True; /* Do use the LanMan hash if it is available */ Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ + Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ @@ -1440,6 +1446,7 @@ static void init_globals(void) Globals.name_cache_timeout = 660; /* In seconds */ Globals.bUseSpnego = True; + Globals.bClientUseSpnego = True; string_set(&Globals.smb_ports, SMB_PORTS); } @@ -1662,12 +1669,15 @@ FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_INTEGER(lp_restrict_anonymous, &Globals.restrict_anonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_ntlm_auth, &Globals.bNTLMAuth) +FN_GLOBAL_BOOL(lp_client_lanman_auth, &Globals.bClientLanManAuth) +FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, &Globals.bClientNTLMv2Auth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) FN_GLOBAL_BOOL(lp_kernel_oplocks, &Globals.bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, &Globals.enhanced_browsing) FN_GLOBAL_BOOL(lp_use_mmap, &Globals.bUseMmap) FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions) FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) +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_INTEGER(lp_os_level, &Globals.os_level) @@ -1814,6 +1824,7 @@ FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) FN_GLOBAL_BOOL(lp_algorithmic_rid_base, &Globals.bAlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) +FN_GLOBAL_BOOL(lp_client_signing, &Globals.client_signing) typedef struct _param_opt_struct param_opt_struct; struct _param_opt_struct { -- cgit From ba3ccc2928f0178034b48e27383e57a8cf1a4f21 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 1 Mar 2003 02:39:12 +0000 Subject: Added limit to number of jobs enumerated. Set to 0 (means no limit). Yes I will add the docs.... Jeremy. (This used to be commit e1b0001c8df9e9823b42a372ca675188570b252a) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b82c1e2ec8..27e02c1685 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -328,6 +328,7 @@ typedef struct char *szMSDfsProxy; int iMinPrintSpace; int iMaxPrintJobs; + int iMaxReportedPrintJobs; int iWriteCacheSize; int iCreate_mask; int iCreate_force_mode; @@ -447,6 +448,7 @@ static service sDefault = { NULL, /* szMSDfsProxy */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ + 0, /* iMaxReportedPrintJobs */ 0, /* iWriteCacheSize */ 0744, /* iCreate_mask */ 0000, /* iCreate_force_mode */ @@ -889,6 +891,7 @@ static struct parm_struct parm_table[] = { {"Printing Options", P_SEP, P_SEPARATOR}, {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, + {"max reported print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxReportedPrintJobs, NULL, NULL, FLAG_PRINT}, {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT | FLAG_DEVELOPER}, @@ -1815,6 +1818,7 @@ FN_LOCAL_INTEGER(lp_max_connections, iMaxConnections) FN_LOCAL_INTEGER(lp_defaultcase, iDefaultCase) FN_LOCAL_INTEGER(lp_minprintspace, iMinPrintSpace) FN_LOCAL_INTEGER(lp_printing, iPrinting) +FN_LOCAL_INTEGER(lp_max_reported_jobs, iMaxReportedPrintJobs) FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) -- cgit From a412ed39de1606a767e3e68bfcb4e16e3165238b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Mar 2003 21:02:45 +0000 Subject: fixed a strcat noticed by metze (This used to be commit 533fe94db95fbb819b35251d9832c925584b7eca) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 27e02c1685..3ff6b3e22f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2870,7 +2870,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue pstr_sprintf(vfskey, "%s:%s:", (snum >= 0) ? lp_servicename(snum) : "global", pszParmName); slen = strlen(vfskey); - safe_strcat(vfskey, sep+1, sizeof(pstring)); + pstrcat(vfskey, sep+1); trim_string(vfskey+slen, " ", " "); paramo = smb_xmalloc(sizeof(param_opt_struct)); paramo->key = strdup(vfskey); -- cgit From dd1b7e3675236f6cda4dc919ec9fb73051a7bd2a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Mar 2003 21:24:01 +0000 Subject: const warning fix. Jeremy. (This used to be commit 478a5c654a6d2765b726e9a8ef64af7716cb56c0) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3ff6b3e22f..366ee13ec2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3272,7 +3272,8 @@ static void dump_a_service(service * pService, FILE * f) { int i; param_opt_struct *data; - char *s, *sn; + const char *sn; + char *s; if (pService != &sDefault) fprintf(f, "\n[%s]\n", pService->szService); -- cgit From 9da46eec53f8a7773eeb6ab841e41adc32f39d64 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 19 Mar 2003 18:21:44 +0000 Subject: Merge from HEAD. Volker (This used to be commit f42032060812e9bf409042c790e71fefb40ff17a) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 366ee13ec2..0c2eedf311 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -219,6 +219,7 @@ typedef struct BOOL ldap_trust_ids; char *szAclCompat; int ldap_passwd_sync; + BOOL ldap_del_only_sam; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; BOOL bWINSsupport; @@ -1025,6 +1026,7 @@ static struct parm_struct parm_table[] = { {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap del only sam attr", P_BOOL, P_GLOBAL, &Globals.ldap_del_only_sam, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1406,6 +1408,7 @@ static void init_globals(void) string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; + Globals.ldap_del_only_sam = True; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1629,6 +1632,7 @@ FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) FN_GLOBAL_BOOL(lp_ldap_trust_ids, &Globals.ldap_trust_ids) +FN_GLOBAL_BOOL(lp_ldap_del_only_sam, &Globals.ldap_del_only_sam) 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) -- cgit From 3d8c50c87482d75d18b21bee954911951f471e2a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 22 Mar 2003 09:03:46 +0000 Subject: Thanks to volker, merge passdb changes from HEAD: - pdb_guest (including change defaults) - 'default' passdb actions (instead of 'not implemented' stubs in each module) - net_rpc_samsync no longer assumes pdb_unix Andrew Bartlett (This used to be commit 4bec53c8c81019f0f06a93c4df0800bbf7281dd6) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0c2eedf311..e91d4bdd32 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1395,9 +1395,9 @@ static void init_globals(void) #ifdef WITH_LDAP_SAMCONFIG string_set(&Globals.szLdapServer, "localhost"); Globals.ldap_port = 636; - Globals.szPassdbBackend = str_list_make("ldapsam unixsam", NULL); + Globals.szPassdbBackend = str_list_make("ldapsam guest", NULL); #else - Globals.szPassdbBackend = str_list_make("smbpasswd unixsam", NULL); + Globals.szPassdbBackend = str_list_make("smbpasswd guest", NULL); #endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); -- cgit From 1f499a79f5468e87d26b60ffe3aa375b91cadbef Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 22 Mar 2003 13:47:42 +0000 Subject: (merge from HEAD) Small clenaup patches: - safe_string.h - don't assume that __FUNCTION__ is available - process.c - use new workaround from safe_string.h for the same - util.c - Show how many bytes we smb_panic()ed trying to smb_xmalloc() - gencache.c - Keep valgrind quiet by always null terminating. - clistr.c - Add copyright - srvstr.h - move srvstr_push into a .c file again, as a real function. - srvstr.c - revive, with 'safe' checked srvstr_push - loadparm.c - set a default for the display charset. - connection.c - use safe_strcpy() Andrew Bartlett (This used to be commit c91e76bddbe1244ddc8d12b092eba875834029ac) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e91d4bdd32..85f92e81ff 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1268,6 +1268,9 @@ static void init_globals(void) /* using UTF8 by default allows us to support all chars */ string_set(&Globals.unix_charset, "UTF8"); + /* using UTF8 by default allows us to support all chars */ + string_set(&Globals.display_charset, "ASCII"); + /* Use codepage 850 as a default for the dos character set */ string_set(&Globals.dos_charset, "CP850"); -- cgit From 79f3265893a60c9109b02407d15d13f18925c751 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 22 Mar 2003 23:32:50 +0000 Subject: (merge from HEAD) Valgrind found some memory leaks! (This used to be commit 8315b9c3119dde62aeb72ad5e20f63aee89abd0b) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 85f92e81ff..cb03d26e61 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2954,6 +2954,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_LIST: + str_list_free(parm_ptr); *(char ***)parm_ptr = str_list_make(pszParmValue, NULL); break; -- cgit From 3970ad75b8c8085a03641136d2b497e5e844f07f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 23 Mar 2003 09:18:33 +0000 Subject: Merge from HEAD: This adds 'ldap delete dn' as the recommended parameter for the 'ldap del only sam attr' functionality. So we are compatiple to the current SuSE patches as well as to TNG... ;-) Volker (This used to be commit 53b5704ff21de6fce097d74dd7f235d3ceccec66) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cb03d26e61..e9ee19bc94 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -219,7 +219,7 @@ typedef struct BOOL ldap_trust_ids; char *szAclCompat; int ldap_passwd_sync; - BOOL ldap_del_only_sam; + BOOL ldap_delete_dn; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; BOOL bWINSsupport; @@ -1026,7 +1026,8 @@ static struct parm_struct parm_table[] = { {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap del only sam attr", P_BOOL, P_GLOBAL, &Globals.ldap_del_only_sam, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap del only sam attr", P_BOOLREV, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1411,7 +1412,7 @@ static void init_globals(void) string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; - Globals.ldap_del_only_sam = True; + Globals.ldap_delete_dn = False; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1635,7 +1636,7 @@ FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) FN_GLOBAL_BOOL(lp_ldap_trust_ids, &Globals.ldap_trust_ids) -FN_GLOBAL_BOOL(lp_ldap_del_only_sam, &Globals.ldap_del_only_sam) +FN_GLOBAL_BOOL(lp_ldap_delete_dn, &Globals.ldap_delete_dn) 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) -- cgit From 6bb9603237e2a8b0fbae54e51b985d300a6afc59 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 31 Mar 2003 11:06:17 +0000 Subject: 3 things: * Remove 'ldap del only sam attr' after asking Lars Mueller from SuSE first. It is replaced by 'ldap delete dn' * Fix a typo in docs. * Document 'set primary group script'. Volker (This used to be commit 0be502a9c09ff319c87394bb36665be9731c23bb) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e9ee19bc94..606c4d605a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1027,7 +1027,6 @@ static struct parm_struct parm_table[] = { {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap del only sam attr", P_BOOLREV, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, -- cgit From b4d0f208fb936382c7b313bd94c180b5cb708cea Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 6 Apr 2003 07:04:09 +0000 Subject: Merge the TNG netlogon schannel from HEAD. No more XP requiresignorseal anymore! Thanks again to Luke :-) Volker (This used to be commit 6b2b55901d66cab0c0c0c90bd0585c870be6e468) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 606c4d605a..807f8607f1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -230,6 +230,7 @@ typedef struct BOOL bDomainLogons; BOOL bEncryptPasswords; BOOL bUpdateEncrypt; + int serverSchannel; BOOL bStripDot; BOOL bNullPasswords; BOOL bObeyPamRestrictions; @@ -735,6 +736,7 @@ static struct parm_struct parm_table[] = { {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC}, {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1331,6 +1333,7 @@ static void init_globals(void) Globals.paranoid_server_security = True; Globals.bEncryptPasswords = True; Globals.bUpdateEncrypt = False; + Globals.serverSchannel = Auto; Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; @@ -1659,6 +1662,7 @@ FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) +FN_GLOBAL_INTEGER(lp_server_schannel, &Globals.serverSchannel) FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) -- cgit From 7238bf5f40e16360439e028fa7607a5a28e02965 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 9 Apr 2003 15:54:17 +0000 Subject: This is the netlogon schannel client code. Try a rpcclient -S pdc -U% -c "samlogon user password" and it should work with the schannel. Needs testing against platforms different from NT4SP6. Volker (This used to be commit eaef0d8aeff1aa5a067679be3f17e08d7434e1e8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 807f8607f1..0c07f575c1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -230,6 +230,7 @@ typedef struct BOOL bDomainLogons; BOOL bEncryptPasswords; BOOL bUpdateEncrypt; + int clientSchannel; int serverSchannel; BOOL bStripDot; BOOL bNullPasswords; @@ -736,6 +737,7 @@ static struct parm_struct parm_table[] = { {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC}, {"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC}, {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1333,6 +1335,7 @@ static void init_globals(void) Globals.paranoid_server_security = True; Globals.bEncryptPasswords = True; Globals.bUpdateEncrypt = False; + Globals.clientSchannel = Auto; Globals.serverSchannel = Auto; Globals.bReadRaw = True; Globals.bWriteRaw = True; @@ -1662,6 +1665,7 @@ FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) +FN_GLOBAL_INTEGER(lp_client_schannel, &Globals.clientSchannel) FN_GLOBAL_INTEGER(lp_server_schannel, &Globals.serverSchannel) FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) -- cgit From 8584b58886805c66a116503826353f84bc19906b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 11 Apr 2003 16:32:05 +0000 Subject: Set the default schannel parameters to False until we know more. Volker (This used to be commit eef7db25ec786d4448915b08487b14b69b88ce64) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0c07f575c1..8624b30af8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1335,8 +1335,8 @@ static void init_globals(void) Globals.paranoid_server_security = True; Globals.bEncryptPasswords = True; Globals.bUpdateEncrypt = False; - Globals.clientSchannel = Auto; - Globals.serverSchannel = Auto; + Globals.clientSchannel = False; + Globals.serverSchannel = False; Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; -- cgit From 7fcbdf00f6bba44d44e560176468605311e81d67 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2003 22:23:02 +0000 Subject: Add some more functions for the modules (backport from HEAD): - init_modules() - smb_probe_module() (This used to be commit b3328dab2fa069af300b4076695bf6c359501111) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8624b30af8..821216837e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -111,6 +111,8 @@ typedef struct char *szSMBPasswdFile; char *szPrivateDir; char **szPassdbBackend; + char **szPreloadModules; + char **szSamBackend; char *szPasswordServer; char *szSocketOptions; char *szRealm; @@ -813,6 +815,7 @@ static struct parm_struct parm_table[] = { {"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 | FLAG_DEVELOPER}, {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_HIDE}, + {"preload modules", P_LIST, P_GLOBAL, &Globals.szPreloadModules, NULL, NULL, FLAG_BASIC | FLAG_GLOBAL}, {"Logging Options", P_SEP, P_SEPARATOR}, @@ -1603,6 +1606,7 @@ FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) +FN_GLOBAL_LIST(lp_preload_modules, &Globals.szPreloadModules) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) -- cgit From 86712297961eeb6e48a1af35c601aa7383fe6602 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2003 20:01:22 +0000 Subject: Remove SamBackend variable (is already gone in HEAD) (This used to be commit 3a99e5a2dbc88a2234ca08ca1e7b50f14ff9bce9) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 821216837e..2640647ce2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -112,7 +112,6 @@ typedef struct char *szPrivateDir; char **szPassdbBackend; char **szPreloadModules; - char **szSamBackend; char *szPasswordServer; char *szSocketOptions; char *szRealm; -- cgit From 48dea39b1d54ba4deee75bfda74e5730d7a35fa3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 18 Apr 2003 20:23:11 +0000 Subject: 'vfs object' is a list not a string (we have cascaded VFS modules in 3_0 as well now) (This used to be commit 6220068d48f1fc5c85ff68a791e4e34e92cb4a0a) --- source3/param/loadparm.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2640647ce2..3d5713d678 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -326,7 +326,7 @@ typedef struct char **printer_admin; char *volume; char *fstype; - char *szVfsObjectFile; + char **szVfsObjectFile; char *szVfsOptions; char *szVfsPath; char *szMSDfsProxy; @@ -537,7 +537,6 @@ static int default_server_announce; /* 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_vfs_object(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_winbind_uid(const char *pszParmValue, char **ptr); @@ -1094,7 +1093,7 @@ static struct parm_struct parm_table[] = { {"VFS module options", P_SEP, P_SEPARATOR}, - {"vfs object", P_STRING, P_LOCAL, &sDefault.szVfsObjectFile, handle_vfs_object, NULL, FLAG_SHARE}, + {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjectFile, NULL, NULL, FLAG_SHARE}, {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, {"vfs path", P_STRING, P_LOCAL, &sDefault.szVfsPath, NULL, NULL, FLAG_SHARE}, @@ -1766,7 +1765,7 @@ FN_LOCAL_LIST(lp_readlist, readlist) FN_LOCAL_LIST(lp_writelist, writelist) FN_LOCAL_LIST(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) -FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile) +FN_LOCAL_LIST(lp_vfsobj, szVfsObjectFile) FN_LOCAL_STRING(lp_vfs_options, szVfsOptions) FN_LOCAL_STRING(lp_vfs_path, szVfsPath) FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy) @@ -2531,22 +2530,6 @@ static BOOL handle_source_env(const char *pszParmValue, char **ptr) return (result); } -/*************************************************************************** - Handle the interpretation of the vfs object parameter. -*************************************************************************/ - -static BOOL handle_vfs_object(const char *pszParmValue, char **ptr) -{ - /* Set string value */ - - string_set(ptr, pszParmValue); - - /* Do any other initialisation required for vfs. Note that - anything done here may have linking repercussions in nmbd. */ - - return True; -} - /*************************************************************************** Handle the include operation. ***************************************************************************/ -- cgit From f071020f5e49837154581c97c5af5f84d0e2de89 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 21 Apr 2003 14:09:03 +0000 Subject: Merge from HEAD - save the type of channel used to contact the DC. This allows us to join as a BDC, without appearing on the network as one until we have the database replicated, and the admin changes the configuration. This also change the SID retreval order from secrets.tdb, so we no longer require a 'net rpc getsid' - the sid fetch during the domain join is sufficient. Also minor fixes to 'net'. Andrew Bartlett (This used to be commit 876e00fd112e4aaf7519eec27f382eb99ec7562a) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3d5713d678..a89330fd5b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2031,6 +2031,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, } else { pstrcpy(newHomedir, lp_pathname(iDefaultService)); string_sub(newHomedir,"%H", pszHomedir, sizeof(newHomedir)); + string_sub(newHomedir,"%S", pszHomename, sizeof(newHomedir)); } string_set(&ServicePtrs[i]->szPath, newHomedir); -- cgit From 4962f4d1764c3431f7141e030710873b714566a0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Apr 2003 01:44:04 +0000 Subject: Try to keep existing behaviour for our printing code - never return global_myname(), always either the name the client called us, or if they didn't call us anything useful, our IP address. Jerry, can you check this? Andrew Bartlett (This used to be commit 599e70bffbae9930b949c9b82cbc8dfc7c966d78) --- source3/param/loadparm.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a89330fd5b..4bc8d7bfc2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3994,7 +3994,7 @@ void lp_set_logfile(const char *name) } /******************************************************************* - Return the NetBIOS called name. + Return the NetBIOS called name, or my IP - but never global_myname(). ********************************************************************/ const char *get_called_name(void) @@ -4002,22 +4002,11 @@ const char *get_called_name(void) extern fstring local_machine; static fstring called_name; - if (! *local_machine) - return global_myname(); - - /* - * Windows NT/2k uses "*SMBSERVER" and XP uses "*SMBSERV" - * arrggg!!! but we've already rewritten the client's - * netbios name at this point... - */ - - if (*local_machine) { - if (!StrCaseCmp(local_machine, "_SMBSERVER") || !StrCaseCmp(local_machine, "_SMBSERV")) { - 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; - } + 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; -- cgit From 1a9394195d0c53c23b9377ce122f399fa914f58c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Apr 2003 11:54:56 +0000 Subject: Merge HEAD's winbind into 3.0. This includes the 'SIDs Rule' patch, mimir's trusted domains cacheing code, the winbind_idmap abstraction (not idmap proper, but the stuff that held up the winbind LDAP backend in HEAD). Andrew Bartlett (This used to be commit d4d5e6c2ee6383c6cceb5d449aa2ba6c83eb0666) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4bc8d7bfc2..0c0a50d7e4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -163,6 +163,7 @@ typedef struct BOOL bWinbindEnumUsers; BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; + char *szWinbindBackend; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1113,6 +1114,7 @@ static struct parm_struct parm_table[] = { {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind backend", P_STRING, P_GLOBAL, &Globals.szWinbindBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1459,6 +1461,8 @@ static void init_globals(void) Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; + string_set(&Globals.szWinbindBackend, "tdb"); + Globals.name_cache_timeout = 660; /* In seconds */ Globals.bUseSpnego = True; @@ -1630,6 +1634,7 @@ FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) +FN_GLOBAL_STRING(lp_winbind_backend, &Globals.szWinbindBackend) #ifdef WITH_LDAP_SAMCONFIG FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -- cgit From 2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Apr 2003 13:27:35 +0000 Subject: Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted a pstrcpy/fstrcpy or at most a safe_strcpy(). These have the advantage of being compiler-verifiable. Get these out of the way, along with a rewrite of 'get_short_archi' in the spoolss client and server. (This pushes around const string pointers, rather than copied strings). Andrew Bartlett (This used to be commit 32fb801ddc035e8971e9911ed4b6e51892e9d1cc) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0c0a50d7e4..94cfcbb47b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1513,14 +1513,17 @@ static char *lp_string(const char *s) if (!ret) return NULL; + /* Note: safe_strcpy touches len+1 bytes, but we allocate 100 + * extra bytes so we're OK. */ + if (!s) *ret = 0; else - StrnCpy(ret, s, len); + safe_strcpy(ret, s, len+99); if (trim_string(ret, "\"", "\"")) { if (strchr(ret,'"') != NULL) - StrnCpy(ret, s, len); + safe_strcpy(ret, s, len+99); } standard_sub_basic(current_user_info.smb_name,ret,len+100); -- cgit From a141af397eb249e25c4c0335c9c42de5826717e2 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 23 Apr 2003 14:56:30 +0000 Subject: Updated FLAGs - Affects only SWAT. (This used to be commit 80f2790eb9c1382c91e5e2668f3b8d82c220ce51) --- source3/param/loadparm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 94cfcbb47b..90cf288430 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -738,8 +738,8 @@ static struct parm_struct parm_table[] = { {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC}, - {"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC}, + {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -762,7 +762,7 @@ static struct parm_struct parm_table[] = { {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEVELOPER}, + {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -844,11 +844,11 @@ static struct parm_struct parm_table[] = { {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER}, {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_ADVANCED}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, + {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_ADVANCED | FLAG_DEVELOPER}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_DEVELOPER}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, + {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED}, {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_DEVELOPER}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_DEVELOPER}, @@ -992,6 +992,7 @@ static struct parm_struct parm_table[] = { {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_DEVELOPER | FLAG_ADVANCED}, {"WINS Options", P_SEP, P_SEPARATOR}, + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1016,7 +1017,7 @@ static struct parm_struct parm_table[] = { {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE|FLAG_GLOBAL}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"Ldap Options", P_SEP, P_SEPARATOR}, -- cgit From 1f008c1203b082039a9824c186fa2eda730c6f46 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 24 Apr 2003 03:46:17 +0000 Subject: Patch from Stephan Metzmacher to add default arguments to lp_parm() smb.conf parameters. Does not break binary compatibility with older modules. (This used to be commit 147c4d56d873a20a49194c5b036a3694299b1b48) --- source3/param/loadparm.c | 450 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 362 insertions(+), 88 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 90cf288430..c96e750a54 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -81,6 +81,14 @@ extern int extra_time_offset; static BOOL defaults_saved = False; +typedef struct _param_opt_struct param_opt_struct; +struct _param_opt_struct { + param_opt_struct *prev, *next; + char *key; + char *value; + char **list; +}; + /* * This structure describes global (ie., server-wide) parameters. */ @@ -278,6 +286,7 @@ typedef struct int restrict_anonymous; int name_cache_timeout; BOOL client_signing; + param_opt_struct *param_opt; } global; @@ -400,6 +409,7 @@ typedef struct BOOL bNTAclSupport; BOOL bUseSendfile; BOOL bProfileAcls; + param_opt_struct *param_opt; char dummy[3]; /* for alignment */ } @@ -520,6 +530,8 @@ static service sDefault = { True, /* bNTAclSupport */ False, /* bUseSendfile */ False, /* bProfileAcls */ + + NULL, /* Parametric options */ "" /* dummy */ }; @@ -1856,49 +1868,6 @@ FN_GLOBAL_BOOL(lp_algorithmic_rid_base, &Globals.bAlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_BOOL(lp_client_signing, &Globals.client_signing) -typedef struct _param_opt_struct param_opt_struct; -struct _param_opt_struct { - char *key; - char *value; - param_opt_struct *prev, *next; -}; - -static param_opt_struct *param_opt = NULL; - -/* Return parametric option from given service. Type is a part of option before ':' */ -/* Parametric option has following syntax: 'Type: option = value' */ -/* Returned value is allocated in 'lp_talloc' context */ - -char *lp_parm_string(const char *servicename, const char *type, const char *option) -{ - param_opt_struct *data; - pstring vfskey; - - if (param_opt != NULL) { - ZERO_STRUCT(vfskey); - pstr_sprintf(vfskey, "%s:%s:%s", (servicename==NULL) ? "global" : servicename, - type, option); - data = param_opt; - while (data) { - if (strcmp(data->key, vfskey) == 0) { - return lp_string(data->value); - } - data = data->next; - } - /* Try to fetch the same option but from globals */ - pstr_sprintf(vfskey, "global:%s:%s", type, option); - data = param_opt; - while (data) { - if (strcmp(data->key, vfskey) == 0) { - return lp_string(data->value); - } - data = data->next; - } - - } - return NULL; -} - /* local prototypes */ static int map_parameter(const char *pszParmName); @@ -1912,6 +1881,238 @@ static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); static BOOL do_section(const char *pszSectionName); static void init_copymap(service * pservice); +/* This is a helper function for parametrical options support. */ +/* It returns a pointer to parametrical option value if it exists or NULL otherwise */ +/* Actual parametrical functions are quite simple */ +static param_opt_struct *get_parametrics(int snum, const char *type, const char *option) +{ + BOOL global_section = False; + char* param_key; + param_opt_struct *data; + + if (snum >= iNumServices) return NULL; + + if (snum < 0) { + data = Globals.param_opt; + global_section = True; + } else { + data = ServicePtrs[snum]->param_opt; + } + + asprintf(¶m_key, "%s:%s", type, option); + if (!param_key) { + DEBUG(0,("asprintf failed!\n")); + return NULL; + } + + while (data) { + if (strcmp(data->key, param_key) == 0) { + string_free(¶m_key); + return data; + } + data = data->next; + } + + if (!global_section) { + /* Try to fetch the same option but from globals */ + /* but only if we are not already working with Globals */ + data = Globals.param_opt; + while (data) { + if (strcmp(data->key, param_key) == 0) { + string_free(¶m_key); + return data; + } + data = data->next; + } + } + + string_free(¶m_key); + + return NULL; +} + + +/******************************************************************* +convenience routine to return int parameters. +********************************************************************/ +static int lp_int(const char *s) +{ + + if (!s) { + DEBUG(0,("lp_int(%s): is called with NULL!\n",s)); + return (-1); + } + + return atoi(s); +} + +/******************************************************************* +convenience routine to return unsigned long parameters. +********************************************************************/ +static int lp_ulong(const char *s) +{ + + if (!s) { + DEBUG(0,("lp_int(%s): is called with NULL!\n",s)); + return (-1); + } + + return strtoul(s, NULL, 10); +} + +/******************************************************************* +convenience routine to return boolean parameters. +********************************************************************/ +static BOOL lp_bool(const char *s) +{ + BOOL ret = False; + + if (!s) { + DEBUG(0,("lp_bool(%s): is called with NULL!\n",s)); + return False; + } + + if (!set_boolean(&ret,s)) { + DEBUG(0,("lp_bool(%s): value is not boolean!\n",s)); + return False; + } + + return ret; +} + +/******************************************************************* +convenience routine to return enum parameters. +********************************************************************/ +static int lp_enum(const char *s,const struct enum_list *_enum) +{ + int i; + + if (!s || !_enum) { + DEBUG(0,("lp_enum(%s,enum): is called with NULL!\n",s)); + return (-1); + } + + for (i=0; _enum[i].name; i++) { + if (strcasecmp(_enum[i].name,s)==0) + return _enum[i].value; + } + + DEBUG(0,("lp_enum(%s,enum): value is not in enum_list!\n",s)); + return (-1); +} + + +/* DO NOT USE lp_parm_string ANYMORE!!!! + * use lp_parm_const_string or lp_parm_talloc_string + * + * lp_parm_string is only used to let old modules find this symbol + */ +#undef lp_parm_string + char *lp_parm_string(const char *servicename, const char *type, const char *option) +{ + return lp_parm_talloc_string(lp_servicenumber(servicename), type, option, NULL); +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ +/* the returned value is talloced in lp_talloc */ +char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data == NULL||data->value==NULL) { + if (def) { + return lp_string(def); + } else { + return NULL; + } + } + + return lp_string(data->value); +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ +const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data == NULL||data->value==NULL) + return def; + + return data->value; +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ + +const char **lp_parm_string_list(int snum, const char *type, const char *option, const char **def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data == NULL||data->value==NULL) + return (const char **)def; + + if (data->list==NULL) { + data->list = str_list_make(data->value, NULL); + } + + return (const char **)data->list; +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ + +int lp_parm_int(int snum, const char *type, const char *option, int def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data && data->value && *data->value) + return lp_int(data->value); + + return def; +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ + +unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data && data->value && *data->value) + return lp_ulong(data->value); + + return def; +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ + +BOOL lp_parm_bool(int snum, const char *type, const char *option, BOOL def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data && data->value && *data->value) + return lp_bool(data->value); + + return def; +} + +/* Return parametric option from a given service. Type is a part of option before ':' */ +/* Parametric option has following syntax: 'Type: option = value' */ + +int lp_parm_enum(int snum, const char *type, const char *option, + const struct enum_list *_enum, int def) +{ + param_opt_struct *data = get_parametrics(snum, type, option); + + if (data && data->value && *data->value && _enum) + return lp_enum(data->value, _enum); + + return def; +} + /*************************************************************************** Initialise a service to the defaults. @@ -1930,6 +2131,7 @@ static void init_service(service * pservice) static void free_service(service *pservice) { int i; + param_opt_struct *data, *pdata; if (!pservice) return; @@ -1953,7 +2155,19 @@ static void free_service(service *pservice) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); } - + + data = pservice->param_opt; + if (data) + DEBUG(5,("Freeing parametrics:\n")); + while (data) { + DEBUG(5,("[%s = %s]\n", data->key, data->value)); + string_free(&data->key); + string_free(&data->value); + str_list_free(&data->list); + pdata = data->next; + SAFE_FREE(data); + data = pdata; + } ZERO_STRUCTP(pservice); } @@ -1968,14 +2182,28 @@ static int add_a_service(const service *pservice, const char *name) int i; service tservice; int num_to_alloc = iNumServices + 1; + param_opt_struct *data, *pdata; tservice = *pservice; /* it might already exist */ if (name) { i = getservicebyname(name, NULL); - if (i >= 0) + if (i >= 0) { + /* Clean all parametric options for service */ + /* They will be added during parsing again */ + data = ServicePtrs[i]->param_opt; + while (data) { + string_free(&data->key); + string_free(&data->value); + str_list_free(&data->list); + pdata = data->next; + SAFE_FREE(data); + data = pdata; + } + ServicePtrs[i]->param_opt = NULL; return (i); + } } /* find an invalid one */ @@ -2035,7 +2263,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, return (False); if (!(*(ServicePtrs[iDefaultService]->szPath)) - || strequal(ServicePtrs[iDefaultService]->szPath, lp_pathname(-1))) { + || strequal(ServicePtrs[iDefaultService]->szPath, lp_pathname(GLOBAL_SECTION_SNUM))) { pstrcpy(newHomedir, pszHomedir); } else { pstrcpy(newHomedir, lp_pathname(iDefaultService)); @@ -2219,6 +2447,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL { int i; BOOL bcopyall = (pcopymapDest == NULL); + param_opt_struct *data, *pdata, *paramo; + BOOL not_added; for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && @@ -2272,6 +2502,32 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL (void *)pserviceSource->copymap, sizeof(BOOL) * NUMPARAMETERS); } + + data = pserviceSource->param_opt; + while (data) { + not_added = True; + pdata = pserviceDest->param_opt; + /* Traverse destination */ + while (pdata) { + /* If we already have same option, override it */ + if (strcmp(pdata->key, data->key) == 0) { + string_free(&pdata->value); + str_list_free(&data->list); + pdata->value = 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->list = NULL; + DLIST_ADD(pserviceDest->param_opt, paramo); + } + data = data->next; + } } /*************************************************************************** @@ -2868,25 +3124,48 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ void *def_ptr = NULL; - pstring vfskey; + pstring param_key; char *sep; - param_opt_struct *paramo; + param_opt_struct *paramo, *data; + BOOL not_added; parmnum = map_parameter(pszParmName); if (parmnum < 0) { if ((sep=strchr(pszParmName, ':')) != NULL) { - *sep = 0; - ZERO_STRUCT(vfskey); - pstr_sprintf(vfskey, "%s:%s:", - (snum >= 0) ? lp_servicename(snum) : "global", pszParmName); - slen = strlen(vfskey); - pstrcat(vfskey, sep+1); - trim_string(vfskey+slen, " ", " "); - paramo = smb_xmalloc(sizeof(param_opt_struct)); - paramo->key = strdup(vfskey); - paramo->value = strdup(pszParmValue); - DLIST_ADD(param_opt, paramo); + *sep = '\0'; + ZERO_STRUCT(param_key); + pstr_sprintf(param_key, "%s:", pszParmName); + slen = strlen(param_key); + pstrcat(param_key, sep+1); + trim_string(param_key+slen, " ", " "); + not_added = True; + data = (snum < 0) ? Globals.param_opt : + ServicePtrs[snum]->param_opt; + /* Traverse destination */ + while (data) { + /* If we already have same option, override it */ + if (strcmp(data->key, param_key) == 0) { + string_free(&data->value); + str_list_free(&data->list); + data->value = 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->list = NULL; + if (snum < 0) { + DLIST_ADD(Globals.param_opt, paramo); + } else { + DLIST_ADD(ServicePtrs[snum]->param_opt, paramo); + } + } + *sep = ':'; return (True); } @@ -3236,7 +3515,6 @@ static void dump_globals(FILE *f) { int i; param_opt_struct *data; - char *s; fprintf(f, "# Global parameters\n[global]\n"); @@ -3250,14 +3528,11 @@ static void dump_globals(FILE *f) print_parameter(&parm_table[i], parm_table[i].ptr, f); fprintf(f, "\n"); } - if (param_opt != NULL) { - data = param_opt; + if (Globals.param_opt != NULL) { + data = Globals.param_opt; while(data) { - if (((s=strstr(data->key, "global")) == data->key) && - (*(s+strlen("global")) == ':')) { - fprintf(f, "\t%s = %s\n", s+strlen("global")+1, data->value); - } - data = data->next; + fprintf(f, "\t%s = %s\n", data->key, data->value); + data = data->next; } } @@ -3284,8 +3559,6 @@ static void dump_a_service(service * pService, FILE * f) { int i; param_opt_struct *data; - const char *sn; - char *s; if (pService != &sDefault) fprintf(f, "\n[%s]\n", pService->szService); @@ -3314,28 +3587,24 @@ static void dump_a_service(service * pService, FILE * f) ((char *)pService) + pdiff, f); fprintf(f, "\n"); } - if (param_opt != NULL) { - data = param_opt; - sn = (pService == &sDefault) ? "global" : pService->szService; + if (pService->param_opt != NULL) { + data = pService->param_opt; while(data) { - if (((s=strstr(data->key, sn)) == data->key) && - (*(s+strlen(sn)) == ':')) { - fprintf(f, "\t%s = %s\n", s+strlen(sn)+1, data->value); - } - data = data->next; + fprintf(f, "\t%s = %s\n", data->key, data->value); + data = data->next; } } } /*************************************************************************** - Return info about the next service in a service. snum==-1 gives the globals. + Return info about the next service in a service. snum==GLOBAL_SECTION_SNUM gives the globals. Return NULL when out of parameters. ***************************************************************************/ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) { - if (snum == -1) { + if (snum < 0) { /* do the globals */ for (; parm_table[*i].label; (*i)++) { if (parm_table[*i].class == P_SEPARATOR) @@ -3657,16 +3926,17 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, lp_save_defaults(); } - if (param_opt != NULL) { - data = param_opt; + if (Globals.param_opt != NULL) { + data = Globals.param_opt; while (data) { - SAFE_FREE(data->key); - SAFE_FREE(data->value); + string_free(&data->key); + string_free(&data->value); + str_list_free(&data->list); pdata = data->next; SAFE_FREE(data); data = pdata; } - param_opt = NULL; + Globals.param_opt = NULL; } /* We get sections first, so have to start 'behind' to make up */ @@ -3696,7 +3966,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ /* if bWINSsupport is true and we are in the client */ if (in_client && Globals.bWINSsupport) { - lp_do_parameter(-1, "wins server", "127.0.0.1"); + lp_do_parameter(GLOBAL_SECTION_SNUM, "wins server", "127.0.0.1"); } init_iconv(); @@ -3765,8 +4035,10 @@ int lp_servicenumber(const char *pszServiceName) { int iService; fstring serviceName; - - + + if (!pszServiceName) + return GLOBAL_SECTION_SNUM; + for (iService = iNumServices - 1; iService >= 0; iService--) { if (VALID(iService) && ServicePtrs[iService]->szService) { /* @@ -3780,8 +4052,10 @@ int lp_servicenumber(const char *pszServiceName) } } - if (iService < 0) + if (iService < 0) { DEBUG(7,("lp_servicenumber: couldn't find %s\n", pszServiceName)); + return GLOBAL_SECTION_SNUM; + } return (iService); } -- cgit From 49530d0db5a509951c66b73aaf2aa101caf6117b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 28 Apr 2003 10:20:55 +0000 Subject: A new pdb_ldap! This patch removes 'non unix account range' (same as idra's change in HEAD), and uses the winbind uid range instead. More importanly, this patch changes the LDAP schema to use 'ntSid' instead of 'rid' as the primary attribute. This makes it in common with the group mapping code, and should allow it to be used closely with a future idmap_ldap. Existing installations can use the existing functionality by using the ldapsam_compat backend, and users who compile with --with-ldapsam will get this by default. More importantly, this patch adds a 'sambaDomain' object to our schema - which contains 2 'next rid' attributes, the domain name and the domain sid. Yes, there are *2* next rid attributes. The problem is that we don't 'own' the entire RID space - we can only allocate RIDs that could be 'algorithmic' RIDs. Therefore, we use the fact that UIDs in 'winbind uid' range will be mapped by IDMAP, not the algorithm. Andrew Bartlett (This used to be commit 3e07406ade81e136f67439d4f8fd7fe1dbb6db14) --- source3/param/loadparm.c | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c96e750a54..b0da868729 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -554,7 +554,6 @@ static BOOL handle_source_env(const char *pszParmValue, char **ptr); static BOOL handle_netbios_name(const char *pszParmValue, char **ptr); static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr); static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr); -static BOOL handle_non_unix_account_range(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 ); @@ -763,7 +762,6 @@ static struct parm_struct parm_table[] = { {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"non unix account range", P_STRING, P_GLOBAL, &Globals.szNonUnixAccountRange, handle_non_unix_account_range, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1420,7 +1418,7 @@ static void init_globals(void) #ifdef WITH_LDAP_SAMCONFIG string_set(&Globals.szLdapServer, "localhost"); Globals.ldap_port = 636; - Globals.szPassdbBackend = str_list_make("ldapsam guest", NULL); + Globals.szPassdbBackend = str_list_make("ldapsam_compat guest", NULL); #else Globals.szPassdbBackend = str_list_make("smbpasswd guest", NULL); #endif /* WITH_LDAP_SAMCONFIG */ @@ -2856,7 +2854,7 @@ static BOOL handle_copy(const char *pszParmValue, char **ptr) } /*************************************************************************** - Handle winbind/non unix account uid and gid allocation parameters. The format of these + Handle winbind uid and gid allocation parameters. The format of these parameters is: [global] @@ -2873,7 +2871,6 @@ static BOOL handle_copy(const char *pszParmValue, char **ptr) static uid_t winbind_uid_low, winbind_uid_high; static gid_t winbind_gid_low, winbind_gid_high; -static uint32 non_unix_account_low, non_unix_account_high; BOOL lp_winbind_uid(uid_t *low, uid_t *high) { @@ -2903,20 +2900,6 @@ BOOL lp_winbind_gid(gid_t *low, gid_t *high) return True; } -BOOL lp_non_unix_account_range(uint32 *low, uint32 *high) -{ - if (non_unix_account_low == 0 || non_unix_account_high == 0) - return False; - - if (low) - *low = non_unix_account_low; - - if (high) - *high = non_unix_account_high; - - return True; -} - /* Do some simple checks on "winbind [ug]id" parameter values */ static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) @@ -2953,27 +2936,6 @@ static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) return True; } -/*************************************************************************** - Do some simple checks on "non unix account range" parameter values. -***************************************************************************/ - -static BOOL handle_non_unix_account_range(const char *pszParmValue, char **ptr) -{ - uint32 low, high; - - if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) - return False; - - /* Parse OK */ - - string_set(ptr, pszParmValue); - - non_unix_account_low = low; - non_unix_account_high = high; - - return True; -} - /*************************************************************************** Handle the DEBUG level list. ***************************************************************************/ -- cgit From 6760896739914c292a056a9de5ed83fb111b3a66 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 29 Apr 2003 05:06:18 +0000 Subject: removing printing = SOFTQ since no one knows what it is (This used to be commit 283953472229952f7f2613a207515580cd0919c3) --- source3/param/loadparm.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b0da868729..f86ed281e4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -597,7 +597,6 @@ static const struct enum_list enum_printing[] = { {PRINT_QNX, "qnx"}, {PRINT_PLP, "plp"}, {PRINT_LPRNG, "lprng"}, - {PRINT_SOFTQ, "softq"}, {PRINT_CUPS, "cups"}, {PRINT_LPRNT, "nt"}, {PRINT_LPROS2, "os2"}, @@ -1218,17 +1217,6 @@ static void init_printer_values(void) string_set(&sDefault.szPrintcommand, "lp -r -P%p %s"); break; - case PRINT_SOFTQ: - string_set(&sDefault.szLpqcommand, "qstat -l -d%p"); - string_set(&sDefault.szLprmcommand, - "qstat -s -j%j -c"); - string_set(&sDefault.szPrintcommand, - "lp -d%p -s %s; rm %s"); - string_set(&sDefault.szLppausecommand, - "qstat -s -j%j -h"); - string_set(&sDefault.szLpresumecommand, - "qstat -s -j%j -r"); - break; #ifdef DEVELOPER case PRINT_TEST: case PRINT_VLP: -- cgit From bdf912f5a22cddc76116c37badc20e16d458abe6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 May 2003 13:40:10 +0000 Subject: Now that multi-pdu schannel works and a but in the negotiator has been fixed I would like to see this tested a bit more. Default the schannel stuff to auto which means 'offer, but do not enforce'. Volker (This used to be commit 7a1b8409bed13d0e7742cbcd3b0fa79b0c671404) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f86ed281e4..9b9922d8e9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1337,8 +1337,8 @@ static void init_globals(void) Globals.paranoid_server_security = True; Globals.bEncryptPasswords = True; Globals.bUpdateEncrypt = False; - Globals.clientSchannel = False; - Globals.serverSchannel = False; + Globals.clientSchannel = Auto; + Globals.serverSchannel = Auto; Globals.bReadRaw = True; Globals.bWriteRaw = True; Globals.bReadPrediction = False; -- cgit From 6278185860e0846b3d7dc3914142b0e0e2b1c5cf Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 9 May 2003 21:47:32 +0000 Subject: removing total print jobs since it is not used anymore (This used to be commit b87be0dddfcace95527b9a05f8f81cd6d2e86d39) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9b9922d8e9..7ffe1244ba 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -906,7 +906,6 @@ static struct parm_struct parm_table[] = { {"Printing Options", P_SEP, P_SEPARATOR}, - {"total print jobs", P_INTEGER, P_GLOBAL, &Globals.iTotalPrintJobs, NULL, NULL, FLAG_PRINT}, {"max reported print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxReportedPrintJobs, NULL, NULL, FLAG_PRINT}, {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, @@ -1728,7 +1727,6 @@ FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) FN_GLOBAL_INTEGER(lp_disable_spoolss, &Globals.bDisableSpoolss) -FN_GLOBAL_INTEGER(lp_totalprintjobs, &Globals.iTotalPrintJobs) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) -- cgit From e7c8c15888454043c73967635deb4d3419a489e9 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 11 May 2003 23:34:18 +0000 Subject: Fix VFS layer: 1. Finally work with cascaded modules with private data storage per module 2. Convert VFS API to macro calls to simplify cascading 3. Add quota support to VFS layer (prepare to NT quota support) Patch by Stefan (metze) Metzemacher, with review of Jelmer and me Tested in past few weeks. Documentation to new VFS API for third-party developers to follow (This used to be commit 91984ef5caa2d13c5d52e1f535bd3bbbae1ec978) --- source3/param/loadparm.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7ffe1244ba..eee23a39b6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -336,9 +336,7 @@ typedef struct char **printer_admin; char *volume; char *fstype; - char **szVfsObjectFile; - char *szVfsOptions; - char *szVfsPath; + char **szVfsObjects; char *szMSDfsProxy; int iMinPrintSpace; int iMaxPrintJobs; @@ -457,9 +455,7 @@ static service sDefault = { NULL, /* printer admin */ NULL, /* volume */ NULL, /* fstype */ - NULL, /* vfs object */ - NULL, /* vfs options */ - NULL, /* vfs path */ + NULL, /* vfs objects */ NULL, /* szMSDfsProxy */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ @@ -1102,10 +1098,9 @@ static struct parm_struct parm_table[] = { {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"VFS module options", P_SEP, P_SEPARATOR}, - - {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjectFile, NULL, NULL, FLAG_SHARE}, - {"vfs options", P_STRING, P_LOCAL, &sDefault.szVfsOptions, NULL, NULL, FLAG_SHARE}, - {"vfs path", P_STRING, P_LOCAL, &sDefault.szVfsPath, NULL, NULL, FLAG_SHARE}, + + {"vfs objects", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_SHARE}, + {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_SHARE | FLAG_HIDE}, {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, @@ -1770,9 +1765,7 @@ FN_LOCAL_LIST(lp_readlist, readlist) FN_LOCAL_LIST(lp_writelist, writelist) FN_LOCAL_LIST(lp_printer_admin, printer_admin) FN_LOCAL_STRING(lp_fstype, fstype) -FN_LOCAL_LIST(lp_vfsobj, szVfsObjectFile) -FN_LOCAL_STRING(lp_vfs_options, szVfsOptions) -FN_LOCAL_STRING(lp_vfs_path, szVfsPath) +FN_LOCAL_LIST(lp_vfs_objects, szVfsObjects) FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy) static FN_LOCAL_STRING(lp_volume, volume) FN_LOCAL_STRING(lp_mangled_map, szMangledMap) -- cgit From e8573c8fa928602fd979d5ac45c692e7464f0aad Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 12 May 2003 01:20:17 +0000 Subject: Add NT quota support. Patch from Stefan (metze) Metzemacher 1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab 2. Disabled by default and when requested, will be probed and enabled only on Linux where it works 3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far Documentation to follow (This used to be commit 4bf022ce9e45be85609426762ba2644ac2031326) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index eee23a39b6..45c95d1258 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -108,6 +108,8 @@ typedef struct char *szRootdir; char *szDefaultService; char *szDfree; + char *szGetQuota; + char *szSetQuota; char *szMsgCommand; char *szHostsEquiv; char *szServerString; @@ -1060,6 +1062,8 @@ static struct parm_struct parm_table[] = { {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DEVELOPER}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, FLAG_DEVELOPER}, @@ -1582,6 +1586,8 @@ 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_get_quota_command, &Globals.szGetQuota) +FN_GLOBAL_STRING(lp_set_quota_command, &Globals.szSetQuota) FN_GLOBAL_STRING(lp_hosts_equiv, &Globals.szHostsEquiv) FN_GLOBAL_STRING(lp_auto_services, &Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program, &Globals.szPasswdProgram) -- cgit From c823b191ab476fc2583d6d6aaa1e2edb09cbb88e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 May 2003 18:12:31 +0000 Subject: And finally IDMAP in 3_0 We really need idmap_ldap to have a good solution with ldapsam, porting it from the prvious code is beeing made, the code is really simple to do so I am confident it is not a problem to commit this code in. Not committing it would have been worst. I really would have been able to finish also the group code, maybe we can put it into a followin release after 3.0.0 even if it may be an upgrade problem. The code has been tested and seem to work right, more testing is needed for corner cases. Currently winbind pdc (working only for users and not for groups) is disabled as I was not able to make a complete group code replacement that works somewhat in a week (I have a complete patch, but there are bugs) Simo. (This used to be commit 0e58085978f984436815114a2ec347cf7899a89d) --- source3/param/loadparm.c | 89 +++++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 35 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 45c95d1258..5740ce1b70 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8,6 +8,7 @@ Copyright (C) Simo Sorce 2001 Copyright (C) Alexander Bokovoy 2002 Copyright (C) Stefan (metze) Metzmacher 2002 + Copyright (C) Anthony Liguori 2003 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 @@ -163,10 +164,11 @@ typedef struct BOOL bUtmp; #endif char *szSourceEnv; - char *szWinbindUID; - char *szWinbindGID; + char *szIdmapUID; + char *szIdmapGID; + BOOL *bIdmapOnly; char *szNonUnixAccountRange; - BOOL bAlgorithmicRidBase; + int AlgorithmicRidBase; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; @@ -174,6 +176,7 @@ typedef struct BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; char *szWinbindBackend; + char *szIdmapBackend; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -550,8 +553,8 @@ 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_winbind_uid(const char *pszParmValue, char **ptr); -static BOOL handle_winbind_gid(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 ); @@ -759,7 +762,7 @@ static struct parm_struct parm_table[] = { {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.bAlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE | FLAG_DEVELOPER}, @@ -1113,8 +1116,12 @@ static struct parm_struct parm_table[] = { {"Winbind options", P_SEP, P_SEPARATOR}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szWinbindUID, handle_winbind_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"idmap only", P_BOOL, P_GLOBAL, &Globals.bIdmapOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_HIDE}, + {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_HIDE}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1122,7 +1129,6 @@ static struct parm_struct parm_table[] = { {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind backend", P_STRING, P_GLOBAL, &Globals.szWinbindBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1311,7 +1317,7 @@ static void init_globals(void) string_set(&Globals.szNameResolveOrder, "lmhosts wins host bcast"); string_set(&Globals.szPasswordServer, "*"); - Globals.bAlgorithmicRidBase = BASE_RID; + Globals.AlgorithmicRidBase = BASE_RID; Globals.bLoadPrinters = True; Globals.mangled_stack = 50; @@ -1458,7 +1464,7 @@ static void init_globals(void) Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; - string_set(&Globals.szWinbindBackend, "tdb"); + Globals.bIdmapOnly = False; Globals.name_cache_timeout = 660; /* In seconds */ @@ -1636,7 +1642,9 @@ FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) -FN_GLOBAL_STRING(lp_winbind_backend, &Globals.szWinbindBackend) + +FN_GLOBAL_STRING(lp_idmap_backend, &Globals.szIdmapBackend) +FN_GLOBAL_BOOL(lp_idmap_only, &Globals.bIdmapOnly) #ifdef WITH_LDAP_SAMCONFIG FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) @@ -1847,7 +1855,7 @@ FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) -FN_GLOBAL_BOOL(lp_algorithmic_rid_base, &Globals.bAlgorithmicRidBase) +FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_BOOL(lp_client_signing, &Globals.client_signing) @@ -2839,55 +2847,55 @@ static BOOL handle_copy(const char *pszParmValue, char **ptr) } /*************************************************************************** - Handle winbind uid and gid allocation parameters. The format of these + Handle idmap/non unix account uid and gid allocation parameters. The format of these parameters is: [global] - winbind uid = 1000-1999 - winbind gid = 700-899 + idmap uid = 1000-1999 + idmap gid = 700-899 We only do simple parsing checks here. The strings are parsed into useful - structures in the winbind daemon code. + structures in the idmap daemon code. ***************************************************************************/ -/* Some lp_ routines to return winbind [ug]id information */ +/* Some lp_ routines to return idmap [ug]id information */ -static uid_t winbind_uid_low, winbind_uid_high; -static gid_t winbind_gid_low, winbind_gid_high; +static uid_t idmap_uid_low, idmap_uid_high; +static gid_t idmap_gid_low, idmap_gid_high; -BOOL lp_winbind_uid(uid_t *low, uid_t *high) +BOOL lp_idmap_uid(uid_t *low, uid_t *high) { - if (winbind_uid_low == 0 || winbind_uid_high == 0) + if (idmap_uid_low == 0 || idmap_uid_high == 0) return False; if (low) - *low = winbind_uid_low; + *low = idmap_uid_low; if (high) - *high = winbind_uid_high; + *high = idmap_uid_high; return True; } -BOOL lp_winbind_gid(gid_t *low, gid_t *high) +BOOL lp_idmap_gid(gid_t *low, gid_t *high) { - if (winbind_gid_low == 0 || winbind_gid_high == 0) + if (idmap_gid_low == 0 || idmap_gid_high == 0) return False; if (low) - *low = winbind_gid_low; + *low = idmap_gid_low; if (high) - *high = winbind_gid_high; + *high = idmap_gid_high; return True; } -/* Do some simple checks on "winbind [ug]id" parameter values */ +/* Do some simple checks on "idmap [ug]id" parameter values */ -static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) +static BOOL handle_idmap_uid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2898,13 +2906,13 @@ static BOOL handle_winbind_uid(const char *pszParmValue, char **ptr) string_set(ptr, pszParmValue); - winbind_uid_low = low; - winbind_uid_high = high; + idmap_uid_low = low; + idmap_uid_high = high; return True; } -static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) +static BOOL handle_idmap_gid(const char *pszParmValue, char **ptr) { uint32 low, high; @@ -2915,8 +2923,8 @@ static BOOL handle_winbind_gid(const char *pszParmValue, char **ptr) string_set(ptr, pszParmValue); - winbind_gid_low = low; - winbind_gid_high = high; + idmap_gid_low = low; + idmap_gid_high = high; return True; } @@ -3800,7 +3808,18 @@ static void set_server_role(void) DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n")); break; case SEC_SERVER: + if (lp_domain_logons()) + DEBUG(0, ("Server's Role (logon server) conflicts with server-level security\n")); + server_role = ROLE_DOMAIN_MEMBER; + break; case SEC_DOMAIN: + if (lp_domain_logons()) { + DEBUG(1, ("Server's Role (logon server) NOT ADVISED with domain-level security\n")); + server_role = ROLE_DOMAIN_BDC; + break; + } + server_role = ROLE_DOMAIN_MEMBER; + break; case SEC_ADS: if (lp_domain_logons()) { server_role = ROLE_DOMAIN_PDC; -- cgit From 5d16254f560ba26929bc473c28b85c87317ca368 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 14 May 2003 03:32:20 +0000 Subject: *****LDAP schema changes***** New objectclass named sambaSamAccount which uses attribute prefaced with the phrase 'samba' to prevent future name clashes. Change in functionality of the 'ldap filter' parameter. This always defaults to "(uid=%u)" now and is and'd with the approriate objectclass depending on whether you are using ldapsam_compat or ldapsam conversion script for migrating from sambaAccount to sambaSamAccount will come next. (This used to be commit 998586e65271daa919e47e1206c0007454cbca66) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5740ce1b70..420a15c4df 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1416,10 +1416,10 @@ static void init_globals(void) #endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); + string_set(&Globals.szLdapFilter, "(uid=%u)"); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); - string_set(&Globals.szLdapFilter, "(&(uid=%u)(objectclass=sambaAccount))"); string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; -- cgit From 06f053bd7c74f0362fe15d2c2ccb76bdc39d668d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 29 May 2003 01:41:56 +0000 Subject: Fix bugzilla #117: winbindd looping on 100+char username This modifies lp_string to use alloc_sub_basic to allow any length substitution instead of fixed at 100 chars. (This used to be commit cad9d88a6125369a43f710a8870300b6f40d899c) --- source3/param/loadparm.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 420a15c4df..1d0bed0695 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1496,8 +1496,7 @@ void lp_talloc_free(void) static char *lp_string(const char *s) { - size_t len = s ? strlen(s) : 0; - char *ret; + char *ret, *tmpstr; /* The follow debug is useful for tracking down memory problems especially if you have an inner loop that is calling a lp_*() @@ -1511,25 +1510,16 @@ static char *lp_string(const char *s) if (!lp_talloc) lp_talloc = talloc_init("lp_talloc"); - ret = (char *)talloc(lp_talloc, len + 100); /* leave room for substitution */ - - if (!ret) - return NULL; - - /* Note: safe_strcpy touches len+1 bytes, but we allocate 100 - * extra bytes so we're OK. */ - - if (!s) - *ret = 0; - else - safe_strcpy(ret, s, len+99); - - if (trim_string(ret, "\"", "\"")) { - if (strchr(ret,'"') != NULL) - safe_strcpy(ret, s, len+99); + tmpstr = alloc_sub_basic(current_user_info.smb_name, s); + if (trim_string(tmpstr, "\"", "\"")) { + if (strchr(tmpstr,'"') != NULL) { + SAFE_FREE(tmpstr); + tmpstr = alloc_sub_basic(current_user_info.smb_name,s); + } } - - standard_sub_basic(current_user_info.smb_name,ret,len+100); + ret = talloc_strdup(lp_talloc, tmpstr); + SAFE_FREE(tmpstr); + return (ret); } -- cgit From 1d2e3ec1485149faa334b6a178754a7a1e6868e9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Jun 2003 07:19:38 +0000 Subject: Merge change winbindd cache time 15 -> 120 secs. Jeremy. (This used to be commit 5acdf6752e187d329c4e59dd167e86549119c670) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1d0bed0695..c70152e6cc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1459,7 +1459,7 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); - Globals.winbind_cache_time = 15; + Globals.winbind_cache_time = 120; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; -- cgit From c384f2dcc7da315e84163febb76a964b2fa179f2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 3 Jun 2003 16:02:33 +0000 Subject: * set winbind cache time to 5 minutes * quit obsessing over the sequence number so much * share the updated sequence number between parent and child winbindd processes in dual mode (This used to be commit 6f99cafa95b2a9dc98d8272fe6a54e9d37098340) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c70152e6cc..1673567321 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1459,7 +1459,7 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); - Globals.winbind_cache_time = 120; + Globals.winbind_cache_time = 600; /* 5 minutes */ Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; -- cgit From 711f8d0a13c6854f8c552a9561571d26fa5e9884 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 6 Jun 2003 13:48:39 +0000 Subject: * break out more common code used between pdb_ldap and idmap_ldap * remove 'winbind uid' and 'winbind gid' parameters (replaced by current idmap parameter) * create the sambaUnixIdPool entries automatically in the 'ldap idmap suffix' * add new 'ldap idmap suffix' and 'ldap group suffix' parametrer * "idmap backend = ldap" now accepts 'ldap:ldap://server/' format (parameters are passed to idmap init() function (This used to be commit 1665926281ed2be3c5affca551c9d458d013fc7f) --- source3/param/loadparm.c | 126 +++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 75 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1673567321..a5e9b1467f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -223,6 +223,8 @@ typedef struct int iLockSpinTime; char *szLdapMachineSuffix; char *szLdapUserSuffix; + char *szLdapIdmapSuffix; + char *szLdapGroupSuffix; #ifdef WITH_LDAP_SAMCONFIG int ldap_port; char *szLdapServer; @@ -560,9 +562,8 @@ 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_ldap_machine_suffix ( const char *pszParmValue, char **ptr ); -static BOOL handle_ldap_user_suffix ( const char *pszParmValue, char **ptr ); static BOOL handle_ldap_suffix ( const char *pszParmValue, char **ptr ); +static BOOL handle_ldap_sub_suffix ( const char *pszParmValue, char **ptr ); static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr); @@ -1035,8 +1036,10 @@ static struct parm_struct parm_table[] = { {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, #endif {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_machine_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_user_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1119,9 +1122,7 @@ static struct parm_struct parm_table[] = { {"idmap only", P_BOOL, P_GLOBAL, &Globals.bIdmapOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_HIDE}, {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_HIDE}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1419,6 +1420,8 @@ static void init_globals(void) string_set(&Globals.szLdapFilter, "(uid=%u)"); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); + string_set(&Globals.szLdapGroupSuffix, ""); + string_set(&Globals.szLdapIdmapSuffix, ""); string_set(&Globals.szLdapAdminDn, ""); Globals.ldap_ssl = LDAP_SSL_ON; @@ -1643,6 +1646,8 @@ FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) FN_GLOBAL_STRING(lp_ldap_machine_suffix, &Globals.szLdapMachineSuffix) FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) +FN_GLOBAL_STRING(lp_ldap_idmap_suffix, &Globals.szLdapIdmapSuffix) +FN_GLOBAL_STRING(lp_ldap_group_suffix, &Globals.szLdapGroupSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) @@ -2933,91 +2938,61 @@ static BOOL handle_debug_list( const char *pszParmValueIn, char **ptr ) } /*************************************************************************** - Handle the ldap machine suffix option. + Handle setting ldap suffix and determines whether ldap machine suffix needs + to be set as well. + + Set all of the sub suffix strings to be the 'ldap suffix' by default ***************************************************************************/ -static BOOL handle_ldap_machine_suffix( const char *pszParmValue, char **ptr) +static BOOL handle_ldap_suffix( const char *pszParmValue, char **ptr ) { - pstring suffix; - - pstrcpy(suffix, pszParmValue); - - if (! *Globals.szLdapSuffix ) { - string_set( ptr, suffix ); - return True; - } - - if (! strstr(suffix, Globals.szLdapSuffix) ) { - if ( *pszParmValue ) - pstrcat(suffix, ","); - pstrcat(suffix, Globals.szLdapSuffix); - } - string_set( ptr, suffix ); - return True; + pstring suffix; + + pstrcpy(suffix, pszParmValue); + + /* set defaults for the the sub-suffixes */ + + if (! *Globals.szLdapMachineSuffix ) + string_set(&Globals.szLdapMachineSuffix, suffix); + if (! *Globals.szLdapUserSuffix ) + string_set(&Globals.szLdapUserSuffix, suffix); + if (! *Globals.szLdapGroupSuffix ) + string_set(&Globals.szLdapGroupSuffix, suffix); + if (! *Globals.szLdapIdmapSuffix ) + string_set(&Globals.szLdapIdmapSuffix, suffix); + + string_set(ptr, suffix); + return True; } /*************************************************************************** - Handle the ldap user suffix option. + Handle the ldap sub suffix option. + Always append the 'ldap suffix' if it is set ***************************************************************************/ -static BOOL handle_ldap_user_suffix( const char *pszParmValue, char **ptr) +static BOOL handle_ldap_sub_suffix( const char *pszParmValue, char **ptr) { - pstring suffix; + pstring suffix; - pstrcpy(suffix, pszParmValue); + pstrcpy(suffix, pszParmValue); - if (! *Globals.szLdapSuffix ) { - string_set( ptr, suffix ); - return True; - } - - if (! strstr(suffix, Globals.szLdapSuffix) ) { - if ( *pszParmValue ) - pstrcat(suffix, ","); - pstrcat(suffix, Globals.szLdapSuffix); - } - string_set( ptr, suffix ); - return True; + if (! *Globals.szLdapSuffix ) { + string_set( ptr, suffix ); + return True; + } + else { + if ( *pszParmValue ) + pstrcat(suffix, ","); + pstrcat(suffix, Globals.szLdapSuffix); + } + + string_set( ptr, suffix ); + return True; } /*************************************************************************** - Handle setting ldap suffix and determines whether ldap machine suffix needs - to be set as well. ***************************************************************************/ -static BOOL handle_ldap_suffix( const char *pszParmValue, char **ptr) -{ - pstring suffix; - pstring user_suffix; - pstring machine_suffix; - - pstrcpy(suffix, pszParmValue); - - if (! *Globals.szLdapMachineSuffix ) - string_set(&Globals.szLdapMachineSuffix, suffix); - if (! *Globals.szLdapUserSuffix ) - string_set(&Globals.szLdapUserSuffix, suffix); - - if (! strstr(Globals.szLdapMachineSuffix, suffix)) { - pstrcpy(machine_suffix, Globals.szLdapMachineSuffix); - if ( *Globals.szLdapMachineSuffix ) - pstrcat(machine_suffix, ","); - pstrcat(machine_suffix, suffix); - string_set(&Globals.szLdapMachineSuffix, machine_suffix); - } - - if (! strstr(Globals.szLdapUserSuffix, suffix)) { - pstrcpy(user_suffix, Globals.szLdapUserSuffix); - if ( *Globals.szLdapUserSuffix ) - pstrcat(user_suffix, ","); - pstrcat(user_suffix, suffix); - string_set(&Globals.szLdapUserSuffix, user_suffix); - } - - string_set(ptr, suffix); - return True; -} - static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr) { if (strequal(pszParmValue, "auto")) @@ -3031,6 +3006,7 @@ static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr) return True; } + /*************************************************************************** Initialise a copymap. ***************************************************************************/ -- cgit From 71298881c4a630666c1a14be99048f8f86e48162 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 6 Jun 2003 22:33:43 +0000 Subject: * add in David Lee's utmp patch (defaults to on if available) * one more try at fixing builds when --with-ldap=no (This used to be commit b516ab7bdef6b6b2b7f0df8966dbd4c329f46a92) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a5e9b1467f..49f0bbd2a4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -158,11 +158,9 @@ typedef struct char *szAbortShutdownScript; char *szWINSHook; char *szWINSPartners; -#ifdef WITH_UTMP char *szUtmpDir; char *szWtmpDir; BOOL bUtmp; -#endif char *szSourceEnv; char *szIdmapUID; char *szIdmapGID; @@ -1575,11 +1573,9 @@ FN_GLOBAL_STRING(lp_lockdir, &Globals.szLockDir) FN_GLOBAL_STRING(lp_piddir, &Globals.szPidDir) FN_GLOBAL_STRING(lp_mangling_method, &Globals.szManglingMethod) FN_GLOBAL_INTEGER(lp_mangle_prefix, &Globals.mangle_prefix) -#ifdef WITH_UTMP FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir) FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp) -#endif FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) FN_GLOBAL_STRING(lp_source_environment, &Globals.szSourceEnv) FN_GLOBAL_STRING(lp_defaultservice, &Globals.szDefaultService) -- cgit From e485bc7e3e192c419e4a9b9dc435f07cfb4535fc Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 6 Jun 2003 22:50:54 +0000 Subject: support LDAP_EXOP_MODIFY_PASSWORD (not experiemental in OpenLDAP 2.1) (This used to be commit 50fdc938222112b5470d05d8cd15386bd0a112df) --- source3/param/loadparm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 49f0bbd2a4..b76a56328b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -624,18 +624,16 @@ static const struct enum_list enum_ldap_ssl[] = { }; static const struct enum_list enum_ldap_passwd_sync[] = { - {LDAP_PASSWD_SYNC_ON, "Yes"}, - {LDAP_PASSWD_SYNC_ON, "yes"}, - {LDAP_PASSWD_SYNC_ON, "on"}, - {LDAP_PASSWD_SYNC_ON, "On"}, {LDAP_PASSWD_SYNC_OFF, "no"}, {LDAP_PASSWD_SYNC_OFF, "No"}, {LDAP_PASSWD_SYNC_OFF, "off"}, {LDAP_PASSWD_SYNC_OFF, "Off"}, -#ifdef LDAP_EXOP_X_MODIFY_PASSWD + {LDAP_PASSWD_SYNC_ON, "Yes"}, + {LDAP_PASSWD_SYNC_ON, "yes"}, + {LDAP_PASSWD_SYNC_ON, "on"}, + {LDAP_PASSWD_SYNC_ON, "On"}, {LDAP_PASSWD_SYNC_ONLY, "Only"}, {LDAP_PASSWD_SYNC_ONLY, "only"}, -#endif /* LDAP_EXOP_X_MODIFY_PASSWD */ {-1, NULL} }; -- cgit From 6a945d3354f6f1471b65dd071cb7058c7708d720 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 7 Jun 2003 13:51:13 +0000 Subject: add back the winbind uid/gid parameter but mark them as deprecated (This used to be commit 61215c68493c200c22ea64edb299d69f46c6ab0a) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b76a56328b..30fc6c5d12 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1119,6 +1119,8 @@ static struct parm_struct parm_table[] = { {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, -- cgit From e4bc8f08c35aeff9aa430058a82a16a515ef474d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 8 Jun 2003 12:49:31 +0000 Subject: Enforce 'client plaintext auth', 'client lanman auth' and 'client ntlmv2 auth'. (this now causes things like the LANMAN protocol and contacting servers with 'encrypt passwords = no' set to fail, if configured) 'client ntlmv2 auth' (a BOOL) forces both plaintext and lanman off, and is the most secure setting for compatible hosts. Perhaps we should change this to 'client minimum auth'? Andrew Bartlett (This used to be commit e1fb681e4c921456fde154b87687722a18ed4aac) --- source3/param/loadparm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 30fc6c5d12..9ca7a58e83 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -276,6 +276,7 @@ typedef struct BOOL bUseSpnego; BOOL bClientLanManAuth; BOOL bClientNTLMv2Auth; + BOOL bClientPlaintextAuth; BOOL bClientUseSpnego; BOOL bDebugHiresTimestamp; BOOL bDebugPid; @@ -567,6 +568,7 @@ static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); +static void set_allowed_client_auth(void); static const struct enum_list enum_protocol[] = { {PROTOCOL_NT1, "NT1"}, @@ -778,6 +780,7 @@ static struct parm_struct parm_table[] = { {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"client NTLMv2 auth", P_BOOL, P_GLOBAL, &Globals.bClientNTLMv2Auth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"client lanman auth", P_BOOL, P_GLOBAL, &Globals.bClientLanManAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client plaintext auth", P_BOOL, P_GLOBAL, &Globals.bClientPlaintextAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, @@ -1386,6 +1389,7 @@ static void init_globals(void) Globals.bStatCache = True; /* use stat cache by default */ Globals.restrict_anonymous = 0; Globals.bClientLanManAuth = True; /* Do use the LanMan hash if it is available */ + Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ @@ -1695,6 +1699,7 @@ FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_INTEGER(lp_restrict_anonymous, &Globals.restrict_anonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) FN_GLOBAL_BOOL(lp_ntlm_auth, &Globals.bNTLMAuth) +FN_GLOBAL_BOOL(lp_client_plaintext_auth, &Globals.bClientPlaintextAuth) FN_GLOBAL_BOOL(lp_client_lanman_auth, &Globals.bClientLanManAuth) FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, &Globals.bClientNTLMv2Auth) FN_GLOBAL_BOOL(lp_host_msdfs, &Globals.bHostMSDfs) @@ -3821,6 +3826,19 @@ static void set_server_role(void) } } +/*********************************************************** + If we should send plaintext/LANMAN passwords in the clinet +************************************************************/ +static void set_allowed_client_auth(void) +{ + if (Globals.bClientNTLMv2Auth) { + Globals.bClientLanManAuth = False; + } + if (!Globals.bClientLanManAuth) { + Globals.bClientPlaintextAuth = False; + } +} + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. @@ -3888,6 +3906,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, set_server_role(); set_default_server_announce_type(); + set_allowed_client_auth(); bLoaded = True; -- cgit From 093116c49fbf914f0a886dfa073f004396ac1f36 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jun 2003 02:13:09 +0000 Subject: when creating aliased parameters in loadparm.c you *must* place the alias directly after the main entry, otherwise it isn't treated as an alias. (This used to be commit 0f3d44858f49c3f9f191b2a3b47d58882e899421) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9ca7a58e83..1a71b2472c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1121,8 +1121,8 @@ static struct parm_struct parm_table[] = { {"idmap only", P_BOOL, P_GLOBAL, &Globals.bIdmapOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, + {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, -- cgit From 9251afe35bc402bbab816d7c33673d4ef3fb0351 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Jun 2003 01:12:20 +0000 Subject: Mapping of Windows ACL inheritance and protected bits onto extended attributes if available. Adds new parameter "map acl inheritance" (docs coming soon) off by default. Allows W2K acl inheritance dialogs to work correctly on POSIX acls. Jeremy. (This used to be commit a83595e80ae539135fa1a65d6066b10ac94fbad1) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1a71b2472c..8289c45b6a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -413,6 +413,7 @@ typedef struct BOOL bNTAclSupport; BOOL bUseSendfile; BOOL bProfileAcls; + BOOL bMap_acl_inherit; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -956,6 +957,7 @@ static struct parm_struct parm_table[] = { {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, + {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, @@ -1831,6 +1833,7 @@ FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode) FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_BOOL(lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) +FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From be61fcef60f053485e1d89749e5ffc9e71d132ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Jun 2003 01:42:13 +0000 Subject: Missed initial param, typo. Jeremy. (This used to be commit 036a551b10f1cb436ea36acbb40983249de8310d) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8289c45b6a..068919a916 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -533,6 +533,7 @@ static service sDefault = { True, /* bNTAclSupport */ False, /* bUseSendfile */ False, /* bProfileAcls */ + False, /* bMap_acl_inherit */ NULL, /* Parametric options */ -- cgit From 4f99186f6b03c1bf24892498196c361c47c2fdae Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Jun 2003 00:58:54 +0000 Subject: Move the map acl inherit parameter into the protocol section. Jeremy. (This used to be commit 076d9a3c9bc264d9456a67da9366bd73d3ce69d5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 068919a916..5c0a730b66 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -864,6 +864,7 @@ static struct parm_struct parm_table[] = { {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_DEVELOPER}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_DEVELOPER}, + {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -958,7 +959,6 @@ static struct parm_struct parm_table[] = { {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, -- cgit From f51d769dd303027a3dbf46fc89a482933988e866 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Jun 2003 17:41:05 +0000 Subject: large change: *) consolidates the dc location routines again (dns and netbios) get_dc_list() or get_sorted_dc_list() is the authoritative means of locating DC's again. (also inludes a flag to get_dc_list() to define if this should be a DNS only lookup or not) (however, if you set "name resolve order = hosts wins" you could still get DNS queries for domain name IFF ldap_domain2hostlist() fails. The answer? Fix your DNS setup) *) enabled DOMAIN<0x1c> lookups to be funneled through resolve_hosts resulting in a call to ldap_domain2hostlist() if lp_security() == SEC_ADS *) enables name cache for winbind ADS backend *) enable the negative connection cache for winbind ADS backend *) removes some old dead code *) consolidates some duplicate code *) moves the internal_name_resolve() to use an IP/port pair to deal with SRV RR dns replies. The namecache code also supports the IP:port syntax now as well. *) removes 'ads server' and moves the functionality back into 'password server' (which can support "hostname:port" syntax now but works fine with defaults depending on the value of lp_security()) (This used to be commit d7f7fcda425bef380441509734eca33da943c091) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5c0a730b66..cee61f54cd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -126,7 +126,6 @@ typedef struct char *szPasswordServer; char *szSocketOptions; char *szRealm; - char *szADSserver; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -736,7 +735,6 @@ static struct parm_struct parm_table[] = { {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"ADS server", P_STRING, P_GLOBAL, &Globals.szADSserver, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1597,7 +1595,6 @@ FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) 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_ads_server, &Globals.szADSserver) 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) -- cgit From 0a4959d48d62cd97d912182f99e0ea969d48253f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 30 Jun 2003 02:11:13 +0000 Subject: - added LOCALE patch from vorlon@debian.org (Steve Langasek) (bug #122) - changed --enable-developer debug to use -gstabs as it makes the samba binaries about 10x smaller and is still quite functional for samba debugging (This used to be commit 53bfcd478a193d4def8da872e92d7ed8f46aa4b9) --- source3/param/loadparm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cee61f54cd..95f6896e6b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1281,8 +1281,13 @@ static void init_globals(void) /* using UTF8 by default allows us to support all chars */ string_set(&Globals.unix_charset, "UTF8"); - /* using UTF8 by default allows us to support all chars */ +#if defined(HAVE_NL_LANGINFO) && defined(CODESET) + /* If the system supports nl_langinfo(), try to grab the value + from the user's locale */ + string_set(&Globals.display_charset, "LOCALE"); +#else string_set(&Globals.display_charset, "ASCII"); +#endif /* Use codepage 850 as a default for the dos character set */ string_set(&Globals.dos_charset, "CP850"); -- cgit From aca3fa914928bdb1b7ea091ffe169a4e74b213d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 Jun 2003 14:55:45 +0000 Subject: Add the 'guest' passdb backend automatically if guest account != "" Volker (This used to be commit 21d330af107f744af9569b5577afc6e7ba6a269c) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 95f6896e6b..d6e24dfc3c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1419,9 +1419,9 @@ static void init_globals(void) #ifdef WITH_LDAP_SAMCONFIG string_set(&Globals.szLdapServer, "localhost"); Globals.ldap_port = 636; - Globals.szPassdbBackend = str_list_make("ldapsam_compat guest", NULL); + Globals.szPassdbBackend = str_list_make("ldapsam_compat", NULL); #else - Globals.szPassdbBackend = str_list_make("smbpasswd guest", NULL); + Globals.szPassdbBackend = str_list_make("smbpasswd", NULL); #endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); -- cgit From ce72beb2b558d86fb49063c6b1fa00e07952ce56 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 Jul 2003 19:11:31 +0000 Subject: Removed strupper/strlower macros that automatically map to strupper_m/strlower_m. I really want people to think about when they're using multibyte strings. Jeremy. (This used to be commit ff222716a08af65d26ad842ce4c2841cc6540959) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d6e24dfc3c..1085a2d175 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2478,7 +2478,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL case P_USTRING: string_set(dest_ptr, *(char **)src_ptr); - strupper(*(char **)dest_ptr); + strupper_m(*(char **)dest_ptr); break; case P_LIST: str_list_copy((char ***)dest_ptr, *(const char ***)src_ptr); @@ -3175,7 +3175,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue case P_USTRING: string_set(parm_ptr, pszParmValue); - strupper(*(char **)parm_ptr); + strupper_m(*(char **)parm_ptr); break; case P_GSTRING: @@ -3184,7 +3184,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue case P_UGSTRING: pstrcpy((char *)parm_ptr, pszParmValue); - strupper((char *)parm_ptr); + strupper_m((char *)parm_ptr); break; case P_ENUM: -- cgit From fcf115a93982933916e27d47643a3a4d741b9d76 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 5 Jul 2003 13:51:54 +0000 Subject: This parameter is unused. Andrew Bartlett (This used to be commit 3dd767841666068a1b32c71b03a8e7bc797087be) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1085a2d175..1736254a4c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -211,7 +211,6 @@ typedef struct 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; @@ -895,7 +894,6 @@ static struct parm_struct parm_table[] = { {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, FLAG_DEVELOPER}, {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_DEVELOPER}, - {"stat cache size", P_INTEGER, P_GLOBAL, &Globals.stat_cache_size, NULL, NULL, FLAG_DEVELOPER}, {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, @@ -1374,7 +1372,6 @@ static void init_globals(void) Globals.ReadSize = 16 * 1024; Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; - Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */ Globals.announce_as = ANNOUNCE_AS_NT_SERVER; #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT)) Globals.bNISHomeMap = False; @@ -1743,7 +1740,6 @@ FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) -FN_GLOBAL_INTEGER(lp_stat_cache_size, &Globals.stat_cache_size) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) -- cgit From 0b18acb841f6a372b3aa285d4734875e5e35fe3b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 7 Jul 2003 05:11:10 +0000 Subject: and so it begins.... * remove idmap_XX_to_XX calls from smbd. Move back to the the winbind_XXX and local_XXX calls used in 2.2 * all uid/gid allocation must involve winbindd now * move flags field around in winbindd_request struct * add WBFLAG_QUERY_ONLY option to winbindd_sid_to_[ug]id() to prevent automatic allocation for unknown SIDs * add 'winbind trusted domains only' parameter to force a domain member server to use matching users names from /etc/passwd for its domain (needed for domain member of a Samba domain) * rename 'idmap only' to 'enable rid algorithm' for better clarity (defaults to "yes") code has been tested on * domain member of native mode 2k domain * ads domain member of native mode 2k domain * domain member of NT4 domain * domain member of Samba domain * Samba PDC running winbindd with trusts Logons tested using 2k clients and smbclient as domain users and trusted users. Tested both 'winbind trusted domains only = [yes|no]' This will be a long week of changes. The next item on the list is winbindd_passdb.c & machine trust accounts not in /etc/passwd (done via winbindd_passdb) (This used to be commit 8266dffab4aedba12a33289ff32880037ce950a8) --- source3/param/loadparm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1736254a4c..3ce4979489 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -163,8 +163,7 @@ typedef struct char *szSourceEnv; char *szIdmapUID; char *szIdmapGID; - BOOL *bIdmapOnly; - char *szNonUnixAccountRange; + BOOL bEnableRidAlgorithm; int AlgorithmicRidBase; char *szTemplateHomedir; char *szTemplateShell; @@ -172,6 +171,7 @@ typedef struct BOOL bWinbindEnumUsers; BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; + BOOL bWinbindTrustedDomainsOnly; char *szWinbindBackend; char *szIdmapBackend; char *szAddShareCommand; @@ -1117,7 +1117,7 @@ static struct parm_struct parm_table[] = { {"Winbind options", P_SEP, P_SEPARATOR}, - {"idmap only", P_BOOL, P_GLOBAL, &Globals.bIdmapOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED}, {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, @@ -1130,6 +1130,7 @@ static struct parm_struct parm_table[] = { {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind trusted domains only", P_BOOL, P_GLOBAL, &Globals.bWinbindTrustedDomainsOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1467,12 +1468,13 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); - Globals.winbind_cache_time = 600; /* 5 minutes */ + Globals.winbind_cache_time = 300; /* 5 minutes */ Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; + Globals.bWinbindTrustedDomainsOnly = False; - Globals.bIdmapOnly = False; + Globals.bEnableRidAlgorithm = True; Globals.name_cache_timeout = 660; /* In seconds */ @@ -1637,9 +1639,10 @@ FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) 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_STRING(lp_idmap_backend, &Globals.szIdmapBackend) -FN_GLOBAL_BOOL(lp_idmap_only, &Globals.bIdmapOnly) +FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm) #ifdef WITH_LDAP_SAMCONFIG FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -- cgit From e4bfa0a4608d794fd0c6228b58469ddf5473b7b4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Jul 2003 21:58:29 +0000 Subject: Moved SAM_ACCOUNT marshall/unmarshall functions to make them externally available. Removed extra auth_init (thanks metze). Jeremy. (This used to be commit 88135fbc4998c266052647f8b8e437ac01cf50ae) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3ce4979489..e7adce7193 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1120,9 +1120,9 @@ static struct parm_struct parm_table[] = { {"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED}, {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED }, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, -- cgit From 16ff7b26f6b9d288cbd1d39e075b637e24da13a6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 9 Jul 2003 16:44:47 +0000 Subject: Large set of changes to add UNIX account/group management to winbindd. See README.idmap-and-winbind-changes for details. (This used to be commit 1111bc7b0c7165e1cdf8d90eb49f4c368d2eded6) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e7adce7193..9194274a61 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -165,9 +165,11 @@ typedef struct char *szIdmapGID; BOOL bEnableRidAlgorithm; int AlgorithmicRidBase; + char *szTemplatePrimaryGroup; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; + BOOL bWinbindEnableLocalAccounts; BOOL bWinbindEnumUsers; BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; @@ -1123,10 +1125,12 @@ static struct parm_struct parm_table[] = { {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, + {"template primary group", P_STRING, P_GLOBAL, &Globals.szTemplatePrimaryGroup, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"winbind enable local accounts", P_BOOL, P_GLOBAL, &Globals.bWinbindEnableLocalAccounts, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1465,10 +1469,12 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); + string_set(&Globals.szTemplatePrimaryGroup, "nobody"); string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); Globals.winbind_cache_time = 300; /* 5 minutes */ + Globals.bWinbindEnableLocalAccounts = True; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; @@ -1632,10 +1638,12 @@ FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) 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_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) +FN_GLOBAL_BOOL(lp_winbind_enable_local_accounts, &Globals.bWinbindEnableLocalAccounts) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) -- cgit From c44a9d25a2bfff9d5ebede80f30e13e41aca797c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Jul 2003 23:05:57 +0000 Subject: Added the "required" keyword to the "client signing" parameter to force it on. Fail if missmatch. Small format tidyups in smbd/sesssetup.c. Preparing to add signing on server side. Jeremy. (This used to be commit c390b3e4cd68cfc233ddf14d139e25d40f050f27) --- source3/param/loadparm.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9194274a61..dd429fa688 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -291,7 +291,7 @@ typedef struct BOOL bKernelChangeNotify; int restrict_anonymous; int name_cache_timeout; - BOOL client_signing; + int client_signing; param_opt_struct *param_opt; } global; @@ -687,6 +687,25 @@ static const struct enum_list enum_csc_policy[] = { {-1, NULL} }; +/* SMB signing types. */ +static const struct enum_list enum_smb_signing_vals[] = { + {False, "No"}, + {False, "False"}, + {False, "0"}, + {False, "Off"}, + {True, "Yes"}, + {True, "True"}, + {True, "1"}, + {True, "On"}, + {Required, "Required"}, + {Required, "Mandatory"}, + {Required, "Force"}, + {Required, "Forced"}, + {Required, "Enforced"}, + {-1, NULL} +}; + + /* Do you want session setups at user level security with a invalid password to be rejected or allowed in as guest? WinNT rejects them @@ -874,7 +893,7 @@ static struct parm_struct parm_table[] = { {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_DEVELOPER}, - {"client signing", P_BOOL, P_GLOBAL, &Globals.client_signing, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED | FLAG_DEVELOPER}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_DEVELOPER}, {"Tuning Options", P_SEP, P_SEPARATOR}, -- cgit From 6ab5e14494ed6b579658f4fe3410759582d909cd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Jul 2003 22:57:56 +0000 Subject: Refactor signing code to remove most dependencies on 'struct cli'. Ensure a server can't do a downgrade attack if client signing is mandatory. Add a lp_server_signing() function and a 'server signing' parameter that will act as the client one does. Jeremy (This used to be commit 203e4bf0bfb66fd9239e9a0656438a71280113cb) --- source3/param/loadparm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dd429fa688..3739407810 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -292,6 +292,7 @@ typedef struct int restrict_anonymous; int name_cache_timeout; int client_signing; + int server_signing; param_opt_struct *param_opt; } global; @@ -693,15 +694,17 @@ static const struct enum_list enum_smb_signing_vals[] = { {False, "False"}, {False, "0"}, {False, "Off"}, + {False, "disabled"}, {True, "Yes"}, {True, "True"}, {True, "1"}, {True, "On"}, - {Required, "Required"}, - {Required, "Mandatory"}, - {Required, "Force"}, - {Required, "Forced"}, - {Required, "Enforced"}, + {True, "enabled"}, + {Required, "required"}, + {Required, "mandatory"}, + {Required, "force"}, + {Required, "forced"}, + {Required, "enforced"}, {-1, NULL} }; @@ -894,6 +897,7 @@ static struct parm_struct parm_table[] = { {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_DEVELOPER}, {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED | FLAG_DEVELOPER}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_DEVELOPER}, {"Tuning Options", P_SEP, P_SEPARATOR}, @@ -1885,7 +1889,8 @@ FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) -FN_GLOBAL_BOOL(lp_client_signing, &Globals.client_signing) +FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) +FN_GLOBAL_INTEGER(lp_server_signing, &Globals.server_signing) /* local prototypes */ -- cgit From f1b6cd794dd5de853c4b068361a326160a3d0384 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Jul 2003 00:48:21 +0000 Subject: Putting the framework for server signing in place. Ensure we don't use sendfile when signing (I need to add this for readbraw/writebraw too...). Jeremy. (This used to be commit f2e84f1ba67b13ff29e24a38099b559d9033a680) --- source3/param/loadparm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3739407810..1af8d51114 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1864,7 +1864,7 @@ 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_nt_acl_support, bNTAclSupport) -FN_LOCAL_BOOL(lp_use_sendfile, bUseSendfile) +FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) @@ -4291,3 +4291,12 @@ int lp_maxprintjobs(int snum) return maxjobs; } + +/******************************************************************* + Ensure we don't use sendfile if server smb signing is active. +********************************************************************/ + +BOOL lp_use_sendfile(int snum) +{ + return (_lp_use_sendfile(snum) && !srv_signing_active()); +} -- cgit From 814e987c6241601fb03335b2ba9a633d65cc5e23 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Jul 2003 00:53:34 +0000 Subject: Signing so far... the client code fails on a SMBtrans2 secondary transaction I think (my changes haven't affected this I believe). Initial support on the server side for smbclient. Still doesn't work for w2k clients I think... Work in progress..... (don't change). Jeremy. (This used to be commit e5714edc233424c2f74edb6d658f32f8e0ec9275) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1af8d51114..272434d487 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4298,5 +4298,5 @@ int lp_maxprintjobs(int snum) BOOL lp_use_sendfile(int snum) { - return (_lp_use_sendfile(snum) && !srv_signing_active()); + return (_lp_use_sendfile(snum) && !srv_is_signing_active()); } -- cgit From 8dea1bb9320c412b40a0bf4446d53e4f74162eda Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Mon, 28 Jul 2003 05:47:15 +0000 Subject: Cleanup of loadparm and swat to correctly display all parameters as required. No change to what is displayed has been made at this time. I do intend to change the display order before 3.0.0 ships. (This used to be commit de7d3063d9e07255da2cc4e67afa50c1e2ddf321) --- source3/param/loadparm.c | 822 ++++++++++++++++++++++++----------------------- 1 file changed, 413 insertions(+), 409 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 272434d487..753f7173da 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -738,428 +738,432 @@ static const struct enum_list enum_map_to_guest[] = { }; /* Note: We do not initialise the defaults union - it is not allowed in ANSI C - * - * Note: We have a flag called FLAG_DEVELOPER but is not used at this time, it - * is implied in current control logic. This may change at some later time. A - * flag value of 0 means - show as development option only. * * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit * screen in SWAT. This is used to exclude parameters as well as to squash all * parameters that have been duplicated by pseudonyms. + * + * NOTE: To display a parameter in BASIC view set FLAG_BASIC + * Any parameter that does NOT have FLAG_ADVANCED will not disply at all + * Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in + * respective views. */ + static struct parm_struct parm_table[] = { - {"Base Options", P_SEP, P_SEPARATOR}, - - {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - - {"Security Options", P_SEP, P_SEPARATOR}, - - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, enum_map_to_guest, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE | FLAG_DEVELOPER}, - {"guest account", P_STRING, P_GLOBAL, &Globals.szGuestaccount, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"pam password change", P_BOOL, P_GLOBAL, &Globals.bPamPasswordChange, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client NTLMv2 auth", P_BOOL, P_GLOBAL, &Globals.bClientNTLMv2Auth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client lanman auth", P_BOOL, P_GLOBAL, &Globals.bClientLanManAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client plaintext auth", P_BOOL, P_GLOBAL, &Globals.bClientPlaintextAuth, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, - - {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_GLOBAL | FLAG_PRINT}, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_SHARE}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_SHARE}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_GLOBAL}, - {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_GLOBAL}, - {"force directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"directory security mask", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_mask, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"force directory security mode", P_OCTAL, P_LOCAL, &sDefault.iDir_Security_force_mode, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE}, - {"inherit permissions", P_BOOL, P_LOCAL, &sDefault.bInheritPerms, NULL, NULL, FLAG_SHARE}, - {"inherit acls", P_BOOL, P_LOCAL, &sDefault.bInheritACLS, NULL, NULL, FLAG_SHARE}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_SHARE}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, - - {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, - {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_HIDE}, - - {"only user", P_BOOL, P_LOCAL, &sDefault.bOnlyUser, NULL, NULL, FLAG_SHARE}, - {"hosts allow", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, - {"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 | FLAG_DEVELOPER}, - {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_HIDE}, - {"preload modules", P_LIST, P_GLOBAL, &Globals.szPreloadModules, NULL, NULL, FLAG_BASIC | FLAG_GLOBAL}, - - {"Logging Options", P_SEP, P_SEPARATOR}, - - {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_HIDE}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, FLAG_DEVELOPER}, - {"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, NULL, NULL, FLAG_DEVELOPER}, - {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, FLAG_DEVELOPER}, - {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, FLAG_DEVELOPER}, - - {"Protocol Options", P_SEP, P_SEPARATOR}, - - {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, FLAG_DEVELOPER}, - {"max protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, FLAG_DEVELOPER}, - {"min protocol", P_ENUM, P_GLOBAL, &Globals.minprotocol, NULL, enum_protocol, FLAG_DEVELOPER}, - {"unicode", P_BOOL, P_GLOBAL, &Globals.bUnicode, NULL, NULL, FLAG_DEVELOPER}, - {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, FLAG_DEVELOPER}, - {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, FLAG_DEVELOPER}, - {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER}, - {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED}, - - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_DEVELOPER}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_DEVELOPER}, - {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_DEVELOPER}, - {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_DEVELOPER}, - - {"Tuning Options", P_SEP, P_SEPARATOR}, - - {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, FLAG_DEVELOPER}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_DEVELOPER}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_DEVELOPER}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_DEVELOPER}, - - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_DEVELOPER}, - {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_DEVELOPER}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_SHARE}, - {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, NULL, NULL, FLAG_DEVELOPER}, - {"max disk size", P_INTEGER, P_GLOBAL, &Globals.maxdisksize, NULL, NULL, FLAG_DEVELOPER}, - {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_PRINT}, - {"read size", P_INTEGER, P_GLOBAL, &Globals.ReadSize, NULL, NULL, FLAG_DEVELOPER}, - - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_DEVELOPER}, - {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_SHARE}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_SHARE}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_SHARE}, - {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_DEVELOPER}, - {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_SHARE}, - {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_SHARE}, - - {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"Printing Options", P_SEP, P_SEPARATOR}, - - {"max reported print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxReportedPrintJobs, NULL, NULL, FLAG_PRINT}, - {"max print jobs", P_INTEGER, P_LOCAL, &sDefault.iMaxPrintJobs, NULL, NULL, FLAG_PRINT}, - {"load printers", P_BOOL, P_GLOBAL, &Globals.bLoadPrinters, NULL, NULL, FLAG_PRINT}, - {"printcap name", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_PRINT | FLAG_DEVELOPER}, - {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_HIDE}, - {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, 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_PRINT | FLAG_GLOBAL}, - {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, - - {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT}, - {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_HIDE}, - {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, - {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, - - {"Filename Handling", P_SEP, P_SEPARATOR}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"mangling method", P_STRING, P_GLOBAL, &Globals.szManglingMethod, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"mangle prefix", P_INTEGER, P_GLOBAL, &Globals.mangle_prefix, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"default case", P_ENUM, P_LOCAL, &sDefault.iDefaultCase, NULL, enum_case, FLAG_SHARE}, - {"case sensitive", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, FLAG_HIDE}, - {"preserve case", P_BOOL, P_LOCAL, &sDefault.bCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"short preserve case", P_BOOL, P_LOCAL, &sDefault.bShortCasePreserve, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangle case", P_BOOL, P_LOCAL, &sDefault.bCaseMangle, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide special files", P_BOOL, P_LOCAL, &sDefault.bHideSpecialFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL }, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"mangled map", P_STRING, P_LOCAL, &sDefault.szMangledMap, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, FLAG_DEVELOPER}, - - {"Domain Options", P_SEP, P_SEPARATOR}, - - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - - {"Logon Options", P_SEP, P_SEPARATOR}, - - {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"set primary group script", P_STRING, P_GLOBAL, &Globals.szSetPrimaryGroupScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"Browse Options", P_SEP, P_SEPARATOR}, - - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED | FLAG_DEVELOPER}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, - {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_DEVELOPER | FLAG_ADVANCED}, - - {"WINS Options", P_SEP, P_SEPARATOR}, - - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, - {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD | FLAG_DEVELOPER}, + {"Base Options", P_SEP, P_SEPARATOR}, + + {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, FLAG_ADVANCED}, + {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, FLAG_ADVANCED}, + {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, FLAG_ADVANCED}, + {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, + {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, +#ifdef WITH_ADS + {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, +#endif + {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED}, + {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED}, + {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED }, + {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + + {"Security Options", P_SEP, P_SEPARATOR}, + + {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_ADVANCED}, + {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_ADVANCED}, + {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, + {"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}, + {"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}, + {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED}, + {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED}, + {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED}, + {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, 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}, + + {"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}, + {"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}, + {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, FLAG_ADVANCED}, + {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, FLAG_ADVANCED}, + {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, FLAG_ADVANCED}, + {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED}, + {"client NTLMv2 auth", P_BOOL, P_GLOBAL, &Globals.bClientNTLMv2Auth, NULL, NULL, FLAG_ADVANCED}, + {"client lanman auth", P_BOOL, P_GLOBAL, &Globals.bClientLanManAuth, NULL, NULL, FLAG_ADVANCED}, + {"client plaintext auth", P_BOOL, P_GLOBAL, &Globals.bClientPlaintextAuth, NULL, NULL, FLAG_ADVANCED}, + + {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, + {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, + + {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT}, + {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED}, + + {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE}, + {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + + {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, + {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + {"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}, + {"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}, + {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, + + {"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}, + {"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}, + + {"Logging Options", P_SEP, P_SEPARATOR}, + + {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_ADVANCED}, + {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_HIDE}, + {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, FLAG_ADVANCED}, + {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, FLAG_ADVANCED}, + {"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}, + {"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}, + + {"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}, + {"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}, + {"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}, + {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + + {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_ADVANCED}, + {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_ADVANCED}, + {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED}, + {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED}, + + {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, FLAG_ADVANCED}, + {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, FLAG_ADVANCED}, + {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, FLAG_ADVANCED}, + {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED}, + {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED}, + {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_ADVANCED}, + {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, + {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, + {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, + + {"Tuning Options", P_SEP, P_SEPARATOR}, + + {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, FLAG_ADVANCED}, + {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, + {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, + {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED}, + {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED}, + + {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED}, + {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_ADVANCED}, + {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, 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}, + {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_ADVANCED}, + {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + + {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, + + {"Printing Options", P_SEP, P_SEPARATOR}, + + {"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 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}, + {"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}, + {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + + {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, FLAG_ADVANCED}, + {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, FLAG_ADVANCED}, + {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, FLAG_ADVANCED}, + {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, FLAG_ADVANCED}, + {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, FLAG_ADVANCED}, + + {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, + {"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}, + + {"Filename Handling", P_SEP, P_SEPARATOR}, + {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED}, + {"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}, + + {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, 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}, + {"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}, + {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, + {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, + {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, 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}, + {"stat cache", P_BOOL, P_GLOBAL, &Globals.bStatCache, NULL, NULL, FLAG_ADVANCED}, + + {"Domain Options", P_SEP, P_SEPARATOR}, + + {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + + {"Logon Options", P_SEP, P_SEPARATOR}, + + {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED}, + {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED}, + {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, FLAG_ADVANCED}, + {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, FLAG_ADVANCED}, + {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, FLAG_ADVANCED}, + {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, FLAG_ADVANCED}, + {"set primary group script", P_STRING, P_GLOBAL, &Globals.szSetPrimaryGroupScript, NULL, NULL, FLAG_ADVANCED}, + {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, FLAG_ADVANCED}, + {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, FLAG_ADVANCED}, + {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, FLAG_ADVANCED}, + + {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_ADVANCED}, + {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_ADVANCED}, + {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, FLAG_ADVANCED}, + {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_ADVANCED}, + {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, FLAG_ADVANCED}, + + {"Browse Options", P_SEP, P_SEPARATOR}, + + {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, + {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED}, + {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, FLAG_ADVANCED}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, + {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, FLAG_ADVANCED}, + {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, + {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_ADVANCED}, + + {"WINS Options", P_SEP, P_SEPARATOR}, + + {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED}, + {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED}, + + {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED}, + {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + + {"Locking Options", P_SEP, P_SEPARATOR}, + + {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"csc policy", P_ENUM, P_LOCAL, &sDefault.iCSCPolicy, NULL, enum_csc_policy, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"lock spin count", P_INTEGER, P_GLOBAL, &Globals.iLockSpinCount, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + + {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"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}, + {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + + {"Ldap Options", P_SEP, P_SEPARATOR}, - {"Locking Options", P_SEP, P_SEPARATOR}, - - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"csc policy", P_ENUM, P_LOCAL, &sDefault.iCSCPolicy, NULL, enum_csc_policy, FLAG_SHARE | FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_SHARE}, - {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"lock spin count", P_INTEGER, P_GLOBAL, &Globals.iLockSpinCount, NULL, NULL, FLAG_GLOBAL}, - {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_GLOBAL}, - - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"oplock break wait time", P_INTEGER, P_GLOBAL, &Globals.oplock_break_wait_time, NULL, NULL, FLAG_GLOBAL}, - {"oplock contention limit", P_INTEGER, P_LOCAL, &sDefault.iOplockContentionLimit, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"posix locking", P_BOOL, P_LOCAL, &sDefault.bPosixLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - - {"Ldap Options", P_SEP, P_SEPARATOR}, - #ifdef WITH_LDAP_SAMCONFIG - {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, 0}, - {"ldap port", P_INTEGER, P_GLOBAL, &Globals.ldap_port, NULL, NULL, 0}, + {"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, handle_ldap_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap filter", P_STRING, P_GLOBAL, &Globals.szLdapFilter, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap admin dn", P_STRING, P_GLOBAL, &Globals.szLdapAdminDn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"Miscellaneous Options", P_SEP, P_SEPARATOR}, - {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"ldap suffix", P_STRING, P_GLOBAL, &Globals.szLdapSuffix, handle_ldap_suffix, NULL, FLAG_ADVANCED}, + {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, + {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, + {"ldap group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, + {"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, handle_ldap_sub_suffix, 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 passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED}, + {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED}, + {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED}, + + {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, + {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED}, + {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, + + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, + {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, + {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED}, {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED}, #ifdef WITH_UTMP - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED}, + {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, FLAG_ADVANCED}, + {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, FLAG_ADVANCED}, #endif - - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_DEVELOPER}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"remote browse sync", P_STRING, P_GLOBAL, &Globals.szRemoteBrowseSync, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"socket address", P_STRING, P_GLOBAL, &Globals.szSocketAddress, NULL, NULL, FLAG_DEVELOPER}, - {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"time offset", P_INTEGER, P_GLOBAL, &extra_time_offset, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"NIS homedir", P_BOOL, P_GLOBAL, &Globals.bNISHomeMap, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"-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_SHARE | FLAG_PRINT}, - {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, FLAG_SHARE}, - {"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE }, - {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, - {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, - {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"wide links", P_BOOL, P_LOCAL, &sDefault.bWidelinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"follow symlinks", P_BOOL, P_LOCAL, &sDefault.bSymlinks, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dont descend", P_STRING, P_LOCAL, &sDefault.szDontdescend, NULL, NULL, FLAG_SHARE}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_SHARE}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_SHARE}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - - {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_SHARE | FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"VFS module options", P_SEP, P_SEPARATOR}, - - {"vfs objects", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_SHARE}, - {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_SHARE | FLAG_HIDE}, - - {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE}, - {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {"Winbind options", P_SEP, P_SEPARATOR}, - - {"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER | FLAG_DEPRECATED}, - {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, - {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEVELOPER }, - {"template primary group", P_STRING, P_GLOBAL, &Globals.szTemplatePrimaryGroup, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind enable local accounts", P_BOOL, P_GLOBAL, &Globals.bWinbindEnableLocalAccounts, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind enum users", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumUsers, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind enum groups", P_BOOL, P_GLOBAL, &Globals.bWinbindEnumGroups, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind use default domain", P_BOOL, P_GLOBAL, &Globals.bWinbindUseDefaultDomain, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"winbind trusted domains only", P_BOOL, P_GLOBAL, &Globals.bWinbindTrustedDomainsOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - - {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} + {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, + {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, + {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED}, + {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, FLAG_ADVANCED}, + {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED}, + {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED}, + {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, 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}, + {"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 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}, + {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | 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}, + {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + + {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED}, + {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED}, + + {"VFS module options", P_SEP, P_SEPARATOR}, + + {"vfs objects", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_HIDE}, + + + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED}, + + {"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 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_ADVANCED}, + {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED}, + {"template primary group", P_STRING, P_GLOBAL, &Globals.szTemplatePrimaryGroup, NULL, NULL, FLAG_ADVANCED}, + {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, 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 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}, + + {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; /*************************************************************************** -- cgit From f210ee9b99b3b6ac0234680f1af83fd783ef9af4 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 1 Aug 2003 14:47:39 +0000 Subject: Fix copyright statements for various pieces of Anthony Liguori's work. (This used to be commit 15d2bc47854df75f8b2644ccbc887d0357d9cd27) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 753f7173da..7da3a1abb3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8,7 +8,7 @@ Copyright (C) Simo Sorce 2001 Copyright (C) Alexander Bokovoy 2002 Copyright (C) Stefan (metze) Metzmacher 2002 - Copyright (C) Anthony Liguori 2003 + Copyright (C) Jim McDonough 2003 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 -- cgit From 8c64504f7c58b05769ec1014242c15a2eb93ca84 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 1 Aug 2003 15:30:44 +0000 Subject: Update my copyrights according to my agreement with IBM (This used to be commit a2bd8f0bfa12f2a1e33c96bc9dabcc0e2171700d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7da3a1abb3..8bd50f35de 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8,7 +8,7 @@ Copyright (C) Simo Sorce 2001 Copyright (C) Alexander Bokovoy 2002 Copyright (C) Stefan (metze) Metzmacher 2002 - Copyright (C) Jim McDonough 2003 + Copyright (C) Jim McDonough 2003 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 -- cgit From 9df23b22cf45d315c907a832c9e33ad72157c444 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Aug 2003 22:19:09 +0000 Subject: Turn on client ntlmv2 by default. Jeremy. (This used to be commit 729b468f7e0e5522dfdede481947826851842483) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8bd50f35de..e06b535db1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1427,7 +1427,8 @@ static void init_globals(void) Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ - + Globals.bClientNTLMv2Auth = True; /* Client should use NTLMv2 if available. */ + Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ -- cgit From 92de6a2a0aa3b35d11276b0834807844b404ba8e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 11 Aug 2003 17:42:17 +0000 Subject: Fix typos. Volker (This used to be commit d07f173767678187237c9fc767c0a05f0b8c7d32) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e06b535db1..cd9b9d9a78 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1433,7 +1433,7 @@ static void init_globals(void) Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; - Globals.iLockSpinCount = 3; /* Try 2 times. */ + Globals.iLockSpinCount = 3; /* Try 3 times. */ Globals.iLockSpinTime = 10; /* usec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; -- cgit From df8d9e0e1742da7bf5ae911d74d724a639aa3131 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 11 Aug 2003 20:50:42 +0000 Subject: Make client signing auto. Jeremy. (This used to be commit e66bfe212db1cec751f4024f631600fa2a3eb07c) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cd9b9d9a78..70efa8042b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -700,6 +700,7 @@ static const struct enum_list enum_smb_signing_vals[] = { {True, "1"}, {True, "On"}, {True, "enabled"}, + {Auto, "auto"}, {Required, "required"}, {Required, "mandatory"}, {Required, "force"}, @@ -1515,6 +1516,9 @@ static void init_globals(void) Globals.bUseSpnego = True; Globals.bClientUseSpnego = True; + Globals.client_signing = Auto; + Globals.server_signing = False; + string_set(&Globals.smb_ports, SMB_PORTS); } -- cgit From 7ddf760beabd61b180c10b6a5a45d472d432da93 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 15 Aug 2003 20:09:12 +0000 Subject: Fix charset detection code in configure. Now we are: 1. Try to find correct name for default character sets for the platform 2. Use DEFAULT_{DOS|DISPLAY|UNIX}_CHARSET defines set during configure phase as defaults This should fix CP850 problem on Solaris (at least) because it actually has IBM850 which is the same but under different name (This used to be commit 836b9fffa0eadc818019ba36ed764e97d4f9a801) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 70efa8042b..7982b87ffc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1310,18 +1310,18 @@ static void init_globals(void) string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); /* using UTF8 by default allows us to support all chars */ - string_set(&Globals.unix_charset, "UTF8"); + string_set(&Globals.unix_charset, DEFAULT_UNIX_CHARSET); #if defined(HAVE_NL_LANGINFO) && defined(CODESET) /* If the system supports nl_langinfo(), try to grab the value from the user's locale */ string_set(&Globals.display_charset, "LOCALE"); #else - string_set(&Globals.display_charset, "ASCII"); + string_set(&Globals.display_charset, DEFAULT_DISPLAY_CHARSET); #endif /* Use codepage 850 as a default for the dos character set */ - string_set(&Globals.dos_charset, "CP850"); + string_set(&Globals.dos_charset, DEFAULT_DOS_CHARSET); /* * Allow the default PASSWD_CHAT to be overridden in local.h. -- cgit From f3404f3e4acb004281f1609a0088c1eb16e6ba94 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Aug 2003 15:18:27 +0000 Subject: - Update 'preload modules' documention (bug #304) - Fix WINS Server List in SWAT (bug #197) - Don't segfault SWAT when adding shares (bug #254) (This used to be commit dd43a29504fe2b6f9d13cdb9431347927548fc10) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7982b87ffc..4a2fffc757 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4163,12 +4163,11 @@ void lp_remove_service(int snum) void lp_copy_service(int snum, const char *new_name) { - char *oldname = lp_servicename(snum); do_section(new_name); if (snum >= 0) { snum = lp_servicenumber(new_name); if (snum >= 0) - lp_do_parameter(snum, "copy", oldname); + lp_do_parameter(snum, "copy", lp_servicename(snum)); } } -- cgit From 8bfe26b62db2e671b143d93a5428f8fb64a9df05 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 20 Aug 2003 17:13:38 +0000 Subject: metze's autogenerate patch for version.h (This used to be commit ae452e51b02672a56adf18aa7a7e365eeaba9272) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4a2fffc757..17c82d5e13 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1340,7 +1340,7 @@ static void init_globals(void) string_set(&Globals.szLockDir, dyn_LOCKDIR); string_set(&Globals.szSocketAddress, "0.0.0.0"); pstrcpy(s, "Samba "); - pstrcat(s, VERSION); + pstrcat(s, SAMBA_VERSION_STRING); string_set(&Globals.szServerString, s); slprintf(s, sizeof(s) - 1, "%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); -- cgit From d422025f421a9be7c746ac4b15c9e75a36b07d5b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 21 Aug 2003 01:38:48 +0000 Subject: Turn UNIX extensions on by default. Yes I will change the docs :-). Jeremy. (This used to be commit 17b09eed96fa2793a5947fa811e8543a1b263d6f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 17c82d5e13..9f378a9424 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1441,7 +1441,7 @@ static void init_globals(void) #else Globals.bUseMmap = True; #endif - Globals.bUnixExtensions = False; + Globals.bUnixExtensions = True; /* hostname lookups can be very expensive and are broken on a large number of sites (tridge) */ -- cgit From ed087210169f7b2f8a0d378720a03e3f06d34dd4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 22 Aug 2003 12:50:53 +0000 Subject: ensure that 'available = no' works for [homes]; reported by Walter Haidinger (This used to be commit 1278d2496162c6427729a795dd940b9863261a6d) --- source3/param/loadparm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9f378a9424..83f85e9187 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2312,8 +2312,6 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, "Home directory of %s", user); string_set(&ServicePtrs[i]->comment, comment); } - ServicePtrs[i]->bAvailable = sDefault.bAvailable; - ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, user, newHomedir)); @@ -2382,7 +2380,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) /* the printer name is set to the service name. */ string_set(&ServicePtrs[i]->szPrintername, pszPrintername); string_set(&ServicePtrs[i]->comment, comment); - ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; +` /* Printers cannot be read_only. */ ServicePtrs[i]->bRead_only = False; /* No share modes on printer services. */ -- cgit From 0c42b6deea6933c41fd74d670c25aca833f8d1a2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 22 Aug 2003 13:39:49 +0000 Subject: fix compile problem (stray character) (This used to be commit 9554a661c2400e9148f7572e4de20064faea5f2a) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 83f85e9187..c0d0e501f3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2380,7 +2380,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) /* the printer name is set to the service name. */ string_set(&ServicePtrs[i]->szPrintername, pszPrintername); string_set(&ServicePtrs[i]->comment, comment); -` + /* Printers cannot be read_only. */ ServicePtrs[i]->bRead_only = False; /* No share modes on printer services. */ -- cgit From 9fdc1363bec6ae9a0a0f9a37130b98a92ebe8ce2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Aug 2003 01:25:01 +0000 Subject: Fix the character set handling properly in nmbd. Also fix bug where iconv wasn't re-initialised on reading of "charset" parameters. This caused workgroup name to be set incorrectly if it contained an extended character. Jeremy. (This used to be commit 84ae44678a6c59c999bc1023fdd9b7ad87f4ec18) --- source3/param/loadparm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c0d0e501f3..5d67ae9169 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -563,6 +563,7 @@ 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_ldap_suffix ( const char *pszParmValue, char **ptr ); static BOOL handle_ldap_sub_suffix ( const char *pszParmValue, char **ptr ); @@ -753,9 +754,9 @@ static const struct enum_list enum_map_to_guest[] = { static struct parm_struct parm_table[] = { {"Base Options", P_SEP, P_SEPARATOR}, - {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, NULL, NULL, FLAG_ADVANCED}, - {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, NULL, NULL, FLAG_ADVANCED}, - {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, NULL, NULL, FLAG_ADVANCED}, + {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, handle_charset, NULL, FLAG_ADVANCED}, + {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, handle_charset, NULL, FLAG_ADVANCED}, + {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, handle_charset, NULL, FLAG_ADVANCED}, {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, @@ -2701,7 +2702,6 @@ static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) standard_sub_basic(current_user_info.smb_name, netbios_name,sizeof(netbios_name)); - ret = set_global_myname(netbios_name); string_set(&Globals.szNetbiosName,global_myname()); @@ -2711,6 +2711,13 @@ static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) return ret; } +static BOOL handle_charset(const char *pszParmValue, char **ptr) +{ + string_set(ptr, pszParmValue); + init_iconv(); + return True; +} + static BOOL handle_workgroup(const char *pszParmValue, char **ptr) { BOOL ret; -- cgit From 7f3e60d83780e13206b814023da50fca949d37c5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 27 Aug 2003 21:17:10 +0000 Subject: remove 'ldap trust ids' since there was no way for it to work now (This used to be commit 3724063f1518c25e33ba6b65cd3bb1e36cec51fa) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5d67ae9169..79524c8b22 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -231,7 +231,6 @@ typedef struct char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; - BOOL ldap_trust_ids; char *szAclCompat; int ldap_passwd_sync; BOOL ldap_delete_dn; @@ -1073,7 +1072,6 @@ static struct parm_struct parm_table[] = { {"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 passwd sync", P_ENUM, P_GLOBAL, &Globals.ldap_passwd_sync, NULL, enum_ldap_passwd_sync, FLAG_ADVANCED}, - {"ldap trust ids", P_BOOL, P_GLOBAL, &Globals.ldap_trust_ids, NULL, NULL, FLAG_ADVANCED}, {"ldap delete dn", P_BOOL, P_GLOBAL, &Globals.ldap_delete_dn, NULL, NULL, FLAG_ADVANCED}, {"Miscellaneous Options", P_SEP, P_SEPARATOR}, @@ -1698,7 +1696,6 @@ FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) -FN_GLOBAL_BOOL(lp_ldap_trust_ids, &Globals.ldap_trust_ids) FN_GLOBAL_BOOL(lp_ldap_delete_dn, &Globals.ldap_delete_dn) FN_GLOBAL_STRING(lp_add_share_cmd, &Globals.szAddShareCommand) FN_GLOBAL_STRING(lp_change_share_cmd, &Globals.szChangeShareCommand) -- cgit From 3d393502e7d9d40454c13dfc590ed0b16a74edaf Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 28 Aug 2003 16:13:16 +0000 Subject: revert a change to r1.397.2.91 because to operate like the docs; browseable for new home directories should be inheritied from the global defaults, not [homes] (This used to be commit ea54bfc211f874c23b79572d8fb89bac73ec21a3) --- source3/param/loadparm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 79524c8b22..d672704c21 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2311,6 +2311,10 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, string_set(&ServicePtrs[i]->comment, comment); } + /* set the browseable flag from the gloabl default */ + + ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; + DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, user, newHomedir)); @@ -2379,6 +2383,9 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) string_set(&ServicePtrs[i]->szPrintername, pszPrintername); string_set(&ServicePtrs[i]->comment, comment); + /* set the browseable flag from the gloabl default */ + ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; + /* Printers cannot be read_only. */ ServicePtrs[i]->bRead_only = False; /* No share modes on printer services. */ -- cgit From 0e8c2a4133158b59426ec0b260e97d1dacf98e73 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Sep 2003 23:03:58 +0000 Subject: More hand-tuning of the fastpath. Don't do strlen() when we're doing to walk to the end anyway. Jeremy. (This used to be commit 467cafdb1f7ddfb4278824f385b732975246a4f5) --- source3/param/loadparm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d672704c21..348abcc9e7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2717,8 +2717,10 @@ static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) static BOOL handle_charset(const char *pszParmValue, char **ptr) { - string_set(ptr, pszParmValue); - init_iconv(); + if (strcmp(*ptr, pszParmValue) != 0) { + string_set(ptr, pszParmValue); + init_iconv(); + } return True; } -- cgit From cadff241823b9c2a239f5a5686629c280d2c2a48 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 5 Sep 2003 14:53:10 +0000 Subject: revert the change from r1.414 in HEAD that removed the ability to use variables in paths for the [homes] service. (This used to be commit 8fd13b63103b3c144bdd170edcb3b642dfd9bb54) --- source3/param/loadparm.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 348abcc9e7..3d0aebf230 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2296,13 +2296,8 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, if (!(*(ServicePtrs[iDefaultService]->szPath)) || strequal(ServicePtrs[iDefaultService]->szPath, lp_pathname(GLOBAL_SECTION_SNUM))) { pstrcpy(newHomedir, pszHomedir); - } else { - pstrcpy(newHomedir, lp_pathname(iDefaultService)); - string_sub(newHomedir,"%H", pszHomedir, sizeof(newHomedir)); - string_sub(newHomedir,"%S", pszHomename, sizeof(newHomedir)); - } - - string_set(&ServicePtrs[i]->szPath, newHomedir); + string_set(&ServicePtrs[i]->szPath, newHomedir); + } if (!(*(ServicePtrs[i]->comment))) { pstring comment; -- cgit From 94f59f54921174fc156fade575ca114d331b1bd8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 5 Sep 2003 19:59:55 +0000 Subject: More tuning from cachegrind. Change most trim_string() calls to trim_char(0, as that's what they do. Fix string_replace() to fast-path ascii. Jeremy. (This used to be commit f35e9a8b909d3c74be47083ccc4a4e91a14938db) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3d0aebf230..c801c4c522 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1558,8 +1558,8 @@ static char *lp_string(const char *s) lp_talloc = talloc_init("lp_talloc"); tmpstr = alloc_sub_basic(current_user_info.smb_name, s); - if (trim_string(tmpstr, "\"", "\"")) { - if (strchr(tmpstr,'"') != NULL) { + if (trim_char(tmpstr, '\"', '\"')) { + if (strchr(tmpstr,'\"') != NULL) { SAFE_FREE(tmpstr); tmpstr = alloc_sub_basic(current_user_info.smb_name,s); } @@ -3112,7 +3112,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue pstr_sprintf(param_key, "%s:", pszParmName); slen = strlen(param_key); pstrcat(param_key, sep+1); - trim_string(param_key+slen, " ", " "); + trim_char(param_key+slen, ' ', ' '); not_added = True; data = (snum < 0) ? Globals.param_opt : ServicePtrs[snum]->param_opt; -- cgit From c913fc058113b3a3a193f7b98459679945afcf03 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 6 Sep 2003 19:23:24 +0000 Subject: address bug #359. Andrew B's patch for implementing client portion of NTLMv2 key exchange. Also revert the default for 'client ntlmv2 auth' to no. This caused no ends of grief in different cases. And based on abartlet's mail.... > All I care about at this point is that we use NTLMv2 > in our client code when connecting to a server that > supports it. There is *no* way to tell this. The server can't tell us, because it doesn't know what it's DC supports. The DC can't tell us, because it doesn't know what the trusted DC supports. One DC might be Win2k, and the PDC could be an older NT4. (This used to be commit fe585d49cc3df0d71314ff43d3271d276d7d4503) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c801c4c522..41b32cef10 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1427,7 +1427,8 @@ static void init_globals(void) Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ - Globals.bClientNTLMv2Auth = True; /* Client should use NTLMv2 if available. */ + Globals.bClientNTLMv2Auth = False; /* Client should not use NTLMv2, as we can't tell that the server supports it. */ + /* Note, that we will use NTLM2 session security (which is different), if it is available */ Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ -- cgit From b33b2284550a643dac7edbfa5d545e24aa81fbf4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 10 Sep 2003 00:40:32 +0000 Subject: remove references to 'strip dot' (This used to be commit 5c0c9d68b44f867bf6c2b24b9fd9ba2408b9f83c) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 41b32cef10..b370b6b049 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -246,7 +246,6 @@ typedef struct BOOL bUpdateEncrypt; int clientSchannel; int serverSchannel; - BOOL bStripDot; BOOL bNullPasswords; BOOL bObeyPamRestrictions; BOOL bLoadPrinters; @@ -965,7 +964,6 @@ static struct parm_struct parm_table[] = { {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, {"Filename Handling", P_SEP, P_SEPARATOR}, - {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1387,7 +1385,6 @@ static void init_globals(void) Globals.bReadbmpx = False; Globals.bNullPasswords = False; Globals.bObeyPamRestrictions = False; - Globals.bStripDot = False; Globals.syslog = 1; Globals.bSyslogOnly = False; Globals.bTimestampLogs = True; @@ -1718,7 +1715,6 @@ FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite) FN_GLOBAL_BOOL(lp_writeraw, &Globals.bWriteRaw) FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) -FN_GLOBAL_BOOL(lp_strip_dot, &Globals.bStripDot) FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt) FN_GLOBAL_INTEGER(lp_client_schannel, &Globals.clientSchannel) -- cgit From c716385220f5ce63fafffd4cff1e9480c5991d02 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 23 Sep 2003 14:52:21 +0000 Subject: This only touches the fake kaserver support. It adds two parameters: afs share -- this is an AFS share, do AFS magic things afs username map -- We need a way to specify the cell and possibly weird username codings for several windows domains in the afs cell Volker (This used to be commit 4a3f7a9356cd5068d9ed4fd6e2336d9bf7923fbd) --- source3/param/loadparm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b370b6b049..a334590e51 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -126,6 +126,7 @@ typedef struct char *szPasswordServer; char *szSocketOptions; char *szRealm; + char *szAfsUsernameMap; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -413,6 +414,7 @@ typedef struct BOOL bUseSendfile; BOOL bProfileAcls; BOOL bMap_acl_inherit; + BOOL bAfs_Share; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -533,6 +535,7 @@ static service sDefault = { False, /* bUseSendfile */ False, /* bProfileAcls */ False, /* bMap_acl_inherit */ + False, /* bAfs_Share */ NULL, /* Parametric options */ @@ -761,6 +764,7 @@ static struct parm_struct parm_table[] = { {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, #ifdef WITH_ADS {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + {"afs username map", P_USTRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, #endif {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED}, @@ -890,6 +894,7 @@ static struct parm_struct parm_table[] = { {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_ADVANCED}, {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_ADVANCED}, {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"afs share", P_BOOL, P_LOCAL, &sDefault.bAfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED}, @@ -1634,6 +1639,7 @@ FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) 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_STRING(lp_username_map, &Globals.szUsernameMap) FN_GLOBAL_CONST_STRING(lp_logon_script, &Globals.szLogonScript) FN_GLOBAL_CONST_STRING(lp_logon_path, &Globals.szLogonPath) @@ -1871,6 +1877,7 @@ FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) +FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From 4bea4ecc741beeba95f1991f3743ea34d2817811 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 24 Sep 2003 06:42:32 +0000 Subject: Don't #ifdef an AFS option with WITH_ADS. Thanks, jerry! Volker (This used to be commit a6c54cbe205a6882d49fc77c04ed21b4f1de4396) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a334590e51..0efa2796c3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -764,8 +764,8 @@ static struct parm_struct parm_table[] = { {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, #ifdef WITH_ADS {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"afs username map", P_USTRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, #endif + {"afs username map", P_USTRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED}, {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED}, -- cgit From 60c8778a6099d6cf759880aeedead0a9e04bdf16 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 1 Oct 2003 16:18:31 +0000 Subject: mark 'mangled map' as depcreated and remove 'mangled stack' (This used to be commit cd06472e420ba0647a73c6e04d180c088acdb626) --- source3/param/loadparm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0efa2796c3..45626192db 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -185,7 +185,6 @@ typedef struct int mangle_prefix; int max_log_size; char *szLogLevel; - int mangled_stack; int max_xmit; int max_mux; int max_open_files; @@ -972,7 +971,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"mangled stack", P_INTEGER, P_GLOBAL, &Globals.mangled_stack, 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}, @@ -992,7 +990,7 @@ static struct parm_struct parm_table[] = { {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, 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}, + {"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}, {"Domain Options", P_SEP, P_SEPARATOR}, @@ -1361,7 +1359,6 @@ static void init_globals(void) Globals.AlgorithmicRidBase = BASE_RID; Globals.bLoadPrinters = True; - Globals.mangled_stack = 50; /* 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; -- cgit From 635dff752869d8284386d9c4b84a87840868ecd6 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 3 Oct 2003 01:42:53 +0000 Subject: Moving towards better i18n support in SWAT. This commit contains a bunch of updates to bug 413 from Monyo: 1) pick up proper strings to call msg strings for example to add strings in wizard menu in web/swat.c, web/statuspage.c and param/loadparm.c. 2) define N_() macro in include/intl.h to pick up some strings in param/loadparm.c 3) quote all name and value tag with '"' For example in swat.c:720 the "Edit Parameter Values" string is displayd only as "Edit" because value tag is not quoted like: value=Edit Parameter Values These tags should be quoted though it sometimes works well without quotation. 4) modify the msg strings not to contain HTML tags or other non-message strings. For example dprintf(_("test\n")); is modified to dprintf("%s\n", _("test")); (This used to be commit 351d16956d8125bc689ca84adcb71e0a57d6b7cc) --- source3/param/loadparm.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 45626192db..5a5ac4a2cc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -752,7 +752,7 @@ static const struct enum_list enum_map_to_guest[] = { */ static struct parm_struct parm_table[] = { - {"Base Options", P_SEP, P_SEPARATOR}, + {N_("Base Options"), P_SEP, P_SEPARATOR}, {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, handle_charset, NULL, FLAG_ADVANCED}, {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, handle_charset, NULL, FLAG_ADVANCED}, @@ -772,7 +772,7 @@ static struct parm_struct parm_table[] = { {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"Security Options", P_SEP, P_SEPARATOR}, + {N_("Security Options"), P_SEP, P_SEPARATOR}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_ADVANCED}, @@ -856,7 +856,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"Logging Options", P_SEP, P_SEPARATOR}, + {N_("Logging Options"), P_SEP, P_SEPARATOR}, {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_ADVANCED}, {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_HIDE}, @@ -871,7 +871,7 @@ static struct parm_struct parm_table[] = { {"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, FLAG_ADVANCED}, {"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, FLAG_ADVANCED}, - {"Protocol Options", P_SEP, P_SEPARATOR}, + {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}, @@ -908,7 +908,7 @@ static struct parm_struct parm_table[] = { {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, - {"Tuning Options", P_SEP, P_SEPARATOR}, + {N_("Tuning Options"), P_SEP, P_SEPARATOR}, {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, FLAG_ADVANCED}, @@ -937,7 +937,7 @@ static struct parm_struct parm_table[] = { {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, - {"Printing Options", P_SEP, P_SEPARATOR}, + {N_("Printing Options"), P_SEP, P_SEPARATOR}, {"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}, @@ -967,7 +967,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"Filename Handling", P_SEP, P_SEPARATOR}, + {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}, @@ -993,11 +993,11 @@ static struct parm_struct parm_table[] = { {"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}, - {"Domain Options", P_SEP, P_SEPARATOR}, + {N_("Domain Options"), P_SEP, P_SEPARATOR}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"Logon Options", P_SEP, P_SEPARATOR}, + {N_("Logon Options"), P_SEP, P_SEPARATOR}, {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED}, {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED}, @@ -1016,7 +1016,7 @@ static struct parm_struct parm_table[] = { {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_ADVANCED}, {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, FLAG_ADVANCED}, - {"Browse Options", P_SEP, P_SEPARATOR}, + {N_("Browse Options"), P_SEP, P_SEPARATOR}, {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED}, @@ -1030,7 +1030,7 @@ static struct parm_struct parm_table[] = { {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_ADVANCED}, - {"WINS Options", P_SEP, P_SEPARATOR}, + {N_("WINS Options"), P_SEP, P_SEPARATOR}, {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED}, {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED}, @@ -1040,7 +1040,7 @@ static struct parm_struct parm_table[] = { {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED}, {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"Locking Options", P_SEP, P_SEPARATOR}, + {N_("Locking Options"), P_SEP, P_SEPARATOR}, {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"csc policy", P_ENUM, P_LOCAL, &sDefault.iCSCPolicy, NULL, enum_csc_policy, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, @@ -1058,7 +1058,7 @@ static struct parm_struct parm_table[] = { {"strict locking", P_BOOL, P_LOCAL, &sDefault.bStrictLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"share modes", P_BOOL, P_LOCAL, &sDefault.bShareModes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"Ldap Options", P_SEP, P_SEPARATOR}, + {N_("Ldap Options"), P_SEP, P_SEPARATOR}, #ifdef WITH_LDAP_SAMCONFIG {"ldap server", P_STRING, P_GLOBAL, &Globals.szLdapServer, NULL, NULL, FLAG_ADVANCED}, @@ -1075,7 +1075,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"Miscellaneous Options", P_SEP, P_SEPARATOR}, + {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED}, {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, @@ -1135,7 +1135,7 @@ static struct parm_struct parm_table[] = { {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED}, {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED}, - {"VFS module options", P_SEP, P_SEPARATOR}, + {N_("VFS module options"), P_SEP, P_SEPARATOR}, {"vfs objects", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_HIDE}, @@ -1145,7 +1145,7 @@ static struct parm_struct parm_table[] = { {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED}, - {"Winbind options", P_SEP, P_SEPARATOR}, + {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}, -- cgit From bb0598faf58679a7ad26a1caab8eadb154a07ae2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Oct 2003 23:38:20 +0000 Subject: Put strcasecmp/strncasecmp on the banned list (except for needed calls in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at all and I really want to discourage that. Jeremy. (This used to be commit d7e35dfb9283d560d0ed2ab231f36ed92767dace) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5a5ac4a2cc..55ab4ee3a0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2025,7 +2025,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum) } for (i=0; _enum[i].name; i++) { - if (strcasecmp(_enum[i].name,s)==0) + if (strequal(_enum[i].name,s)) return _enum[i].value; } -- cgit From 75b246906323a9c6dba6c73041882d4ddebe7577 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 Nov 2003 22:07:12 +0000 Subject: Fix bug #471. (const needed in lp_set_name_resolve_order). Jeremy. (This used to be commit 3c19ac5f1c9e393780e57028808871dfdc77b170) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 55ab4ee3a0..e1308da3aa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4240,9 +4240,9 @@ int lp_minor_announce_version(void) Set the global name resolution order (used in smbclient). ************************************************************/ -void lp_set_name_resolve_order(char *new_order) +void lp_set_name_resolve_order(const char *new_order) { - Globals.szNameResolveOrder = new_order; + string_set(&Globals.szNameResolveOrder, new_order); } const char *lp_printername(int snum) -- cgit From 4097f5ec8dbca0be7b4310c4b30961c0b6835f69 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 17 Nov 2003 16:06:10 +0000 Subject: * make sure we only enumerate group mapping entries (not /etc/group) even when doing local aliases * remove "hide local users" parameter; we have this behavior built into 3.0 (This used to be commit a7685a069766ac720f0b26fe01b0e17fc388fca3) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e1308da3aa..4760f293c6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -280,7 +280,6 @@ typedef struct BOOL bDebugPid; BOOL bDebugUid; BOOL bHostMSDfs; - BOOL bHideLocalUsers; BOOL bUnicode; BOOL bUseMmap; BOOL bHostnameLookups; @@ -1133,7 +1132,6 @@ static struct parm_struct parm_table[] = { {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED}, - {"hide local users", P_BOOL, P_GLOBAL, &Globals.bHideLocalUsers, NULL, NULL, FLAG_ADVANCED}, {N_("VFS module options"), P_SEP, P_SEPARATOR}, @@ -1894,7 +1892,6 @@ FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) -FN_GLOBAL_BOOL(lp_hide_local_users, &Globals.bHideLocalUsers) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) -- cgit From 478bb592a3070b2dee2e93368e5d3944b9e6ba42 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 21 Nov 2003 19:11:48 +0000 Subject: make sure we don't append the ldap suffix when writing out the ldap XXX suffix values in SWAT; based on tpot's original patch; bug 328 (This used to be commit 12a06dd9807ea3a10f8220d6e7c33b4b79ae25b4) --- source3/param/loadparm.c | 99 ++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 53 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4760f293c6..18e53a7f29 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -564,9 +564,6 @@ 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_ldap_suffix ( const char *pszParmValue, char **ptr ); -static BOOL handle_ldap_sub_suffix ( const char *pszParmValue, char **ptr ); - static BOOL handle_acl_compatibility(const char *pszParmValue, char **ptr); static void set_server_role(void); @@ -1063,11 +1060,11 @@ static struct parm_struct parm_table[] = { {"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, handle_ldap_suffix, NULL, FLAG_ADVANCED}, - {"ldap machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, - {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, - {"ldap group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, - {"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, handle_ldap_sub_suffix, NULL, FLAG_ADVANCED}, + {"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 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}, @@ -1687,10 +1684,6 @@ FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) #endif FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -FN_GLOBAL_STRING(lp_ldap_machine_suffix, &Globals.szLdapMachineSuffix) -FN_GLOBAL_STRING(lp_ldap_user_suffix, &Globals.szLdapUserSuffix) -FN_GLOBAL_STRING(lp_ldap_idmap_suffix, &Globals.szLdapIdmapSuffix) -FN_GLOBAL_STRING(lp_ldap_group_suffix, &Globals.szLdapGroupSuffix) FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) @@ -2989,56 +2982,56 @@ static BOOL handle_debug_list( const char *pszParmValueIn, char **ptr ) } /*************************************************************************** - Handle setting ldap suffix and determines whether ldap machine suffix needs - to be set as well. - - Set all of the sub suffix strings to be the 'ldap suffix' by default + Handle ldap suffixes - default to ldapsuffix if sub-suffixes are not defined. ***************************************************************************/ -static BOOL handle_ldap_suffix( const char *pszParmValue, char **ptr ) +static char* append_ldap_suffix( const char *str ) { - pstring suffix; - - pstrcpy(suffix, pszParmValue); + char *suffix_string; - /* set defaults for the the sub-suffixes */ - - if (! *Globals.szLdapMachineSuffix ) - string_set(&Globals.szLdapMachineSuffix, suffix); - if (! *Globals.szLdapUserSuffix ) - string_set(&Globals.szLdapUserSuffix, suffix); - if (! *Globals.szLdapGroupSuffix ) - string_set(&Globals.szLdapGroupSuffix, suffix); - if (! *Globals.szLdapIdmapSuffix ) - string_set(&Globals.szLdapIdmapSuffix, suffix); - - string_set(ptr, suffix); - return True; + + if (!lp_talloc) + lp_talloc = talloc_init("lp_talloc"); + + suffix_string = talloc_asprintf( lp_talloc, "%s,%s", str, Globals.szLdapSuffix ); + if ( !suffix_string ) { + DEBUG(0,("append_ldap_suffix: talloc_asprintf() failed!\n")); + return NULL; + } + + return suffix_string; } -/*************************************************************************** - Handle the ldap sub suffix option. - Always append the 'ldap suffix' if it is set -***************************************************************************/ +char *lp_ldap_machine_suffix() +{ + if (Globals.szLdapMachineSuffix[0]) + return append_ldap_suffix(Globals.szLdapMachineSuffix); + + return lp_string(Globals.szLdapSuffix); +} -static BOOL handle_ldap_sub_suffix( const char *pszParmValue, char **ptr) +char *lp_ldap_user_suffix() { - pstring suffix; - - pstrcpy(suffix, pszParmValue); + if (Globals.szLdapUserSuffix[0]) + return append_ldap_suffix(Globals.szLdapUserSuffix); - if (! *Globals.szLdapSuffix ) { - string_set( ptr, suffix ); - return True; - } - else { - if ( *pszParmValue ) - pstrcat(suffix, ","); - pstrcat(suffix, Globals.szLdapSuffix); - } - - string_set( ptr, suffix ); - return True; + return lp_string(Globals.szLdapSuffix); +} + +char *lp_ldap_group_suffix() +{ + if (Globals.szLdapGroupSuffix[0]) + return append_ldap_suffix(Globals.szLdapGroupSuffix); + + return lp_string(Globals.szLdapSuffix); +} + +char *lp_ldap_idmap_suffix() +{ + if (Globals.szLdapIdmapSuffix[0]) + return append_ldap_suffix(Globals.szLdapIdmapSuffix); + + return lp_string(Globals.szLdapSuffix); } /*************************************************************************** -- cgit From bdea2e8a47f98d7146f5d1dc4e74b16097308d4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 21 Nov 2003 19:20:07 +0000 Subject: Fix Jerry's no-proto bug :-). Jeremy. (This used to be commit 48153f7a07cc04b849a79778fdc3e76af6c6eb13) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 18e53a7f29..8643ecb028 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3002,7 +3002,7 @@ static char* append_ldap_suffix( const char *str ) return suffix_string; } -char *lp_ldap_machine_suffix() +char *lp_ldap_machine_suffix(void) { if (Globals.szLdapMachineSuffix[0]) return append_ldap_suffix(Globals.szLdapMachineSuffix); @@ -3010,7 +3010,7 @@ char *lp_ldap_machine_suffix() return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_user_suffix() +char *lp_ldap_user_suffix(void) { if (Globals.szLdapUserSuffix[0]) return append_ldap_suffix(Globals.szLdapUserSuffix); @@ -3018,7 +3018,7 @@ char *lp_ldap_user_suffix() return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_group_suffix() +char *lp_ldap_group_suffix(void) { if (Globals.szLdapGroupSuffix[0]) return append_ldap_suffix(Globals.szLdapGroupSuffix); @@ -3026,7 +3026,7 @@ char *lp_ldap_group_suffix() return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_idmap_suffix() +char *lp_ldap_idmap_suffix(void) { if (Globals.szLdapIdmapSuffix[0]) return append_ldap_suffix(Globals.szLdapIdmapSuffix); -- cgit From 11f4893145f94c85b4f1268544a84116d3a38751 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 22 Nov 2003 04:33:36 +0000 Subject: Ensure that items in a list of strings containing whitespace are written out surrounded by single quotes. This means that both double and single quotes are now used to surround strings in smb.conf. This is a slight change from the previous behavior but needed or else things like printer admin = +ntadmin, 'VALE\Domain, Admin' get written to smb.conf by SWAT. (This used to be commit 5bf91c79d620e34ac71d72c80f74e47754d49dcb) --- source3/param/loadparm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8643ecb028..e98d924964 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3301,9 +3301,13 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) if ((char ***)ptr && *(char ***)ptr) { char **list = *(char ***)ptr; - for (; *list; list++) - fprintf(f, "%s%s", *list, - ((*(list+1))?", ":"")); + for (; *list; list++) { + /* surround strings with whitespace in single quotes */ + if ( strchr_m( *list, ' ' ) ) + fprintf(f, "\'%s\'%s", *list, ((*(list+1))?", ":"")); + else + fprintf(f, "%s%s", *list, ((*(list+1))?", ":"")); + } } break; -- cgit From 73034f91166ca6ebb1bf11532eb2a99b95967636 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Nov 2003 20:18:47 +0000 Subject: Added "passwd chat timeout" parameter. Docs to follow. Jeremy. (This used to be commit 16097f2072085432f4c669d9e008023f36f7afbb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e98d924964..54cc2f3eef 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -262,6 +262,7 @@ typedef struct BOOL bPamPasswordChange; BOOL bUnixPasswdSync; BOOL bPasswdChatDebug; + int iPasswdChatTimeout; BOOL bTimestampLogs; BOOL bNTSmbSupport; BOOL bNTPipeSupport; @@ -797,6 +798,7 @@ static struct parm_struct parm_table[] = { {"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}, {"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}, @@ -1412,6 +1414,7 @@ static void init_globals(void) Globals.bUnixPasswdSync = False; 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. */ @@ -1725,6 +1728,7 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange) 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) -- cgit From ee8fc934146bf631224b9aed1c4493135fcd3fa5 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 26 Nov 2003 18:43:26 +0000 Subject: Fixing barfed idmap entries and adding not on use of FLAG_HIDE. (This used to be commit 25aa5df5c79070d0f1273a71617e64fba7831742) --- source3/param/loadparm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 54cc2f3eef..f54c97fc1b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -746,6 +746,12 @@ static const struct enum_list enum_map_to_guest[] = { * Any parameter that does NOT have FLAG_ADVANCED will not disply at all * Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in * respective views. + * + * NOTE2: Handling of duplicated (synonym) paramters: + * Only the first occurance of a parameter should be enabled by FLAG_BASIC + * and/or FLAG_ADVANCED. All duplicates following the first mention should be + * set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred + * name first, and all synonyms must follow it with the FLAG_HIDE attribute. */ static struct parm_struct parm_table[] = { @@ -1147,9 +1153,9 @@ static struct parm_struct parm_table[] = { {"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 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_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}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED}, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE}, {"template primary group", P_STRING, P_GLOBAL, &Globals.szTemplatePrimaryGroup, NULL, NULL, FLAG_ADVANCED}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, FLAG_ADVANCED}, {"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, FLAG_ADVANCED}, -- cgit From 91e1154370567d9ab6899ce337b8bb891ed77a33 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 25 Dec 2003 10:08:31 +0000 Subject: abartlet pointed me at the fact that the order and flags in loadparm.c are actually used.... 'afs username map' should not show up in the swat basic view. :-) Maybe I should use swat from time to time.... Volker (This used to be commit d4e071d14b8ae622c1edbb33bb5677713df1f961) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f54c97fc1b..124a905a79 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -767,7 +767,6 @@ static struct parm_struct parm_table[] = { #ifdef WITH_ADS {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, #endif - {"afs username map", P_USTRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED}, {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED}, @@ -1106,6 +1105,7 @@ static struct parm_struct parm_table[] = { {"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}, {"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}, -- cgit From 3a1b189a9f3d2dab1fcadc5277546baa2f88cdfa Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 25 Dec 2003 22:42:15 +0000 Subject: This is metze's LDAP rebind sleep patch: When smb.conf tells us to write to a read-only LDAP replica and we are redirected by the LDAP server, the replication might take some seconds, especially over slow links. This patch delays the next read after a rebind for 'ldap rebind sleep' milliseconds. Metze, thanks for your patience. Volker (This used to be commit 63ffa770b67d700f138d19b4982da152f57674fc) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 124a905a79..31348b559d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -233,6 +233,7 @@ typedef struct char *szLdapAdminDn; char *szAclCompat; int ldap_passwd_sync; + int ldap_rebind_sleep; BOOL ldap_delete_dn; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; @@ -1077,6 +1078,7 @@ static struct parm_struct parm_table[] = { {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 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 rebind sleep", P_INTEGER, P_GLOBAL, &Globals.ldap_rebind_sleep, NULL, NULL, FLAG_ADVANCED}, {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, @@ -1469,6 +1471,7 @@ static void init_globals(void) Globals.ldap_ssl = LDAP_SSL_ON; Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; Globals.ldap_delete_dn = False; + Globals.ldap_rebind_sleep = 1000; /* wait 1 sec for replication */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1698,6 +1701,7 @@ FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) 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_rebind_sleep, &Globals.ldap_rebind_sleep) 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) -- cgit From 38b17cb1531806f177ff828944d78e887b066a05 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 25 Dec 2003 23:11:07 +0000 Subject: ldap rebind sleep -> ldap replication sleep While writing documentation for metze's patch, it became clear that this is a better name. Andrew Bartlett (This used to be commit 6f828ff3d3622c56ee732b976e7ab90b7897a8d3) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 31348b559d..669d0c16c1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -233,7 +233,7 @@ typedef struct char *szLdapAdminDn; char *szAclCompat; int ldap_passwd_sync; - int ldap_rebind_sleep; + int ldap_replication_sleep; BOOL ldap_delete_dn; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; @@ -1078,7 +1078,7 @@ static struct parm_struct parm_table[] = { {"ldap ssl", P_ENUM, P_GLOBAL, &Globals.ldap_ssl, NULL, enum_ldap_ssl, 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 rebind sleep", P_INTEGER, P_GLOBAL, &Globals.ldap_rebind_sleep, NULL, NULL, FLAG_ADVANCED}, + {"ldap replication sleep", P_INTEGER, P_GLOBAL, &Globals.ldap_replication_sleep, NULL, NULL, FLAG_ADVANCED}, {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, @@ -1471,7 +1471,7 @@ static void init_globals(void) Globals.ldap_ssl = LDAP_SSL_ON; Globals.ldap_passwd_sync = LDAP_PASSWD_SYNC_OFF; Globals.ldap_delete_dn = False; - Globals.ldap_rebind_sleep = 1000; /* wait 1 sec for replication */ + Globals.ldap_replication_sleep = 1000; /* wait 1 sec for replication */ /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1701,7 +1701,7 @@ FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) 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_rebind_sleep, &Globals.ldap_rebind_sleep) +FN_GLOBAL_INTEGER(lp_ldap_replication_sleep, &Globals.ldap_replication_sleep) 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) -- cgit From 125e7e8e25d306fcba1f56692bf549337792d017 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Jan 2004 23:46:47 +0000 Subject: Machines are people too! While machine accounts cannot use an NTLM login (NT4 style), they are otherwise full and valid members of the domain, and expect to be able to use kerberos to connect to CIFS servers. This means that the LocalSystem account, used by various services, can perform things like backups, without the admin needing to enter further passwords. This particular issue (bug 722) has started to come up a lot on the lists. I have only enabled it for winbindd-based systems, as the macros use use to call the 'add user script' will strip the $ from the username for security reasons. Andrew Bartlett (This used to be commit 6a9bbd1da3bb961d24e74348fa0b68574022855f) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 669d0c16c1..81a3a32247 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1678,8 +1678,8 @@ FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) 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_STRING(lp_template_homedir, &Globals.szTemplateHomedir) -FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) +FN_GLOBAL_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) +FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enable_local_accounts, &Globals.bWinbindEnableLocalAccounts) -- cgit From b75b755a2ba78ad323d6a87fdbee78b1829f864f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 12 Jan 2004 12:18:11 +0000 Subject: First stab at cracklib support (password quality checking) in Samba 3.0 This adds a configure test, that tries to find out if we have a working cracklib installation, and tries to pick up the debian hints on where the dictionary might be found. Default is per my Fedora Core 1 system - I'm not sure how much it changes. Andrew Bartlett (This used to be commit bc770edb788f0b6f719011cda683f045b76b7ba5) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 81a3a32247..66335e983f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -215,6 +215,7 @@ typedef struct int change_notify_timeout; int map_to_guest; int min_passwd_length; + BOOL use_cracklib; int oplock_break_wait_time; int winbind_cache_time; int iLockSpinCount; @@ -787,6 +788,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"use cracklib", P_BOOL, P_GLOBAL, &Globals.use_cracklib, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1437,6 +1439,7 @@ static void init_globals(void) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ + Globals.use_cracklib = False; Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; Globals.iLockSpinCount = 3; /* Try 3 times. */ @@ -1788,6 +1791,7 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) +FN_GLOBAL_BOOL(lp_use_cracklib, &Globals.use_cracklib) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) -- cgit From 9bf45a0393dc75128373984e663748d0864b43d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 14 Jan 2004 06:44:20 +0000 Subject: Remove duplicate extern. Jeremy. (This used to be commit fb088b5679f1def054d8b433c5e6c5b855411488) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 66335e983f..8004d25c12 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4282,7 +4282,6 @@ void get_private_directory(pstring privdir) void lp_set_logfile(const char *name) { - extern pstring debugf; string_set(&Globals.szLogFile, name); pstrcpy(debugf, name); } -- cgit From 1dce4ebed861a6dfbd19da20601d92bc9be3484a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 14 Jan 2004 17:34:41 +0000 Subject: revert the cracklib changes until post 3.0.2 (This used to be commit 6202e0fa727a4307f51bf42f5ced401a7c7b8214) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8004d25c12..f944a47891 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -215,7 +215,6 @@ typedef struct int change_notify_timeout; int map_to_guest; int min_passwd_length; - BOOL use_cracklib; int oplock_break_wait_time; int winbind_cache_time; int iLockSpinCount; @@ -788,7 +787,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"use cracklib", P_BOOL, P_GLOBAL, &Globals.use_cracklib, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1439,7 +1437,6 @@ static void init_globals(void) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ - Globals.use_cracklib = False; Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; Globals.iLockSpinCount = 3; /* Try 3 times. */ @@ -1791,7 +1788,6 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) -FN_GLOBAL_BOOL(lp_use_cracklib, &Globals.use_cracklib) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) -- cgit From 3c3c7b329aec6962754dcc5e0c784eafe03ae86a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 15 Jan 2004 17:05:08 +0000 Subject: Don't substitute stuff in lp_afs_username_map, this is explicitly done later. Volker (This used to be commit c4a6151f469764444f4dab8bcae04e1a2bdb0b64) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f944a47891..8938e41469 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1643,7 +1643,7 @@ FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) 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_STRING(lp_username_map, &Globals.szUsernameMap) FN_GLOBAL_CONST_STRING(lp_logon_script, &Globals.szLogonScript) FN_GLOBAL_CONST_STRING(lp_logon_path, &Globals.szLogonPath) -- cgit From cf3bbe7385d145b6454a752116639ab02689cb0c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 29 Jan 2004 17:28:45 +0000 Subject: removing more unused parameters (This used to be commit 8135ea08b3dce212a98c17a604619dd383e96c24) --- source3/param/loadparm.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8938e41469..f921206610 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -161,7 +161,6 @@ typedef struct char *szUtmpDir; char *szWtmpDir; BOOL bUtmp; - char *szSourceEnv; char *szIdmapUID; char *szIdmapGID; BOOL bEnableRidAlgorithm; @@ -207,7 +206,6 @@ typedef struct 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 */ @@ -253,7 +251,6 @@ typedef struct BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; - BOOL bReadPrediction; BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; @@ -928,7 +925,6 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1126,7 +1122,6 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1388,7 +1383,6 @@ static void init_globals(void) Globals.serverSchannel = Auto; Globals.bReadRaw = True; Globals.bWriteRaw = True; - Globals.bReadPrediction = False; Globals.bReadbmpx = False; Globals.bNullPasswords = False; Globals.bObeyPamRestrictions = False; @@ -1405,7 +1399,6 @@ static void init_globals(void) 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; @@ -1630,7 +1623,6 @@ FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir) 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) @@ -1715,7 +1707,6 @@ FN_GLOBAL_BOOL(lp_wins_proxy, &Globals.bWINSproxy) 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) @@ -1769,7 +1760,6 @@ FN_GLOBAL_INTEGER(lp_maxxmit, &Globals.max_xmit) 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) -- cgit From 2f2e5b01919fe4daf60f97430959ebc98e31ce92 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 30 Jan 2004 18:38:48 +0000 Subject: Fix up name canonicalization (needed for krb5 keytab support later). Remove source_env handler (no longer used in any codepath). Jeremy. (This used to be commit 3a3e33603084048e647af86a9badaaf49433c789) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f921206610..344002e653 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -553,7 +553,6 @@ static int default_server_announce; /* 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); @@ -2790,6 +2789,8 @@ static BOOL source_env(char **lines) return (True); } +#if 0 +/* Doesn't seem to be used anymore. JRA */ /*************************************************************************** Handle the source environment operation. ***************************************************************************/ @@ -2829,6 +2830,7 @@ static BOOL handle_source_env(const char *pszParmValue, char **ptr) return (result); } +#endif /*************************************************************************** Handle the include operation. -- cgit From 575bc995c0d6d1381c02deebc1c45c0fd644f1c2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 31 Jan 2004 18:25:57 +0000 Subject: * BUG 101: patch from j.lu@tiesse.com to set the SV_TYPE_PRINTQ_SERVER; * don't set the unix_ERR_XX code in mkdir_internal, let the error mapping handle it. (This used to be commit 87343fc15a385153c2205bd8bfe876504d38d9a1) --- source3/param/loadparm.c | 110 +++-------------------------------------------- 1 file changed, 6 insertions(+), 104 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 344002e653..29845a51e0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2386,8 +2386,6 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) DEBUG(3, ("adding printer service %s\n", pszPrintername)); - update_server_announce_as_printserver(); - return (True); } @@ -2739,99 +2737,6 @@ static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) 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); -} - -#if 0 -/* Doesn't seem to be used anymore. JRA */ -/*************************************************************************** - 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); -} -#endif - /*************************************************************************** Handle the include operation. ***************************************************************************/ @@ -3711,15 +3616,6 @@ void lp_add_one_printer(char *name, char *comment) } } -/*************************************************************************** - 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? ***************************************************************************/ @@ -4084,6 +3980,12 @@ static void set_default_server_announce_type(void) 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; -- cgit From 1daa101516e405c2eb3dd21e41c18360f3d19a6d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 Feb 2004 07:45:50 +0000 Subject: Merge the 'use cracklib' parameter from HEAD back to 3.0 Andrew Bartlett (This used to be commit 2202667ebb713fb5d933fcaa1c19dc761da47ccb) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 29845a51e0..3513c5b179 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -213,6 +213,7 @@ typedef struct int change_notify_timeout; int map_to_guest; int min_passwd_length; + BOOL use_cracklib; int oplock_break_wait_time; int winbind_cache_time; int iLockSpinCount; @@ -783,6 +784,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"use cracklib", P_BOOL, P_GLOBAL, &Globals.use_cracklib, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1429,6 +1431,7 @@ static void init_globals(void) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ + Globals.use_cracklib = False; Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; Globals.iLockSpinCount = 3; /* Try 3 times. */ @@ -1777,6 +1780,7 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) +FN_GLOBAL_BOOL(lp_use_cracklib, &Globals.use_cracklib) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) -- cgit From 00e0a5ca901b8a98da5958692fb2225165eed549 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 11 Feb 2004 04:32:12 +0000 Subject: marking 'only user' as deprecated (based on feedback in bug 66) (This used to be commit a44f67b141efc7fc14a75b938bf428bf571351a6) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3513c5b179..baa14959e3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -851,7 +851,7 @@ static struct parm_struct parm_table[] = { {"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}, -- cgit From 62a7e258a3c67fc653af83bc2e728cff70f8bea1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 2 Mar 2004 04:09:39 +0000 Subject: BUG 761: read the config file before initialized default values for printing options (This used to be commit d358f72974ce49bf2007c9b3b7314caa5897b4c1) --- source3/param/loadparm.c | 96 +++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 46 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index baa14959e3..af26697476 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1172,61 +1172,66 @@ static struct parm_struct parm_table[] = { Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ -static void init_printer_values(void) +static void init_printer_values(service *pService) { + if ( pService == NULL ) { + DEBUG(0,("init_printer_values: NULL pointer\n")); + return; + } + /* 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, + 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, + 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(&sDefault.szQueuepausecommand, + string_set(&pService->szQueuepausecommand, "lpc stop '%p'"); - string_set(&sDefault.szQueueresumecommand, + string_set(&pService->szQueueresumecommand, "lpc start '%p'"); - string_set(&sDefault.szLppausecommand, + string_set(&pService->szLppausecommand, "lpc hold '%p' %j"); - string_set(&sDefault.szLpresumecommand, + 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(&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, ""); string_set(&Globals.szPrintcapname, "cups"); #else - string_set(&sDefault.szLpqcommand, + string_set(&pService->szLpqcommand, "/usr/bin/lpstat -o '%p'"); - string_set(&sDefault.szLprmcommand, + string_set(&pService->szLprmcommand, "/usr/bin/cancel '%p-%j'"); - string_set(&sDefault.szPrintcommand, + string_set(&pService->szPrintcommand, "/usr/bin/lp -d '%p' %s; rm %s"); - string_set(&sDefault.szLppausecommand, + string_set(&pService->szLppausecommand, "lp -i '%p-%j' -H hold"); - string_set(&sDefault.szLpresumecommand, + string_set(&pService->szLpresumecommand, "lp -i '%p-%j' -H resume"); - string_set(&sDefault.szQueuepausecommand, + string_set(&pService->szQueuepausecommand, "/usr/bin/disable '%p'"); - string_set(&sDefault.szQueueresumecommand, + string_set(&pService->szQueueresumecommand, "/usr/bin/enable '%p'"); string_set(&Globals.szPrintcapname, "lpstat"); #endif /* HAVE_CUPS */ @@ -1234,38 +1239,38 @@ static void init_printer_values(void) case PRINT_SYSV: case PRINT_HPUX: - string_set(&sDefault.szLpqcommand, "lpstat -o%p"); - string_set(&sDefault.szLprmcommand, "cancel %p-%j"); - string_set(&sDefault.szPrintcommand, + 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(&sDefault.szQueuepausecommand, + string_set(&pService->szQueuepausecommand, "disable %p"); - string_set(&sDefault.szQueueresumecommand, + string_set(&pService->szQueueresumecommand, "enable %p"); #ifndef HPUX - string_set(&sDefault.szLppausecommand, + string_set(&pService->szLppausecommand, "lp -i %p-%j -H hold"); - string_set(&sDefault.szLpresumecommand, + 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 */ @@ -1293,8 +1298,6 @@ static void init_globals(void) string_set(&sDefault.fstype, FSTYPE_STRING); - init_printer_values(); - done_init = True; } @@ -2387,7 +2390,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) ServicePtrs[i]->bOpLocks = False; /* Printer services must be printable. */ ServicePtrs[i]->bPrint_ok = True; - + DEBUG(3, ("adding printer service %s\n", pszPrintername)); return (True); @@ -3870,6 +3873,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, } init_iconv(); + init_printer_values(&sDefault); return (bRetval); } -- cgit From c24dccd413c41ed81454bc204c59d1fc17a54a33 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 19 Mar 2004 22:06:54 +0000 Subject: BUG 417: fix %UuGg variables expansion in include lines setging the current_user_info struct in register_vuid() -- shouldn't be any more broken than we were (This used to be commit a90c3bd281e7a62bb8482e42aa3b674eeeb5995a) --- source3/param/loadparm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af26697476..35bd464b56 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2657,7 +2657,16 @@ static void add_to_file_list(const char *fname, const char *subfname) BOOL lp_file_list_changed(void) { struct file_lists *f = file_lists; - DEBUG(6, ("lp_file_list_changed()\n")); + char *username; + + DEBUG(6, ("lp_file_list_changed()\n")); + + /* get the username for substituion -- preference to the current_user_info */ + if ( strlen( current_user_info.smb_name ) != 0 ) + username = current_user_info.smb_name; + else + username = sub_get_smb_name(); + while (f) { pstring n2; @@ -3806,9 +3815,18 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, pstring n2; BOOL bRetval; param_opt_struct *data, *pdata; + char *username; pstrcpy(n2, pszFname); - standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2)); + + /* get the username for substituion -- preference to the current_user_info */ + + if ( strlen( current_user_info.smb_name ) != 0 ) + username = current_user_info.smb_name; + else + username = sub_get_smb_name(); + + standard_sub_basic( username, n2,sizeof(n2) ); add_to_file_list(pszFname, n2); -- cgit From deee8fae47be8722f737d4a2583e93f85658c126 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 27 Mar 2004 05:38:20 +0000 Subject: As I raised (without objection) on the mailing list a while back, this patch removes the 'unicode' smb.conf option. Clients are as always free not to negotiate unicode, but Samba will always accept unicode in smbd. Setting 'unicode = no' caused me more client BSODs than any other option I have seen, and I really want to protect some of our more silly users, who will, no matter what, select and change every option... Andrew Bartlett (This used to be commit 3f9177bd5df68809294335a36919994893ff8ead) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 35bd464b56..5313491f7e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -280,7 +280,6 @@ typedef struct BOOL bDebugPid; BOOL bDebugUid; BOOL bHostMSDfs; - BOOL bUnicode; BOOL bUseMmap; BOOL bHostnameLookups; BOOL bUnixExtensions; @@ -880,7 +879,6 @@ static struct parm_struct parm_table[] = { {"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}, {"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}, @@ -1420,7 +1418,6 @@ static void init_globals(void) 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 */ @@ -1735,7 +1732,6 @@ FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange) 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) -- cgit From d113219e78c4c03375ad03595603ece6dff94461 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 31 Mar 2004 02:20:16 +0000 Subject: Added support for OS/2 EA's in smbd server. Test with smbtorture eatest. New protocol option "ea support" to turn them on (off by default). Conrad at Apple may like this as it allows MacOS resource forks to be stored on a file. Passes valgrind. Documentation to follow. Jeremy. (This used to be commit 8cc10a6c0550c017a62e8a3790afd2172d173e00) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5313491f7e..4c0a3948f8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -412,6 +412,7 @@ typedef struct BOOL bProfileAcls; BOOL bMap_acl_inherit; BOOL bAfs_Share; + BOOL bEASupport; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -533,6 +534,7 @@ static service sDefault = { False, /* bProfileAcls */ False, /* bMap_acl_inherit */ False, /* bAfs_Share */ + False, /* bEASupport */ NULL, /* Parametric options */ @@ -885,6 +887,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"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}, @@ -1868,6 +1871,7 @@ 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_nt_acl_support, bNTAclSupport) +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) -- cgit From 722aa118c66b020c2b9f2b595e1af50429f13986 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Apr 2004 18:46:19 +0000 Subject: Added per-share parameter "store dos attributes". When set, will store dos attributes in an EA. Based on an original patch from tridge, but modified somewhat to cover all cases. Jeremy. (This used to be commit ed653cd468213e0be901bc654aa3748ce5837947) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4c0a3948f8..6b09faf7bf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -379,6 +379,7 @@ typedef struct BOOL bMap_system; BOOL bMap_hidden; BOOL bMap_archive; + BOOL bStoreDosAttributes; BOOL bLocking; BOOL bStrictLocking; BOOL bPosixLocking; @@ -501,6 +502,7 @@ static service sDefault = { False, /* bMap_system */ False, /* bMap_hidden */ True, /* bMap_archive */ + False, /* bStoreDosAttributes */ True, /* bLocking */ True, /* bStrictLocking */ True, /* bPosixLocking */ @@ -994,6 +996,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1844,6 +1847,7 @@ FN_LOCAL_BOOL(lp_guest_only, bGuest_only) 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_BOOL(lp_posix_locking, bPosixLocking) -- cgit From 931df5850e326ad0639fe317e0ca82e6d820a68e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 5 Apr 2004 12:19:50 +0000 Subject: r39: * importing .cvsignore files * updateing WHATSNEW with vl's change (This used to be commit a7e2730ec4389e0c249886a8bfe1ee14c5abac41) --- source3/param/.cvsignore | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 source3/param/.cvsignore (limited to 'source3/param') diff --git a/source3/param/.cvsignore b/source3/param/.cvsignore deleted file mode 100644 index 76e2d7ff3e..0000000000 --- a/source3/param/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -*.po32 -*.po - -- cgit From 7af3777ab32ee220700ed3367d07ca18b2bbdd47 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 7 Apr 2004 12:43:44 +0000 Subject: r116: volker's patch for local group and group nesting (This used to be commit b393469d9581f20e4d4c52633b952ee984cca36f) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6b09faf7bf..894e7ecc9c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -174,6 +174,7 @@ typedef struct BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; BOOL bWinbindTrustedDomainsOnly; + BOOL bWinbindNestedGroups; char *szWinbindBackend; char *szIdmapBackend; char *szAddShareCommand; @@ -1168,6 +1169,7 @@ static struct parm_struct parm_table[] = { {"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} }; @@ -1515,6 +1517,7 @@ static void init_globals(void) Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; + Globals.bWinbindNestedGroups = False; Globals.bEnableRidAlgorithm = True; @@ -1687,6 +1690,7 @@ FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) 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_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm) -- cgit From 3287bd9364c4214e41cd87167dc8d7a768a9edc2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 10 Apr 2004 22:37:47 +0000 Subject: r155: real for for BUG 761 -- allow printing parameter to set defaults on a per share basis (This used to be commit 14d3794eecd848d3d75e2b8e71cf8b4d0792b0c9) --- source3/param/loadparm.c | 134 ++++++++++++++++++++++++++++++----------------- 1 file changed, 85 insertions(+), 49 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 894e7ecc9c..061af12494 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -556,18 +556,18 @@ static int default_server_announce; #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_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); @@ -951,7 +951,7 @@ static struct parm_struct parm_table[] = { {"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}, {"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}, @@ -1180,11 +1180,6 @@ static struct parm_struct parm_table[] = { static void init_printer_values(service *pService) { - if ( pService == NULL ) { - DEBUG(0,("init_printer_values: NULL pointer\n")); - return; - } - /* choose defaults depending on the type of printing */ switch (pService->iPrinting) { case PRINT_BSD: @@ -2708,7 +2703,7 @@ BOOL lp_file_list_changed(void) 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; @@ -2726,7 +2721,7 @@ static BOOL handle_netbios_name(const char *pszParmValue, char **ptr) 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); @@ -2735,7 +2730,7 @@ static BOOL handle_charset(const char *pszParmValue, char **ptr) return True; } -static BOOL handle_workgroup(const char *pszParmValue, char **ptr) +static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr) { BOOL ret; @@ -2745,7 +2740,7 @@ static BOOL handle_workgroup(const char *pszParmValue, char **ptr) 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; @@ -2755,7 +2750,7 @@ static BOOL handle_netbios_scope(const char *pszParmValue, char **ptr) return ret; } -static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) +static BOOL handle_netbios_aliases(int snum, const char *pszParmValue, char **ptr) { Globals.szNetbiosAliases = str_list_make(pszParmValue, NULL); return set_netbios_aliases((const char **)Globals.szNetbiosAliases); @@ -2765,7 +2760,7 @@ static BOOL handle_netbios_aliases(const char *pszParmValue, char **ptr) 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); @@ -2788,7 +2783,7 @@ static BOOL handle_include(const char *pszParmValue, char **ptr) 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; @@ -2869,7 +2864,7 @@ BOOL lp_idmap_gid(gid_t *low, gid_t *high) /* 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; @@ -2886,7 +2881,7 @@ static BOOL handle_idmap_uid(const char *pszParmValue, char **ptr) 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; @@ -2907,7 +2902,7 @@ static BOOL handle_idmap_gid(const char *pszParmValue, char **ptr) 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; @@ -2972,7 +2967,7 @@ char *lp_ldap_idmap_suffix(void) /*************************************************************************** ***************************************************************************/ -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, ""); @@ -2986,6 +2981,49 @@ static BOOL handle_acl_compatibility(const char *pszParmValue, char **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. ***************************************************************************/ @@ -3108,7 +3146,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue /* 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); } @@ -3160,16 +3198,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue 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; @@ -3467,11 +3496,14 @@ static void dump_a_service(service * pService, FILE * f) 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) { @@ -3490,14 +3522,16 @@ static void dump_a_service(service * pService, FILE * f) 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 (pService->param_opt != NULL) { + data = pService->param_opt; + while(data) { + fprintf(f, "\t%s = %s\n", data->key, data->value); + data = data->next; + } + } + } } @@ -3899,7 +3933,9 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, } init_iconv(); +#if 0 /* JERRY */ init_printer_values(&sDefault); +#endif return (bRetval); } -- cgit From 578a7d254fa857a9cd109f27efe1071c0afc37c5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 15 Apr 2004 20:40:26 +0000 Subject: r242: adding 'cups options' parameter to allow raw printing without changing /etc/cups/cupsd.conf -- documentation to follow (This used to be commit 2f323b0991c37022fb59ef8c69454eff03296662) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 061af12494..edd1bc0be7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -315,6 +315,7 @@ typedef struct char *szPostExec; char *szRootPreExec; char *szRootPostExec; + char *szCupsOptions; char *szPrintcommand; char *szLpqcommand; char *szLprmcommand; @@ -438,6 +439,7 @@ static service sDefault = { NULL, /* szPostExec */ NULL, /* szRootPreExec */ NULL, /* szRootPostExec */ + NULL, /* szCupsOptions */ NULL, /* szPrintcommand */ NULL, /* szLpqcommand */ NULL, /* szLprmcommand */ @@ -952,6 +954,7 @@ static struct parm_struct parm_table[] = { {"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, 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}, {"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}, @@ -1800,6 +1803,7 @@ FN_LOCAL_STRING(lp_username, szUsername) 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_LOCAL_STRING(lp_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) -- cgit From 335b10ef10f9825ad52501c77bc6b77cdad39067 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 19 Apr 2004 17:05:31 +0000 Subject: r283: removing --with-cracklib after discussion with abartklet @ sambaXP (This used to be commit df94b0471eb0628aa27f534134d60b62ed123688) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index edd1bc0be7..e47fc3ebad 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -214,7 +214,6 @@ typedef struct int change_notify_timeout; int map_to_guest; int min_passwd_length; - BOOL use_cracklib; int oplock_break_wait_time; int winbind_cache_time; int iLockSpinCount; @@ -790,7 +789,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"use cracklib", P_BOOL, P_GLOBAL, &Globals.use_cracklib, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1437,7 +1435,6 @@ static void init_globals(void) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ - Globals.use_cracklib = False; Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; Globals.iLockSpinCount = 3; /* Try 3 times. */ @@ -1787,7 +1784,6 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) -FN_GLOBAL_BOOL(lp_use_cracklib, &Globals.use_cracklib) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) -- cgit From e0da56a84808c522bc7324b5d636f1cbd317a2c5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 May 2004 18:37:47 +0000 Subject: r570: Remove lots of globals to handle case issues - move them to connection struct entries (as they should have been from the start). Jerry, once you've cut over to 3.0.4 release branch I'll add this to 3.0 also. - Jerry cut over :-). Jeremy. (This used to be commit 578a508509d21226ad3332fc54c3ab54cd8ae452) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e47fc3ebad..b378342372 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -365,7 +365,6 @@ typedef struct BOOL bCaseSensitive; BOOL bCasePreserve; BOOL bShortCasePreserve; - BOOL bCaseMangle; BOOL bHideDotFiles; BOOL bHideSpecialFiles; BOOL bHideUnReadable; @@ -489,7 +488,6 @@ static service sDefault = { False, /* case sensitive */ True, /* case preserve */ True, /* short case preserve */ - False, /* case mangle */ True, /* bHideDotFiles */ False, /* bHideSpecialFiles */ False, /* bHideUnReadable */ @@ -982,7 +980,6 @@ static struct parm_struct parm_table[] = { {"casesignames", P_BOOL, P_LOCAL, &sDefault.bCaseSensitive, NULL, NULL, 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}, @@ -1833,7 +1830,6 @@ FN_LOCAL_BOOL(lp_rootpreexec_close, bRootpreexecClose) FN_LOCAL_BOOL(lp_casesensitive, bCaseSensitive) 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) -- cgit From 348b01ff7734c5db7ce37e0fbeeb0de5f675950f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 11 May 2004 14:54:54 +0000 Subject: r647: fix for setting the called name to by our IP if the called name was *SMBSERVER and *SMBSERV -- fixes issue with connecting to printers via \ip.ad.dr.ess\printer UNC path (This used to be commit 8ee268f0ed0c2f75ded9c2ddd66e0953f443c79e) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b378342372..30fbc9713e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4252,7 +4252,7 @@ const char *get_called_name(void) static fstring called_name; if (!*local_machine) { - fstrcpy(called_name, get_my_primary_ip()); + fstrcpy(called_name, client_socket_addr()); DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n", called_name)); return called_name; -- cgit From 8c0db1bbc469932694ed877eebecffa3d1948abd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 19 May 2004 21:49:58 +0000 Subject: r786: Memory leak fixes in (mostly) error code paths from kawasa_r@itg.hitachi.co.jp. A couple of mem leak fixes in mainline code paths though :-). Jeremy. (This used to be commit 4695cc95fe576b6da0d0cb0686f208fc306b2646) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 30fbc9713e..b5bd14cdde 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1447,6 +1447,7 @@ static void init_globals(void) 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; @@ -2517,6 +2518,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL 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: @@ -2748,6 +2750,7 @@ static BOOL handle_netbios_scope(int snum, 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); } -- cgit From 67d474861d34490f6a8064d3eadc716d5a3a6020 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 20 May 2004 16:23:17 +0000 Subject: r799: BUG 1259 -- add 'printcap cache time' patch from Lars (This used to be commit fac90741139b953d0e88d050dd457657f0b9c9f3) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b5bd14cdde..6376e4aa91 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -249,6 +249,7 @@ typedef struct BOOL bNullPasswords; BOOL bObeyPamRestrictions; BOOL bLoadPrinters; + int PrintcapCacheTime; BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; @@ -945,6 +946,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1362,6 +1364,7 @@ static void init_globals(void) 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; @@ -1614,6 +1617,7 @@ FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) 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_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime) FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand) -- cgit From 03d4344432c6aa75d400afc501aec1a14070f35d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 1 Jun 2004 20:43:32 +0000 Subject: r971: Auto remove store dos attributes if underlying filesystem doesn't support EA's. Jeremy. (This used to be commit 9de6b25c9e9abe982e21b0229df520802cafbfd8) --- source3/param/loadparm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6376e4aa91..f158a35336 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4289,3 +4289,14 @@ BOOL lp_use_sendfile(int snum) { return (_lp_use_sendfile(snum) && !srv_is_signing_active()); } + +/******************************************************************* + 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; +} -- cgit From e707189db3dbaa2874f383cf623b1c75f23c393c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 2 Jun 2004 14:58:18 +0000 Subject: r979: Implement the 'cups server' option. This makes it possible to have virtual smbd's connect to different cups daemons. Volker (This used to be commit 148dc71ea5c1ec619ba6f4873fa7c69a608e58cc) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f158a35336..4ac2f8950f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -231,6 +231,7 @@ typedef struct char *szLdapFilter; char *szLdapAdminDn; char *szAclCompat; + char *szCupsServer; int ldap_passwd_sync; int ldap_replication_sleep; BOOL ldap_delete_dn; @@ -953,6 +954,7 @@ static struct parm_struct parm_table[] = { {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE}, {"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}, @@ -1506,6 +1508,7 @@ static void init_globals(void) 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; @@ -1802,6 +1805,7 @@ 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) -- cgit From 7e6734a0dd50c11601c60e86dee202004b2d6a90 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 8 Jun 2004 20:10:26 +0000 Subject: r1087: BUG 1221: revert old change that used single and double quotes as delimters in next_token(), and change print_parameter() to print out parm values surrounded by double quotes (instead of single quotes) (This used to be commit b0739b073a1db8b0b163726a1d181b2f05d71883) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ac2f8950f..2c65ac67d9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3273,9 +3273,9 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) 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))?", ":"")); } -- cgit From 76ca0f6f3f57c487564697c795da65672bbf4052 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 10 Jun 2004 17:09:00 +0000 Subject: r1104: get_called_name is used in the printing subsystem. In case of multi-homed servers we need to make sure that the clients are given back the IP address they connected to. Volker (This used to be commit 5f482df169eebae87ec769a05e3c3fc6e32af1e3) --- source3/param/loadparm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2c65ac67d9..03b86a9c18 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4262,7 +4262,10 @@ const char *get_called_name(void) extern fstring local_machine; static fstring called_name; - if (!*local_machine) { + if ( (!*local_machine) || + (client_socket_port() == 445) ) { + /* Everybody coming in on 445 should be able to live with the + * IP address */ fstrcpy(called_name, client_socket_addr()); DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n", called_name)); -- cgit From 2acd0848663f28afedff9b11b738e048f5ead2cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Jun 2004 18:36:45 +0000 Subject: r1154: Change default setting for case sensitivity to "auto". If set to auto then is the client supports it (current clients supported are Samba and CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare "NT LM 0.12" string) then the setting of the per packet flag smb_flag FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows the linux CIFS client to use Samba in a case sensitive manner. Additional command in smbclient "case_sensitive", toggles the flag in subsequent packets. Docs to follow. Jeremy. (This used to be commit cf84c0fe1a061acc0313f7db124b8f947cdf623d) --- source3/param/loadparm.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 03b86a9c18..5e959dbba3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -364,7 +364,7 @@ typedef struct int iBlock_size; BOOL bPreexecClose; BOOL bRootpreexecClose; - BOOL bCaseSensitive; + int iCaseSensitive; BOOL bCasePreserve; BOOL bShortCasePreserve; BOOL bHideDotFiles; @@ -487,7 +487,7 @@ static service sDefault = { 1024, /* iBlock_size */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ - False, /* case sensitive */ + Auto, /* case sensitive */ True, /* case preserve */ True, /* short case preserve */ True, /* bHideDotFiles */ @@ -980,8 +980,8 @@ static struct parm_struct parm_table[] = { {"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}, {"mangling char", P_CHAR, P_LOCAL, &sDefault.magic_char, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, @@ -1836,7 +1836,7 @@ FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) 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_hide_dot_files, bHideDotFiles) @@ -2997,10 +2997,8 @@ static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue { int i; - for (i = 0; parm->enum_list[i].name; i++) - { - if ( strequal(pszParmValue, parm->enum_list[i].name)) - { + for (i = 0; parm->enum_list[i].name; i++) { + if ( strequal(pszParmValue, parm->enum_list[i].name)) { *ptr = parm->enum_list[i].value; break; } @@ -3870,11 +3868,12 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, /* get the username for substituion -- preference to the current_user_info */ - if ( strlen( current_user_info.smb_name ) != 0 ) + if ( strlen( current_user_info.smb_name ) != 0 ) { username = current_user_info.smb_name; - else + } else { username = sub_get_smb_name(); - + } + standard_sub_basic( username, n2,sizeof(n2) ); add_to_file_list(pszFname, n2); @@ -3889,8 +3888,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, init_globals(); debug_init(); - if (save_defaults) - { + if (save_defaults) { init_locals(); lp_save_defaults(); } -- cgit From 48a6e9fd76a9af9fb459a66d0d1d895f412b7653 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 21 Jun 2004 17:51:06 +0000 Subject: r1212: small change to prevent home directories added during the SMBsesssetup&X tfrom being removed as unused services (This used to be commit 951a88519467736fffd80ff962f1df71b04c9c2f) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5e959dbba3..a163caefc3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2319,6 +2319,8 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, 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)); @@ -3699,6 +3701,10 @@ void lp_killunused(BOOL (*snumused) (int)) 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]); -- cgit From e948458a79462bd99ef7c02b4d7ec22c6554a163 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Jun 2004 00:48:59 +0000 Subject: r1215: Intermediate checkin of the new keytab code. I need to make sure I haven't broken krb5 ticket verification in the mainline code path, also need to check with valgrind. Everything now compiles (MIT, need to also check Heimdal) and the "net keytab" utility code will follow. Jeremy. (This used to be commit f0f2e28958cb9abfed216c71f291f19ea346d630) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a163caefc3..247159a7b1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -287,6 +287,7 @@ typedef struct BOOL bUnixExtensions; BOOL bDisableNetbios; BOOL bKernelChangeNotify; + BOOL bUseKerberosKeytab; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -861,6 +862,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1761,6 +1763,7 @@ FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) 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_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) -- cgit From adf65489bd358c4da73d3e5f23365ee2596dbe6d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Jun 2004 01:51:45 +0000 Subject: r1224: Fix longstanding memleak bug with logfile name being set before lp_load() loads the initial config file and overwrites the written logfile name with zeros in init_globals(). Ensure we do a string_free() on Globals.szLogFile if it isn't NULL. Jeremy. (This used to be commit c378f3c32533c085fef2c2e07f0660781a16a341) --- source3/param/loadparm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 247159a7b1..12bbebcaa8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1293,6 +1293,13 @@ static void init_globals(void) 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++) -- cgit From 7f05a7d0c85fd3deaf5e3e263cf8b0f05d4a7f01 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 26 Jun 2004 00:47:58 +0000 Subject: r1260: Added new parameter in the protocol section. "defer sharing violations", by default set to "yes" (to correctly emulate Windows). I've added this to ensure if we find a critical problem with this new code when 3.0.5 ships it can be turned off to test for bugs. Jeremy. (This used to be commit bee0619cc476335e19a5f76179832802587563d1) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 12bbebcaa8..107e500a51 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -417,6 +417,7 @@ typedef struct BOOL bMap_acl_inherit; BOOL bAfs_Share; BOOL bEASupport; + BOOL bDeferSharingViolations; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -540,6 +541,7 @@ static service sDefault = { False, /* bMap_acl_inherit */ False, /* bAfs_Share */ False, /* bEASupport */ + True, /* bDeferSharingViolations */ NULL, /* Parametric options */ @@ -892,6 +894,7 @@ static struct parm_struct parm_table[] = { {"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_LOCAL, &sDefault.bDeferSharingViolations, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | 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}, @@ -1890,6 +1893,7 @@ FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode) FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_BOOL(lp_ea_support, bEASupport) +FN_LOCAL_BOOL(lp_defer_sharing_violations, bDeferSharingViolations) FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) -- cgit From 3e0f586298125bbda80b8edcced49d5bbb424b0d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 26 Jun 2004 01:04:02 +0000 Subject: r1263: Make "defer sharing violations" a global parameter. Jeremy. (This used to be commit 42cdeccc36dc5f4bd133b84d4eaeb76f42f8043b) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 107e500a51..585a1792e1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -288,6 +288,7 @@ typedef struct BOOL bDisableNetbios; BOOL bKernelChangeNotify; BOOL bUseKerberosKeytab; + BOOL bDeferSharingViolations; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -417,7 +418,6 @@ typedef struct BOOL bMap_acl_inherit; BOOL bAfs_Share; BOOL bEASupport; - BOOL bDeferSharingViolations; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -541,7 +541,6 @@ static service sDefault = { False, /* bMap_acl_inherit */ False, /* bAfs_Share */ False, /* bEASupport */ - True, /* bDeferSharingViolations */ NULL, /* Parametric options */ @@ -894,7 +893,7 @@ static struct parm_struct parm_table[] = { {"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_LOCAL, &sDefault.bDeferSharingViolations, NULL, 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}, @@ -1540,6 +1539,7 @@ static void init_globals(void) Globals.client_signing = Auto; Globals.server_signing = False; + Globals.bDeferSharingViolations = True; string_set(&Globals.smb_ports, SMB_PORTS); } @@ -1774,6 +1774,7 @@ 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_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) @@ -1893,7 +1894,6 @@ FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode) FN_LOCAL_BOOL(lp_nt_acl_support, bNTAclSupport) FN_LOCAL_BOOL(lp_ea_support, bEASupport) -FN_LOCAL_BOOL(lp_defer_sharing_violations, bDeferSharingViolations) FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) -- cgit From a003d0e5d258572aa135ccbbc91882df68c1b51b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 30 Jun 2004 23:00:40 +0000 Subject: r1311: Turn on sendfile for non-oplocked files. tridge proved this is the correct thing to do on a train in Germany :-). Turn on sendfile by default ! It's about time..... Jeremy. (This used to be commit ec614a8f7d158b57f5981c1515962aca3c3e6ef4) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 585a1792e1..c43edd5eda 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -536,7 +536,7 @@ static service sDefault = { False, /* bUseClientDriver */ False, /* bDefaultDevmode */ True, /* bNTAclSupport */ - False, /* bUseSendfile */ + True, /* bUseSendfile */ False, /* bProfileAcls */ False, /* bMap_acl_inherit */ False, /* bAfs_Share */ -- cgit From aa9be75d8a836106037389cb3d774d38d1397ea5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jul 2004 14:49:44 +0000 Subject: r1314: Restore the 2.2 'force unknown acl user' parameter. When getting a security descriptor for a file, if the owner sid is not known, the owner uid is set to the current uid. Same for group sid. This makes xcopy /o possible for files that are owned by local users/groups (local administrators for example). Thanks to Guenther for his persistence :-) Volker (This used to be commit 80e57d27909a9a1edad962e3f43c2178d2da2a92) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c43edd5eda..b4686d56ea 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -413,6 +413,7 @@ typedef struct BOOL bUseClientDriver; BOOL bDefaultDevmode; BOOL bNTAclSupport; + BOOL bForceUnknownAclUser; BOOL bUseSendfile; BOOL bProfileAcls; BOOL bMap_acl_inherit; @@ -536,6 +537,7 @@ static service sDefault = { False, /* bUseClientDriver */ False, /* bDefaultDevmode */ True, /* bNTAclSupport */ + False, /* bForceUnknownAclUser */ True, /* bUseSendfile */ False, /* bProfileAcls */ False, /* bMap_acl_inherit */ @@ -849,6 +851,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1893,6 +1896,7 @@ 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_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) -- cgit From 569177a194ef990b55d3ad5d5243ca0f2659f25c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 1 Jul 2004 16:35:43 +0000 Subject: r1317: Patch from Joe Meadows "Joe Meadows" to add a timeout to the ldap open calls. New parameter, ldap timeout added. Jeremy. (This used to be commit e5b3094c4cc75eb07f667dd1aeb73921ed7366ac) --- source3/param/loadparm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b4686d56ea..0710c36514 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -234,6 +234,7 @@ typedef struct 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; @@ -1079,17 +1080,18 @@ static struct parm_struct parm_table[] = { {"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 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}, @@ -1487,6 +1489,7 @@ static void init_globals(void) 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; /* these parameters are set to defaults that are more appropriate for the increasing samba install base: @@ -1721,6 +1724,7 @@ FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) 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) -- cgit From b42a10a8ef770b5d26fa703482ab477ad082fd16 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Jul 2004 21:52:23 +0000 Subject: r1386: We can't use sendfile for Win9x. It causes oplock failures (who knew....). Jeremy. (This used to be commit f423a631974b9126888aff2e476882abf1f3afad) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0710c36514..0785c2501b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4320,7 +4320,7 @@ int lp_maxprintjobs(int snum) BOOL lp_use_sendfile(int snum) { - return (_lp_use_sendfile(snum) && !srv_is_signing_active()); + return (_lp_use_sendfile(snum) && (get_remote_arch() != RA_WIN95) && !srv_is_signing_active()); } /******************************************************************* -- cgit From f0f87cf7faecb9899a6a04da72e13ed6c408d01b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 10 Jul 2004 17:00:53 +0000 Subject: r1430: Although prepared for only one remote backend, make the 'idmap backend' parameter a list instead of a string. This makes idmap backend = ldap:"ldap://localhost/ ldap://fallback/" possible. Volker (This used to be commit ea718347937ec0e5640b29e0e9edf6eda2b45e34) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0785c2501b..a309fde007 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -176,7 +176,7 @@ typedef struct BOOL bWinbindTrustedDomainsOnly; BOOL bWinbindNestedGroups; char *szWinbindBackend; - char *szIdmapBackend; + char **szIdmapBackend; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1165,7 +1165,7 @@ static struct parm_struct parm_table[] = { {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}, @@ -1710,7 +1710,7 @@ 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 -- cgit From 8ef0682954232e7c1f67da3b7d65919216ae2786 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 Jul 2004 15:30:23 +0000 Subject: r1468: Dump the parametrical options only once at the end of the service. Fixes Testparm producing huge output and swat creating monster smb.conf files. (This used to be commit 9c41adb98b8eef344203d80ef38cf96a27853c7f) --- source3/param/loadparm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a309fde007..978ea89d5c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3552,14 +3552,14 @@ static void dump_a_service(service * pService, FILE * f) ((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 (pService->param_opt != NULL) { + data = pService->param_opt; + while(data) { + fprintf(f, "\t%s = %s\n", data->key, data->value); + data = data->next; + } } } -- cgit From 603ac68a2ac1d2c5e7337b350a0b81187f13d816 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Aug 2004 13:41:28 +0000 Subject: r1638: Dont always uppercase "afs username map" (This used to be commit e9263a5204c42e8f3f1079cd535ce6fc091f3d6a) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 978ea89d5c..549e232fe0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1120,7 +1120,7 @@ static struct parm_struct parm_table[] = { {"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}, {"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}, -- cgit From e0475afa8375eb27795aaecca16f8ae6f98666e7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Aug 2004 17:49:00 +0000 Subject: r1665: Patch from James Peach @ SGI to stop using sendfile if it isn't supported by the underlying OS. Jeremy. (This used to be commit 1b0c70cf97aa45093fe5ef866a351b47ef1a5879) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 549e232fe0..4150f57e55 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4323,6 +4323,18 @@ BOOL lp_use_sendfile(int snum) 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. ********************************************************************/ -- cgit From f17922d537213fe1d15cebcd78a8df4068801e7f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Aug 2004 21:27:26 +0000 Subject: r1841: Fix for #1606, can't launch dos exe's. 2 related problems - 1). DOS uses chained commands - when we are replying with sendfile we neglect to send the chained header. 2). Win9x and DOS TCP stacks blow up when getting data back from a Linux sendfile - "The engines canna take the strain cap'n". Don't use sendfile for anything less than NT1. Jeremy. (This used to be commit 3cd88f48afa589a189bb728d2d2660d058203d4d) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4150f57e55..2750cc7eda 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4320,6 +4320,11 @@ int lp_maxprintjobs(int snum) BOOL lp_use_sendfile(int snum) { + extern int 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()); } -- cgit From df5ee6a6ba2ebe445c8889625c2ee36eea81fcc8 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 26 Aug 2004 20:47:58 +0000 Subject: r2077: fix logic bug in the check for creating a user's home directory in register_vuid(); add a few extra debug lines (This used to be commit 02571e7f5040a577840c969ff9c46a1e533edc21) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2750cc7eda..bc2b0ced08 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2305,6 +2305,10 @@ static int add_a_service(const service *pservice, const char *name) 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); } @@ -2344,7 +2348,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, 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); } -- cgit From a5489bb83174f4469582cb2c64124b355b1bc52a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 27 Aug 2004 16:13:50 +0000 Subject: r2090: fix formatting that was bugging me (This used to be commit 5d3ba1fac0ccb7024b72fd3a672e14fab062ef0b) --- source3/param/loadparm.c | 54 ++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 36 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bc2b0ced08..e6bc01ff3f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1199,24 +1199,18 @@ static void init_printer_values(service *pService) case PRINT_LPROS2: 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->szPrintcommand, "lpr -r -P'%p' %s"); break; case PRINT_LPRNG: case PRINT_PLP: 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"); + 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: @@ -1231,20 +1225,13 @@ static void init_printer_values(service *pService) string_set(&Globals.szPrintcapname, "cups"); #else - 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'"); + 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'"); string_set(&Globals.szPrintcapname, "lpstat"); #endif /* HAVE_CUPS */ break; @@ -1253,17 +1240,12 @@ static void init_printer_values(service *pService) case PRINT_HPUX: 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"); + 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(&pService->szLppausecommand, - "lp -i %p-%j -H hold"); - string_set(&pService->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; -- cgit From 4c20275f51c68e3ff66a96621e578ec18c47e254 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 31 Aug 2004 18:34:52 +0000 Subject: r2135: BUG 1464: make sure that printing commands are initialized even if the 'printing' parameter is not explicitly set (This used to be commit 8ae57a8e8d7334bc0feb2c8afb673bd5c53bffca) --- source3/param/loadparm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e6bc01ff3f..468b4c8f27 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1299,6 +1299,8 @@ static void init_globals(void) string_set(&sDefault.fstype, FSTYPE_STRING); + init_printer_values(&sDefault); + done_init = True; } @@ -3952,9 +3954,6 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, } init_iconv(); -#if 0 /* JERRY */ - init_printer_values(&sDefault); -#endif return (bRetval); } -- cgit From 6667776e87628b9035212392c9f2724be62391f5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Sep 2004 02:13:48 +0000 Subject: r2157: This parameter in loadparm appears compleatly unused. Andrew Bartlett (This used to be commit 3dabe879f74d2ea3b379a00a3778ee76051a359a) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 468b4c8f27..71543d1e15 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -200,7 +200,6 @@ typedef struct int lpqcachetime; int iMaxSmbdProcesses; BOOL bDisableSpoolss; - int iTotalPrintJobs; int syslog; int os_level; int enhanced_browsing; @@ -1374,7 +1373,6 @@ static void init_globals(void) Globals.lpqcachetime = 10; Globals.bDisableSpoolss = False; Globals.iMaxSmbdProcesses = 0;/* no limit specified */ - Globals.iTotalPrintJobs = 0; /* no limit specified */ Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; -- cgit From 3fe747bfdc60168a8e284e1f80df604469a8e55b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 2 Sep 2004 20:51:12 +0000 Subject: r2190: disable 'winbind enable local accounts' by default (had to be done doctor) (This used to be commit 1f71295801c7af554fba293069e52666083d7bc5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 71543d1e15..14981b97c4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1510,7 +1510,7 @@ static void init_globals(void) 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; -- cgit From 410a6c72eafbb7fb1ecc9bf89310842ea8027494 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 14 Sep 2004 00:21:11 +0000 Subject: r2331: check password script code and example from trunk (This used to be commit f836be323a233f3a28cbaa04c532e83ea98ead89) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 14981b97c4..24811af37d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -156,6 +156,7 @@ typedef struct char *szAddMachineScript; char *szShutdownScript; char *szAbortShutdownScript; + char *szCheckPasswordScript; char *szWINSHook; char *szWINSPartners; char *szUtmpDir; @@ -811,6 +812,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1678,6 +1680,8 @@ FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) 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) -- cgit From 31441aaa137145511a2c09dd540d46876df56701 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 1 Oct 2004 20:34:12 +0000 Subject: r2768: BUG 1519: save the hostname used in the open_printer_ex() for later reuse when filling in the spolss replies (also gets rid of get_called_name() (This used to be commit 57db8ca91f52329c7f8985c04463b6b69015b0c4) --- source3/param/loadparm.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 24811af37d..726ae5fe56 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4266,28 +4266,6 @@ void lp_set_logfile(const char *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) || - (client_socket_port() == 445) ) { - /* Everybody coming in on 445 should be able to live with the - * IP address */ - fstrcpy(called_name, client_socket_addr()); - 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. ********************************************************************/ -- cgit From 4e18fa46d54b65a2145da769cb5e26b63eee1b1d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 19 Oct 2004 22:13:08 +0000 Subject: r3069: add 'force printername' service parameter for people that want to enforce printername == sharename for spoolss printing (This used to be commit d47b8a0b4f348171df35b3b0028ce7d99fab8af3) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 726ae5fe56..053626c730 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -413,6 +413,7 @@ typedef struct BOOL bMSDfsRoot; BOOL bUseClientDriver; BOOL bDefaultDevmode; + BOOL bForcePrintername; BOOL bNTAclSupport; BOOL bForceUnknownAclUser; BOOL bUseSendfile; @@ -537,6 +538,7 @@ static service sDefault = { False, /* bMSDfsRoot */ False, /* bUseClientDriver */ False, /* bDefaultDevmode */ + False, /* bForcePrintername */ True, /* bNTAclSupport */ False, /* bForceUnknownAclUser */ True, /* bUseSendfile */ @@ -983,6 +985,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1885,6 +1888,7 @@ FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) 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) -- cgit From b3abb495f099c47b656b3ac7e40f4959192ea231 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 27 Oct 2004 19:44:12 +0000 Subject: r3298: turning sendfile back off by default (This used to be commit 7dc28014860a5c5bbe78dc22628301ea8dc245ee) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 053626c730..8ea597c118 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -541,7 +541,7 @@ static service sDefault = { False, /* bForcePrintername */ True, /* bNTAclSupport */ False, /* bForceUnknownAclUser */ - True, /* bUseSendfile */ + False, /* bUseSendfile */ False, /* bProfileAcls */ False, /* bMap_acl_inherit */ False, /* bAfs_Share */ -- cgit From b845dce3ac521234d694834f8cd58225b0d7d687 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 28 Oct 2004 13:50:13 +0000 Subject: r3326: BUG 1782: reorder loadparm.c to prevent testparm from displaying synonyms; patch from Luke Mewburn (This used to be commit c8101dbb6561267298728714e5b82591138c56e6) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8ea597c118..65e9e6b57f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -794,8 +794,8 @@ static struct parm_struct parm_table[] = { {"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 passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -881,8 +881,8 @@ static struct parm_struct parm_table[] = { {"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}, @@ -890,9 +890,9 @@ static struct parm_struct parm_table[] = { {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}, {"read bmpx", P_BOOL, P_GLOBAL, &Globals.bReadbmpx, NULL, NULL, FLAG_ADVANCED}, {"read raw", P_BOOL, P_GLOBAL, &Globals.bReadRaw, NULL, NULL, FLAG_ADVANCED}, @@ -1131,8 +1131,8 @@ static struct parm_struct parm_table[] = { {"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}, -- cgit From d0bb5f9505b1bd90913d159f91c7aa9c5654bf73 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 19 Nov 2004 12:11:13 +0000 Subject: r3873: The semantics of the parameter 'printcap name' are a bit tricky. I had seen the effect that I could not list printers with smbclient -L. I have cups libraries but no running cups server, so remove_stale_printers() removed all my printer definitions from the share list. So I said 'printing = bsd' but it still would not work. This happened because init_globals() would initialize Globals.szPrintcapname to "cups", and the explicit 'printing = bsd' did not reset it. 'printing=bsd' can't reset it, as this might overwrite an explicit setting. Thus I separated the lp_printcapname into a function of its own, looking at Globals.szPrintcapname and subsequently at sDefault.iPrinting. Please revisit, there are just too many cases to cover. Thanks, Volker (This used to be commit 3cdde7071b6bf83ad05046745ad2a5fa353995bf) --- source3/param/loadparm.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 65e9e6b57f..b8e5f88efc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1226,8 +1226,6 @@ static void init_printer_values(service *pService) string_set(&pService->szLpresumecommand, ""); string_set(&pService->szQueuepausecommand, ""); string_set(&pService->szQueueresumecommand, ""); - - string_set(&Globals.szPrintcapname, "cups"); #else string_set(&pService->szLpqcommand, "/usr/bin/lpstat -o '%p'"); string_set(&pService->szLprmcommand, "/usr/bin/cancel '%p-%j'"); @@ -1236,7 +1234,6 @@ static void init_printer_values(service *pService) 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'"); - string_set(&Globals.szPrintcapname, "lpstat"); #endif /* HAVE_CUPS */ break; @@ -1346,7 +1343,6 @@ static void init_globals(void) 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"); @@ -1626,7 +1622,6 @@ 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_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime) -FN_GLOBAL_STRING(lp_printcapname, &Globals.szPrintcapname) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand) FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand) @@ -4283,6 +4278,26 @@ int lp_maxprintjobs(int snum) 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. ********************************************************************/ -- cgit From 5cd96ef0cfdc1b825e1834c6f22bd3ad8cfe8d2d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 23 Nov 2004 14:52:56 +0000 Subject: r3923: BUG 2073: fall back to smb_name if current_user_info is not available in lp_file_list_changed() (This used to be commit b0e44b11b36dcd89a8c825911efadbeeac9faab5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b8e5f88efc..d5069e6836 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2695,7 +2695,7 @@ BOOL lp_file_list_changed(void) time_t mod_time; pstrcpy(n2, f->name); - standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2)); + standard_sub_basic( username, n2, sizeof(n2) ); DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", f->name, n2, ctime(&f->modtime))); -- cgit From 482f14871d568a24006fec5af68d722b5fa70a0d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Nov 2004 00:07:01 +0000 Subject: r3946: Fix for bugid #2085 reported by Jason Mader . Use consistent enum type for Protocol extern. Jeremy. (This used to be commit 65dfae7ea45d4c9452b2a08efa09b01d870142f3) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d5069e6836..95f09c70e4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4304,7 +4304,7 @@ const char *lp_printcapname(void) BOOL lp_use_sendfile(int snum) { - extern int Protocol; + 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; -- cgit From acf9d61421faa6c0055d57fdee7db300dc5431aa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 7 Dec 2004 18:25:53 +0000 Subject: r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a) --- source3/param/loadparm.c | 39 ++++++++++++++++++--------------------- source3/param/params.c | 10 +++++----- 2 files changed, 23 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 95f09c70e4..d0bad3ff17 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2262,9 +2262,7 @@ static int add_a_service(const service *pservice, const char *name) 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")); @@ -2272,8 +2270,7 @@ static int add_a_service(const service *pservice, const char *name) } 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")); @@ -2565,16 +2562,16 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL 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); } @@ -2649,16 +2646,16 @@ static void add_to_file_list(const char *fname, const char *subfname) } 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; @@ -2708,7 +2705,7 @@ BOOL lp_file_list_changed(void) 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; @@ -3050,7 +3047,7 @@ static void init_copymap(service * pservice) { 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", @@ -3104,16 +3101,16 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue 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); @@ -3656,7 +3653,7 @@ static void lp_add_auto_services(char *str) if (!str) return; - s = strdup(str); + s = SMB_STRDUP(str); if (!s) return; @@ -3755,7 +3752,7 @@ static void lp_save_defaults(void) 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; } @@ -3763,7 +3760,7 @@ static void lp_save_defaults(void) 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; } diff --git a/source3/param/params.c b/source3/param/params.c index 892e5476cc..2d6fe56716 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -238,7 +238,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) { char *tb; - tb = Realloc( bufr, bSize +BUFR_INC ); + tb = SMB_REALLOC( bufr, bSize +BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); @@ -335,7 +335,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) { char *tb; - tb = Realloc( bufr, bSize + BUFR_INC ); + tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); @@ -403,7 +403,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) { char *tb; - tb = Realloc( bufr, bSize + BUFR_INC ); + tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); @@ -521,7 +521,7 @@ static myFILE *OpenConfFile( const char *FileName ) int lvl = in_client?1:0; myFILE *ret; - ret = (myFILE *)malloc(sizeof(*ret)); + ret = SMB_MALLOC_P(myFILE); if (!ret) return NULL; ret->buf = file_load(FileName, &ret->size); @@ -572,7 +572,7 @@ BOOL pm_process( const char *FileName, else /* If we don't have a buffer */ { /* allocate one, then parse, */ bSize = BUFR_INC; /* then free. */ - bufr = (char *)malloc( bSize ); + bufr = (char *)SMB_MALLOC( bSize ); if( NULL == bufr ) { DEBUG(0,("%s memory allocation failure.\n", func)); -- cgit From bc7142ce2373993e87511ff401815efd60b1c1dd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Dec 2004 03:02:29 +0000 Subject: r4094: BUG 2107: fix memory bloating caused by large numbers of print_queue_updates() requests sent via messages.tdb (This used to be commit 56b1110c71b17eeb2ebdb7d506d86deb6b81f0d5) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d0bad3ff17..094eff81c0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1371,7 +1371,7 @@ static void init_globals(void) /* 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.pwordlevel = 0; -- cgit From 934566332835eed5a3b768e07642c569eca37001 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Dec 2004 00:30:28 +0000 Subject: r4143: Make strict locking an enum. Auto means use oplock optimization. Jeremy. (This used to be commit 0dd4adeae2042d0ea64398a78b3f48eb0150c133) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 094eff81c0..d8aef215b8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -386,7 +386,7 @@ typedef struct BOOL bMap_archive; BOOL bStoreDosAttributes; BOOL bLocking; - BOOL bStrictLocking; + int iStrictLocking; BOOL bPosixLocking; BOOL bShareModes; BOOL bOpLocks; @@ -511,7 +511,7 @@ static service sDefault = { True, /* bMap_archive */ False, /* bStoreDosAttributes */ True, /* bLocking */ - True, /* bStrictLocking */ + True, /* iStrictLocking */ True, /* bPosixLocking */ True, /* bShareModes */ True, /* bOpLocks */ @@ -1075,7 +1075,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1858,7 +1858,7 @@ 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) -- cgit From c96872d3ab895ccf122f077a54104542cb3f772b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 17 Dec 2004 11:42:10 +0000 Subject: r4256: Add a patch from kllin@it.su.se: New Parameter 'afs token lifetime' tells the AFS client when to throw away a token. Thanks, Volker (This used to be commit 836a8277b2281bcdb6eab8339b05bec61b49eb74) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d8aef215b8..c745da063a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -127,6 +127,7 @@ typedef struct char *szSocketOptions; char *szRealm; char *szAfsUsernameMap; + int iAfsTokenLifetime; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -1125,6 +1126,7 @@ static struct parm_struct parm_table[] = { {"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_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}, @@ -1474,6 +1476,11 @@ static void init_globals(void) 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: @@ -1647,6 +1654,7 @@ 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_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) -- cgit From b800233942107b229d04999bf7eeffe4211ccbdf Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 21 Dec 2004 11:10:28 +0000 Subject: r4312: Marking "min password length" as depreciated (to be removed in one of the next releases). The corresponding functionality is better handled with the account policy. See https://bugzilla.samba.org/show_bug.cgi?id=1705 for details. Guenther (This used to be commit 61204a267c3b1b024ba6cb2340317301210b4d90) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c745da063a..5ca19134bb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -795,8 +795,8 @@ static struct parm_struct parm_table[] = { {"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 password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, 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_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}, -- cgit From c3ba8b9a53617c75ffbcfa8ef32044cb1691d693 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 14 Jan 2005 19:26:13 +0000 Subject: r4736: small set of merges from rtunk to minimize the diffs (This used to be commit 4b351f2fcc365a7b7f8c22b5139c299aa54c9458) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5ca19134bb..e6beebedb8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1092,6 +1092,7 @@ static struct parm_struct parm_table[] = { {"ldap idmap suffix", P_STRING, P_GLOBAL, &Globals.szLdapIdmapSuffix, NULL, NULL, 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 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}, -- cgit From ade3ef6f0435a06d602519c012ffa6a0b0fbec71 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 17 Jan 2005 20:27:29 +0000 Subject: r4809: * include SeDiskOperatorPrivilege and SeRemoteShutdownPrivilege (noty enfornced yet though) * add 'enable privileges (off by default) to control whether or not any privuleges can be assigned to SIDs (This used to be commit cf63519169d2f3c56a6acf46b9257f4c11d5ea74) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e6beebedb8..8531b2fdd1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -291,6 +291,7 @@ typedef struct BOOL bKernelChangeNotify; BOOL bUseKerberosKeytab; BOOL bDeferSharingViolations; + BOOL bEnablePrivileges; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -809,6 +810,7 @@ static struct parm_struct parm_table[] = { {"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}, @@ -1538,6 +1540,12 @@ static void init_globals(void) 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; @@ -1775,6 +1783,7 @@ 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) -- cgit From 6441450e9306b1b09ca2a085d47992867acdd4ec Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 27 Jan 2005 15:13:16 +0000 Subject: r5046: mark 'winbind enable local accounts' and testprns as depcrecated (This used to be commit 17bc42b4c2e21004adaeac78db6231a384fda16c) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8531b2fdd1..97d9389aa6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1184,7 +1184,7 @@ static struct parm_struct parm_table[] = { {"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}, -- cgit From 9dbb5769fe70d3c0e2a2c679a42104bc15d42bc7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 2 Feb 2005 16:05:55 +0000 Subject: r5174: ensure that we consistently use the current_user_info.smb_name vs. smb_name when parsing smb.conf and reloading config files (This used to be commit be537eaebe84b2ccae089e5982263df8a96e7a5b) --- source3/param/loadparm.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 97d9389aa6..01213a8fb3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1584,11 +1584,11 @@ static char *lp_string(const char *s) 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); @@ -2694,23 +2694,15 @@ static void add_to_file_list(const char *fname, const char *subfname) BOOL lp_file_list_changed(void) { struct file_lists *f = file_lists; - char *username; DEBUG(6, ("lp_file_list_changed()\n")); - /* get the username for substituion -- preference to the current_user_info */ - if ( strlen( current_user_info.smb_name ) != 0 ) - username = current_user_info.smb_name; - else - username = sub_get_smb_name(); - - while (f) { pstring n2; time_t mod_time; pstrcpy(n2, f->name); - standard_sub_basic( username, 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))); @@ -2744,7 +2736,7 @@ static BOOL handle_netbios_name(int snum, const char *pszParmValue, char **ptr) 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()); @@ -2800,7 +2792,7 @@ 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); @@ -3894,19 +3886,10 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, pstring n2; BOOL bRetval; param_opt_struct *data, *pdata; - char *username; pstrcpy(n2, pszFname); - /* get the username for substituion -- preference to the current_user_info */ - - if ( strlen( current_user_info.smb_name ) != 0 ) { - username = current_user_info.smb_name; - } else { - username = sub_get_smb_name(); - } - - standard_sub_basic( username, n2,sizeof(n2) ); + standard_sub_basic( get_current_username(), n2,sizeof(n2) ); add_to_file_list(pszFname, n2); @@ -4046,7 +4029,7 @@ int lp_servicenumber(const char *pszServiceName) * 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; } -- cgit From aa9132cc55d43d9d197e3196fc7098eec6e8615a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 11 Feb 2005 10:32:46 +0000 Subject: r5331: Support SIDs as %s replacements in the afs username map parameter. Add 'log nt token command' parameter. If set, %s is replaced with the user sid, and %t takes all the group sids. Volker (This used to be commit e7dc9fde45c750013ad07f584599dd51f8eb8a54) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 01213a8fb3..45245e2cfe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -128,6 +128,7 @@ typedef struct char *szRealm; char *szAfsUsernameMap; int iAfsTokenLifetime; + char *szLogNtTokenCommand; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -1130,6 +1131,7 @@ static struct parm_struct parm_table[] = { {"homedir map", P_STRING, P_GLOBAL, &Globals.szNISHomeMapName, 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}, + {"log nt token command", P_STRING, P_GLOBAL, &Globals.szLogNtTokenCommand, 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}, @@ -1664,6 +1666,7 @@ FN_GLOBAL_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_realm, &Globals.szRealm) FN_GLOBAL_CONST_STRING(lp_afs_username_map, &Globals.szAfsUsernameMap) FN_GLOBAL_INTEGER(lp_afs_token_lifetime, &Globals.iAfsTokenLifetime) +FN_GLOBAL_STRING(lp_log_nt_token_command, &Globals.szLogNtTokenCommand) 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) -- cgit From f9a28748cfa89d020249ca24d8fcbab1a2bdd4f5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 12 Feb 2005 14:41:00 +0000 Subject: r5359: BUG 2333: use the lpq command to pass in the correct printer name for cups_queue_get(). See comments in code for details (This used to be commit 3eee00e0d0e9b58cdd35209691072b625813681c) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 45245e2cfe..80843eda82 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1226,7 +1226,9 @@ static void init_printer_values(service *pService) case PRINT_CUPS: #ifdef HAVE_CUPS - string_set(&pService->szLpqcommand, ""); + /* set the lpq command to contain the destination printer + name only. This is used by cups_queue_get() */ + string_set(&pService->szLpqcommand, "%p"); string_set(&pService->szLprmcommand, ""); string_set(&pService->szPrintcommand, ""); string_set(&pService->szLppausecommand, ""); -- cgit From 26d81332de11fd115b081cb438f0c698b81b9bb1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Feb 2005 02:19:17 +0000 Subject: r5535: Reformat so I can actually maintain this code and eventually convert to MB safe. Jeremy. (This used to be commit 0285754c1408b4155e115a5f76b1f5ff481c9d7e) --- source3/param/params.c | 778 ++++++++++++++++++++++++------------------------- 1 file changed, 377 insertions(+), 401 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 2d6fe56716..192223605a 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -111,14 +111,16 @@ typedef struct { static int mygetc(myFILE *f) { - if (f->p >= f->buf+f->size) return EOF; + if (f->p >= f->buf+f->size) + return EOF; /* be sure to return chars >127 as positive values */ return (int)( *(f->p++) & 0x00FF ); } static void myfile_close(myFILE *f) { - if (!f) return; + if (!f) + return; SAFE_FREE(f->buf); SAFE_FREE(f); } @@ -126,8 +128,6 @@ static void myfile_close(myFILE *f) /* -------------------------------------------------------------------------- ** * Functions... */ - -static int EatWhitespace( myFILE *InFile ) /* ------------------------------------------------------------------------ ** * Scan past whitespace (see ctype(3C)) and return the first non-whitespace * character, or newline, or EOF. @@ -144,15 +144,16 @@ static int EatWhitespace( myFILE *InFile ) * * ------------------------------------------------------------------------ ** */ - { - int c; + +static int EatWhitespace( myFILE *InFile ) +{ + int c; - for( c = mygetc( InFile ); isspace( c ) && ('\n' != c); c = mygetc( InFile ) ) - ; - return( c ); - } /* EatWhitespace */ + for( c = mygetc( InFile ); isspace( c ) && ('\n' != c); c = mygetc( InFile ) ) + ; + return( c ); +} -static int EatComment( myFILE *InFile ) /* ------------------------------------------------------------------------ ** * Scan to the end of a comment. * @@ -169,13 +170,15 @@ static int EatComment( myFILE *InFile ) * * ------------------------------------------------------------------------ ** */ - { - int c; - for( c = mygetc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = mygetc( InFile ) ) - ; - return( c ); - } /* EatComment */ +static int EatComment( myFILE *InFile ) +{ + int c; + + for( c = mygetc( InFile ); ('\n'!=c) && (EOF!=c) && (c>0); c = mygetc( InFile ) ) + ; + return( c ); +} /***************************************************************************** * Scan backards within a string to discover if the last non-whitespace @@ -200,400 +203,373 @@ static int Continuation(char *line, int pos ) return (((pos >= 0) && ('\\' == line[pos])) ? pos : -1 ); } +/* ------------------------------------------------------------------------ ** + * Scan a section name, and pass the name to function sfunc(). + * + * Input: InFile - Input source. + * sfunc - Pointer to the function to be called if the section + * name is successfully read. + * + * Output: True if the section name was read and True was returned from + * . False if failed or if a lexical error was + * encountered. + * + * ------------------------------------------------------------------------ ** + */ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) - /* ------------------------------------------------------------------------ ** - * Scan a section name, and pass the name to function sfunc(). - * - * Input: InFile - Input source. - * sfunc - Pointer to the function to be called if the section - * name is successfully read. - * - * Output: True if the section name was read and True was returned from - * . False if failed or if a lexical error was - * encountered. - * - * ------------------------------------------------------------------------ ** - */ - { - int c; - int i; - int end; - const char *func = "params.c:Section() -"; - - i = 0; /* is the offset of the next free byte in bufr[] and */ - end = 0; /* is the current "end of string" offset. In most */ - /* cases these will be the same, but if the last */ - /* character written to bufr[] is a space, then */ - /* will be one less than . */ - - c = EatWhitespace( InFile ); /* We've already got the '['. Scan */ - /* past initial white space. */ - - while( (EOF != c) && (c > 0) ) - { - - /* Check that the buffer is big enough for the next character. */ - if( i > (bSize - 2) ) - { - char *tb; +{ + int c; + int i; + int end; + const char *func = "params.c:Section() -"; + + i = 0; /* is the offset of the next free byte in bufr[] and */ + end = 0; /* is the current "end of string" offset. In most */ + /* cases these will be the same, but if the last */ + /* character written to bufr[] is a space, then */ + /* will be one less than . */ + + c = EatWhitespace( InFile ); /* We've already got the '['. Scan */ + /* past initial white space. */ + + while( (EOF != c) && (c > 0) ) { + /* Check that the buffer is big enough for the next character. */ + if( i > (bSize - 2) ) { + char *tb; - tb = SMB_REALLOC( bufr, bSize +BUFR_INC ); - if( NULL == tb ) - { - DEBUG(0, ("%s Memory re-allocation failure.", func) ); - return( False ); - } - bufr = tb; - bSize += BUFR_INC; - } - - /* Handle a single character. */ - switch( c ) - { - case ']': /* Found the closing bracket. */ - bufr[end] = '\0'; - if( 0 == end ) /* Don't allow an empty name. */ - { - DEBUG(0, ("%s Empty section name in configuration file.\n", func )); - return( False ); - } - if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ - return( False ); - (void)EatComment( InFile ); /* Finish off the line. */ - return( True ); - - case '\n': /* Got newline before closing ']'. */ - i = Continuation( bufr, i ); /* Check for line continuation. */ - if( i < 0 ) - { - bufr[end] = '\0'; - DEBUG(0, ("%s Badly formed line in configuration file: %s\n", - func, bufr )); - return( False ); - } - end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); - c = mygetc( InFile ); /* Continue with next line. */ - break; - - default: /* All else are a valid name chars. */ - if( isspace( c ) ) /* One space per whitespace region. */ - { - bufr[end] = ' '; - i = end + 1; - c = EatWhitespace( InFile ); - } - else /* All others copy verbatim. */ - { - bufr[i++] = c; - end = i; - c = mygetc( InFile ); - } - } - } - - /* We arrive here if we've met the EOF before the closing bracket. */ - DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, bufr )); - return( False ); - } /* Section */ + tb = SMB_REALLOC( bufr, bSize +BUFR_INC ); + if( NULL == tb ) { + DEBUG(0, ("%s Memory re-allocation failure.", func) ); + return False; + } + bufr = tb; + bSize += BUFR_INC; + } + + /* Handle a single character. */ + switch( c ) { + case ']': /* Found the closing bracket. */ + bufr[end] = '\0'; + if( 0 == end ) { + /* Don't allow an empty name. */ + DEBUG(0, ("%s Empty section name in configuration file.\n", func )); + return False; + } + if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ + return False; + EatComment( InFile ); /* Finish off the line. */ + return True; + + case '\n': /* Got newline before closing ']'. */ + i = Continuation( bufr, i ); /* Check for line continuation. */ + if( i < 0 ) { + bufr[end] = '\0'; + DEBUG(0, ("%s Badly formed line in configuration file: %s\n", func, bufr )); + return False; + } + end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + c = mygetc( InFile ); /* Continue with next line. */ + break; + + default: /* All else are a valid name chars. */ + if(isspace( c )) { + /* One space per whitespace region. */ + bufr[end] = ' '; + i = end + 1; + c = EatWhitespace( InFile ); + } else { + bufr[i++] = c; + end = i; + c = mygetc( InFile ); + } + } + } + + /* We arrive here if we've met the EOF before the closing bracket. */ + DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, bufr )); + return False; +} + +/* ------------------------------------------------------------------------ ** + * Scan a parameter name and value, and pass these two fields to pfunc(). + * + * Input: InFile - The input source. + * pfunc - A pointer to the function that will be called to + * process the parameter, once it has been scanned. + * c - The first character of the parameter name, which + * would have been read by Parse(). Unlike a comment + * line or a section header, there is no lead-in + * character that can be discarded. + * + * Output: True if the parameter name and value were scanned and processed + * successfully, else False. + * + * Notes: This function is in two parts. The first loop scans the + * parameter name. Internal whitespace is compressed, and an + * equal sign (=) terminates the token. Leading and trailing + * whitespace is discarded. The second loop scans the parameter + * value. When both have been successfully identified, they are + * passed to pfunc() for processing. + * + * ------------------------------------------------------------------------ ** + */ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *), int c ) - /* ------------------------------------------------------------------------ ** - * Scan a parameter name and value, and pass these two fields to pfunc(). - * - * Input: InFile - The input source. - * pfunc - A pointer to the function that will be called to - * process the parameter, once it has been scanned. - * c - The first character of the parameter name, which - * would have been read by Parse(). Unlike a comment - * line or a section header, there is no lead-in - * character that can be discarded. - * - * Output: True if the parameter name and value were scanned and processed - * successfully, else False. - * - * Notes: This function is in two parts. The first loop scans the - * parameter name. Internal whitespace is compressed, and an - * equal sign (=) terminates the token. Leading and trailing - * whitespace is discarded. The second loop scans the parameter - * value. When both have been successfully identified, they are - * passed to pfunc() for processing. - * - * ------------------------------------------------------------------------ ** - */ - { - int i = 0; /* Position within bufr. */ - int end = 0; /* bufr[end] is current end-of-string. */ - int vstart = 0; /* Starting position of the parameter value. */ - const char *func = "params.c:Parameter() -"; - - /* Read the parameter name. */ - while( 0 == vstart ) /* Loop until we've found the start of the value. */ - { - - if( i > (bSize - 2) ) /* Ensure there's space for next char. */ - { - char *tb; - - tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); - if( NULL == tb ) - { - DEBUG(0, ("%s Memory re-allocation failure.", func) ); - return( False ); - } - bufr = tb; - bSize += BUFR_INC; - } - - switch( c ) - { - case '=': /* Equal sign marks end of param name. */ - if( 0 == end ) /* Don't allow an empty name. */ - { - DEBUG(0, ("%s Invalid parameter name in config. file.\n", func )); - return( False ); - } - bufr[end++] = '\0'; /* Mark end of string & advance. */ - i = end; /* New string starts here. */ - vstart = end; /* New string is parameter value. */ - bufr[i] = '\0'; /* New string is nul, for now. */ - break; - - case '\n': /* Find continuation char, else error. */ - i = Continuation( bufr, i ); - if( i < 0 ) - { - bufr[end] = '\0'; - DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", - func, bufr )); - return( True ); - } - end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); - c = mygetc( InFile ); /* Read past eoln. */ - break; - - case '\0': /* Shouldn't have EOF within param name. */ - case EOF: - bufr[i] = '\0'; - DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, bufr )); - return( True ); - - default: - if( isspace( c ) ) /* One ' ' per whitespace region. */ - { - bufr[end] = ' '; - i = end + 1; - c = EatWhitespace( InFile ); - } - else /* All others verbatim. */ - { - bufr[i++] = c; - end = i; - c = mygetc( InFile ); - } - } - } - - /* Now parse the value. */ - c = EatWhitespace( InFile ); /* Again, trim leading whitespace. */ - while( (EOF !=c) && (c > 0) ) - { - - if( i > (bSize - 2) ) /* Make sure there's enough room. */ - { - char *tb; - - tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); - if( NULL == tb ) - { - DEBUG(0, ("%s Memory re-allocation failure.", func) ); - return( False ); - } - bufr = tb; - bSize += BUFR_INC; - } - - switch( c ) - { - case '\r': /* Explicitly remove '\r' because the older */ - c = mygetc( InFile ); /* version called fgets_slash() which also */ - break; /* removes them. */ - - case '\n': /* Marks end of value unless there's a '\'. */ - i = Continuation( bufr, i ); - if( i < 0 ) - c = 0; - else - { - for( end = i; (end >= 0) && isspace((int)bufr[end]); end-- ) - ; - c = mygetc( InFile ); - } - break; - - default: /* All others verbatim. Note that spaces do */ - bufr[i++] = c; /* not advance . This allows trimming */ - if( !isspace( c ) ) /* of whitespace at the end of the line. */ - end = i; - c = mygetc( InFile ); - break; - } - } - bufr[end] = '\0'; /* End of value. */ - - return( pfunc( bufr, &bufr[vstart] ) ); /* Pass name & value to pfunc(). */ - } /* Parameter */ +{ + int i = 0; /* Position within bufr. */ + int end = 0; /* bufr[end] is current end-of-string. */ + int vstart = 0; /* Starting position of the parameter value. */ + const char *func = "params.c:Parameter() -"; + + /* Read the parameter name. */ + while( 0 == vstart ) { + /* Loop until we've found the start of the value. */ + if( i > (bSize - 2) ) { + /* Ensure there's space for next char. */ + char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + if( NULL == tb ) { + DEBUG(0, ("%s Memory re-allocation failure.", func) ); + return False; + } + bufr = tb; + bSize += BUFR_INC; + } + + switch(c) { + case '=': /* Equal sign marks end of param name. */ + if( 0 == end ) { + /* Don't allow an empty name. */ + DEBUG(0, ("%s Invalid parameter name in config. file.\n", func )); + return False; + } + bufr[end++] = '\0'; /* Mark end of string & advance. */ + i = end; /* New string starts here. */ + vstart = end; /* New string is parameter value. */ + bufr[i] = '\0'; /* New string is nul, for now. */ + break; + + case '\n': /* Find continuation char, else error. */ + i = Continuation( bufr, i ); + if( i < 0 ) { + bufr[end] = '\0'; + DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", func, bufr )); + return True; + } + end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + c = mygetc( InFile ); /* Read past eoln. */ + break; + + case '\0': /* Shouldn't have EOF within param name. */ + case EOF: + bufr[i] = '\0'; + DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, bufr )); + return True; + + default: + if(isspace( c )) { + /* One ' ' per whitespace region. */ + bufr[end] = ' '; + i = end + 1; + c = EatWhitespace( InFile ); + } else { + bufr[i++] = c; + end = i; + c = mygetc( InFile ); + } + } + } + + /* Now parse the value. */ + c = EatWhitespace( InFile ); /* Again, trim leading whitespace. */ + while( (EOF !=c) && (c > 0) ) { + if( i > (bSize - 2) ) { + /* Make sure there's enough room. */ + char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + if( NULL == tb ) { + DEBUG(0, ("%s Memory re-allocation failure.", func)); + return False; + } + bufr = tb; + bSize += BUFR_INC; + } + + switch(c) { + case '\r': /* Explicitly remove '\r' because the older */ + c = mygetc( InFile ); /* version called fgets_slash() which also */ + break; /* removes them. */ + + case '\n': /* Marks end of value unless there's a '\'. */ + i = Continuation( bufr, i ); + if( i < 0 ) { + c = 0; + } else { + for( end = i; (end >= 0) && isspace((int)bufr[end]); end-- ) + ; + c = mygetc( InFile ); + } + break; + + default: /* All others verbatim. Note that spaces do not advance . This allows trimming */ + bufr[i++] = c; + if( !isspace( c ) ) /* of whitespace at the end of the line. */ + end = i; + c = mygetc( InFile ); + break; + } + } + bufr[end] = '\0'; /* End of value. */ + + return( pfunc( bufr, &bufr[vstart] ) ); /* Pass name & value to pfunc(). */ +} + +/* ------------------------------------------------------------------------ ** + * Scan & parse the input. + * + * Input: InFile - Input source. + * sfunc - Function to be called when a section name is scanned. + * See Section(). + * pfunc - Function to be called when a parameter is scanned. + * See Parameter(). + * + * Output: True if the file was successfully scanned, else False. + * + * Notes: The input can be viewed in terms of 'lines'. There are four + * types of lines: + * Blank - May contain whitespace, otherwise empty. + * Comment - First non-whitespace character is a ';' or '#'. + * The remainder of the line is ignored. + * Section - First non-whitespace character is a '['. + * Parameter - The default case. + * + * ------------------------------------------------------------------------ ** + */ static BOOL Parse( myFILE *InFile, BOOL (*sfunc)(const char *), BOOL (*pfunc)(const char *, const char *) ) - /* ------------------------------------------------------------------------ ** - * Scan & parse the input. - * - * Input: InFile - Input source. - * sfunc - Function to be called when a section name is scanned. - * See Section(). - * pfunc - Function to be called when a parameter is scanned. - * See Parameter(). - * - * Output: True if the file was successfully scanned, else False. - * - * Notes: The input can be viewed in terms of 'lines'. There are four - * types of lines: - * Blank - May contain whitespace, otherwise empty. - * Comment - First non-whitespace character is a ';' or '#'. - * The remainder of the line is ignored. - * Section - First non-whitespace character is a '['. - * Parameter - The default case. - * - * ------------------------------------------------------------------------ ** - */ - { - int c; - - c = EatWhitespace( InFile ); - while( (EOF != c) && (c > 0) ) - { - switch( c ) - { - case '\n': /* Blank line. */ - c = EatWhitespace( InFile ); - break; - - case ';': /* Comment line. */ - case '#': - c = EatComment( InFile ); - break; - - case '[': /* Section Header. */ - if( !Section( InFile, sfunc ) ) - return( False ); - c = EatWhitespace( InFile ); - break; - - case '\\': /* Bogus backslash. */ - c = EatWhitespace( InFile ); - break; - - default: /* Parameter line. */ - if( !Parameter( InFile, pfunc, c ) ) - return( False ); - c = EatWhitespace( InFile ); - break; - } - } - return( True ); - } /* Parse */ +{ + int c; + + c = EatWhitespace( InFile ); + while( (EOF != c) && (c > 0) ) { + switch( c ) { + case '\n': /* Blank line. */ + c = EatWhitespace( InFile ); + break; + + case ';': /* Comment line. */ + case '#': + c = EatComment( InFile ); + break; + + case '[': /* Section Header. */ + if( !Section( InFile, sfunc ) ) + return False; + c = EatWhitespace( InFile ); + break; + + case '\\': /* Bogus backslash. */ + c = EatWhitespace( InFile ); + break; + + default: /* Parameter line. */ + if( !Parameter( InFile, pfunc, c ) ) + return False; + c = EatWhitespace( InFile ); + break; + } + } + return True; +} + +/* ------------------------------------------------------------------------ ** + * Open a configuration file. + * + * Input: FileName - The pathname of the config file to be opened. + * + * Output: A pointer of type (char **) to the lines of the file + * + * ------------------------------------------------------------------------ ** + */ static myFILE *OpenConfFile( const char *FileName ) - /* ------------------------------------------------------------------------ ** - * Open a configuration file. - * - * Input: FileName - The pathname of the config file to be opened. - * - * Output: A pointer of type (char **) to the lines of the file - * - * ------------------------------------------------------------------------ ** - */ - { - const char *func = "params.c:OpenConfFile() -"; - extern BOOL in_client; - int lvl = in_client?1:0; - myFILE *ret; - - ret = SMB_MALLOC_P(myFILE); - if (!ret) return NULL; - - ret->buf = file_load(FileName, &ret->size); - if( NULL == ret->buf ) - { - DEBUG( lvl, - ("%s Unable to open configuration file \"%s\":\n\t%s\n", - func, FileName, strerror(errno)) ); - SAFE_FREE(ret); - return NULL; - } - - ret->p = ret->buf; - return( ret ); - } /* OpenConfFile */ +{ + const char *func = "params.c:OpenConfFile() -"; + extern BOOL in_client; + int lvl = in_client?1:0; + myFILE *ret; + + ret = SMB_MALLOC_P(myFILE); + if (!ret) + return NULL; + + ret->buf = file_load(FileName, &ret->size); + if( NULL == ret->buf ) { + DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n", + func, FileName, strerror(errno)) ); + SAFE_FREE(ret); + return NULL; + } + + ret->p = ret->buf; + return( ret ); +} + +/* ------------------------------------------------------------------------ ** + * Process the named parameter file. + * + * Input: FileName - The pathname of the parameter file to be opened. + * sfunc - A pointer to a function that will be called when + * a section name is discovered. + * pfunc - A pointer to a function that will be called when + * a parameter name and value are discovered. + * + * Output: TRUE if the file was successfully parsed, else FALSE. + * + * ------------------------------------------------------------------------ ** + */ BOOL pm_process( const char *FileName, - BOOL (*sfunc)(const char *), - BOOL (*pfunc)(const char *, const char *) ) - /* ------------------------------------------------------------------------ ** - * Process the named parameter file. - * - * Input: FileName - The pathname of the parameter file to be opened. - * sfunc - A pointer to a function that will be called when - * a section name is discovered. - * pfunc - A pointer to a function that will be called when - * a parameter name and value are discovered. - * - * Output: TRUE if the file was successfully parsed, else FALSE. - * - * ------------------------------------------------------------------------ ** - */ - { - int result; - myFILE *InFile; - const char *func = "params.c:pm_process() -"; - - InFile = OpenConfFile( FileName ); /* Open the config file. */ - if( NULL == InFile ) - return( False ); - - DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) ); - - if( NULL != bufr ) /* If we already have a buffer */ - result = Parse( InFile, sfunc, pfunc ); /* (recursive call), then just */ - /* use it. */ - - else /* If we don't have a buffer */ - { /* allocate one, then parse, */ - bSize = BUFR_INC; /* then free. */ - bufr = (char *)SMB_MALLOC( bSize ); - if( NULL == bufr ) - { - DEBUG(0,("%s memory allocation failure.\n", func)); - myfile_close(InFile); - return( False ); - } - result = Parse( InFile, sfunc, pfunc ); - SAFE_FREE( bufr ); - bufr = NULL; - bSize = 0; - } - - myfile_close(InFile); - - if( !result ) /* Generic failure. */ - { - DEBUG(0,("%s Failed. Error returned from params.c:parse().\n", func)); - return( False ); - } - - return( True ); /* Generic success. */ - } /* pm_process */ - -/* -------------------------------------------------------------------------- */ + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) +{ + int result; + myFILE *InFile; + const char *func = "params.c:pm_process() -"; + + InFile = OpenConfFile( FileName ); /* Open the config file. */ + if( NULL == InFile ) + return False; + + DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) ); + + if( NULL != bufr ) { + /* If we already have a buffer */ + /* (recursive call), then just */ + /* use it. */ + result = Parse( InFile, sfunc, pfunc ); + } else { + bSize = BUFR_INC; + bufr = (char *)SMB_MALLOC( bSize ); + if( NULL == bufr ) { + DEBUG(0,("%s memory allocation failure.\n", func)); + myfile_close(InFile); + return False; + } + + result = Parse( InFile, sfunc, pfunc ); + SAFE_FREE( bufr ); + bufr = NULL; + bSize = 0; + } + + myfile_close(InFile); + + if( !result ) { + DEBUG(0,("%s Failed. Error returned from params.c:parse().\n", func)); + return False; + } + + return True; +} -- cgit From 413eb87493d5f4c2ed8e1f674b223e270fcb3667 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Feb 2005 21:06:11 +0000 Subject: r5543: Fix for bug #962 - using MB sharenames containing a ']' character. Processing a share name is now MB safe so long as the correct unix charset is in scope. Jeremy. (This used to be commit 5bd027e9ed095c01fc176178ff51b5839fe0c140) --- source3/param/params.c | 54 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 192223605a..9d21d25a24 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -107,6 +107,7 @@ typedef struct { char *buf; char *p; size_t size; + char *end_section_p; } myFILE; static int mygetc(myFILE *f) @@ -125,6 +126,22 @@ static void myfile_close(myFILE *f) SAFE_FREE(f); } +/* Find the end of the section. We must use mb functions for this. */ +static int FindSectionEnd(myFILE *f) +{ + f->end_section_p = strchr_m(f->p, ']'); + return f->end_section_p ? 1 : 0; +} + +static int AtSectionEnd(myFILE *f) +{ + if (f->p == f->end_section_p + 1) { + f->end_section_p = NULL; + return 1; + } + return 0; +} + /* -------------------------------------------------------------------------- ** * Functions... */ @@ -230,6 +247,13 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) /* character written to bufr[] is a space, then */ /* will be one less than . */ + + /* Find the end of the section. We must use mb functions for this. */ + if (!FindSectionEnd(InFile)) { + DEBUG(0, ("%s No terminating ']' character in section.\n", func) ); + return False; + } + c = EatWhitespace( InFile ); /* We've already got the '['. Scan */ /* past initial white space. */ @@ -247,20 +271,8 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) bSize += BUFR_INC; } - /* Handle a single character. */ + /* Handle a single character other than section end. */ switch( c ) { - case ']': /* Found the closing bracket. */ - bufr[end] = '\0'; - if( 0 == end ) { - /* Don't allow an empty name. */ - DEBUG(0, ("%s Empty section name in configuration file.\n", func )); - return False; - } - if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ - return False; - EatComment( InFile ); /* Finish off the line. */ - return True; - case '\n': /* Got newline before closing ']'. */ i = Continuation( bufr, i ); /* Check for line continuation. */ if( i < 0 ) { @@ -284,6 +296,21 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) c = mygetc( InFile ); } } + + if (AtSectionEnd(InFile)) { + /* Got to the closing bracket. */ + bufr[end] = '\0'; + if( 0 == end ) { + /* Don't allow an empty name. */ + DEBUG(0, ("%s Empty section name in configuration file.\n", func )); + return False; + } + if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ + return False; + EatComment( InFile ); /* Finish off the line. */ + return True; + } + } /* We arrive here if we've met the EOF before the closing bracket. */ @@ -513,6 +540,7 @@ static myFILE *OpenConfFile( const char *FileName ) } ret->p = ret->buf; + ret->end_section_p = NULL; return( ret ); } -- cgit From f0a683ec344b97b6bf29e1aa022378297813eb26 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 2 Mar 2005 20:30:37 +0000 Subject: r5628: Deprecate the write cache parameter - this code will go away soon. Jeremy. (This used to be commit 743cd4a53627cc2be5271fa78f6b0980a4407862) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 80843eda82..ac97956645 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -953,7 +953,7 @@ static struct parm_struct parm_table[] = { {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_ADVANCED}, {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, + {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED}, {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, -- cgit From 02fdabc2a7f0199bc5f42afb2c744f3c740122e4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 Mar 2005 03:43:57 +0000 Subject: r5636: Re-add the allocation size - parameterized by share as "allocation roundup size", by default set as 1Mb. From advice by BlueArc about Windows client behaviour. VC++ people can set this to zero to turn it off. Jeremy. (This used to be commit 833ca101772bfab65dbd79eb64f63464177f144e) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ac97956645..21abafb578 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -424,6 +424,7 @@ typedef struct BOOL bMap_acl_inherit; BOOL bAfs_Share; BOOL bEASupport; + int iallocation_roundup_size; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -549,6 +550,7 @@ static service sDefault = { False, /* bMap_acl_inherit */ False, /* bAfs_Share */ False, /* bEASupport */ + SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ NULL, /* Parametric options */ @@ -893,6 +895,7 @@ static struct parm_struct parm_table[] = { {N_("Protocol Options"), P_SEP, P_SEPARATOR}, + {"allocation roundup size", P_INTEGER, P_LOCAL, &sDefault.iallocation_roundup_size, NULL, NULL, FLAG_ADVANCED}, {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 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}, @@ -1931,6 +1934,7 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) +FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size); FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) -- cgit From 26462d905d63519ddbb551fc56f2b70da0a2167d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 8 Mar 2005 21:04:36 +0000 Subject: r5696: BUG 2355: use bsd style commands for 'printing = cups' but \!defined(HAVE_CUPS) (This used to be commit 5216728d82fcbdcba9a06f9730806ef4a4d6108f) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 21abafb578..d86f4b391a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1239,9 +1239,9 @@ static void init_printer_values(service *pService) string_set(&pService->szQueuepausecommand, ""); string_set(&pService->szQueueresumecommand, ""); #else - 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->szLpqcommand, "/usr/bin/lpq -P'%p'"); + string_set(&pService->szLprmcommand, "/usr/bin/lprm -P'%p' %j"); + string_set(&pService->szPrintcommand, "/usr/bin/lpr -P'%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'"); -- cgit From cc5ba986bf4c7b704ae5c3787f2f3881145e719c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Mar 2005 01:19:58 +0000 Subject: r5792: Added new parameter "inherit owner". If set on a share, the created file/directory will be owned by the same uid as the containing directory. Doing this for directories in a race-free mannor has only been tested on Linux (it depends on being able to open a directory and then do a fchown on that file descriptor). If this functionality is not available then the code silently downgrades to not changing the ownership of a new directory. This new parameter (docs to follow) finally makes it possible to create "drop boxes" on Samba, which requires all files within a directory to be commonly owned. A HOWTO on how to use this will follow. Jeremy. (This used to be commit 2e1f727184b9d025d2e3413bdd3d01d5ca803a41) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d86f4b391a..a75a19f85c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -413,6 +413,7 @@ typedef struct BOOL bBlockingLocks; BOOL bInheritPerms; BOOL bInheritACLS; + BOOL bInheritOwner; BOOL bMSDfsRoot; BOOL bUseClientDriver; BOOL bDefaultDevmode; @@ -539,6 +540,7 @@ static service sDefault = { True, /* bBlockingLocks */ False, /* bInheritPerms */ False, /* bInheritACLS */ + False, /* bInheritOwner */ False, /* bMSDfsRoot */ False, /* bUseClientDriver */ False, /* bDefaultDevmode */ @@ -864,6 +866,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"inherit owner", P_BOOL, P_LOCAL, &sDefault.bInheritOwner, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, @@ -1907,6 +1910,7 @@ FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) FN_LOCAL_BOOL(lp_inherit_acls, bInheritACLS) +FN_LOCAL_BOOL(lp_inherit_owner, bInheritOwner) FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver) FN_LOCAL_BOOL(lp_default_devmode, bDefaultDevmode) FN_LOCAL_BOOL(lp_force_printername, bForcePrintername) -- cgit From 5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Mar 2005 23:26:33 +0000 Subject: r6014: rather large change set.... pulling back all recent rpc changes from trunk into 3.0. I've tested a compile and so don't think I've missed any files. But if so, just mail me and I'll clean backup in a couple of hours. Changes include \winreg, \eventlog, \svcctl, and general parse_misc.c updates. I am planning on bracketing the event code with an #ifdef ENABLE_EVENTLOG until I finish merging Marcin's changes (very soon). (This used to be commit 4e0ac63c36527cd8c52ef720cae17e84f67e7221) --- source3/param/loadparm.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a75a19f85c..59d2db0527 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -183,8 +183,16 @@ typedef struct char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; + char *szEventLogOpenCommand; + char *szEventLogReadCommand; + char *szEventLogClearCommand; + char *szEventLogNumRecordsCommand; + char *szEventLogOldestRecordCommand; + char *szEventLogCloseCommand; + char **szEventLogs; char *szGuestaccount; char *szManglingMethod; + char **szServicesList; int mangle_prefix; int max_log_size; char *szLogLevel; @@ -583,6 +591,7 @@ 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 BOOL handle_eventlog( int snum, const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -935,6 +944,8 @@ static struct parm_struct parm_table[] = { {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, + {"enable svcctl", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, + {N_("Tuning Options"), P_SEP, P_SEPARATOR}, {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, @@ -978,6 +989,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"enable spoolss", P_BOOLREV, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_HIDE}, {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, @@ -1113,6 +1125,14 @@ static struct parm_struct parm_table[] = { {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED}, {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, + {N_("EventLog Options"), P_SEP, P_SEPARATOR}, + {"eventlog open command", P_STRING, P_GLOBAL, &Globals.szEventLogOpenCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog read command", P_STRING, P_GLOBAL, &Globals.szEventLogReadCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog clear command", P_STRING, P_GLOBAL, &Globals.szEventLogClearCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog num records command", P_STRING, P_GLOBAL, &Globals.szEventLogNumRecordsCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog oldest record command", P_STRING, P_GLOBAL, &Globals.szEventLogOldestRecordCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, @@ -1381,7 +1401,7 @@ static void init_globals(void) Globals.AlgorithmicRidBase = BASE_RID; Globals.bLoadPrinters = True; - Globals.PrintcapCacheTime = 0; + Globals.PrintcapCacheTime = 750; /* 12.5 minutes */ /* 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; @@ -1530,6 +1550,12 @@ static void init_globals(void) string_set(&Globals.szAclCompat, ""); string_set(&Globals.szCupsServer, ""); + string_set(&Globals.szEventLogOpenCommand, ""); + string_set(&Globals.szEventLogReadCommand, ""); + string_set(&Globals.szEventLogClearCommand, ""); + string_set(&Globals.szEventLogNumRecordsCommand, ""); + string_set(&Globals.szEventLogOldestRecordCommand, ""); + Globals.winbind_cache_time = 300; /* 5 minutes */ Globals.bWinbindEnableLocalAccounts = False; Globals.bWinbindEnumUsers = True; @@ -1556,6 +1582,8 @@ static void init_globals(void) operations as root */ Globals.bEnablePrivileges = False; + + Globals.szServicesList = str_list_make( "Spooler NETLOGON", NULL ); } static TALLOC_CTX *lp_talloc; @@ -1722,6 +1750,7 @@ 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_LIST(lp_idmap_backend, &Globals.szIdmapBackend) FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm) @@ -1741,6 +1770,14 @@ 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_STRING(lp_eventlog_open_cmd, &Globals.szEventLogOpenCommand) +FN_GLOBAL_STRING(lp_eventlog_read_cmd, &Globals.szEventLogReadCommand) +FN_GLOBAL_STRING(lp_eventlog_clear_cmd, &Globals.szEventLogClearCommand) +FN_GLOBAL_STRING(lp_eventlog_num_records_cmd, &Globals.szEventLogNumRecordsCommand) +FN_GLOBAL_STRING(lp_eventlog_oldest_record_cmd, &Globals.szEventLogOldestRecordCommand) +FN_GLOBAL_STRING(lp_eventlog_close_cmd, &Globals.szEventLogCloseCommand) +FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) + FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) @@ -1838,6 +1875,7 @@ FN_LOCAL_STRING(lp_username, szUsername) FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers) FN_LOCAL_LIST(lp_valid_users, szValidUsers) FN_LOCAL_LIST(lp_admin_users, szAdminUsers) +FN_GLOBAL_LIST(lp_enable_svcctl, &Globals.szServicesList) FN_LOCAL_STRING(lp_cups_options, szCupsOptions) FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) FN_LOCAL_STRING(lp_printcommand, szPrintcommand) @@ -2769,6 +2807,12 @@ static BOOL handle_charset(int snum, const char *pszParmValue, char **ptr) return True; } +static BOOL handle_eventlog(int snum, const char *pszParmValue, char **ptr) +{ + string_set(ptr, pszParmValue); + return True; +} + static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr) { BOOL ret; -- cgit From 717845f1093df1205a8d4b0f40480002acb6cafc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Mar 2005 21:31:01 +0000 Subject: r6104: Update dos filetimes to default yes for Office 2000. Jeremy. (This used to be commit d1ff66f6cde844bf0312747c50b402e81846891f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 59d2db0527..f28b0c49ae 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -542,7 +542,7 @@ static service sDefault = { False, /* bFakeOplocks */ False, /* bDeleteVetoFiles */ False, /* bDosFilemode */ - False, /* bDosFiletimes */ + True, /* bDosFiletimes */ False, /* bDosFiletimeResolution */ False, /* bFakeDirCreateTimes */ True, /* bBlockingLocks */ -- cgit From 8de11f06df03e19fe92f44da10a10eab30e118b2 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Thu, 31 Mar 2005 20:28:47 +0000 Subject: r6155: Fixes bug #1133 Added provision for overloading some global configuration options via the new, per-user file ~/.smb/smb.conf.append which is read after the global config file is read (and only if the global config file was read). This leave the original, BC behavior of ~/.smb/smb.conf which, if found, is read but causes the global config file to not be read. Also fixed a potential seg fault in to lp_dump_one(). (This used to be commit 2c5a6305bd127b1a7e65356c2b3aa5c13cd2bd74) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f28b0c49ae..8ec7efddcd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -73,7 +73,7 @@ extern pstring user_socket_options; /* some helpful bits */ #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && ServicePtrs[(i)]->valid) -#define VALID(i) ServicePtrs[i]->valid +#define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid) int keepalive = DEFAULT_KEEPALIVE; BOOL use_getwd_cache = True; -- cgit From 978ca8486031e43754a3c23757f361bf3a85f335 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Wed, 6 Apr 2005 16:28:04 +0000 Subject: r6225: get rid of warnings from my compiler about nested externs (This used to be commit efea76ac71412f8622cd233912309e91b9ea52da) --- source3/param/loadparm.c | 2 +- source3/param/params.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8ec7efddcd..ad952b6362 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -58,6 +58,7 @@ BOOL bLoaded = False; extern userdom_struct current_user_info; extern pstring user_socket_options; +extern enum protocol_types Protocol; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -4359,7 +4360,6 @@ const char *lp_printcapname(void) BOOL lp_use_sendfile(int snum) { - 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; diff --git a/source3/param/params.c b/source3/param/params.c index 9d21d25a24..3b736113be 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -81,6 +81,8 @@ #include "includes.h" +extern BOOL in_client; + /* -------------------------------------------------------------------------- ** * Constants... */ @@ -523,7 +525,6 @@ static BOOL Parse( myFILE *InFile, static myFILE *OpenConfFile( const char *FileName ) { const char *func = "params.c:OpenConfFile() -"; - extern BOOL in_client; int lvl = in_client?1:0; myFILE *ret; -- cgit From ecc6933a86dfc61b49ce907cf444cc45d2e3f8d5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Apr 2005 20:59:37 +0000 Subject: r6240: Fix for bug #2581. Add size limit (in kb) to stat cache. Jeremy. (This used to be commit 836b73d0018c3137b7a924b6345e69ae5d23431d) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ad952b6362..619a9ccb3d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -281,6 +281,7 @@ typedef struct BOOL bNTPipeSupport; BOOL bNTStatusSupport; BOOL bStatCache; + int iMaxStatCacheSize; BOOL bKernelOplocks; BOOL bAllowTrustedDomains; BOOL bLanmanAuth; @@ -1033,6 +1034,7 @@ static struct parm_struct parm_table[] = { {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, 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 }, + {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1462,6 +1464,7 @@ static void init_globals(void) Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTStatusSupport = True; /* Use NT status by default. */ Globals.bStatCache = True; /* use stat cache by default */ + Globals.iMaxStatCacheSize = 0; /* unlimited size in kb by default. */ Globals.restrict_anonymous = 0; Globals.bClientLanManAuth = True; /* Do use the LanMan hash if it is available */ Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ @@ -1814,6 +1817,7 @@ FN_GLOBAL_INTEGER(lp_passwd_chat_timeout, &Globals.iPasswdChatTimeout) 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_INTEGER(lp_max_stat_cache_size, &Globals.iMaxStatCacheSize) FN_GLOBAL_BOOL(lp_allow_trusted_domains, &Globals.bAllowTrustedDomains) FN_GLOBAL_INTEGER(lp_restrict_anonymous, &Globals.restrict_anonymous) FN_GLOBAL_BOOL(lp_lanman_auth, &Globals.bLanmanAuth) -- cgit From d3d6126d94d55a69c45b2f7a63a7fa9b561baf48 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 15 Apr 2005 13:41:49 +0000 Subject: r6351: This is quite a large and intrusive patch, but there are not many pieces that can be taken out of it, so I decided to commit this in one lump. It changes the passdb enumerating functions to use ldap paged results where possible. In particular the samr calls querydispinfo, enumdomusers and friends have undergone significant internal changes. I have tested this extensively with rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will follow later. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code is based on a first implementation by Günther Deschner, but has evolved quite a bit since then. Volker (This used to be commit f0bb44ac58e190e19eb4e92928979b0446e611c9) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 619a9ccb3d..06070b0700 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -246,6 +246,7 @@ typedef struct int ldap_passwd_sync; int ldap_replication_sleep; int ldap_timeout; /* This is initialised in init_globals */ + int ldap_page_size; BOOL ldap_delete_dn; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; @@ -1121,6 +1122,7 @@ static struct parm_struct parm_table[] = { {"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 page size", P_INTEGER, P_GLOBAL, &Globals.ldap_page_size, NULL, NULL, FLAG_ADVANCED}, {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED}, {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, @@ -1512,6 +1514,7 @@ static void init_globals(void) Globals.ldap_delete_dn = False; Globals.ldap_replication_sleep = 1000; /* wait 1 sec for replication */ Globals.ldap_timeout = LDAP_CONNECT_DEFAULT_TIMEOUT; + Globals.ldap_page_size = LDAP_PAGE_SIZE; /* 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 @@ -1770,6 +1773,7 @@ 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_INTEGER(lp_ldap_page_size, &Globals.ldap_page_size) 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) -- cgit From 7b9d6ac23e1a7d8136fffd2e3977b09a815da65a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 May 2005 07:33:49 +0000 Subject: r6595: This is Volkers new-talloc patch. Just got the go-ahead from Volker to commit. Woo Hoo ! Jeremy. (This used to be commit 316df944a456f150944761dab34add5e8c4ab699) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 06070b0700..14bec052b8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1603,7 +1603,7 @@ void lp_talloc_free(void) { if (!lp_talloc) return; - talloc_destroy(lp_talloc); + talloc_free(lp_talloc); lp_talloc = NULL; } -- cgit From 90e9f18c2c1de9b159b83de3a46cdbcc7b4f7ed2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 10 May 2005 01:32:43 +0000 Subject: r6686: strip the directory path from cups printin defaults (This used to be commit 8fde2a80602d6f58974d0c0f6182abda58bbe0f4) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 14bec052b8..5a2b807e0c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1267,13 +1267,13 @@ static void init_printer_values(service *pService) string_set(&pService->szQueuepausecommand, ""); string_set(&pService->szQueueresumecommand, ""); #else - string_set(&pService->szLpqcommand, "/usr/bin/lpq -P'%p'"); - string_set(&pService->szLprmcommand, "/usr/bin/lprm -P'%p' %j"); - string_set(&pService->szPrintcommand, "/usr/bin/lpr -P'%p' %s; rm %s"); + string_set(&pService->szLpqcommand, "lpq -P'%p'"); + string_set(&pService->szLprmcommand, "lprm -P'%p' %j"); + string_set(&pService->szPrintcommand, "lpr -P'%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'"); + string_set(&pService->szQueuepausecommand, "disable '%p'"); + string_set(&pService->szQueueresumecommand, "enable '%p'"); #endif /* HAVE_CUPS */ break; -- cgit From ab964c6cd7c5eee4bf1deaef4acecbd0dfaa784c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 14 May 2005 15:50:35 +0000 Subject: r6785: deprecating the printer admin parameter (This used to be commit 0826feafd7a7eec56093c303fcb250a61bef607f) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5a2b807e0c..8043f8864d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -855,7 +855,7 @@ static struct parm_struct parm_table[] = { {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT}, + {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT | FLAG_DEPRECATED }, {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED}, @@ -922,7 +922,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"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}, -- cgit From bd16770954424d86298a57d6c59aa69d5b42ce07 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 18 May 2005 23:37:35 +0000 Subject: r6895: Add "acl check permissions" to turn on/off the new behaviour of checking for write access in a directory before delete. Also controls checking for write access before labeling a file read-only if DOS attributes are not being stored in EA's. Docuementation to follow. Jeremy. (This used to be commit dd1a5e6e499dd721c5bb8d56a61810a7454a3449) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8043f8864d..0ddd6bb0c7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -436,6 +436,7 @@ typedef struct BOOL bMap_acl_inherit; BOOL bAfs_Share; BOOL bEASupport; + BOOL bAclCheckPermissions; int iallocation_roundup_size; param_opt_struct *param_opt; @@ -563,6 +564,7 @@ static service sDefault = { False, /* bMap_acl_inherit */ False, /* bAfs_Share */ False, /* bEASupport */ + True, /* bAclCheckPermissions */ SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ NULL, /* Parametric options */ @@ -865,6 +867,7 @@ static struct parm_struct parm_table[] = { {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, + {"acl check permissions", P_BOOL, P_LOCAL, &sDefault.bAclCheckPermissions, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, @@ -1968,6 +1971,7 @@ FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) +FN_LOCAL_BOOL(lp_acl_check_permissions, bAclCheckPermissions) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From f0c650a38286c07b9f3e83139c15bfbadc70ad5f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 23 May 2005 16:25:31 +0000 Subject: r6942: * merging the registry changes back to the 3.0 tree * removing the testprns tool (This used to be commit 81ffb0dbbbd244623507880c323a3c37e2b8dc4d) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0ddd6bb0c7..ac6dbb4d4a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -304,6 +304,7 @@ typedef struct BOOL bUseKerberosKeytab; BOOL bDeferSharingViolations; BOOL bEnablePrivileges; + BOOL bASUSupport; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -950,6 +951,7 @@ static struct parm_struct parm_table[] = { {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, + {"enable asu support", P_BOOL, P_GLOBAL, &Globals.bASUSupport, NULL, NULL, FLAG_ADVANCED}, {"enable svcctl", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, {N_("Tuning Options"), P_SEP, P_SEPARATOR}, @@ -1593,6 +1595,8 @@ static void init_globals(void) Globals.bEnablePrivileges = False; + Globals.bASUSupport = True; + Globals.szServicesList = str_list_make( "Spooler NETLOGON", NULL ); } @@ -1844,6 +1848,7 @@ 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_BOOL(lp_enable_asu_support, &Globals.bASUSupport) 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) @@ -4007,6 +4012,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, /* When 'restrict anonymous = 2' guest connections to ipc$ are denied */ lp_add_ipc("IPC$", (lp_restrict_anonymous() < 2)); + if ( lp_enable_asu_support() ) lp_add_ipc("ADMIN$", False); } -- cgit From af52df2f1fde76b518bf946e396bc29869aa6964 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 27 May 2005 13:58:04 +0000 Subject: r7020: fixing printer ace values and getting rid of false compiler warning about unitialized variable (This used to be commit 3a91b20e4bcc78c91932e6c4394b3f6f153b2ff5) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ac6dbb4d4a..c90d214be6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -754,6 +754,7 @@ static const struct enum_list enum_smb_signing_vals[] = { are rejected, unless the username does not exist, in which case it is treated as a guest login + {MAP_TO_GUEST_ON_VALID_DOMAIN_USER, "Non-UNIX Valid Domain User"}, "Bad Password" means session setups with an invalid password are treated as a guest login -- cgit From cc6df2e9cf5b31f83cf88d21457b32712d90f04b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 27 May 2005 14:19:57 +0000 Subject: r7024: reverting mistaken commit (This used to be commit c70c5c4ee9b14fbdb174f542607aceebe0e88470) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c90d214be6..ac6dbb4d4a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -754,7 +754,6 @@ static const struct enum_list enum_smb_signing_vals[] = { are rejected, unless the username does not exist, in which case it is treated as a guest login - {MAP_TO_GUEST_ON_VALID_DOMAIN_USER, "Non-UNIX Valid Domain User"}, "Bad Password" means session setups with an invalid password are treated as a guest login -- cgit From 450e8d5749504f8392c0cfe8b79218f03b88076a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 31 May 2005 02:23:47 +0000 Subject: r7130: remove 'winbind enable local accounts' code from the 3.0 tree (This used to be commit 318c3db4cb1c85be40b2f812f781bcf5f1da5c19) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ac6dbb4d4a..aeca0fab43 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -173,7 +173,6 @@ typedef struct char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; - BOOL bWinbindEnableLocalAccounts; BOOL bWinbindEnumUsers; BOOL bWinbindEnumGroups; BOOL bWinbindUseDefaultDomain; @@ -1222,7 +1221,6 @@ static struct parm_struct parm_table[] = { {"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|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}, @@ -1569,7 +1567,6 @@ static void init_globals(void) string_set(&Globals.szEventLogOldestRecordCommand, ""); Globals.winbind_cache_time = 300; /* 5 minutes */ - Globals.bWinbindEnableLocalAccounts = False; Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; @@ -1757,7 +1754,6 @@ FN_GLOBAL_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) -FN_GLOBAL_BOOL(lp_winbind_enable_local_accounts, &Globals.bWinbindEnableLocalAccounts) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) -- cgit From 27ccf6ba6abd6815212b7520a986b904e9b27669 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 31 May 2005 16:09:58 +0000 Subject: r7142: removing 'ldap filter' smb.conf option (This used to be commit e2f8eeb4e26e8f7bec4d9dc820b86a7b548f82da) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index aeca0fab43..2c6a93483d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -238,7 +238,6 @@ typedef struct #endif int ldap_ssl; char *szLdapSuffix; - char *szLdapFilter; char *szLdapAdminDn; char *szAclCompat; char *szCupsServer; @@ -1116,7 +1115,6 @@ static struct parm_struct parm_table[] = { #endif {"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 machine suffix", P_STRING, P_GLOBAL, &Globals.szLdapMachineSuffix, NULL, NULL, FLAG_ADVANCED}, @@ -1505,7 +1503,6 @@ static void init_globals(void) #endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); - string_set(&Globals.szLdapFilter, "(uid=%u)"); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); string_set(&Globals.szLdapGroupSuffix, ""); @@ -1769,7 +1766,6 @@ FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) #endif FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -FN_GLOBAL_STRING(lp_ldap_filter, &Globals.szLdapFilter) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) FN_GLOBAL_INTEGER(lp_ldap_passwd_sync, &Globals.ldap_passwd_sync) -- cgit From 377f947930f3a3fe69c21d5b9386642cbf8b3df7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 14:23:49 +0000 Subject: r7395: * new feature 'map to guest = bad uid' (based on patch from aruna.prabakar@hp.com). This re-enables the Samba 2.2 behavior where a user that was successfully authenticated by a remote DC would be mapped to the guest account if there was not existing UNIX account for that user and we could not create one. (This used to be commit b7455fbf81f4e47c087c861f70d492a328730a9b) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2c6a93483d..7089bbfd6a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -763,6 +763,7 @@ static const struct enum_list enum_map_to_guest[] = { {NEVER_MAP_TO_GUEST, "Never"}, {MAP_TO_GUEST_ON_BAD_USER, "Bad User"}, {MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"}, + {MAP_TO_GUEST_ON_BAD_UID, "Bad Uid"}, {-1, NULL} }; -- cgit From 0da9b4b336a24c184f097b46a46ffd9585f4a710 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 14:37:14 +0000 Subject: r7396: cleaning up vestiges of winbind local accounts code (This used to be commit c57c23cf52184171ac588c2919dc4ee4e68f2431) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7089bbfd6a..9ac1d7a075 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -169,7 +169,6 @@ typedef struct char *szIdmapGID; BOOL bEnableRidAlgorithm; int AlgorithmicRidBase; - char *szTemplatePrimaryGroup; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; @@ -1215,7 +1214,6 @@ static struct parm_struct parm_table[] = { {"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}, {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE}, - {"template primary group", P_STRING, P_GLOBAL, &Globals.szTemplatePrimaryGroup, NULL, NULL, FLAG_ADVANCED}, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, 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}, @@ -1553,7 +1551,6 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); - string_set(&Globals.szTemplatePrimaryGroup, "nobody"); string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); string_set(&Globals.szCupsServer, ""); @@ -1747,7 +1744,6 @@ 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_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -- cgit From fed660877c16562265327c6093ea645cf4176b5c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 22:10:34 +0000 Subject: r7415: * big change -- volker's new async winbindd from trunk (This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9ac1d7a075..339624a9a8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -225,6 +225,7 @@ typedef struct int min_passwd_length; int oplock_break_wait_time; int winbind_cache_time; + int winbind_max_idle_children; int iLockSpinCount; int iLockSpinTime; char *szLdapMachineSuffix; @@ -1223,6 +1224,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1567,6 +1569,7 @@ static void init_globals(void) Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = False; + Globals.winbind_max_idle_children = 3; Globals.bEnableRidAlgorithm = True; @@ -1986,6 +1989,7 @@ FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size); FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) +FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) -- cgit From bf66eb3a92a0b111f005826696430d934d1187e5 Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Sun, 12 Jun 2005 16:00:29 +0000 Subject: r7511: Add three new command line switches to testparm: --show-all-parameters Enumerates all available parameters, grouped in to sections [local] and [global] by the class of the parameter. Each line is formated name=type[,enum values],flags --parameter-name Display the setting of the named parameter. The global section is assumed if no other is set with --section-name --section-name Limit the view of testparm to the named section. Use 'global' to only view the settings of the global section. This fixes bug #2767. Lars (This used to be commit a1b82624d739b1066c356dd4b689233f3c36814e) --- source3/param/loadparm.c | 104 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 339624a9a8..c0fbb1b77a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2519,6 +2519,59 @@ static int map_parameter(const char *pszParmName) return (-1); } +/*************************************************************************** + Show all parameter's name, type, [values,] and flags. +***************************************************************************/ + +void show_parameter_list(void) +{ + int classIndex, parmIndex, enumIndex, flagIndex; + BOOL hadFlag; + char *section_names[] = { "local", "global", NULL}; + char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", + "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", + "P_UGSTRING", "P_ENUM", "P_SEP"}; + unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, + FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, + FLAG_HIDE, FLAG_DOS_STRING}; + char *flag_names[] = { "FLAG_BASIC", "FLAG_SHARE", "FLAG_PRINT", + "FLAG_GLOBAL", "FLAG_WIZARD", "FLAG_ADVANCED", "FLAG_DEVELOPER", + "FLAG_DEPRECATED", "FLAG_HIDE", "FLAG_DOS_STRING", NULL}; + + for ( classIndex=0; section_names[classIndex]; classIndex++) { + printf("[%s]\n", section_names[classIndex]); + for (parmIndex = 0; parm_table[parmIndex].label; parmIndex++) { + if (parm_table[parmIndex].class == classIndex) { + printf("%s=%s", + parm_table[parmIndex].label, + type[parm_table[parmIndex].type]); + switch (parm_table[parmIndex].type) { + case P_ENUM: + printf(","); + for (enumIndex=0; parm_table[parmIndex].enum_list[enumIndex].name; enumIndex++) + printf("%s%s", + enumIndex ? "|" : "", + parm_table[parmIndex].enum_list[enumIndex].name); + break; + default: + break; + } + printf(","); + hadFlag = False; + for ( flagIndex=0; flag_names[flagIndex]; flagIndex++ ) { + if (parm_table[parmIndex].flags & flags[flagIndex]) { + printf("%s%s", + hadFlag ? "|" : "", + flag_names[flagIndex]); + hadFlag = True; + } + } + printf("\n"); + } + } + } +} + /*************************************************************************** Set a boolean variable from the text value stored in the passed string. Returns True in success, False if the passed string does not correctly @@ -3542,7 +3595,7 @@ static void dump_globals(FILE *f) int i; param_opt_struct *data; - fprintf(f, "# Global parameters\n[global]\n"); + fprintf(f, "[global]\n"); for (i = 0; parm_table[i].label; i++) if (parm_table[i].class == P_GLOBAL && @@ -3587,7 +3640,7 @@ static void dump_a_service(service * pService, FILE * f) param_opt_struct *data; if (pService != &sDefault) - fprintf(f, "\n[%s]\n", pService->szService); + fprintf(f, "[%s]\n", pService->szService); for (i = 0; parm_table[i].label; i++) { @@ -3627,6 +3680,49 @@ static void dump_a_service(service * pService, FILE * f) } } +/*************************************************************************** + Display the contents of a parameter of a single services record. +***************************************************************************/ + +BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) +{ + service * pService = ServicePtrs[snum]; + int i, result = False; + parm_class class; + unsigned flag = 0; + void *ptr; + + if (isGlobal) { + class = P_GLOBAL; + flag = FLAG_GLOBAL; + } else + class = P_LOCAL; + + for (i = 0; parm_table[i].label; i++) { + if (strwicmp(parm_table[i].label, parm_name) == 0 && + (parm_table[i].class == class || parm_table[i].flags & flag) && + parm_table[i].ptr && + (*parm_table[i].label != '-') && + (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) + { + void *ptr; + + if (isGlobal) + ptr = parm_table[i].ptr; + else + ptr = ((char *)pService) + + PTR_DIFF(parm_table[i].ptr, &sDefault); + + print_parameter(&parm_table[i], + ptr, f); + fprintf(f, "\n"); + result = True; + break; + } + } + + return result; +} /*************************************************************************** Return info about the next service in a service. snum==GLOBAL_SECTION_SNUM gives the globals. @@ -4059,8 +4155,10 @@ void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) dump_a_service(&sDefault, f); - for (iService = 0; iService < maxtoprint; iService++) + for (iService = 0; iService < maxtoprint; iService++) { + fprintf(f,"\n"); lp_dump_one(f, show_defaults, iService); + } } /*************************************************************************** -- cgit From 0fe12bf9018131d846af6b9e6f40d6337dbbde19 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Jun 2005 09:33:09 +0000 Subject: r7529: Apply some const, remove unused variable. Guenther (This used to be commit bc419472e295945559cf83f6ed9febff29adcfc1) --- source3/param/loadparm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c0fbb1b77a..bfd7b650cb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2527,14 +2527,14 @@ void show_parameter_list(void) { int classIndex, parmIndex, enumIndex, flagIndex; BOOL hadFlag; - char *section_names[] = { "local", "global", NULL}; - char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", + const char *section_names[] = { "local", "global", NULL}; + const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", "P_UGSTRING", "P_ENUM", "P_SEP"}; unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, FLAG_HIDE, FLAG_DOS_STRING}; - char *flag_names[] = { "FLAG_BASIC", "FLAG_SHARE", "FLAG_PRINT", + const char *flag_names[] = { "FLAG_BASIC", "FLAG_SHARE", "FLAG_PRINT", "FLAG_GLOBAL", "FLAG_WIZARD", "FLAG_ADVANCED", "FLAG_DEVELOPER", "FLAG_DEPRECATED", "FLAG_HIDE", "FLAG_DOS_STRING", NULL}; @@ -3690,7 +3690,6 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) int i, result = False; parm_class class; unsigned flag = 0; - void *ptr; if (isGlobal) { class = P_GLOBAL; -- cgit From 5b678f7a8469e345a6b25fa19ea1a20fce939a21 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Jun 2005 15:18:18 +0000 Subject: r7610: can successfully stop and start the 'spooler' service by setting the state for the 'disable spoolss' parameter in memory for an individual smbd (This used to be commit f19c10d0c3e7701066b765c712df0636e914bf7e) --- source3/param/loadparm.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bfd7b650cb..0083b50820 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1860,7 +1860,7 @@ FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) -FN_GLOBAL_INTEGER(lp_disable_spoolss, &Globals.bDisableSpoolss) +FN_GLOBAL_INTEGER(_lp_disable_spoolss, &Globals.bDisableSpoolss) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) @@ -4466,6 +4466,32 @@ const char *lp_printcapname(void) Ensure we don't use sendfile if server smb signing is active. ********************************************************************/ +static uint32 spoolss_state; + +BOOL lp_disable_spoolss( void ) +{ + if ( spoolss_state == SVCCTL_STATE_UNKNOWN ) + spoolss_state = _lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING; + + return spoolss_state == SVCCTL_STOPPED ? True : False; +} + +void lp_set_spoolss_state( uint32 state ) +{ + SMB_ASSERT( (state == SVCCTL_STOPPED) || (state == SVCCTL_RUNNING) ); + + spoolss_state = state; +} + +uint32 lp_get_spoolss_state( void ) +{ + return lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING; +} + +/******************************************************************* + Ensure we don't use sendfile if server smb signing is active. +********************************************************************/ + BOOL lp_use_sendfile(int snum) { /* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */ -- cgit From 7e509e9b99a18495bde01a990e37de70bae35aac Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Jun 2005 21:20:41 +0000 Subject: r7842: With the patch I sent Steve yesterday this gives us complete POSIX pathnames. ie. files containing : and \ can be accessed from Linux. Jeremy. (This used to be commit e9b8d23d6138d909a65ea70b2e801881e8333b38) --- source3/param/loadparm.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0083b50820..fd0154d275 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4523,3 +4523,29 @@ void set_store_dos_attributes(int snum, BOOL val) return; ServicePtrs[(snum)]->bStoreDosAttributes = val; } + +void lp_set_mangling_method(const char *new_method) +{ + string_set(&Globals.szManglingMethod, new_method); +} + +/******************************************************************* + Global state for POSIX pathname processing. +********************************************************************/ + +static BOOL posix_pathnames; + +BOOL lp_posix_pathnames(void) +{ + return posix_pathnames; +} + +/******************************************************************* + Change everything needed to ensure POSIX pathname processing (currently + not much). +********************************************************************/ + +void lp_set_posix_pathnames(void) +{ + posix_pathnames = True; +} -- cgit From 19ca97a70f6b7b41d251eaa76e4d3c980c6eedff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Jun 2005 20:25:18 +0000 Subject: r7882: Looks like a large patch - but what it actually does is make Samba safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a) --- source3/param/loadparm.c | 46 +++++++++++++++++++++++----------------------- source3/param/params.c | 6 +++--- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fd0154d275..2456304261 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1338,7 +1338,7 @@ static void init_globals(void) if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].ptr) - string_set(parm_table[i].ptr, ""); + string_set((char **)parm_table[i].ptr, ""); string_set(&sDefault.fstype, FSTYPE_STRING); @@ -2272,12 +2272,12 @@ static void free_service(service *pservice) for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && - parm_table[i].class == P_LOCAL) + parm_table[i].p_class == P_LOCAL) string_free((char **) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); else if (parm_table[i].type == P_LIST && - parm_table[i].class == P_LOCAL) + parm_table[i].p_class == P_LOCAL) str_list_free((char ***) (((char *)pservice) + PTR_DIFF(parm_table[i].ptr, &sDefault))); @@ -2541,7 +2541,7 @@ void show_parameter_list(void) for ( classIndex=0; section_names[classIndex]; classIndex++) { printf("[%s]\n", section_names[classIndex]); for (parmIndex = 0; parm_table[parmIndex].label; parmIndex++) { - if (parm_table[parmIndex].class == classIndex) { + if (parm_table[parmIndex].p_class == classIndex) { printf("%s=%s", parm_table[parmIndex].label, type[parm_table[parmIndex].type]); @@ -2632,7 +2632,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL BOOL not_added; for (i = 0; parm_table[i].label; i++) - if (parm_table[i].ptr && parm_table[i].class == P_LOCAL && + if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && (bcopyall || pcopymapDest[i])) { void *def_ptr = parm_table[i].ptr; void *src_ptr = @@ -2659,12 +2659,12 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL break; case P_STRING: - string_set(dest_ptr, + string_set((char **)dest_ptr, *(char **)src_ptr); break; case P_USTRING: - string_set(dest_ptr, + string_set((char **)dest_ptr, *(char **)src_ptr); strupper_m(*(char **)dest_ptr); break; @@ -3268,7 +3268,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue if (snum < 0) { parm_ptr = def_ptr; } else { - if (parm_table[parmnum].class == P_GLOBAL) { + if (parm_table[parmnum].p_class == P_GLOBAL) { DEBUG(0, ("Global parameter %s found in service section!\n", pszParmName)); @@ -3300,11 +3300,11 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue switch (parm_table[parmnum].type) { case P_BOOL: - set_boolean(parm_ptr, pszParmValue); + set_boolean((BOOL *)parm_ptr, pszParmValue); break; case P_BOOLREV: - set_boolean(parm_ptr, pszParmValue); + set_boolean((BOOL *)parm_ptr, pszParmValue); *(BOOL *)parm_ptr = !*(BOOL *)parm_ptr; break; @@ -3321,16 +3321,16 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_LIST: - str_list_free(parm_ptr); + str_list_free((char ***)parm_ptr); *(char ***)parm_ptr = str_list_make(pszParmValue, NULL); break; case P_STRING: - string_set(parm_ptr, pszParmValue); + string_set((char **)parm_ptr, pszParmValue); break; case P_USTRING: - string_set(parm_ptr, pszParmValue); + string_set((char **)parm_ptr, pszParmValue); strupper_m(*(char **)parm_ptr); break; @@ -3598,7 +3598,7 @@ static void dump_globals(FILE *f) fprintf(f, "[global]\n"); for (i = 0; parm_table[i].label; i++) - if (parm_table[i].class == P_GLOBAL && + if (parm_table[i].p_class == P_GLOBAL && parm_table[i].ptr && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { if (defaults_saved && is_default(i)) @@ -3644,7 +3644,7 @@ static void dump_a_service(service * pService, FILE * f) for (i = 0; parm_table[i].label; i++) { - if (parm_table[i].class == P_LOCAL && + if (parm_table[i].p_class == P_LOCAL && parm_table[i].ptr && (*parm_table[i].label != '-') && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) @@ -3688,18 +3688,18 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) { service * pService = ServicePtrs[snum]; int i, result = False; - parm_class class; + parm_class p_class; unsigned flag = 0; if (isGlobal) { - class = P_GLOBAL; + p_class = P_GLOBAL; flag = FLAG_GLOBAL; } else - class = P_LOCAL; + p_class = P_LOCAL; for (i = 0; parm_table[i].label; i++) { if (strwicmp(parm_table[i].label, parm_name) == 0 && - (parm_table[i].class == class || parm_table[i].flags & flag) && + (parm_table[i].p_class == p_class || parm_table[i].flags & flag) && parm_table[i].ptr && (*parm_table[i].label != '-') && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) @@ -3733,7 +3733,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) if (snum < 0) { /* do the globals */ for (; parm_table[*i].label; (*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + if (parm_table[*i].p_class == P_SEPARATOR) return &parm_table[(*i)++]; if (!parm_table[*i].ptr @@ -3751,10 +3751,10 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) service *pService = ServicePtrs[snum]; for (; parm_table[*i].label; (*i)++) { - if (parm_table[*i].class == P_SEPARATOR) + if (parm_table[*i].p_class == P_SEPARATOR) return &parm_table[(*i)++]; - if (parm_table[*i].class == P_LOCAL && + if (parm_table[*i].p_class == P_LOCAL && parm_table[*i].ptr && (*parm_table[*i].label != '-') && ((*i) == 0 || @@ -3795,7 +3795,7 @@ static void dump_copy_map(BOOL *pcopymap) printf("\n\tNon-Copied parameters:\n"); for (i = 0; parm_table[i].label; i++) - if (parm_table[i].class == P_LOCAL && + if (parm_table[i].p_class == P_LOCAL && parm_table[i].ptr && !pcopymap[i] && (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) { diff --git a/source3/param/params.c b/source3/param/params.c index 3b736113be..2a6c8b3e65 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -264,7 +264,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) if( i > (bSize - 2) ) { char *tb; - tb = SMB_REALLOC( bufr, bSize +BUFR_INC ); + tb = (char *)SMB_REALLOC( bufr, bSize +BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; @@ -356,7 +356,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) /* Loop until we've found the start of the value. */ if( i > (bSize - 2) ) { /* Ensure there's space for next char. */ - char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; @@ -414,7 +414,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) while( (EOF !=c) && (c > 0) ) { if( i > (bSize - 2) ) { /* Make sure there's enough room. */ - char *tb = SMB_REALLOC( bufr, bSize + BUFR_INC ); + char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func)); return False; -- cgit From f2f55d703d0dd549a83809d3e5cc5151569b48d6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jun 2005 22:53:56 +0000 Subject: r7963: Add aio support to 3.0. Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2456304261..ff410a01db 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -360,6 +360,7 @@ typedef struct char *fstype; char **szVfsObjects; char *szMSDfsProxy; + char *szAioWriteBehind; int iMinPrintSpace; int iMaxPrintJobs; int iMaxReportedPrintJobs; @@ -437,6 +438,8 @@ typedef struct BOOL bEASupport; BOOL bAclCheckPermissions; int iallocation_roundup_size; + int iAioReadSize; + int iAioWriteSize; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -488,6 +491,7 @@ static service sDefault = { NULL, /* fstype */ NULL, /* vfs objects */ NULL, /* szMSDfsProxy */ + NULL, /* szAioWriteBehind */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ 0, /* iMaxReportedPrintJobs */ @@ -565,6 +569,8 @@ static service sDefault = { False, /* bEASupport */ True, /* bAclCheckPermissions */ SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ + 0, /* iAioReadSize */ + 0, /* iAioWriteSize */ NULL, /* Parametric options */ @@ -914,6 +920,9 @@ static struct parm_struct parm_table[] = { {N_("Protocol Options"), P_SEP, P_SEPARATOR}, {"allocation roundup size", P_INTEGER, P_LOCAL, &sDefault.iallocation_roundup_size, NULL, NULL, FLAG_ADVANCED}, + {"aio read size", P_INTEGER, P_LOCAL, &sDefault.iAioReadSize, NULL, NULL, FLAG_ADVANCED}, + {"aio write size", P_INTEGER, P_LOCAL, &sDefault.iAioWriteSize, NULL, NULL, FLAG_ADVANCED}, + {"aio write behind", P_STRING, P_LOCAL, &sDefault.szAioWriteBehind, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 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}, @@ -1914,6 +1923,7 @@ FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) +FN_LOCAL_STRING(lp_aio_write_behind, szAioWriteBehind) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) FN_LOCAL_BOOL(lp_rootpreexec_close, bRootpreexecClose) @@ -1987,6 +1997,8 @@ FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size); +FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize); +FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize); FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) -- cgit From 9b782f49350bd7682ad3270bf585b9af15669245 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Jun 2005 21:48:09 +0000 Subject: r7985: Add "acl map full control", true by default, to allow people to change mapping of rwx to full control or not. Requested feature at SambaXP. Jeremy. (This used to be commit c870579f4cd91dc9e030134dd367109aed3e3469) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ff410a01db..15eee5313c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -437,6 +437,7 @@ typedef struct BOOL bAfs_Share; BOOL bEASupport; BOOL bAclCheckPermissions; + BOOL bAclMapFullControl; int iallocation_roundup_size; int iAioReadSize; int iAioWriteSize; @@ -568,6 +569,7 @@ static service sDefault = { False, /* bAfs_Share */ False, /* bEASupport */ True, /* bAclCheckPermissions */ + True, /* bAclMapFullControl */ SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ 0, /* iAioReadSize */ 0, /* iAioWriteSize */ @@ -874,6 +876,7 @@ static struct parm_struct parm_table[] = { {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, {"acl check permissions", P_BOOL, P_LOCAL, &sDefault.bAclCheckPermissions, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"acl map full control", P_BOOL, P_LOCAL, &sDefault.bAclMapFullControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, @@ -1979,6 +1982,7 @@ FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) FN_LOCAL_BOOL(lp_acl_check_permissions, bAclCheckPermissions) +FN_LOCAL_BOOL(lp_acl_map_full_control, bAclMapFullControl) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask) -- cgit From 2e7f22e833fbb549f698460f9ed4d81af68b86e9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 29 Jun 2005 14:03:53 +0000 Subject: r7994: This adds support in Winbindd's "security = ads"-mode to retrieve the POSIX homedirectory and the loginshell from Active Directory's "Services for Unix". Enable it with: winbind sfu support = yes User-Accounts without SFU-Unix-Attributes will be assigned template-based Shells and Homedirs as before. Note that it doesn't matter which version of Services for Unix you use (2.0, 2.2, 3.0 or 3.5). Samba should detect the correct attributes (msSFULoginShell, msSFU30LoginShell, etc.) automatically. If you also want to share the same uid/gid-space as SFU then also use PADL's ad-idmap-Plugin: idmap backend = ad When using the idmap-plugin only those accounts will appear in Name Service Switch that have those UNIX-attributes which avoids potential uid/gid-space clashes between SFU-ids and automatically assigned idmap-ids. Guenther (This used to be commit 28b59699425b1c954d191fc0e3bd357e4a4e4cd8) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 15eee5313c..d584997f81 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -226,6 +226,7 @@ typedef struct int oplock_break_wait_time; int winbind_cache_time; int winbind_max_idle_children; + BOOL bWinbindSFUSupport; int iLockSpinCount; int iLockSpinTime; char *szLdapMachineSuffix; @@ -1237,6 +1238,7 @@ static struct parm_struct parm_table[] = { {"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}, {"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED}, + {"winbind sfu support", P_BOOL, P_GLOBAL, &Globals.bWinbindSFUSupport, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1582,6 +1584,7 @@ static void init_globals(void) Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = False; Globals.winbind_max_idle_children = 3; + Globals.bWinbindSFUSupport = False; Globals.bEnableRidAlgorithm = True; @@ -2006,6 +2009,7 @@ FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize); FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) +FN_GLOBAL_BOOL(lp_winbind_sfu_support, &Globals.bWinbindSFUSupport) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) -- cgit From 665909539572c48555916425729a25e158ac5255 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Jul 2005 13:51:17 +0000 Subject: r8144: remove unused parameter leftover. Guenther (This used to be commit e79e384eb307c6bbe05e07a87dcc6af42a0c0a32) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d584997f81..bb6feaf2a1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -177,7 +177,6 @@ typedef struct BOOL bWinbindUseDefaultDomain; BOOL bWinbindTrustedDomainsOnly; BOOL bWinbindNestedGroups; - char *szWinbindBackend; char **szIdmapBackend; char *szAddShareCommand; char *szChangeShareCommand; -- cgit From 944ecbdbb05f87270430efbef0ddc7cc388e5d36 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 4 Jul 2005 13:57:54 +0000 Subject: r8145: When inventing a new parameter for SFU-support, be aware of Volker's upcoming changes for "unixinfo"-pipe. Therefor (after speaking with Volker) replace "winbind sfu support" with the list-parameter "winbind nss info" which defaults to "template". For SFU-support set it to "winbind nss info = template sfu". Note that nss_info_use() is just a dummy function at the moment. Guenther (This used to be commit 91596330ea3c4ba0fb9ddc52ad9d4a7c8e5b2d3f) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bb6feaf2a1..a1dcf28491 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -225,7 +225,7 @@ typedef struct int oplock_break_wait_time; int winbind_cache_time; int winbind_max_idle_children; - BOOL bWinbindSFUSupport; + char **szWinbindNssInfo; int iLockSpinCount; int iLockSpinTime; char *szLdapMachineSuffix; @@ -1237,7 +1237,7 @@ static struct parm_struct parm_table[] = { {"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}, {"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED}, - {"winbind sfu support", P_BOOL, P_GLOBAL, &Globals.bWinbindSFUSupport, NULL, NULL, FLAG_ADVANCED}, + {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1583,7 +1583,7 @@ static void init_globals(void) Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = False; Globals.winbind_max_idle_children = 3; - Globals.bWinbindSFUSupport = False; + Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bEnableRidAlgorithm = True; @@ -2008,7 +2008,7 @@ FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize); FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) -FN_GLOBAL_BOOL(lp_winbind_sfu_support, &Globals.bWinbindSFUSupport) +FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) -- cgit From 200ff9c1e930249a0ab1dea4a8b1b92ef614aa6e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 14 Jul 2005 08:02:10 +0000 Subject: r8454: Fix Bug #2502 Removing deprecated lp_min_password_length (the same functionality is provided by the account policy). Note that we now allow to set passwords less then 5 chars (if the admins decides to do so by setting the account policy). Thanks to Daniel Beschorner Guenther (This used to be commit fd91378925f7e3541df4f31bd461dabc1da523a9) --- source3/param/loadparm.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a1dcf28491..49e63666c9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -221,7 +221,6 @@ typedef struct int machine_password_timeout; int change_notify_timeout; int map_to_guest; - int min_passwd_length; int oplock_break_wait_time; int winbind_cache_time; int winbind_max_idle_children; @@ -823,8 +822,6 @@ static struct parm_struct parm_table[] = { {"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 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}, @@ -1491,7 +1488,6 @@ static void init_globals(void) /* Note, that we will use NTLM2 session security (which is different), if it is available */ Globals.map_to_guest = 0; /* By Default, "Never" */ - Globals.min_passwd_length = MINPASSWDLENGTH; /* By Default, 5. */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; Globals.iLockSpinCount = 3; /* Try 3 times. */ @@ -1882,7 +1878,6 @@ FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) -FN_GLOBAL_INTEGER(lp_min_passwd_length, &Globals.min_passwd_length) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) -- cgit From 21cd4ee355157737c4dfcf6cc901ed1410baceab Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 Jul 2005 20:59:52 +0000 Subject: r8615: Added "acl group control". Defaults to off. Docs to follow. Jeremy. (This used to be commit f7b169ed57de81229c3b9089a05f4e73ea39010c) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 49e63666c9..ae5af60e46 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -437,6 +437,7 @@ typedef struct BOOL bEASupport; BOOL bAclCheckPermissions; BOOL bAclMapFullControl; + BOOL bAclGroupControl; int iallocation_roundup_size; int iAioReadSize; int iAioWriteSize; @@ -569,6 +570,7 @@ static service sDefault = { False, /* bEASupport */ True, /* bAclCheckPermissions */ True, /* bAclMapFullControl */ + False, /* bAclGroupControl */ SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ 0, /* iAioReadSize */ 0, /* iAioWriteSize */ @@ -873,6 +875,7 @@ static struct parm_struct parm_table[] = { {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, {"acl check permissions", P_BOOL, P_LOCAL, &sDefault.bAclCheckPermissions, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"acl group control", P_BOOL, P_LOCAL, &sDefault.bAclGroupControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"acl map full control", P_BOOL, P_LOCAL, &sDefault.bAclMapFullControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, @@ -1979,6 +1982,7 @@ FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) FN_LOCAL_BOOL(lp_acl_check_permissions, bAclCheckPermissions) +FN_LOCAL_BOOL(lp_acl_group_control, bAclGroupControl) FN_LOCAL_BOOL(lp_acl_map_full_control, bAclMapFullControl) FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask) FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode) -- cgit From c03f6b32a3f07f429b645f4647d3c7d8f2241999 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 22 Jul 2005 17:45:39 +0000 Subject: r8716: adding 'username map script' which if defined takes precendence over the username map file. (This used to be commit 46f2897fdc1f9308f2cc15834c8b039c17c34707) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ae5af60e46..00f191db28 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -159,6 +159,7 @@ typedef struct char *szAddMachineScript; char *szShutdownScript; char *szAbortShutdownScript; + char *szUsernameMapScript; char *szCheckPasswordScript; char *szWINSHook; char *szWINSPartners; @@ -1071,6 +1072,7 @@ static struct parm_struct parm_table[] = { {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, FLAG_ADVANCED}, {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, FLAG_ADVANCED}, {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, FLAG_ADVANCED}, + {"username map script", P_STRING, P_GLOBAL, &Globals.szUsernameMapScript, NULL, NULL, FLAG_ADVANCED}, {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_ADVANCED}, {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_ADVANCED}, @@ -1755,6 +1757,7 @@ FN_GLOBAL_STRING(lp_addmachine_script, &Globals.szAddMachineScript) FN_GLOBAL_STRING(lp_shutdown_script, &Globals.szShutdownScript) FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) +FN_GLOBAL_STRING(lp_username_map_script, &Globals.szUsernameMapScript) FN_GLOBAL_STRING(lp_check_password_script, &Globals.szCheckPasswordScript) -- cgit From 8c072021efba737539b46e993df0c21a6438a82a Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 30 Aug 2005 06:41:32 +0000 Subject: r9780: Clean up a bunch of compiler warnings. (This used to be commit 623d2e69319ffead31a780a4d6156dae45f386d7) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 00f191db28..3c97a3bb37 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2004,9 +2004,9 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) -FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size); -FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize); -FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize); +FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) +FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) +FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) -- cgit From c762908074c45baacde1df04b633e01308030864 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Sep 2005 23:28:22 +0000 Subject: r10371: Adding iPrint printing backend written by Joel J. Smith @ Novell. Jeremy. (This used to be commit 155dc2d52a971bfb8d7565c06f3efc637e130b11) --- source3/param/loadparm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3c97a3bb37..7c5a17b86f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -241,6 +241,7 @@ typedef struct char *szLdapAdminDn; char *szAclCompat; char *szCupsServer; + char *szIPrintServer; int ldap_passwd_sync; int ldap_replication_sleep; int ldap_timeout; /* This is initialised in init_globals */ @@ -641,6 +642,7 @@ static const struct enum_list enum_printing[] = { {PRINT_PLP, "plp"}, {PRINT_LPRNG, "lprng"}, {PRINT_CUPS, "cups"}, + {PRINT_IPRINT, "iprint"}, {PRINT_LPRNT, "nt"}, {PRINT_LPROS2, "os2"}, #ifdef DEVELOPER @@ -1007,6 +1009,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"iprint server", P_STRING, P_GLOBAL, &Globals.szIPrintServer, 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}, {"enable spoolss", P_BOOLREV, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_HIDE}, @@ -1273,6 +1276,7 @@ static void init_printer_values(service *pService) break; case PRINT_CUPS: + case PRINT_IPRINT: #ifdef HAVE_CUPS /* set the lpq command to contain the destination printer name only. This is used by cups_queue_get() */ @@ -1570,6 +1574,7 @@ static void init_globals(void) string_set(&Globals.szWinbindSeparator, "\\"); string_set(&Globals.szAclCompat, ""); string_set(&Globals.szCupsServer, ""); + string_set(&Globals.szIPrintServer, ""); string_set(&Globals.szEventLogOpenCommand, ""); string_set(&Globals.szEventLogReadCommand, ""); @@ -1902,6 +1907,7 @@ FN_LOCAL_LIST(lp_admin_users, szAdminUsers) FN_GLOBAL_LIST(lp_enable_svcctl, &Globals.szServicesList) FN_LOCAL_STRING(lp_cups_options, szCupsOptions) FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) +FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer) FN_LOCAL_STRING(lp_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/param/loadparm.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7c5a17b86f..0a4f0556ae 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -122,6 +122,7 @@ typedef struct char *szConfigFile; char *szSMBPasswdFile; char *szPrivateDir; + char *szCountersDir; char **szPassdbBackend; char **szPreloadModules; char *szPasswordServer; @@ -188,6 +189,7 @@ typedef struct char *szEventLogNumRecordsCommand; char *szEventLogOldestRecordCommand; char *szEventLogCloseCommand; + char *szEventLogControlCommand; char **szEventLogs; char *szGuestaccount; char *szManglingMethod; @@ -833,6 +835,7 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED}, + {"counters dir", P_STRING, P_GLOBAL, &Globals.szCountersDir, NULL, NULL, FLAG_ADVANCED}, {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED}, @@ -966,7 +969,7 @@ static struct parm_struct parm_table[] = { {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, {"enable asu support", P_BOOL, P_GLOBAL, &Globals.bASUSupport, NULL, NULL, FLAG_ADVANCED}, - {"enable svcctl", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, + {"svcctl list", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, {N_("Tuning Options"), P_SEP, P_SEPARATOR}, @@ -1156,6 +1159,8 @@ static struct parm_struct parm_table[] = { {"eventlog clear command", P_STRING, P_GLOBAL, &Globals.szEventLogClearCommand, handle_eventlog, NULL, FLAG_ADVANCED}, {"eventlog num records command", P_STRING, P_GLOBAL, &Globals.szEventLogNumRecordsCommand, handle_eventlog, NULL, FLAG_ADVANCED}, {"eventlog oldest record command", P_STRING, P_GLOBAL, &Globals.szEventLogOldestRecordCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog close command", P_STRING, P_GLOBAL, &Globals.szEventLogCloseCommand, handle_eventlog, NULL, FLAG_ADVANCED}, + {"eventlog control command", P_STRING, P_GLOBAL, &Globals.szEventLogControlCommand, handle_eventlog, NULL, FLAG_ADVANCED}, {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, @@ -1428,6 +1433,7 @@ static void init_globals(void) Globals.bLoadPrinters = True; Globals.PrintcapCacheTime = 750; /* 12.5 minutes */ + /* 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; @@ -1520,7 +1526,6 @@ static void init_globals(void) #else Globals.szPassdbBackend = str_list_make("smbpasswd", NULL); #endif /* WITH_LDAP_SAMCONFIG */ - string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); @@ -1581,6 +1586,8 @@ static void init_globals(void) string_set(&Globals.szEventLogClearCommand, ""); string_set(&Globals.szEventLogNumRecordsCommand, ""); string_set(&Globals.szEventLogOldestRecordCommand, ""); + string_set(&Globals.szEventLogCloseCommand, ""); + string_set(&Globals.szEventLogControlCommand, ""); Globals.winbind_cache_time = 300; /* 5 minutes */ Globals.bWinbindEnumUsers = True; @@ -1609,7 +1616,7 @@ static void init_globals(void) operations as root */ Globals.bEnablePrivileges = False; - + Globals.bASUSupport = True; Globals.szServicesList = str_list_make( "Spooler NETLOGON", NULL ); @@ -1703,6 +1710,7 @@ FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) +FN_GLOBAL_STRING(lp_counters_dir, &Globals.szCountersDir) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) @@ -1804,6 +1812,8 @@ FN_GLOBAL_STRING(lp_eventlog_clear_cmd, &Globals.szEventLogClearCommand) FN_GLOBAL_STRING(lp_eventlog_num_records_cmd, &Globals.szEventLogNumRecordsCommand) FN_GLOBAL_STRING(lp_eventlog_oldest_record_cmd, &Globals.szEventLogOldestRecordCommand) FN_GLOBAL_STRING(lp_eventlog_close_cmd, &Globals.szEventLogCloseCommand) +FN_GLOBAL_STRING(lp_eventlog_control_cmd, &Globals.szEventLogControlCommand) + FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) @@ -1904,7 +1914,7 @@ FN_LOCAL_STRING(lp_username, szUsername) FN_LOCAL_LIST(lp_invalid_users, szInvalidUsers) FN_LOCAL_LIST(lp_valid_users, szValidUsers) FN_LOCAL_LIST(lp_admin_users, szAdminUsers) -FN_GLOBAL_LIST(lp_enable_svcctl, &Globals.szServicesList) +FN_GLOBAL_LIST(lp_svcctl_list, &Globals.szServicesList) FN_LOCAL_STRING(lp_cups_options, szCupsOptions) FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer) @@ -3344,7 +3354,10 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_OCTAL: - sscanf(pszParmValue, "%o", (int *)parm_ptr); + i = sscanf(pszParmValue, "%o", (int *)parm_ptr); + if ( i != 1 ) { + DEBUG ( 0, ("Invalid octal number %s\n", pszParmName )); + } break; case P_LIST: @@ -3698,13 +3711,13 @@ static void dump_a_service(service * pService, FILE * f) } } - 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 (pService->param_opt != NULL) { + data = pService->param_opt; + while(data) { + fprintf(f, "\t%s = %s\n", data->key, data->value); + data = data->next; + } + } } /*************************************************************************** @@ -4128,7 +4141,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, are denied */ lp_add_ipc("IPC$", (lp_restrict_anonymous() < 2)); if ( lp_enable_asu_support() ) - lp_add_ipc("ADMIN$", False); + lp_add_ipc("ADMIN$", False); } set_server_role(); -- cgit From 0bf72b6e330a76bee502cb36c1cb80c46d47d33c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 6 Oct 2005 17:48:03 +0000 Subject: r10781: merging eventlog and svcctl code from trunk (This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac) --- source3/param/loadparm.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0a4f0556ae..126d70939c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -183,13 +183,6 @@ typedef struct char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; - char *szEventLogOpenCommand; - char *szEventLogReadCommand; - char *szEventLogClearCommand; - char *szEventLogNumRecordsCommand; - char *szEventLogOldestRecordCommand; - char *szEventLogCloseCommand; - char *szEventLogControlCommand; char **szEventLogs; char *szGuestaccount; char *szManglingMethod; @@ -608,7 +601,6 @@ 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 BOOL handle_eventlog( int snum, const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -1154,13 +1146,6 @@ static struct parm_struct parm_table[] = { {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, {N_("EventLog Options"), P_SEP, P_SEPARATOR}, - {"eventlog open command", P_STRING, P_GLOBAL, &Globals.szEventLogOpenCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog read command", P_STRING, P_GLOBAL, &Globals.szEventLogReadCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog clear command", P_STRING, P_GLOBAL, &Globals.szEventLogClearCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog num records command", P_STRING, P_GLOBAL, &Globals.szEventLogNumRecordsCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog oldest record command", P_STRING, P_GLOBAL, &Globals.szEventLogOldestRecordCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog close command", P_STRING, P_GLOBAL, &Globals.szEventLogCloseCommand, handle_eventlog, NULL, FLAG_ADVANCED}, - {"eventlog control command", P_STRING, P_GLOBAL, &Globals.szEventLogControlCommand, handle_eventlog, NULL, FLAG_ADVANCED}, {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, @@ -1581,14 +1566,6 @@ static void init_globals(void) string_set(&Globals.szCupsServer, ""); string_set(&Globals.szIPrintServer, ""); - string_set(&Globals.szEventLogOpenCommand, ""); - string_set(&Globals.szEventLogReadCommand, ""); - string_set(&Globals.szEventLogClearCommand, ""); - string_set(&Globals.szEventLogNumRecordsCommand, ""); - string_set(&Globals.szEventLogOldestRecordCommand, ""); - string_set(&Globals.szEventLogCloseCommand, ""); - string_set(&Globals.szEventLogControlCommand, ""); - Globals.winbind_cache_time = 300; /* 5 minutes */ Globals.bWinbindEnumUsers = True; Globals.bWinbindEnumGroups = True; @@ -1806,14 +1783,6 @@ 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_STRING(lp_eventlog_open_cmd, &Globals.szEventLogOpenCommand) -FN_GLOBAL_STRING(lp_eventlog_read_cmd, &Globals.szEventLogReadCommand) -FN_GLOBAL_STRING(lp_eventlog_clear_cmd, &Globals.szEventLogClearCommand) -FN_GLOBAL_STRING(lp_eventlog_num_records_cmd, &Globals.szEventLogNumRecordsCommand) -FN_GLOBAL_STRING(lp_eventlog_oldest_record_cmd, &Globals.szEventLogOldestRecordCommand) -FN_GLOBAL_STRING(lp_eventlog_close_cmd, &Globals.szEventLogCloseCommand) -FN_GLOBAL_STRING(lp_eventlog_control_cmd, &Globals.szEventLogControlCommand) - FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) @@ -2908,11 +2877,7 @@ static BOOL handle_charset(int snum, const char *pszParmValue, char **ptr) return True; } -static BOOL handle_eventlog(int snum, const char *pszParmValue, char **ptr) -{ - string_set(ptr, pszParmValue); - return True; -} + static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr) { -- cgit From 254938c636b6062630d54a598b2975d7a984f70d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 11 Oct 2005 20:14:04 +0000 Subject: r10911: part of #2861: add rename support for usrmgr.exe when using tdbsam This gets it working before replacing tdb with the samba4 version. (This used to be commit 8210b0503a050e12ee1b4335fa6e50d10ad06577) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 126d70939c..dc2784804d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -151,6 +151,7 @@ typedef struct char *szNameResolveOrder; char *szPanicAction; char *szAddUserScript; + char *szRenameUserScript; char *szDelUserScript; char *szAddGroupScript; char *szDelGroupScript; @@ -1061,6 +1062,7 @@ static struct parm_struct parm_table[] = { {N_("Logon Options"), P_SEP, P_SEPARATOR}, {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED}, + {"rename user script", P_STRING, P_GLOBAL, &Globals.szRenameUserScript, NULL, NULL, FLAG_ADVANCED}, {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED}, {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, FLAG_ADVANCED}, {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, FLAG_ADVANCED}, @@ -1734,6 +1736,7 @@ FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_LIST(lp_preload_modules, &Globals.szPreloadModules) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) +FN_GLOBAL_STRING(lp_renameuser_script, &Globals.szRenameUserScript) FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript) FN_GLOBAL_CONST_STRING(lp_guestaccount, &Globals.szGuestaccount) -- cgit From a1eb5255042c3ff246e27a3cd3cdfd869c5542d3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 14 Oct 2005 01:09:37 +0000 Subject: r10979: After discussions on IRC about profile shares, added new parameter : map readonly = [yes|no|permissions] If yes: map inverse of user "w" bit to mean readonly. If no: never set DOS readonly bit. If permissions: check file permissions for user and set readonly bit if the current user cannot write. If store dos attributes is set to yes then this parameter is ignored. Jeremy. (This used to be commit da4238d18c7a57d1264db8517fb027a10a11baed) --- source3/param/loadparm.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dc2784804d..383b1d7047 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -439,6 +439,7 @@ typedef struct int iallocation_roundup_size; int iAioReadSize; int iAioWriteSize; + int iMap_readonly; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -572,6 +573,7 @@ static service sDefault = { SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ 0, /* iAioReadSize */ 0, /* iAioWriteSize */ + MAP_READONLY_YES, /* iMap_readonly */ NULL, /* Parametric options */ @@ -692,6 +694,18 @@ static const struct enum_list enum_announce_as[] = { {-1, NULL} }; +static const struct enum_list enum_map_readonly[] = { + {MAP_READONLY_NO, "no"}, + {MAP_READONLY_NO, "false"}, + {MAP_READONLY_NO, "0"}, + {MAP_READONLY_YES, "yes"}, + {MAP_READONLY_YES, "true"}, + {MAP_READONLY_YES, "1"}, + {MAP_READONLY_PERMISSIONS, "permissions"}, + {MAP_READONLY_PERMISSIONS, "perms"}, + {-1, NULL} +}; + static const struct enum_list enum_case[] = { {CASE_LOWER, "lower"}, {CASE_UPPER, "upper"}, @@ -1046,9 +1060,11 @@ static struct parm_struct parm_table[] = { {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map readonly", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"map read only", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, 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 }, {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, @@ -1995,6 +2011,7 @@ FN_LOCAL_INTEGER(lp_block_size, iBlock_size) FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) +FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) -- cgit From dc4a569e7e49151e47893759b04948a0a61c2744 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 18 Oct 2005 22:50:24 +0000 Subject: r11169: removing duplicate 'map read only' entry (This used to be commit 0e60813ed0d5c56c44a371d84275d1944bade770) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 383b1d7047..d99336ea97 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1064,7 +1064,6 @@ static struct parm_struct parm_table[] = { {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"map readonly", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"map read only", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, 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 }, {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, -- cgit From c6aea6ef2d97982263b1652b7c186df269bf0de6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 19 Oct 2005 20:02:12 +0000 Subject: r11190: Fix enhancement request #3192. This does 2 things. 1). Makes dfree command a per-share parameter (it should be anyway IMHO). 2). Adds a "dfree cache time" parameter in seconds that specifies how long a dfree command output should be cached for. Default is zero (no caching). Jeremy. (This used to be commit 49ef8b88a3e12883148eb28d8e86fb07dbc3d12d) --- source3/param/loadparm.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d99336ea97..cecd1d0f98 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -109,7 +109,6 @@ typedef struct char *szPidDir; char *szRootdir; char *szDefaultService; - char *szDfree; char *szGetQuota; char *szSetQuota; char *szMsgCommand; @@ -358,6 +357,7 @@ typedef struct char **szVfsObjects; char *szMSDfsProxy; char *szAioWriteBehind; + char *szDfree; int iMinPrintSpace; int iMaxPrintJobs; int iMaxReportedPrintJobs; @@ -376,6 +376,7 @@ typedef struct int iOplockContentionLimit; int iCSCPolicy; int iBlock_size; + int iDfreeCacheTime; BOOL bPreexecClose; BOOL bRootpreexecClose; int iCaseSensitive; @@ -492,6 +493,7 @@ static service sDefault = { NULL, /* vfs objects */ NULL, /* szMSDfsProxy */ NULL, /* szAioWriteBehind */ + NULL, /* szDfree */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ 0, /* iMaxReportedPrintJobs */ @@ -509,7 +511,8 @@ static service sDefault = { DEFAULT_PRINTING, /* iPrinting */ 2, /* iOplockContentionLimit */ 0, /* iCSCPolicy */ - 1024, /* iBlock_size */ + 1024, /* iBlock_size */ + 0, /* iDfreeCacheTime */ False, /* bPreexecClose */ False, /* bRootpreexecClose */ Auto, /* case sensitive */ @@ -1180,7 +1183,8 @@ static struct parm_struct parm_table[] = { {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED}, - {"dfree command", P_STRING, P_GLOBAL, &Globals.szDfree, NULL, NULL, FLAG_ADVANCED}, + {"dfree cache time", P_STRING, P_LOCAL, &sDefault.iDfreeCacheTime, NULL, NULL, FLAG_ADVANCED}, + {"dfree command", P_STRING, P_LOCAL, &sDefault.szDfree, NULL, NULL, FLAG_ADVANCED}, {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED}, {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED}, {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, NULL, NULL, FLAG_ADVANCED}, @@ -1721,7 +1725,6 @@ FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp) FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir) 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_get_quota_command, &Globals.szGetQuota) FN_GLOBAL_STRING(lp_set_quota_command, &Globals.szSetQuota) FN_GLOBAL_STRING(lp_hosts_equiv, &Globals.szHostsEquiv) @@ -1933,6 +1936,7 @@ FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) FN_LOCAL_STRING(lp_aio_write_behind, szAioWriteBehind) +FN_LOCAL_STRING(lp_dfree_command, szDfree) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) FN_LOCAL_BOOL(lp_rootpreexec_close, bRootpreexecClose) @@ -2007,6 +2011,7 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) +FN_LOCAL_INTEGER(lp_dfree_cache_time, iDfreeCacheTime) FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) -- cgit From 4e9bc2ec5c897ca790edd989af0b6072aeef3e2f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 23 Oct 2005 16:29:02 +0000 Subject: r11266: Speed up loading smb.conf for large numbers of share definitions. The problem was a O(n^2) loop: Whenever a service definition was found, we linearly searched the already loaded share definitions, the patch adds an internal tdb for this. For a smb.conf with 2000 shares this speeds up loading by about a factor of 50. Might be a fix for bug #1117. Thanks to Michael Adam , Volker (This used to be commit d07343e0c4022d753f381d368fc0f03972a070f3) --- source3/param/loadparm.c | 137 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 111 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cecd1d0f98..13bb4a7d06 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -73,7 +73,7 @@ extern enum protocol_types Protocol; #endif /* some helpful bits */ -#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && ServicePtrs[(i)]->valid) +#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid) #define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid) int keepalive = DEFAULT_KEEPALIVE; @@ -587,6 +587,9 @@ static service sDefault = { static service **ServicePtrs = NULL; static int iNumServices = 0; static int iServiceIndex = 0; +static TDB_CONTEXT *ServiceHash; +static int *invalid_services = NULL; +static int num_invalid_services = 0; static BOOL bInGlobalSection = True; static BOOL bGlobalOnly = False; static int server_role; @@ -2037,6 +2040,9 @@ static BOOL service_ok(int iService); static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); static BOOL do_section(const char *pszSectionName); static void init_copymap(service * pservice); +static BOOL hash_a_service(const char *name, int number); +static void free_service_byindex(int iService); +static char * canonicalize_servicename(const char *name); /* This is a helper function for parametrical options support. */ /* It returns a pointer to parametrical option value if it exists or NULL otherwise */ @@ -2329,6 +2335,26 @@ static void free_service(service *pservice) ZERO_STRUCTP(pservice); } + +/*************************************************************************** + remove a service indexed in the ServicePtrs array from the ServiceHash + and free the dynamically allocated parts +***************************************************************************/ + +static void free_service_byindex(int idx) +{ + if (!LP_SNUM_OK(idx)) { + return; + } + + ServicePtrs[idx]->valid = False; + invalid_services[num_invalid_services++] = idx; + if (ServicePtrs[idx]->szService) { + tdb_delete_bystring(ServiceHash, ServicePtrs[idx]->szService); + } + free_service(ServicePtrs[idx]); +} + /*************************************************************************** Add a new service to the services array initialising it with the given service. @@ -2364,32 +2390,41 @@ static int add_a_service(const service *pservice, const char *name) } /* find an invalid one */ - for (i = 0; i < iNumServices; i++) - if (!ServicePtrs[i]->valid) - break; + i = iNumServices; + if (num_invalid_services > 0) { + i = invalid_services[--num_invalid_services]; + } /* if not, then create one */ if (i == iNumServices) { service **tsp; + int *tinvalid; tsp = SMB_REALLOC_ARRAY(ServicePtrs, service *, num_to_alloc); - - if (!tsp) { + if (tsp == NULL) { DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n")); return (-1); } - else { - ServicePtrs = tsp; - ServicePtrs[iNumServices] = SMB_MALLOC_P(service); - } + ServicePtrs = tsp; + ServicePtrs[iNumServices] = SMB_MALLOC_P(service); if (!ServicePtrs[iNumServices]) { DEBUG(0,("add_a_service: out of memory!\n")); return (-1); } - iNumServices++; - } else - free_service(ServicePtrs[i]); + + /* enlarge invalid_services here for now... */ + tinvalid = SMB_REALLOC_ARRAY(invalid_services, int, + num_to_alloc); + if (tinvalid == NULL) { + DEBUG(0,("add_a_service: failed to enlarge " + "invalid_services!\n")); + return (-1); + } + invalid_services = tinvalid; + } else { + free_service_byindex(i); + } ServicePtrs[i]->valid = True; @@ -2400,10 +2435,57 @@ static int add_a_service(const service *pservice, const char *name) DEBUG(8,("add_a_service: Creating snum = %d for %s\n", i, ServicePtrs[i]->szService)); + + if (!hash_a_service(ServicePtrs[i]->szService, i)) { + return (-1); + } return (i); } +/*************************************************************************** + Convert a string to uppercase and remove whitespaces. +***************************************************************************/ + +static char *canonicalize_servicename(const char *src) +{ + static fstring canon; /* is fstring large enough? */ + int dst_idx = 0; + + for (; *src != '\0'; src++) { + if (isspace(*src)) { + continue; + } + if (dst_idx == sizeof(canon) - 1) { + return NULL; + } + canon[dst_idx++] = toupper(*src); + } + canon[dst_idx] = '\0'; + return canon; +} + +/*************************************************************************** + Add a name/index pair for the services array to the hash table. +***************************************************************************/ + +static BOOL hash_a_service(const char *name, int idx) +{ + if (ServiceHash == NULL) { + DEBUG(10,("hash_a_service: creating tdb servicehash\n")); + ServiceHash = tdb_open("servicehash", 1031, TDB_INTERNAL, + (O_RDWR|O_CREAT), 0644); + if (ServiceHash == NULL) { + DEBUG(0,("hash_a_service: open tdb servicehash failed!\n")); + return False; + } + } + DEBUG(10,("hash_a_service: hashing index %d for service name %s\n", + idx, name)); + tdb_store_int32(ServiceHash, canonicalize_servicename(name), idx); + return True; +} + /*************************************************************************** Add a new home service, with the specified home directory, defaults coming from service ifrom. @@ -2636,16 +2718,20 @@ Find a service by name. Otherwise works like get_service. static int getservicebyname(const char *pszServiceName, service * pserviceDest) { - int iService; - - for (iService = iNumServices - 1; iService >= 0; iService--) - if (VALID(iService) && - strwicmp(ServicePtrs[iService]->szService, pszServiceName) == 0) { - if (pserviceDest != NULL) - copy_service(pserviceDest, ServicePtrs[iService], NULL); - break; + int iService = -1; + + if (ServiceHash != NULL) { + iService = tdb_fetch_int32(ServiceHash, + canonicalize_servicename(pszServiceName)); + if (LP_SNUM_OK(iService)) { + if (pserviceDest != NULL) { + copy_service(pserviceDest, + ServicePtrs[iService], NULL); + } + } else { + iService = -1; } - + } return (iService); } @@ -3916,8 +4002,7 @@ void lp_killunused(BOOL (*snumused) (int)) continue; if (!snumused || !snumused(i)) { - ServicePtrs[i]->valid = False; - free_service(ServicePtrs[i]); + free_service_byindex(i); } } } @@ -3929,8 +4014,7 @@ void lp_killunused(BOOL (*snumused) (int)) void lp_killservice(int iServiceIn) { if (VALID(iServiceIn)) { - ServicePtrs[iServiceIn]->valid = False; - free_service(ServicePtrs[iServiceIn]); + free_service_byindex(iServiceIn); } } @@ -4346,6 +4430,7 @@ BOOL lp_preferred_master(void) void lp_remove_service(int snum) { ServicePtrs[snum]->valid = False; + invalid_services[num_invalid_services++] = snum; } /******************************************************************* -- cgit From 536900743df8a30c77482036dba9ea88b9eebf29 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 23 Oct 2005 19:00:40 +0000 Subject: r11269: Ensure the new canonicalize_servicename() is mb safe. MB service names may contain embedded ' ' characters. Jeremy. (This used to be commit 83d0cda858de5f40ab652e1f438808a3bfac0f81) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 13bb4a7d06..f084d52c26 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2452,7 +2452,7 @@ static char *canonicalize_servicename(const char *src) static fstring canon; /* is fstring large enough? */ int dst_idx = 0; - for (; *src != '\0'; src++) { + for (; *src != '\0'; src += next_mb_char_size(src)) { if (isspace(*src)) { continue; } -- cgit From bac6524af1ab318270e4ceafeaabbe870a3b7776 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 25 Oct 2005 14:54:41 +0000 Subject: r11295: new service hashing code has assumign that the service name stored in the array was normalized. This was causing records to not be deleted on a reload. As a result, I was getting the wrong path for various services. Seems to be ok after this change. Also converted canonicalize_servicename() to just use strupper_m() rather than doing the conversion itself. Jeremy, i think this should be ok but please check. also cleaned up some things in the hash service code and added debug messages for sanity purposes. (This used to be commit e0bf0581f0aaf1505f653f2101eed61352d03da8) --- source3/param/loadparm.c | 52 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f084d52c26..6ad1ace755 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2343,15 +2343,20 @@ static void free_service(service *pservice) static void free_service_byindex(int idx) { - if (!LP_SNUM_OK(idx)) { + if ( !LP_SNUM_OK(idx) ) return; - } ServicePtrs[idx]->valid = False; invalid_services[num_invalid_services++] = idx; + + /* we have to cleanup the hash record */ + if (ServicePtrs[idx]->szService) { - tdb_delete_bystring(ServiceHash, ServicePtrs[idx]->szService); + char *canon_name = canonicalize_servicename( ServicePtrs[idx]->szService ); + + tdb_delete_bystring(ServiceHash, canon_name ); } + free_service(ServicePtrs[idx]); } @@ -2452,6 +2457,15 @@ static char *canonicalize_servicename(const char *src) static fstring canon; /* is fstring large enough? */ int dst_idx = 0; + if ( !src ) { + DEBUG(0,("canonicalize_servicename: NULL source name!\n")); + return NULL; + } + + fstrcpy( canon, src ); + strupper_m( canon ); + +#if 0 for (; *src != '\0'; src += next_mb_char_size(src)) { if (isspace(*src)) { continue; @@ -2462,6 +2476,8 @@ static char *canonicalize_servicename(const char *src) canon[dst_idx++] = toupper(*src); } canon[dst_idx] = '\0'; +#endif + return canon; } @@ -2471,18 +2487,26 @@ static char *canonicalize_servicename(const char *src) static BOOL hash_a_service(const char *name, int idx) { - if (ServiceHash == NULL) { + char *canon_name; + + if ( !ServiceHash ) { DEBUG(10,("hash_a_service: creating tdb servicehash\n")); ServiceHash = tdb_open("servicehash", 1031, TDB_INTERNAL, - (O_RDWR|O_CREAT), 0644); - if (ServiceHash == NULL) { + (O_RDWR|O_CREAT), 0600); + if ( !ServiceHash ) { DEBUG(0,("hash_a_service: open tdb servicehash failed!\n")); return False; } } + DEBUG(10,("hash_a_service: hashing index %d for service name %s\n", - idx, name)); - tdb_store_int32(ServiceHash, canonicalize_servicename(name), idx); + idx, name)); + + if ( !(canon_name = canonicalize_servicename( name )) ) + return False; + + tdb_store_int32(ServiceHash, canon_name, idx); + return True; } @@ -2719,19 +2743,23 @@ Find a service by name. Otherwise works like get_service. static int getservicebyname(const char *pszServiceName, service * pserviceDest) { int iService = -1; + char *canon_name; if (ServiceHash != NULL) { - iService = tdb_fetch_int32(ServiceHash, - canonicalize_servicename(pszServiceName)); + if ( !(canon_name = canonicalize_servicename( pszServiceName )) ) + return -1; + + iService = tdb_fetch_int32(ServiceHash, canon_name ); + if (LP_SNUM_OK(iService)) { if (pserviceDest != NULL) { - copy_service(pserviceDest, - ServicePtrs[iService], NULL); + copy_service(pserviceDest, ServicePtrs[iService], NULL); } } else { iService = -1; } } + return (iService); } -- cgit From 2f25efcbaf82c2d97b4aad0a59198e388b3ae654 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 25 Oct 2005 14:56:22 +0000 Subject: r11296: removing unused variable and ifdef'd out code (This used to be commit 88a33c4cf87ada17637579d9261471c219e88de0) --- source3/param/loadparm.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6ad1ace755..ed392ef137 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2455,7 +2455,6 @@ static int add_a_service(const service *pservice, const char *name) static char *canonicalize_servicename(const char *src) { static fstring canon; /* is fstring large enough? */ - int dst_idx = 0; if ( !src ) { DEBUG(0,("canonicalize_servicename: NULL source name!\n")); @@ -2465,19 +2464,6 @@ static char *canonicalize_servicename(const char *src) fstrcpy( canon, src ); strupper_m( canon ); -#if 0 - for (; *src != '\0'; src += next_mb_char_size(src)) { - if (isspace(*src)) { - continue; - } - if (dst_idx == sizeof(canon) - 1) { - return NULL; - } - canon[dst_idx++] = toupper(*src); - } - canon[dst_idx] = '\0'; -#endif - return canon; } -- cgit From d5447033429449889242f96d889607ba6883866d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Nov 2005 01:21:46 +0000 Subject: r11494: Finally fix #3192 - remember iDiskfreeCacheTime is an *integer*, not a pointer. Doh ! Jeremy. (This used to be commit f1e0c863637f11f5857663d1980ba7f40fce7357) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ed392ef137..d2cbf380da 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1186,7 +1186,7 @@ static struct parm_struct parm_table[] = { {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED}, - {"dfree cache time", P_STRING, P_LOCAL, &sDefault.iDfreeCacheTime, NULL, NULL, FLAG_ADVANCED}, + {"dfree cache time", P_INTEGER, P_LOCAL, &sDefault.iDfreeCacheTime, NULL, NULL, FLAG_ADVANCED}, {"dfree command", P_STRING, P_LOCAL, &sDefault.szDfree, NULL, NULL, FLAG_ADVANCED}, {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED}, {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED}, -- cgit From 77460a90756dcaa54ec12bbcd30a5266286103d7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 8 Nov 2005 16:33:45 +0000 Subject: r11579: syncing up perf counter code cfrom trunk (This used to be commit 59c00924b67aa3d37a933731a56d03963ec7f1b5) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d2cbf380da..d2d739fa72 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -121,7 +121,6 @@ typedef struct char *szConfigFile; char *szSMBPasswdFile; char *szPrivateDir; - char *szCountersDir; char **szPassdbBackend; char **szPreloadModules; char *szPasswordServer; @@ -848,7 +847,6 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED}, - {"counters dir", P_STRING, P_GLOBAL, &Globals.szCountersDir, NULL, NULL, FLAG_ADVANCED}, {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED}, @@ -1711,7 +1709,6 @@ FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile) FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile) FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile) FN_GLOBAL_STRING(lp_private_dir, &Globals.szPrivateDir) -FN_GLOBAL_STRING(lp_counters_dir, &Globals.szCountersDir) FN_GLOBAL_STRING(lp_serverstring, &Globals.szServerString) FN_GLOBAL_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) -- cgit From 88eb98275e8ecf33f9751aeb8a4d66ae205d7044 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Nov 2005 20:15:46 +0000 Subject: r11734: Remove unused variable (This used to be commit 5b882acafbacce6246b8f729eb8e347039ee16bd) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d2d739fa72..5e49a56225 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -145,7 +145,6 @@ typedef struct char *szNetbiosName; char **szNetbiosAliases; char *szNetbiosScope; - char *szDomainOtherSIDs; char *szNameResolveOrder; char *szPanicAction; char *szAddUserScript; -- cgit From 05f7bec525484b7a13ba0f80fd684cd1f9b1d66b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Nov 2005 06:54:39 +0000 Subject: r11739: As per Jeremy's request, add a panic action for developers. Now configure.in needs something along the lines of if [ $LOGNAME == "jht" ] then CFLAGS="$CFLAGS -DDEVELOPER" fi But that goes a bit far I think.... :-))) Volker (This used to be commit 99d76042e962405fcaeb974a55db563207e0f92a) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5e49a56225..f45d8cf952 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1424,6 +1424,9 @@ static void init_globals(void) slprintf(s, sizeof(s) - 1, "%d.%d", DEFAULT_MAJOR_VERSION, DEFAULT_MINOR_VERSION); string_set(&Globals.szAnnounceVersion, s); +#ifdef DEVELOPER + string_set(&Globals.szPanicAction, "/bin/sleep 999999999"); +#endif pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); -- cgit From 1bfb5b734b0d5e1bc093bb43513729ed458fe372 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 25 Nov 2005 12:31:40 +0000 Subject: r11909: Implement 'reset on zero vc'. This kills other connections when a session setup comes in with the vc (virtual connection) field set to zero. This is done by Windows, probably you can tweak that by some registry key. This boolean option controls whether an incoming session setup should kill other connections coming from the same IP. This matches the default Windows 2003 behaviour. Setting this parameter to yes becomes necessary when you have a flaky network and windows decides to reconnect while the old connection still has files with share modes open. These files become inaccessible over the new connection. The client sends a zero VC on the new connection, and Windows 2003 kills all other connections coming from the same IP. This way the locked files are accessible again. Please be aware that enabling this option will kill connections behind a masquerading router. Volker (This used to be commit 5629ca16235f0aa21fea3afd9e414309e4e1374e) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f45d8cf952..86a5353dca 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -301,6 +301,7 @@ typedef struct int name_cache_timeout; int client_signing; int server_signing; + BOOL bResetOnZeroVC; param_opt_struct *param_opt; } global; @@ -951,6 +952,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"reset on zero vc", P_BOOL, P_GLOBAL, &Globals.bResetOnZeroVC, 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}, @@ -1522,6 +1524,7 @@ static void init_globals(void) Globals.bUseMmap = True; #endif Globals.bUnixExtensions = True; + Globals.bResetOnZeroVC = False; /* hostname lookups can be very expensive and are broken on a large number of sites (tridge) */ @@ -1809,6 +1812,7 @@ FN_GLOBAL_STRING(lp_delete_share_cmd, &Globals.szDeleteShareCommand) FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) +FN_GLOBAL_BOOL(lp_reset_on_zero_vc, &Globals.bResetOnZeroVC) FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport) -- cgit From bd21ee68e5af675a4cd9cfcfb2301ad260c116d5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Dec 2005 14:46:56 +0000 Subject: r11999: Re-add "passdb expand explicit". We came to the conclusion that changing the default is something that has to wait one or two more releases, but it will happen one way or the other. Volker (This used to be commit 30fcdf84d8943e630af78a96320607c42e4d15aa) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 86a5353dca..cdef034061 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -168,6 +168,7 @@ typedef struct char *szIdmapUID; char *szIdmapGID; BOOL bEnableRidAlgorithm; + BOOL bPassdbExpandExplicit; int AlgorithmicRidBase; char *szTemplateHomedir; char *szTemplateShell; @@ -1240,6 +1241,7 @@ static struct parm_struct parm_table[] = { {N_("Winbind options"), P_SEP, P_SEPARATOR}, {"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_DEPRECATED}, + {"passdb expand explicit", P_BOOL, P_GLOBAL, &Globals.bPassdbExpandExplicit, 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}, @@ -1603,6 +1605,7 @@ static void init_globals(void) Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bEnableRidAlgorithm = True; + Globals.bPassdbExpandExplicit = True; Globals.name_cache_timeout = 660; /* In seconds */ @@ -1792,6 +1795,7 @@ FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm) +FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) #ifdef WITH_LDAP_SAMCONFIG FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -- cgit From 7ae0fd8ed8204cda1cd1578192f4ca308b2963fb Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 16 Dec 2005 15:58:31 +0000 Subject: r12290: Typo (This used to be commit de839cc1658b6394e153a1f027c29524b301625b) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cdef034061..ca47e48d8c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2532,7 +2532,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, string_set(&ServicePtrs[i]->comment, comment); } - /* set the browseable flag from the gloabl default */ + /* set the browseable flag from the global default */ ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; -- cgit From 107fe91d2b93a34be9fe056da46810dec66aa343 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 21 Dec 2005 23:15:57 +0000 Subject: r12414: Remove the unnecessary SMB_STRDUP in server_role_str() + reuse the role translation elsewhere. Guenther (This used to be commit 6c4a6da3dc7cecce09890a0da7d97b9d1bb47827) --- source3/param/loadparm.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ca47e48d8c..fa61a8aedb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4098,6 +4098,28 @@ static void lp_save_defaults(void) Set the server type we will announce as via nmbd. ********************************************************************/ +static const struct srv_role_tab { + uint32 role; + const char *role_str; +} srv_role_tab [] = { + { ROLE_STANDALONE, "ROLE_STANDALONE" }, + { ROLE_DOMAIN_MEMBER, "ROLE_DOMAIN_MEMBER" }, + { ROLE_DOMAIN_BDC, "ROLE_DOMAIN_BDC" }, + { ROLE_DOMAIN_PDC, "ROLE_DOMAIN_PDC" }, + { 0, NULL } +}; + +const char* server_role_str(uint32 role) +{ + int i = 0; + for (i=0; srv_role_tab[i].role_str; i++) { + if (role == srv_role_tab[i].role) { + return srv_role_tab[i].role_str; + } + } + return NULL; +} + static void set_server_role(void) { server_role = ROLE_STANDALONE; @@ -4141,22 +4163,7 @@ static void set_server_role(void) break; } - DEBUG(10, ("set_server_role: role = ")); - - switch(server_role) { - case ROLE_STANDALONE: - DEBUGADD(10, ("ROLE_STANDALONE\n")); - break; - case ROLE_DOMAIN_MEMBER: - DEBUGADD(10, ("ROLE_DOMAIN_MEMBER\n")); - break; - case ROLE_DOMAIN_BDC: - DEBUGADD(10, ("ROLE_DOMAIN_BDC\n")); - break; - case ROLE_DOMAIN_PDC: - DEBUGADD(10, ("ROLE_DOMAIN_PDC\n")); - break; - } + DEBUG(10, ("set_server_role: role = %s", server_role_str(server_role))); } /*********************************************************** -- cgit From 1501a1755c9e0eaf0d9fee80e5efcba53f541cf9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 21 Dec 2005 23:26:23 +0000 Subject: r12415: Forgot newlines. Guenther (This used to be commit c727a1a330e50b0919ff705d9ebc55c72d8fdee4) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fa61a8aedb..526bce9b60 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4163,7 +4163,7 @@ static void set_server_role(void) break; } - DEBUG(10, ("set_server_role: role = %s", server_role_str(server_role))); + DEBUG(10, ("set_server_role: role = %s\n", server_role_str(server_role))); } /*********************************************************** -- cgit From a189257c15725e36e68970ed723f3365d4496792 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 5 Jan 2006 11:35:29 +0000 Subject: r12721: GPFS 2.4 on Linux will contain some windows semantics, ie share modes and oplocks across the cluster. Adapt Samba to it. The gpfs API is called via libgpfs.so. This code is written with dlopen(), so that you can compile on a system with gpfs installed and later on run on systems without gpfs available. So to actually make Samba call gpfs share mode calls you need to compile with gpfs.h and libgpfs.so around and set 'gpfs share = yes' on the shares you export from GPFS. Volker (This used to be commit 2253b17a1a88555291b59d52c826c81c2b8f7e7f) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 526bce9b60..3fa6dee5a2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -433,6 +433,7 @@ typedef struct BOOL bProfileAcls; BOOL bMap_acl_inherit; BOOL bAfs_Share; + BOOL bGpfs_Share; BOOL bEASupport; BOOL bAclCheckPermissions; BOOL bAclMapFullControl; @@ -569,6 +570,7 @@ static service sDefault = { False, /* bProfileAcls */ False, /* bMap_acl_inherit */ False, /* bAfs_Share */ + False, /* bGpfs_Share */ False, /* bEASupport */ True, /* bAclCheckPermissions */ True, /* bAclMapFullControl */ @@ -967,6 +969,7 @@ static struct parm_struct parm_table[] = { {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_ADVANCED}, {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"afs share", P_BOOL, P_LOCAL, &sDefault.bAfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"gpfs share", P_BOOL, P_LOCAL, &sDefault.bGpfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED}, @@ -2001,6 +2004,7 @@ FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) +FN_LOCAL_BOOL(lp_gpfs_share, bGpfs_Share) FN_LOCAL_BOOL(lp_acl_check_permissions, bAclCheckPermissions) FN_LOCAL_BOOL(lp_acl_group_control, bAclGroupControl) FN_LOCAL_BOOL(lp_acl_map_full_control, bAclMapFullControl) -- cgit From 4d1d826be44ec82e3778e89cbd2873e0aacfc134 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 6 Jan 2006 10:27:12 +0000 Subject: r12735: After talking to Tridge and Jeremy... This needs to be made more generic before it goes in. Volker (This used to be commit 2c3d5c029a31111e1fe84ddc13c1bfc183d8bfde) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3fa6dee5a2..526bce9b60 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -433,7 +433,6 @@ typedef struct BOOL bProfileAcls; BOOL bMap_acl_inherit; BOOL bAfs_Share; - BOOL bGpfs_Share; BOOL bEASupport; BOOL bAclCheckPermissions; BOOL bAclMapFullControl; @@ -570,7 +569,6 @@ static service sDefault = { False, /* bProfileAcls */ False, /* bMap_acl_inherit */ False, /* bAfs_Share */ - False, /* bGpfs_Share */ False, /* bEASupport */ True, /* bAclCheckPermissions */ True, /* bAclMapFullControl */ @@ -969,7 +967,6 @@ static struct parm_struct parm_table[] = { {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_ADVANCED}, {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"afs share", P_BOOL, P_LOCAL, &sDefault.bAfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"gpfs share", P_BOOL, P_LOCAL, &sDefault.bGpfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED}, {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED}, @@ -2004,7 +2001,6 @@ FN_LOCAL_BOOL(_lp_use_sendfile, bUseSendfile) FN_LOCAL_BOOL(lp_profile_acls, bProfileAcls) FN_LOCAL_BOOL(lp_map_acl_inherit, bMap_acl_inherit) FN_LOCAL_BOOL(lp_afs_share, bAfs_Share) -FN_LOCAL_BOOL(lp_gpfs_share, bGpfs_Share) FN_LOCAL_BOOL(lp_acl_check_permissions, bAclCheckPermissions) FN_LOCAL_BOOL(lp_acl_group_control, bAclGroupControl) FN_LOCAL_BOOL(lp_acl_map_full_control, bAclMapFullControl) -- cgit From 543ff192b37feff91fd77c336177cb628bd1e08a Mon Sep 17 00:00:00 2001 From: James Peach Date: Thu, 19 Jan 2006 00:30:16 +0000 Subject: r13027: Support file change notifications from FAM. (This used to be commit 652b511ff24ce41c7745a0e00363e619e5027828) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 526bce9b60..83a5b2fc3c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -294,6 +294,7 @@ typedef struct BOOL bUnixExtensions; BOOL bDisableNetbios; BOOL bKernelChangeNotify; + BOOL bFamChangeNotify; BOOL bUseKerberosKeytab; BOOL bDeferSharingViolations; BOOL bEnablePrivileges; @@ -992,6 +993,7 @@ static struct parm_struct parm_table[] = { {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED}, {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED}, + {"fam change notify", P_BOOL, P_GLOBAL, &Globals.bFamChangeNotify, NULL, NULL, FLAG_ADVANCED}, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED}, {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_ADVANCED}, @@ -1486,6 +1488,7 @@ static void init_globals(void) 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.bFamChangeNotify = True; /* On if we have it. */ Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; Globals.announce_as = ANNOUNCE_AS_NT_SERVER; @@ -1868,6 +1871,7 @@ FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) 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_fam_change_notify, &Globals.bFamChangeNotify) 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) -- cgit From 9c15bd311db76885b27f30ba92d885833f668550 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Sat, 28 Jan 2006 22:53:04 +0000 Subject: r13212: r12414@cabra: derrell | 2006-01-28 17:52:17 -0500 lp_load() could not be called multiple times to modify parameter settings based on reading from multiple configuration settings. Each time, it initialized all of the settings back to their defaults before reading the specified configuration file. This patch adds a parameter to lp_load() specifying whether the settings should be initialized. It does, however, still force the settings to be initialized the first time, even if the request was to not initialize them. (Not doing so could wreak havoc due to uninitialized values.) (This used to be commit f2a24de769d1b2266e576597c57a8e3b1e2a2b51) --- source3/param/loadparm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 83a5b2fc3c..a2aa851b09 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1354,11 +1354,17 @@ static void init_printer_values(service *pService) Initialise the global parameter structure. ***************************************************************************/ -static void init_globals(void) +static void init_globals(BOOL first_time_only) { static BOOL done_init = False; pstring s; + /* If requested to initialize only once and we've already done it... */ + if (first_time_only && done_init) { + /* ... then we have nothing more to do */ + return; + } + if (!done_init) { int i; @@ -4188,8 +4194,11 @@ static void set_allowed_client_auth(void) False on failure. ***************************************************************************/ -BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, - BOOL add_ipc) +BOOL lp_load(const char *pszFname, + BOOL global_only, + BOOL save_defaults, + BOOL add_ipc, + BOOL initialize_globals) { pstring n2; BOOL bRetval; @@ -4208,7 +4217,7 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, bInGlobalSection = True; bGlobalOnly = global_only; - init_globals(); + init_globals(! initialize_globals); debug_init(); if (save_defaults) { -- cgit From 0af1500fc0bafe61019f1b2ab1d9e1d369221240 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Feb 2006 22:19:41 +0000 Subject: r13316: Let the carnage begin.... Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f) --- source3/param/loadparm.c | 715 +++++++++++++++++++++++++++++++++++++++++++++-- source3/param/params.c | 2 +- 2 files changed, 698 insertions(+), 19 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a2aa851b09..a886728047 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -54,6 +54,7 @@ #include "includes.h" BOOL in_client = False; /* Not in the client by default */ +BOOL in_server = False; /* Not in the server by default */ BOOL bLoaded = False; extern userdom_struct current_user_info; @@ -76,6 +77,9 @@ extern enum protocol_types Protocol; #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid) #define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid) +#define USERSHARE_VALID 1 +#define USERSHARE_PENDING_DELETE 2 + int keepalive = DEFAULT_KEEPALIVE; BOOL use_getwd_cache = True; @@ -94,8 +98,7 @@ struct _param_opt_struct { /* * This structure describes global (ie., server-wide) parameters. */ -typedef struct -{ +typedef struct { char *smb_ports; char *dos_charset; char *unix_charset; @@ -167,7 +170,6 @@ typedef struct BOOL bUtmp; char *szIdmapUID; char *szIdmapGID; - BOOL bEnableRidAlgorithm; BOOL bPassdbExpandExplicit; int AlgorithmicRidBase; char *szTemplateHomedir; @@ -178,6 +180,8 @@ typedef struct BOOL bWinbindUseDefaultDomain; BOOL bWinbindTrustedDomainsOnly; BOOL bWinbindNestedGroups; + BOOL bWinbindRefreshTickets; + BOOL bWinbindOfflineLogon; char **szIdmapBackend; char *szAddShareCommand; char *szChangeShareCommand; @@ -186,6 +190,10 @@ typedef struct char *szGuestaccount; char *szManglingMethod; char **szServicesList; + char *szUsersharePath; + char *szUsershareTemplateShare; + char **szUsersharePrefixAllowList; + char **szUsersharePrefixDenyList; int mangle_prefix; int max_log_size; char *szLogLevel; @@ -299,24 +307,27 @@ typedef struct BOOL bDeferSharingViolations; BOOL bEnablePrivileges; BOOL bASUSupport; + BOOL bUsershareOwnerOnly; int restrict_anonymous; int name_cache_timeout; int client_signing; int server_signing; + int iUsershareMaxShares; + BOOL bResetOnZeroVC; param_opt_struct *param_opt; -} -global; +} global; static global Globals; /* * This structure describes a single service. */ -typedef struct -{ +typedef struct { BOOL valid; BOOL autoloaded; + int usershare; + time_t usershare_last_mod; char *szService; char *szPath; char *szUsername; @@ -445,14 +456,15 @@ typedef struct param_opt_struct *param_opt; char dummy[3]; /* for alignment */ -} -service; +} service; /* This is a default service used to prime a services structure */ static service sDefault = { True, /* valid */ False, /* not autoloaded */ + 0, /* not a usershare */ + (time_t)0, /* No last mod time */ NULL, /* szService */ NULL, /* szPath */ NULL, /* szUsername */ @@ -1214,6 +1226,12 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"usershare max shares", P_INTEGER, P_GLOBAL, &Globals.iUsershareMaxShares, NULL, NULL, FLAG_ADVANCED}, + {"usershare owner only", P_BOOL, P_GLOBAL, &Globals.bUsershareOwnerOnly, NULL, NULL, FLAG_ADVANCED}, + {"usershare path", P_STRING, P_GLOBAL, &Globals.szUsersharePath, NULL, NULL, FLAG_ADVANCED}, + {"usershare prefix allow list", P_LIST, P_GLOBAL, &Globals.szUsersharePrefixAllowList, NULL, NULL, FLAG_ADVANCED}, + {"usershare prefix deny list", P_LIST, P_GLOBAL, &Globals.szUsersharePrefixDenyList, NULL, NULL, FLAG_ADVANCED}, + {"usershare template share", P_STRING, P_GLOBAL, &Globals.szUsershareTemplateShare, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -1242,7 +1260,6 @@ static struct parm_struct parm_table[] = { {N_("Winbind options"), P_SEP, P_SEPARATOR}, - {"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_DEPRECATED}, {"passdb expand explicit", P_BOOL, P_GLOBAL, &Globals.bPassdbExpandExplicit, 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}, @@ -1260,6 +1277,8 @@ static struct parm_struct parm_table[] = { {"winbind nested groups", P_BOOL, P_GLOBAL, &Globals.bWinbindNestedGroups, NULL, NULL, FLAG_ADVANCED}, {"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED}, {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, + {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, + {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1612,8 +1631,9 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindNestedGroups = False; Globals.winbind_max_idle_children = 3; Globals.szWinbindNssInfo = str_list_make("template", NULL); + Globals.bWinbindRefreshTickets = False; + Globals.bWinbindOfflineLogon = False; - Globals.bEnableRidAlgorithm = True; Globals.bPassdbExpandExplicit = True; Globals.name_cache_timeout = 660; /* In seconds */ @@ -1636,6 +1656,15 @@ static void init_globals(BOOL first_time_only) Globals.bASUSupport = True; Globals.szServicesList = str_list_make( "Spooler NETLOGON", NULL ); + + /* User defined shares. */ + pstrcpy(s, dyn_LOCKDIR); + pstrcat(s, "/usershares"); + string_set(&Globals.szUsersharePath, s); + string_set(&Globals.szUsershareTemplateShare, ""); + Globals.iUsershareMaxShares = 0; + /* By default disallow sharing of directories not owned by the sharer. */ + Globals.bUsershareOwnerOnly = True; } static TALLOC_CTX *lp_talloc; @@ -1652,6 +1681,19 @@ void lp_talloc_free(void) lp_talloc = NULL; } +TALLOC_CTX *tmp_talloc_ctx(void) +{ + if (lp_talloc == NULL) { + lp_talloc = talloc_init(NULL); + } + + if (lp_talloc == NULL) { + smb_panic("Could not create temporary talloc context\n"); + } + + return lp_talloc; +} + /******************************************************************* Convenience routine to grab string parameters into temporary memory and run standard_sub_basic on them. The buffers can be written to by @@ -1800,10 +1842,10 @@ 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_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) +FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) -FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) #ifdef WITH_LDAP_SAMCONFIG @@ -1821,9 +1863,13 @@ FN_GLOBAL_INTEGER(lp_ldap_page_size, &Globals.ldap_page_size) 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_STRING(lp_usershare_path, &Globals.szUsersharePath) +FN_GLOBAL_LIST(lp_usershare_prefix_allow_list, &Globals.szUsersharePrefixAllowList) +FN_GLOBAL_LIST(lp_usershare_prefix_deny_list, &Globals.szUsersharePrefixDenyList) FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) +FN_GLOBAL_BOOL(lp_usershare_owner_only, &Globals.bUsershareOwnerOnly) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) FN_GLOBAL_BOOL(lp_reset_on_zero_vc, &Globals.bResetOnZeroVC) FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) @@ -1912,6 +1958,8 @@ FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) +FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) + FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) FN_LOCAL_STRING(lp_rootpreexec, szRootPreExec) @@ -2479,7 +2527,7 @@ static char *canonicalize_servicename(const char *src) } fstrcpy( canon, src ); - strupper_m( canon ); + strlower_m( canon ); return canon; } @@ -4028,9 +4076,11 @@ void lp_killunused(BOOL (*snumused) (int)) if (!VALID(i)) continue; - /* don't kill autoloaded services */ - if ( ServicePtrs[i]->autoloaded ) + /* don't kill autoloaded or usershare services */ + if ( ServicePtrs[i]->autoloaded || + ServicePtrs[i]->usershare == USERSHARE_VALID) { continue; + } if (!snumused || !snumused(i)) { free_service_byindex(i); @@ -4179,6 +4229,7 @@ static void set_server_role(void) /*********************************************************** If we should send plaintext/LANMAN passwords in the clinet ************************************************************/ + static void set_allowed_client_auth(void) { if (Globals.bClientNTLMv2Auth) { @@ -4189,6 +4240,611 @@ static void set_allowed_client_auth(void) } } +/*************************************************************************** + JRA. + The following code allows smbd to read a user defined share file. + Yes, this is my intent. Yes, I'm comfortable with that... + + THE FOLLOWING IS SECURITY CRITICAL CODE. + + It washes your clothes, it cleans your house, it guards you while you sleep... + Do not f%^k with it.... +***************************************************************************/ + +#define MAX_USERSHARE_FILE_SIZE (10*1024) + +/*************************************************************************** + Check allowed stat state of a usershare file. + Ensure we print out who is dicking with us so the admin can + get their sorry ass fired. +***************************************************************************/ + +static BOOL check_usershare_stat(const char *fname, SMB_STRUCT_STAT *psbuf) +{ + if (!S_ISREG(psbuf->st_mode)) { + DEBUG(0,("check_usershare_stat: file %s owned by uid %u is " + "not a regular file\n", + fname, (unsigned int)psbuf->st_uid )); + return False; + } + + /* Ensure this doesn't have the other write bit set. */ + if (psbuf->st_mode & S_IWOTH) { + DEBUG(0,("check_usershare_stat: file %s owned by uid %u allows " + "public write. Refusing to allow as a usershare file.\n", + fname, (unsigned int)psbuf->st_uid )); + return False; + } + + /* Should be 10k or less. */ + if (psbuf->st_size > MAX_USERSHARE_FILE_SIZE) { + DEBUG(0,("check_usershare_stat: file %s owned by uid %u is " + "too large (%u) to be a user share file.\n", + fname, (unsigned int)psbuf->st_uid, + (unsigned int)psbuf->st_size )); + return False; + } + + return True; +} + +/*************************************************************************** + Parse the contents of a usershare file. +***************************************************************************/ + +enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, + SMB_STRUCT_STAT *psbuf, + const char *servicename, + int snum, + char **lines, + int numlines, + pstring sharepath, + pstring comment, + SEC_DESC **ppsd) +{ + const char **prefixallowlist = lp_usershare_prefix_allow_list(); + const char **prefixdenylist = lp_usershare_prefix_deny_list(); + SMB_STRUCT_DIR *dp; + SMB_STRUCT_STAT sbuf; + + if (numlines < 4) { + return USERSHARE_MALFORMED_FILE; + } + + if (!strequal(lines[0], "#VERSION 1")) { + return USERSHARE_BAD_VERSION; + } + + if (!strnequal(lines[1], "path=", 5)) { + return USERSHARE_MALFORMED_PATH; + } + + pstrcpy(sharepath, &lines[1][5]); + trim_string(sharepath, " ", " "); + + if (!strnequal(lines[2], "comment=", 8)) { + return USERSHARE_MALFORMED_COMMENT_DEF; + } + + pstrcpy(comment, &lines[2][8]); + trim_string(comment, " ", " "); + trim_char(comment, '"', '"'); + + if (!strnequal(lines[3], "usershare_acl=", 14)) { + return USERSHARE_MALFORMED_ACL_DEF; + } + + if (!parse_usershare_acl(ctx, &lines[3][14], ppsd)) { + return USERSHARE_ACL_ERR; + } + + if (snum != -1 && strequal(sharepath, ServicePtrs[snum]->szPath)) { + /* Path didn't change, no checks needed. */ + return USERSHARE_OK; + } + + /* The path *must* be absolute. */ + if (sharepath[0] != '/') { + DEBUG(2,("parse_usershare_file: share %s: path %s is not an absolute path.\n", + servicename, sharepath)); + return USERSHARE_PATH_NOT_ABSOLUTE; + } + + /* If there is a usershare prefix deny list ensure one of these paths + doesn't match the start of the user given path. */ + if (prefixdenylist) { + int i; + for ( i=0; prefixdenylist[i]; i++ ) { + DEBUG(10,("parse_usershare_file: share %s : checking prefixdenylist[%d]='%s' against %s\n", + servicename, i, prefixdenylist[i], sharepath )); + if (memcmp( sharepath, prefixdenylist[i], strlen(prefixdenylist[i])) == 0) { + DEBUG(2,("parse_usershare_file: share %s path %s starts with one of the " + "usershare prefix deny list entries.\n", + servicename, sharepath)); + return USERSHARE_PATH_IS_DENIED; + } + } + } + + /* If there is a usershare prefix allow list ensure one of these paths + does match the start of the user given path. */ + + if (prefixallowlist) { + int i; + for ( i=0; prefixallowlist[i]; i++ ) { + DEBUG(10,("parse_usershare_file: share %s checking prefixallowlist[%d]='%s' against %s\n", + servicename, i, prefixallowlist[i], sharepath )); + if (memcmp( sharepath, prefixallowlist[i], strlen(prefixallowlist[i])) == 0) { + break; + } + } + if (prefixallowlist[i] == NULL) { + DEBUG(2,("parse_usershare_file: share %s path %s doesn't start with one of the " + "usershare prefix allow list entries.\n", + servicename, sharepath)); + return USERSHARE_PATH_NOT_ALLOWED; + } + } + + /* Ensure this is pointing to a directory. */ + dp = sys_opendir(sharepath); + + if (!dp) { + DEBUG(2,("parse_usershare_file: share %s path %s is not a directory.\n", + servicename, sharepath)); + return USERSHARE_PATH_NOT_DIRECTORY; + } + + /* Ensure the owner of the usershare file has permission to share + this directory. */ + + if (sys_stat(sharepath, &sbuf) == -1) { + DEBUG(2,("parse_usershare_file: share %s : stat failed on path %s. %s\n", + servicename, sharepath, strerror(errno) )); + sys_closedir(dp); + return USERSHARE_POSIX_ERR; + } + + sys_closedir(dp); + + if (!S_ISDIR(sbuf.st_mode)) { + DEBUG(2,("parse_usershare_file: share %s path %s is not a directory.\n", + servicename, sharepath )); + return USERSHARE_PATH_NOT_DIRECTORY; + } + + /* Check if sharing is restricted to owner-only. */ + /* psbuf is the stat of the usershare definition file, + sbuf is the stat of the target directory to be shared. */ + + if (lp_usershare_owner_only()) { + /* root can share anything. */ + if ((psbuf->st_uid != 0) && (sbuf.st_uid != psbuf->st_uid)) { + return USERSHARE_PATH_NOT_ALLOWED; + } + } + + return USERSHARE_OK; +} + +/*************************************************************************** + Deal with a usershare file. + Returns: + >= 0 - snum + -1 - Bad name, invalid contents. + - service name already existed and not a usershare, problem + with permissions to share directory etc. +***************************************************************************/ + +static int process_usershare_file(const char *dir_name, const char *file_name, int snum_template) +{ + SMB_STRUCT_STAT sbuf; + SMB_STRUCT_STAT lsbuf; + pstring fname; + pstring sharepath; + pstring comment; + fstring service_name; + char **lines = NULL; + int numlines = 0; + int fd = -1; + int iService = -1; + TALLOC_CTX *ctx = NULL; + SEC_DESC *psd = NULL; + + /* Ensure share name doesn't contain invalid characters. */ + if (!validate_net_name(file_name, INVALID_SHARENAME_CHARS, strlen(file_name))) { + DEBUG(0,("process_usershare_file: share name %s contains " + "invalid characters (any of %s)\n", + file_name, INVALID_SHARENAME_CHARS )); + return -1; + } + + fstrcpy(service_name, file_name); + + pstrcpy(fname, dir_name); + pstrcat(fname, "/"); + pstrcat(fname, file_name); + + /* Minimize the race condition by doing an lstat before we + open and fstat. Ensure this isn't a symlink link. */ + + if (sys_lstat(fname, &lsbuf) != 0) { + DEBUG(0,("process_usershare_file: stat of %s failed. %s\n", + fname, strerror(errno) )); + return -1; + } + + /* This must be a regular file, not a symlink, directory or + other strange filetype. */ + if (!check_usershare_stat(fname, &lsbuf)) { + return -1; + } + + /* See if there is already a servicenum for this name. */ + /* tdb_fetch_int32 returns -1 if not found. */ + iService = (int)tdb_fetch_int32(ServiceHash, canonicalize_servicename(service_name) ); + + if (iService != -1 && ServicePtrs[iService]->usershare_last_mod == lsbuf.st_mtime) { + /* Nothing changed - Mark valid and return. */ + DEBUG(10,("process_usershare_file: service %s not changed.\n", + service_name )); + ServicePtrs[iService]->usershare = USERSHARE_VALID; + return iService; + } + + /* Try and open the file read only - no symlinks allowed. */ +#ifdef O_NOFOLLOW + fd = sys_open(fname, O_RDONLY|O_NOFOLLOW, 0); +#else + fd = sys_open(fname, O_RDONLY, 0); +#endif + + if (fd == -1) { + DEBUG(0,("process_usershare_file: unable to open %s. %s\n", + fname, strerror(errno) )); + return -1; + } + + /* Now fstat to be *SURE* it's a regular file. */ + if (sys_fstat(fd, &sbuf) != 0) { + close(fd); + DEBUG(0,("process_usershare_file: fstat of %s failed. %s\n", + fname, strerror(errno) )); + return -1; + } + + /* Is it the same dev/inode as was lstated ? */ + if (lsbuf.st_dev != sbuf.st_dev || lsbuf.st_ino != sbuf.st_ino) { + close(fd); + DEBUG(0,("process_usershare_file: fstat of %s is a different file from lstat. " + "Symlink spoofing going on ?\n", fname )); + return -1; + } + + /* This must be a regular file, not a symlink, directory or + other strange filetype. */ + if (!check_usershare_stat(fname, &sbuf)) { + return -1; + } + + lines = fd_lines_load(fd, &numlines, MAX_USERSHARE_FILE_SIZE); + + close(fd); + if (lines == NULL) { + DEBUG(0,("process_usershare_file: loading file %s owned by %u failed.\n", + fname, (unsigned int)sbuf.st_uid )); + } + + /* Should we allow printers to be shared... ? */ + ctx = talloc_init("usershare_sd_xctx"); + if (!ctx) { + SAFE_FREE(lines); + return 1; + } + + if (parse_usershare_file(ctx, &sbuf, service_name, iService, lines, numlines, sharepath, comment, &psd) != USERSHARE_OK) { + talloc_destroy(ctx); + SAFE_FREE(lines); + return -1; + } + + SAFE_FREE(lines); + + /* Everything ok - add the service possibly using a template. */ + if (iService < 0) { + const service *sp = &sDefault; + if (snum_template != -1) { + sp = ServicePtrs[snum_template]; + } + + if ((iService = add_a_service(sp, service_name)) < 0) { + DEBUG(0, ("process_usershare_file: Failed to add " + "new service %s\n", service_name)); + talloc_destroy(ctx); + return -1; + } + + /* Read only is controlled by usershare ACL below. */ + ServicePtrs[iService]->bRead_only = False; + } + + /* Write the ACL of the new/modified share. */ + if (!set_share_security(ctx, service_name, psd)) { + DEBUG(0, ("process_usershare_file: Failed to set share " + "security for user share %s\n", + service_name )); + lp_remove_service(iService); + talloc_destroy(ctx); + return -1; + } + + talloc_destroy(ctx); + + /* If from a template it may be marked invalid. */ + ServicePtrs[iService]->valid = True; + + /* Set the service as a valid usershare. */ + ServicePtrs[iService]->usershare = USERSHARE_VALID; + + /* And note when it was loaded. */ + ServicePtrs[iService]->usershare_last_mod = sbuf.st_mtime; + string_set(&ServicePtrs[iService]->szPath, sharepath); + string_set(&ServicePtrs[iService]->comment, comment); + + return iService; +} + +/*************************************************************************** + Checks if a usershare entry has been modified since last load. +***************************************************************************/ + +static BOOL usershare_exists(int iService, time_t *last_mod) +{ + SMB_STRUCT_STAT lsbuf; + const char *usersharepath = Globals.szUsersharePath; + pstring fname; + + pstrcpy(fname, usersharepath); + pstrcat(fname, "/"); + pstrcat(fname, ServicePtrs[iService]->szService); + + if (sys_lstat(fname, &lsbuf) != 0) { + return False; + } + + if (!S_ISREG(lsbuf.st_mode)) { + return False; + } + + *last_mod = lsbuf.st_mtime; + return True; +} + +/*************************************************************************** + Load a usershare service by name. Returns a valid servicenumber or -1. +***************************************************************************/ + +int load_usershare_service(const char *servicename) +{ + SMB_STRUCT_STAT sbuf; + const char *usersharepath = Globals.szUsersharePath; + int max_user_shares = Globals.iUsershareMaxShares; + int snum_template = -1; + + if (*usersharepath == 0 || max_user_shares == 0) { + return -1; + } + + if (sys_stat(usersharepath, &sbuf) != 0) { + DEBUG(0,("load_usershare_service: stat of %s failed. %s\n", + usersharepath, strerror(errno) )); + return -1; + } + + if (!S_ISDIR(sbuf.st_mode)) { + DEBUG(0,("load_usershare_service: %s is not a directory.\n", + usersharepath )); + return -1; + } + + /* + * This directory must be owned by root, and have the 't' bit set. + * It also must not be writable by "other". + */ + +#ifdef S_ISVTX + if (sbuf.st_uid != 0 || !(sbuf.st_mode & S_ISVTX) || (sbuf.st_mode & S_IWOTH)) { +#else + if (sbuf.st_uid != 0 || (sbuf.st_mode & S_IWOTH)) { +#endif + DEBUG(0,("load_usershare_service: directory %s is not owned by root " + "or does not have the sticky bit 't' set or is writable by anyone.\n", + usersharepath )); + return -1; + } + + /* Ensure the template share exists if it's set. */ + if (Globals.szUsershareTemplateShare[0]) { + /* We can't use lp_servicenumber here as we are recommending that + template shares have -valid=False set. */ + for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) { + if (ServicePtrs[snum_template]->szService && + strequal(ServicePtrs[snum_template]->szService, + Globals.szUsershareTemplateShare)) { + break; + } + } + + if (snum_template == -1) { + DEBUG(0,("load_usershare_service: usershare template share %s " + "does not exist.\n", + Globals.szUsershareTemplateShare )); + return -1; + } + } + + return process_usershare_file(usersharepath, servicename, snum_template); +} + +/*************************************************************************** + Load all user defined shares from the user share directory. + We only do this if we're enumerating the share list. + This is the function that can delete usershares that have + been removed. +***************************************************************************/ + +int load_usershare_shares(void) +{ + SMB_STRUCT_DIR *dp; + SMB_STRUCT_STAT sbuf; + SMB_STRUCT_DIRENT *de; + int num_usershares = 0; + int max_user_shares = Globals.iUsershareMaxShares; + unsigned int num_dir_entries, num_bad_dir_entries, num_tmp_dir_entries; + unsigned int allowed_bad_entries = ((2*max_user_shares)/10); + unsigned int allowed_tmp_entries = ((2*max_user_shares)/10); + int iService; + int snum_template = -1; + const char *usersharepath = Globals.szUsersharePath; + int ret = lp_numservices(); + + if (max_user_shares == 0 || *usersharepath == '\0') { + return lp_numservices(); + } + + if (sys_stat(usersharepath, &sbuf) != 0) { + DEBUG(0,("load_usershare_shares: stat of %s failed. %s\n", + usersharepath, strerror(errno) )); + return ret; + } + + /* + * This directory must be owned by root, and have the 't' bit set. + * It also must not be writable by "other". + */ + +#ifdef S_ISVTX + if (sbuf.st_uid != 0 || !(sbuf.st_mode & S_ISVTX) || (sbuf.st_mode & S_IWOTH)) { +#else + if (sbuf.st_uid != 0 || (sbuf.st_mode & S_IWOTH)) { +#endif + DEBUG(0,("load_usershare_shares: directory %s is not owned by root " + "or does not have the sticky bit 't' set or is writable by anyone.\n", + usersharepath )); + return ret; + } + + /* Ensure the template share exists if it's set. */ + if (Globals.szUsershareTemplateShare[0]) { + /* We can't use lp_servicenumber here as we are recommending that + template shares have -valid=False set. */ + for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) { + if (ServicePtrs[snum_template]->szService && + strequal(ServicePtrs[snum_template]->szService, + Globals.szUsershareTemplateShare)) { + break; + } + } + + if (snum_template == -1) { + DEBUG(0,("load_usershare_shares: usershare template share %s " + "does not exist.\n", + Globals.szUsershareTemplateShare )); + return ret; + } + } + + /* Mark all existing usershares as pending delete. */ + for (iService = iNumServices - 1; iService >= 0; iService--) { + if (VALID(iService) && ServicePtrs[iService]->usershare) { + ServicePtrs[iService]->usershare = USERSHARE_PENDING_DELETE; + } + } + + dp = sys_opendir(usersharepath); + if (!dp) { + DEBUG(0,("load_usershare_shares:: failed to open directory %s. %s\n", + usersharepath, strerror(errno) )); + return ret; + } + + for (num_dir_entries = 0, num_bad_dir_entries = 0, num_tmp_dir_entries = 0; + (de = sys_readdir(dp)); + num_dir_entries++ ) { + int r; + const char *n = de->d_name; + + /* Ignore . and .. */ + if (*n == '.') { + if ((n[1] == '\0') || (n[1] == '.' && n[2] == '\0')) { + continue; + } + } + + if (n[0] == ':') { + /* Temporary file used when creating a share. */ + num_tmp_dir_entries++; + } + + /* Allow 20% tmp entries. */ + if (num_tmp_dir_entries > allowed_tmp_entries) { + DEBUG(0,("load_usershare_shares: too many temp entries (%u) " + "in directory %s\n", + num_tmp_dir_entries, usersharepath)); + break; + } + + r = process_usershare_file(usersharepath, n, snum_template); + if (r == 0) { + /* Update the services count. */ + num_usershares++; + if (num_usershares >= max_user_shares) { + DEBUG(0,("load_usershare_shares: max user shares reached " + "on file %s in directory %s\n", + n, usersharepath )); + break; + } + } else if (r == -1) { + num_bad_dir_entries++; + } + + /* Allow 20% bad entries. */ + if (num_bad_dir_entries > allowed_bad_entries) { + DEBUG(0,("load_usershare_shares: too many bad entries (%u) " + "in directory %s\n", + num_bad_dir_entries, usersharepath)); + break; + } + + /* Allow 20% bad entries. */ + if (num_dir_entries > max_user_shares + allowed_bad_entries) { + DEBUG(0,("load_usershare_shares: too many total entries (%u) " + "in directory %s\n", + num_dir_entries, usersharepath)); + break; + } + } + + sys_closedir(dp); + + /* Sweep through and delete any non-refreshed usershares that are + not currently in use. */ + for (iService = iNumServices - 1; iService >= 0; iService--) { + if (VALID(iService) && (ServicePtrs[iService]->usershare == USERSHARE_PENDING_DELETE)) { + if (conn_snum_used(iService)) { + continue; + } + /* Remove from the share ACL db. */ + DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n", + lp_servicename(iService) )); + delete_share_security(iService); + free_service_byindex(iService); + } + } + + return lp_numservices(); +} + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. @@ -4339,8 +4995,9 @@ int lp_servicenumber(const char *pszServiceName) int iService; fstring serviceName; - if (!pszServiceName) + if (!pszServiceName) { return GLOBAL_SECTION_SNUM; + } for (iService = iNumServices - 1; iService >= 0; iService--) { if (VALID(iService) && ServicePtrs[iService]->szService) { @@ -4350,8 +5007,30 @@ int lp_servicenumber(const char *pszServiceName) */ fstrcpy(serviceName, ServicePtrs[iService]->szService); standard_sub_basic(get_current_username(), serviceName,sizeof(serviceName)); - if (strequal(serviceName, pszServiceName)) + if (strequal(serviceName, pszServiceName)) { break; + } + } + } + + if (iService >= 0 && ServicePtrs[iService]->usershare == USERSHARE_VALID) { + time_t last_mod; + + if (!usershare_exists(iService, &last_mod)) { + /* Remove the share security tdb entry for it. */ + delete_share_security(iService); + /* Remove it from the array. */ + free_service_byindex(iService); + /* Doesn't exist anymore. */ + return GLOBAL_SECTION_SNUM; + } + + /* Has it been modified ? If so delete and reload. */ + if (ServicePtrs[iService]->usershare_last_mod < last_mod) { + /* Remove it from the array. */ + free_service_byindex(iService); + /* and now reload it. */ + iService = load_usershare_service(pszServiceName); } } diff --git a/source3/param/params.c b/source3/param/params.c index 2a6c8b3e65..f5ce6bdb64 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -532,7 +532,7 @@ static myFILE *OpenConfFile( const char *FileName ) if (!ret) return NULL; - ret->buf = file_load(FileName, &ret->size); + ret->buf = file_load(FileName, &ret->size, 0); if( NULL == ret->buf ) { DEBUG( lvl, ("%s Unable to open configuration file \"%s\":\n\t%s\n", func, FileName, strerror(errno)) ); -- cgit From ef3f2c9675194efa17cfd4b4b5393a6e0a335bdf Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Feb 2006 15:09:09 +0000 Subject: r13393: Do not initialize the lp_svcctl_list() value since it is handled internally in services_db.c now. This prevents internal services from being listed twice (one internal and one external) when no 'svcctl list' parameter is explcitly set in smb.conf (This used to be commit 6c4ede6cee7e1d25a6357e959972e8d390c27fe3) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a886728047..6ed6b90498 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1655,8 +1655,6 @@ static void init_globals(BOOL first_time_only) Globals.bASUSupport = True; - Globals.szServicesList = str_list_make( "Spooler NETLOGON", NULL ); - /* User defined shares. */ pstrcpy(s, dyn_LOCKDIR); pstrcat(s, "/usershares"); -- cgit From 75ef18fa7510d894ccc4540d82616110c3166db3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 11 Feb 2006 21:27:08 +0000 Subject: r13460: by popular demand.... * remove pdb_context data structure * set default group for DOMAIN_RID_GUEST user as RID 513 (just like Windows) * Allow RID 513 to resolve to always resolve to a name * Remove auto mapping of guest account primary group given the previous 2 changes (This used to be commit 7a2da5f0cc05c1920c664c9a690a23bdf854e285) --- source3/param/loadparm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6ed6b90498..207be6c037 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -124,7 +124,7 @@ typedef struct { char *szConfigFile; char *szSMBPasswdFile; char *szPrivateDir; - char **szPassdbBackend; + char *szPassdbBackend; char **szPreloadModules; char *szPasswordServer; char *szSocketOptions; @@ -861,7 +861,7 @@ static struct parm_struct parm_table[] = { {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED}, {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED}, - {"passdb backend", P_LIST, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + {"passdb backend", P_STRING, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED}, {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_ADVANCED}, {"root dir", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, FLAG_HIDE}, @@ -1560,13 +1560,12 @@ static void init_globals(BOOL first_time_only) 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.szPassdbBackend = str_list_make("ldapsam_compat", NULL); + string_set(&Globals.szPassdbBackend, "ldapsam_compat"); #else - Globals.szPassdbBackend = str_list_make("smbpasswd", NULL); + string_set(&Globals.szPassdbBackend, "smbpasswd"); #endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); @@ -1807,7 +1806,7 @@ FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) -FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend) +FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) FN_GLOBAL_LIST(lp_preload_modules, &Globals.szPreloadModules) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) -- cgit From 28d12c3b9dc07733f3dc5290c68d372ed339dfda Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Feb 2006 18:27:06 +0000 Subject: r13513: Changing defaults: * enable privileges = yes * enable asu support = no Remove unused function after the tdbsam rewrite. (This used to be commit 5385a01ee19d9c7e00b4dd7a6ab3ec1d4b03b558) --- source3/param/loadparm.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 207be6c037..c1cac6b966 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1646,13 +1646,8 @@ static void init_globals(BOOL first_time_only) 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; - - Globals.bASUSupport = True; + Globals.bEnablePrivileges = True; + Globals.bASUSupport = False; /* User defined shares. */ pstrcpy(s, dyn_LOCKDIR); @@ -5241,15 +5236,6 @@ const char *lp_printername(int snum) } -/**************************************************************** - Compatibility fn. for 2.2.2 code..... -*****************************************************************/ - -void get_private_directory(pstring privdir) -{ - pstrcpy (privdir, lp_private_dir()); -} - /*********************************************************** Allow daemons such as winbindd to fix their logfile name. ************************************************************/ -- cgit From fb5362c069b5b6548478b2217a0519c56d856705 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Feb 2006 17:59:58 +0000 Subject: r13571: Replace all calls to talloc_free() with thye TALLOC_FREE() macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c1cac6b966..b44fcfbd91 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1665,11 +1665,11 @@ static TALLOC_CTX *lp_talloc; Free up temporary memory - called from the main loop. ********************************************************************/ -void lp_talloc_free(void) +void lp_TALLOC_FREE(void) { if (!lp_talloc) return; - talloc_free(lp_talloc); + TALLOC_FREE(lp_talloc); lp_talloc = NULL; } -- cgit From f5f37f6f8a83b017ebd4bb461cc291411581fe35 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Feb 2006 01:31:43 +0000 Subject: r13610: Patch from Bjoern JACKE . Don't default to /tmp if there is no path in the share, make it unavailable. All printer shares should have a path and IPC$ is already explicitly set to tmpdir(). Jeremy. (This used to be commit b1915a0591d9842b4c95f527363a807e8a756697) --- source3/param/loadparm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b44fcfbd91..92719d9a3a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2929,10 +2929,12 @@ static BOOL service_ok(int iService) } if (ServicePtrs[iService]->szPath[0] == '\0' && - strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) { - DEBUG(0, ("No path in service %s - using %s\n", - ServicePtrs[iService]->szService, tmpdir())); - string_set(&ServicePtrs[iService]->szPath, tmpdir()); + strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0 && + ServicePtrs[iService]->szMSDfsProxy[0] == '\0' + ) { + DEBUG(0, ("WARNING: No path in service %s - making it unavailable!\n", + ServicePtrs[iService]->szService)); + ServicePtrs[iService]->bAvailable = False; } /* If a service is flagged unavailable, log the fact at level 0. */ -- cgit From 51d3bbe2858c8ed1afd9b3fd46ae952fd22d48f0 Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 28 Feb 2006 00:59:14 +0000 Subject: r13736: Don't assume that printf can handle string arguments being NULL. Tidy up typing and tighten error checking a little. (This used to be commit 37e12a196b1b1ee57b17a21226ba55d3aa6c69a5) --- source3/param/loadparm.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 92719d9a3a..8c8afbfbe7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2152,14 +2152,17 @@ static param_opt_struct *get_parametrics(int snum, const char *type, const char } +#define MISSING_PARAMETER(name) \ + DEBUG(0, ("%s(): value is NULL or empty!\n", #name)) + /******************************************************************* convenience routine to return int parameters. ********************************************************************/ static int lp_int(const char *s) { - if (!s) { - DEBUG(0,("lp_int(%s): is called with NULL!\n",s)); + if (!s || !*s) { + MISSING_PARAMETER(lp_int); return (-1); } @@ -2169,12 +2172,12 @@ static int lp_int(const char *s) /******************************************************************* convenience routine to return unsigned long parameters. ********************************************************************/ -static int lp_ulong(const char *s) +static unsigned long lp_ulong(const char *s) { - if (!s) { - DEBUG(0,("lp_int(%s): is called with NULL!\n",s)); - return (-1); + if (!s || !*s) { + MISSING_PARAMETER(lp_ulong); + return (0); } return strtoul(s, NULL, 10); @@ -2187,8 +2190,8 @@ static BOOL lp_bool(const char *s) { BOOL ret = False; - if (!s) { - DEBUG(0,("lp_bool(%s): is called with NULL!\n",s)); + if (!s || !*s) { + MISSING_PARAMETER(lp_bool); return False; } @@ -2207,8 +2210,8 @@ static int lp_enum(const char *s,const struct enum_list *_enum) { int i; - if (!s || !_enum) { - DEBUG(0,("lp_enum(%s,enum): is called with NULL!\n",s)); + if (!s || !*s || !_enum) { + MISSING_PARAMETER(lp_enum); return (-1); } @@ -2221,6 +2224,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum) return (-1); } +#undef MISSING_PARAMETER /* DO NOT USE lp_parm_string ANYMORE!!!! * use lp_parm_const_string or lp_parm_talloc_string @@ -3485,16 +3489,15 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue switch (parm_table[parmnum].type) { case P_BOOL: - set_boolean((BOOL *)parm_ptr, pszParmValue); + *(BOOL *)parm_ptr = lp_bool(pszParmValue); break; case P_BOOLREV: - set_boolean((BOOL *)parm_ptr, pszParmValue); - *(BOOL *)parm_ptr = !*(BOOL *)parm_ptr; + *(BOOL *)parm_ptr = !lp_bool(pszParmValue); break; case P_INTEGER: - *(int *)parm_ptr = atoi(pszParmValue); + *(int *)parm_ptr = lp_int(pszParmValue); break; case P_CHAR: -- cgit From 1438ee5359f012e32de8ef51f129fce29b234e6d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 1 Mar 2006 15:23:43 +0000 Subject: r13772: More default changes * winbind nested groups = yes * host msdfs = ye * msdfs root = yes (This used to be commit b5f01559e1f75c427e59646ee79e18433806213e) --- source3/param/loadparm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8c8afbfbe7..65daf041e4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -572,7 +572,7 @@ static service sDefault = { False, /* bInheritPerms */ False, /* bInheritACLS */ False, /* bInheritOwner */ - False, /* bMSDfsRoot */ + True, /* bMSDfsRoot */ False, /* bUseClientDriver */ False, /* bDefaultDevmode */ False, /* bForcePrintername */ @@ -1627,7 +1627,7 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindEnumGroups = True; Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; - Globals.bWinbindNestedGroups = False; + Globals.bWinbindNestedGroups = True; Globals.winbind_max_idle_children = 3; Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; @@ -1647,6 +1647,7 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.smb_ports, SMB_PORTS); Globals.bEnablePrivileges = True; + Globals.bHostMSDfs = True; Globals.bASUSupport = False; /* User defined shares. */ -- cgit From d0ab9712f54d104c855ffb7521c4cae8e8083309 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 2 Mar 2006 19:26:33 +0000 Subject: r13794: If you are going to go, go big. That's what I always say. * disable winbind enum {users,groups} by default after further conversations with Volker. (This used to be commit d640d815405ce226c51577de5524daf63515d0a7) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 65daf041e4..6d0eb46f23 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1623,8 +1623,8 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.szIPrintServer, ""); Globals.winbind_cache_time = 300; /* 5 minutes */ - Globals.bWinbindEnumUsers = True; - Globals.bWinbindEnumGroups = True; + Globals.bWinbindEnumUsers = False; + Globals.bWinbindEnumGroups = False; Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; -- cgit From e33b728c7b2076917e2149191222b259e5c1d942 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Mar 2006 16:44:30 +0000 Subject: r13815: "Into the blind world let us now descend," Began the poet, his face as pale as death. "I will go first, and you will follow me." --- Adding XcvDataPort() to the spoolss code for remotely add ports. The design is to allow an intuitive means of creating a new CUPS print queue from the Windows 2000/XP APW without hacks like specifying the deviceURI in the location field of the printer properties dialog. Also set 'default devmode = yes' as the new default since it causes no harm and only is executed when you have a NULL devmode anyways. (This used to be commit 123e478ce5b5f63a61d00197332b847e83722468) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6d0eb46f23..ce4bef8d27 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -574,7 +574,7 @@ static service sDefault = { False, /* bInheritOwner */ True, /* bMSDfsRoot */ False, /* bUseClientDriver */ - False, /* bDefaultDevmode */ + True, /* bDefaultDevmode */ False, /* bForcePrintername */ True, /* bNTAclSupport */ False, /* bForceUnknownAclUser */ -- cgit From 5df58c38f3c29d87c5918d1611c17e016c6f7545 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 4 Mar 2006 00:05:40 +0000 Subject: r13829: From the "It's not pretty but it works" category * Finish prototype of the "add port command" implementation Format is "addportcommand portname deviceURI" * DeviceURI is either - socket://hostname:port/ - lpr://hostname/queue depending on what the client sent in the request (This used to be commit 6d74de7a676b71e83a3c3714743e6380c04e4425) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ce4bef8d27..64b3ecd81b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -104,6 +104,7 @@ typedef struct { char *unix_charset; char *display_charset; char *szPrintcapname; + char *szAddPortCommand; char *szEnumPortsCommand; char *szAddPrinterCommand; char *szDeletePrinterCommand; @@ -1050,6 +1051,7 @@ static struct parm_struct parm_table[] = { {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, + {"addport command", P_STRING, P_GLOBAL, &Globals.szAddPortCommand, NULL, NULL, FLAG_ADVANCED}, {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, FLAG_ADVANCED}, {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, FLAG_ADVANCED}, {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, FLAG_ADVANCED}, @@ -1763,6 +1765,7 @@ 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_INTEGER(lp_printcap_cache_time, &Globals.PrintcapCacheTime) +FN_GLOBAL_STRING(lp_addport_cmd, &Globals.szAddPortCommand) FN_GLOBAL_STRING(lp_enumports_cmd, &Globals.szEnumPortsCommand) FN_GLOBAL_STRING(lp_addprinter_cmd, &Globals.szAddPrinterCommand) FN_GLOBAL_STRING(lp_deleteprinter_cmd, &Globals.szDeletePrinterCommand) -- cgit From 894358a8f3e338b339b6c37233edef794b312087 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 7 Mar 2006 06:31:04 +0000 Subject: r13915: Fixed a very interesting class of realloc() bugs found by Coverity. realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0) --- source3/param/loadparm.c | 4 ++-- source3/param/params.c | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 64b3ecd81b..8b79ec37d7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2470,7 +2470,7 @@ static int add_a_service(const service *pservice, const char *name) service **tsp; int *tinvalid; - tsp = SMB_REALLOC_ARRAY(ServicePtrs, service *, num_to_alloc); + tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, service *, num_to_alloc); if (tsp == NULL) { DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n")); return (-1); @@ -2484,7 +2484,7 @@ static int add_a_service(const service *pservice, const char *name) iNumServices++; /* enlarge invalid_services here for now... */ - tinvalid = SMB_REALLOC_ARRAY(invalid_services, int, + tinvalid = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(invalid_services, int, num_to_alloc); if (tinvalid == NULL) { DEBUG(0,("add_a_service: failed to enlarge " diff --git a/source3/param/params.c b/source3/param/params.c index f5ce6bdb64..6669e80191 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -262,10 +262,8 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) while( (EOF != c) && (c > 0) ) { /* Check that the buffer is big enough for the next character. */ if( i > (bSize - 2) ) { - char *tb; - - tb = (char *)SMB_REALLOC( bufr, bSize +BUFR_INC ); - if( NULL == tb ) { + char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize +BUFR_INC ); + if(!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; } @@ -356,8 +354,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) /* Loop until we've found the start of the value. */ if( i > (bSize - 2) ) { /* Ensure there's space for next char. */ - char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); - if( NULL == tb ) { + char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC ); + if (!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; } @@ -414,8 +412,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) while( (EOF !=c) && (c > 0) ) { if( i > (bSize - 2) ) { /* Make sure there's enough room. */ - char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC ); - if( NULL == tb ) { + char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC ); + if (!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func)); return False; } -- cgit From f635dcb5f3f4d65b45126a857ccd150ec0f5bed6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Mar 2006 06:32:26 +0000 Subject: r14018: Coverity error CID #27. Missing return -1 on error condition. Jeremy. (This used to be commit 94e869d9c6d1a1c1df0d072530bf8d4452bd10bb) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b79ec37d7..2f100b303c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4534,6 +4534,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i if (lines == NULL) { DEBUG(0,("process_usershare_file: loading file %s owned by %u failed.\n", fname, (unsigned int)sbuf.st_uid )); + return -1; } /* Should we allow printers to be shared... ? */ -- cgit From a156d128f2bd5ea8ff9c1b5a4927ad3b82956fa8 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sat, 11 Mar 2006 10:23:02 +0000 Subject: r14204: Remove the basically unused P_GSTRING and P_UGSTRING parameter types. (This used to be commit 23328fe6fc5e3b4ed3dc35e1475d661a8593eb1a) --- source3/param/loadparm.c | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2f100b303c..2be578ba4f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1016,7 +1016,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED}, + {"socket options", P_STRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED}, {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, @@ -2716,8 +2716,8 @@ void show_parameter_list(void) BOOL hadFlag; const char *section_names[] = { "local", "global", NULL}; const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", - "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", - "P_UGSTRING", "P_ENUM", "P_SEP"}; + "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", + "P_ENUM", "P_SEP"}; unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, FLAG_HIDE, FLAG_DOS_STRING}; @@ -3529,15 +3529,6 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue strupper_m(*(char **)parm_ptr); break; - case P_GSTRING: - pstrcpy((char *)parm_ptr, pszParmValue); - break; - - case P_UGSTRING: - pstrcpy((char *)parm_ptr, pszParmValue); - strupper_m((char *)parm_ptr); - break; - case P_ENUM: lp_set_enum_parm( &parm_table[parmnum], pszParmValue, (int*)parm_ptr ); break; @@ -3616,13 +3607,6 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) } break; - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) { - fprintf(f, "%s", (char *)ptr); - } - break; - case P_STRING: case P_USTRING: if (*(char **)ptr) { @@ -3656,16 +3640,6 @@ static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_LIST: return str_list_compare(*(char ***)ptr1, *(char ***)ptr2); - case P_GSTRING: - case P_UGSTRING: - { - char *p1 = (char *)ptr1, *p2 = (char *)ptr2; - if (p1 && !*p1) - p1 = NULL; - if (p2 && !*p2) - p2 = NULL; - return (p1 == p2 || strequal(p1, p2)); - } case P_STRING: case P_USTRING: { @@ -3759,10 +3733,6 @@ static BOOL is_default(int i) case P_USTRING: return strequal(parm_table[i].def.svalue, *(char **)parm_table[i].ptr); - case P_GSTRING: - case P_UGSTRING: - return strequal(parm_table[i].def.svalue, - (char *)parm_table[i].ptr); case P_BOOL: case P_BOOLREV: return parm_table[i].def.bvalue == @@ -4125,14 +4095,6 @@ static void lp_save_defaults(void) parm_table[i].def.svalue = NULL; } break; - case P_GSTRING: - case P_UGSTRING: - if (parm_table[i].ptr) { - parm_table[i].def.svalue = SMB_STRDUP((char *)parm_table[i].ptr); - } else { - parm_table[i].def.svalue = NULL; - } - break; case P_BOOL: case P_BOOLREV: parm_table[i].def.bvalue = -- cgit From a62c0925e8b38e491fef7967fdca076895152d7e Mon Sep 17 00:00:00 2001 From: James Peach Date: Sat, 11 Mar 2006 10:59:03 +0000 Subject: r14207: Convert the lp_acl_compatibility() param into an enum. (This used to be commit 5429c495c538e416010cf44e1d6fb771770a72ae) --- source3/param/loadparm.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2be578ba4f..e285bd6087 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -622,7 +622,6 @@ 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); @@ -778,6 +777,13 @@ static const struct enum_list enum_smb_signing_vals[] = { {-1, NULL} }; +/* ACL compatibility options. */ +static const struct enum_list enum_acl_compat_vals[] = { + { ACL_COMPAT_AUTO, "auto" }, + { ACL_COMPAT_WINNT, "winnt" }, + { ACL_COMPAT_WIN2K, "win2k" }, + { -1, NULL} +}; /* Do you want session setups at user level security with a invalid @@ -969,7 +975,7 @@ static struct parm_struct parm_table[] = { {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED}, {"reset on zero vc", P_BOOL, P_GLOBAL, &Globals.bResetOnZeroVC, NULL, NULL, FLAG_ADVANCED}, - {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, NULL, enum_acl_compat_vals, 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}, @@ -1832,7 +1838,7 @@ FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) +FN_GLOBAL_INTEGER(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) @@ -3305,23 +3311,6 @@ char *lp_ldap_idmap_suffix(void) return lp_string(Globals.szLdapSuffix); } -/*************************************************************************** -***************************************************************************/ - -static BOOL handle_acl_compatibility(int snum, const char *pszParmValue, char **ptr) -{ - if (strequal(pszParmValue, "auto")) - string_set(ptr, ""); - else if (strequal(pszParmValue, "winnt")) - string_set(ptr, "winnt"); - else if (strequal(pszParmValue, "win2k")) - string_set(ptr, "win2k"); - else - return False; - - return True; -} - /**************************************************************************** set the value for a P_ENUM ***************************************************************************/ -- cgit From d245d5c0171c918f2d691160aecde43608bf2264 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sun, 12 Mar 2006 22:27:01 +0000 Subject: r14255: Revert r14204 which was horribly broken. (This used to be commit 950ed28f9f3f57dc449bd3bd6e7be7acb1e3d26d) --- source3/param/loadparm.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e285bd6087..97e876a542 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1022,7 +1022,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"socket options", P_STRING, P_GLOBAL, user_socket_options, 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}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, @@ -2722,8 +2722,8 @@ void show_parameter_list(void) BOOL hadFlag; const char *section_names[] = { "local", "global", NULL}; const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", - "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", - "P_ENUM", "P_SEP"}; + "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", + "P_UGSTRING", "P_ENUM", "P_SEP"}; unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, FLAG_HIDE, FLAG_DOS_STRING}; @@ -3518,6 +3518,15 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue strupper_m(*(char **)parm_ptr); break; + case P_GSTRING: + pstrcpy((char *)parm_ptr, pszParmValue); + break; + + case P_UGSTRING: + pstrcpy((char *)parm_ptr, pszParmValue); + strupper_m((char *)parm_ptr); + break; + case P_ENUM: lp_set_enum_parm( &parm_table[parmnum], pszParmValue, (int*)parm_ptr ); break; @@ -3596,6 +3605,13 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) } break; + case P_GSTRING: + case P_UGSTRING: + if ((char *)ptr) { + fprintf(f, "%s", (char *)ptr); + } + break; + case P_STRING: case P_USTRING: if (*(char **)ptr) { @@ -3629,6 +3645,16 @@ static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_LIST: return str_list_compare(*(char ***)ptr1, *(char ***)ptr2); + case P_GSTRING: + case P_UGSTRING: + { + char *p1 = (char *)ptr1, *p2 = (char *)ptr2; + if (p1 && !*p1) + p1 = NULL; + if (p2 && !*p2) + p2 = NULL; + return (p1 == p2 || strequal(p1, p2)); + } case P_STRING: case P_USTRING: { @@ -3722,6 +3748,10 @@ static BOOL is_default(int i) case P_USTRING: return strequal(parm_table[i].def.svalue, *(char **)parm_table[i].ptr); + case P_GSTRING: + case P_UGSTRING: + return strequal(parm_table[i].def.svalue, + (char *)parm_table[i].ptr); case P_BOOL: case P_BOOLREV: return parm_table[i].def.bvalue == @@ -4084,6 +4114,14 @@ static void lp_save_defaults(void) parm_table[i].def.svalue = NULL; } break; + case P_GSTRING: + case P_UGSTRING: + if (parm_table[i].ptr) { + parm_table[i].def.svalue = SMB_STRDUP((char *)parm_table[i].ptr); + } else { + parm_table[i].def.svalue = NULL; + } + break; case P_BOOL: case P_BOOLREV: parm_table[i].def.bvalue = -- cgit From 1267a3b297c188c789dda4e32c9961a87f771de9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 17 Mar 2006 20:35:44 +0000 Subject: r14530: removing unused 'winbind max idle children' parameter (This used to be commit 0e789b7e43388b0e7155708981b4ab52ec6d3961) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 97e876a542..7b831d1e98 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1283,7 +1283,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"winbind max idle children", P_INTEGER, P_GLOBAL, &Globals.winbind_max_idle_children, NULL, NULL, FLAG_ADVANCED}, {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, @@ -1636,7 +1635,6 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; - Globals.winbind_max_idle_children = 3; Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; @@ -2088,7 +2086,6 @@ FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) -FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) -- cgit From 1839b4be14e905428257eb999def184d73dcf08f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 22 Mar 2006 08:04:13 +0000 Subject: r14634: Many bug fixes thanks to train rides and overnight stays in airports * Finally fix parsing idmap uid/gid ranges not to break with spaces surrounding the '-' * Allow local groups to renamed by adding info level 2 to _samr_set_aliasinfo() * Fix parsing bug in _samr_del_dom_alias() reply * Prevent root from being deleted via Samba * Prevent builting groups from being renamed or deleted * Fix bug in pdb_tdb that broke renaming user accounts * Make sure winbindd is running when trying to create the Administrators and Users BUILTIN groups automatically from smbd (and not just check the winbind nexted groups parameter value). * Have the top level rid allocator verify that the RID it is about to grant is not already assigned in our own SAM (retries up to 250 times). This fixes passdb with existing SIDs assigned to users from the RID algorithm but not monotonically allocating the RIDs from passdb. (This used to be commit db1162241f79c2af8afb7d8c26e8ed1c4a4b476f) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7b831d1e98..0bde5805b0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3212,7 +3212,7 @@ static BOOL handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) { uint32 low, high; - if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) + if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) return False; /* Parse OK */ @@ -3229,7 +3229,7 @@ static BOOL handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) { uint32 low, high; - if (sscanf(pszParmValue, "%u-%u", &low, &high) != 2 || high < low) + if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) return False; /* Parse OK */ -- cgit From 40d0707827ee154bcb03013abe6f72f1026a70c9 Mon Sep 17 00:00:00 2001 From: James Peach Date: Wed, 22 Mar 2006 23:49:09 +0000 Subject: r14668: Set the FILE_STATUS_OFFLINE bit by observing the events a DMAPI-based HSM is interested in. Tested on both IRIX and SLES9. (This used to be commit 514a767c57f8194547e5b708ad2573ab9a0719c6) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0bde5805b0..13f585d8d0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -410,6 +410,7 @@ typedef struct { BOOL bMap_hidden; BOOL bMap_archive; BOOL bStoreDosAttributes; + BOOL bDmapiSupport; BOOL bLocking; int iStrictLocking; BOOL bPosixLocking; @@ -547,6 +548,7 @@ static service sDefault = { False, /* bMap_hidden */ True, /* bMap_archive */ False, /* bStoreDosAttributes */ + False, /* bDmapiSupport */ True, /* bLocking */ True, /* iStrictLocking */ True, /* bPosixLocking */ @@ -1097,6 +1099,8 @@ static struct parm_struct parm_table[] = { {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, {"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}, + {"dmapi support", P_BOOL, P_LOCAL, &sDefault.bDmapiSupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {N_("Domain Options"), P_SEP, P_SEPARATOR}, @@ -2024,6 +2028,7 @@ 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_dmapi_support, bDmapiSupport) FN_LOCAL_BOOL(lp_locking, bLocking) FN_LOCAL_INTEGER(lp_strict_locking, iStrictLocking) FN_LOCAL_BOOL(lp_posix_locking, bPosixLocking) -- cgit From 81d4f40bbe202e5dae3d4d1070b02edf16a9f62e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Mar 2006 22:19:01 +0000 Subject: r14763: Add a new tuning parameter, open files database hash size, this allows us to experiment with ensuring the tdb hash size for our open files and locking db are appropriately sized. Make the hash size larger by default (10007 instead of 1049) and make the locking db hash size the same as the open file db hash size. Jeremy. (This used to be commit e7225f7e813423c3e2a94af6a9d7ce8a1b50a166) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 13f585d8d0..a80eda7a4e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -201,6 +201,7 @@ typedef struct { int max_xmit; int max_mux; int max_open_files; + int open_files_db_hash_size; int pwordlevel; int unamelevel; int deadtime; @@ -1023,6 +1024,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"open files database hash size", P_INTEGER, P_GLOBAL, &Globals.open_files_db_hash_size, 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}, @@ -1498,6 +1500,7 @@ static void init_globals(BOOL first_time_only) Globals.bLargeReadwrite = True; Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; + Globals.open_files_db_hash_size = SMB_OPEN_DATABASE_TDB_HASH_SIZE; Globals.maxprotocol = PROTOCOL_NT1; Globals.minprotocol = PROTOCOL_CORE; Globals.security = SEC_USER; @@ -1938,6 +1941,7 @@ FN_GLOBAL_INTEGER(lp_max_wins_ttl, &Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_min_wins_ttl, &Globals.min_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size, &Globals.max_log_size) FN_GLOBAL_INTEGER(lp_max_open_files, &Globals.max_open_files) +FN_GLOBAL_INTEGER(lp_open_files_db_hash_size, &Globals.open_files_db_hash_size) FN_GLOBAL_INTEGER(lp_maxxmit, &Globals.max_xmit) FN_GLOBAL_INTEGER(lp_maxmux, &Globals.max_mux) FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel) -- cgit From 6c9eaa6880897aabbc56ad3d7bd73dfc69f926f9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 2 Apr 2006 06:25:11 +0000 Subject: r14855: Various fixes: * depreacte 'acl group control' after discussion with Jeremy and implement functionality as part of 'dos filemode' * fix winbindd on a non-member server to expand local groups * prevent code previously only used by smbd from blindly turning _NO_WINBINDD back on (This used to be commit 4ab372f4cab22225716b5c9a9a08f0c1dbc9928d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a80eda7a4e..7644843fc5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -916,7 +916,7 @@ static struct parm_struct parm_table[] = { {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, {"acl check permissions", P_BOOL, P_LOCAL, &sDefault.bAclCheckPermissions, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"acl group control", P_BOOL, P_LOCAL, &sDefault.bAclGroupControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {"acl group control", P_BOOL, P_LOCAL, &sDefault.bAclGroupControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED }, {"acl map full control", P_BOOL, P_LOCAL, &sDefault.bAclMapFullControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, -- cgit From 570b49f33faf99491220faeca98c36086fe9f71f Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Sun, 2 Apr 2006 21:12:23 +0000 Subject: r14869: Allow to dump a paramatrical option. Flaw: We print an empty line if the paramatrical option is not defined in the requested section. (This used to be commit a0d84ccc02e19d22d827e7d052fab6d471f0a1b3) --- source3/param/loadparm.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7644843fc5..7d3995f092 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3880,13 +3880,31 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) int i, result = False; parm_class p_class; unsigned flag = 0; + fstring local_parm_name; + char *parm_opt; + + /* check for parametrical option */ + fstrcpy( local_parm_name, parm_name); + parm_opt = strchr( local_parm_name, ':'); + + if (parm_opt) { + *parm_opt = '\0'; + parm_opt++; + if (strlen(parm_opt)) { + printf( "%s\n", lp_parm_const_string( snum, + local_parm_name, parm_opt, "")); + result = True; + } + return result; + } + /* check for a key and print the value */ if (isGlobal) { p_class = P_GLOBAL; flag = FLAG_GLOBAL; } else p_class = P_LOCAL; - + for (i = 0; parm_table[i].label; i++) { if (strwicmp(parm_table[i].label, parm_name) == 0 && (parm_table[i].p_class == p_class || parm_table[i].flags & flag) && -- cgit From e9488049c153aca4fe3ae034c483b15078fdc40f Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Wed, 5 Apr 2006 07:29:22 +0000 Subject: r14922: Use BOOL for the returned value. (This used to be commit b228474be0ced2637272a7b614b92e412a118993) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7d3995f092..95c095dcf2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3877,7 +3877,8 @@ static void dump_a_service(service * pService, FILE * f) BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) { service * pService = ServicePtrs[snum]; - int i, result = False; + int i; + BOOL result = False; parm_class p_class; unsigned flag = 0; fstring local_parm_name; -- cgit From 52f4dfa6fcc60eb36f7f59747387fd10855046cd Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Wed, 5 Apr 2006 07:44:14 +0000 Subject: r14923: Return False in the case a parametrical option is not configured in the config file. For a "somesettings: foo = " we still return an empty line. (This used to be commit 59175ee522c5b4f9554ee734c008d8048eb1eadb) --- source3/param/loadparm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 95c095dcf2..b7d6546fd9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3883,6 +3883,7 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) unsigned flag = 0; fstring local_parm_name; char *parm_opt; + const char *parm_opt_value; /* check for parametrical option */ fstrcpy( local_parm_name, parm_name); @@ -3892,9 +3893,12 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) *parm_opt = '\0'; parm_opt++; if (strlen(parm_opt)) { - printf( "%s\n", lp_parm_const_string( snum, - local_parm_name, parm_opt, "")); - result = True; + parm_opt_value = lp_parm_const_string( snum, + local_parm_name, parm_opt, NULL); + if (parm_opt_value) { + printf( "%s\n", parm_opt_value); + result = True; + } } return result; } -- cgit From bbf666e447132a5f6b206ddf9ca918298b756392 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 8 Apr 2006 17:25:31 +0000 Subject: r15003: patch based on code from Arkady Glabek to ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms) (This used to be commit 1e0b79e591d70352a96e0a0487d8f394dc7b36ba) --- source3/param/loadparm.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b7d6546fd9..e0c6c0686f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4865,6 +4865,56 @@ int load_usershare_shares(void) return lp_numservices(); } +/******************************************************** + Destroy global resources allocated in this file +********************************************************/ + +void gfree_loadparm(void) +{ + struct file_lists *f; + struct file_lists *next; + int i; + + lp_TALLOC_FREE(); + + /* Free the file lists */ + + f = file_lists; + while( f ) { + next = f->next; + SAFE_FREE( f->name ); + SAFE_FREE( f->subfname ); + SAFE_FREE( f ); + f = next; + } + + /* Free resources allocated to services */ + + for ( i = 0; i < iNumServices; i++ ) { + if ( VALID(i) ) { + free_service_byindex(i); + } + } + + SAFE_FREE( ServicePtrs ); + iNumServices = 0; + + /* Now release all resources allocated to global + parameters and the default service */ + + for (i = 0; parm_table[i].label; i++) + { + if ( parm_table[i].type == P_STRING + || parm_table[i].type == P_USTRING ) + { + string_free( (char**)parm_table[i].ptr ); + } + else if (parm_table[i].type == P_LIST) { + str_list_free( (char***)parm_table[i].ptr ); + } + } +} + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. -- cgit From 22dbd67708f1651a2341d70ce576fac360affccf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Apr 2006 15:33:04 +0000 Subject: r15018: Merge Volker's ipc/trans2/nttrans changes over into 3.0. Also merge the new POSIX lock code - this is not enabled unless -DDEVELOPER is defined. This doesn't yet map onto underlying system POSIX locks. Updates vfs to allow lock queries. Jeremy. (This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7) --- source3/param/loadparm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e0c6c0686f..af4293a11e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5444,3 +5444,22 @@ void lp_set_posix_pathnames(void) { posix_pathnames = True; } + +/******************************************************************* + Global state for POSIX lock processing - CIFS unix extensions. +********************************************************************/ + +static enum brl_flavour posix_cifsx_locktype; /* By default 0 == WINDOWS_LOCK */ + +enum brl_flavour lp_posix_cifsu_locktype(void) +{ + return posix_cifsx_locktype; +} + +/******************************************************************* +********************************************************************/ + +void lp_set_posix_cifsx_locktype(enum brl_flavour val) +{ + posix_cifsx_locktype = val; +} -- cgit From 5445694eb9c7a5e64e7e58feb78c87bc627402b5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Apr 2006 22:32:38 +0000 Subject: r15112: Move strict locking default to auto. Fix up the error return for one of the Samba4 torture tests. Jeremy. (This used to be commit 9db6617756ff155eb7549c3c622a9920189e577d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index af4293a11e..e0cbc981de 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -551,7 +551,7 @@ static service sDefault = { False, /* bStoreDosAttributes */ False, /* bDmapiSupport */ True, /* bLocking */ - True, /* iStrictLocking */ + Auto, /* iStrictLocking */ True, /* bPosixLocking */ True, /* bShareModes */ True, /* bOpLocks */ -- cgit From 335637b2ebeefffb7668639662c03da2f75976ed Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 19 Apr 2006 14:11:51 +0000 Subject: r15133: in_server is not used anywhere (This used to be commit c981bc7f31483e7821b9654eb30d665283aa07d5) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e0cbc981de..34b463de22 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -54,7 +54,6 @@ #include "includes.h" BOOL in_client = False; /* Not in the client by default */ -BOOL in_server = False; /* Not in the server by default */ BOOL bLoaded = False; extern userdom_struct current_user_info; -- cgit From 60af4023ad2801ee446be3b6f9b16e51a5f005db Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 29 Apr 2006 12:19:57 +0000 Subject: r15320: default "passdb expand explicit" to no (This used to be commit 88b5a21d63b18af56b4fe7e5c353eae3ff7d4752) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 34b463de22..b2ce9b7f4f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1645,7 +1645,7 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.bPassdbExpandExplicit = True; + Globals.bPassdbExpandExplicit = False; Globals.name_cache_timeout = 660; /* In seconds */ -- cgit From 677b4769bd0080d58e83b508e66e029cdafc019f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 30 Apr 2006 00:36:26 +0000 Subject: r15341: Ok I give up, I've been beaten by bug reports. People just don't get why "guest ok" is not allowed in usershares. Added "usershare allow guests" bool parameter that allows this, reved usershare file version to VERSION#2 which allows this. Updated user tools. This should now be (finally) finished and I'll add the new parameter docs and a HOWTO. Jeremy. (This used to be commit cdc3aa9d07d568570f2117bea9f1a4d227b3a35d) --- source3/param/loadparm.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b2ce9b7f4f..fc34c067c8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -309,6 +309,7 @@ typedef struct { BOOL bEnablePrivileges; BOOL bASUSupport; BOOL bUsershareOwnerOnly; + BOOL bUsershareAllowGuests; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -1239,6 +1240,7 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"usershare allow guests", P_BOOL, P_GLOBAL, &Globals.bUsershareAllowGuests, NULL, NULL, FLAG_ADVANCED}, {"usershare max shares", P_INTEGER, P_GLOBAL, &Globals.iUsershareMaxShares, NULL, NULL, FLAG_ADVANCED}, {"usershare owner only", P_BOOL, P_GLOBAL, &Globals.bUsershareOwnerOnly, NULL, NULL, FLAG_ADVANCED}, {"usershare path", P_STRING, P_GLOBAL, &Globals.szUsersharePath, NULL, NULL, FLAG_ADVANCED}, @@ -1670,6 +1672,8 @@ static void init_globals(BOOL first_time_only) Globals.iUsershareMaxShares = 0; /* By default disallow sharing of directories not owned by the sharer. */ Globals.bUsershareOwnerOnly = True; + /* By default disallow guest access to usershares. */ + Globals.bUsershareAllowGuests = False; } static TALLOC_CTX *lp_talloc; @@ -1875,6 +1879,7 @@ FN_GLOBAL_LIST(lp_usershare_prefix_deny_list, &Globals.szUsersharePrefixDenyList FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) +FN_GLOBAL_BOOL(lp_usershare_allow_guests, &Globals.bUsershareAllowGuests) FN_GLOBAL_BOOL(lp_usershare_owner_only, &Globals.bUsershareOwnerOnly) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) FN_GLOBAL_BOOL(lp_reset_on_zero_vc, &Globals.bResetOnZeroVC) @@ -4318,29 +4323,40 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, int numlines, pstring sharepath, pstring comment, - SEC_DESC **ppsd) + SEC_DESC **ppsd, + BOOL *pallow_guest) { const char **prefixallowlist = lp_usershare_prefix_allow_list(); const char **prefixdenylist = lp_usershare_prefix_deny_list(); + int us_vers; SMB_STRUCT_DIR *dp; SMB_STRUCT_STAT sbuf; + *pallow_guest = False; + if (numlines < 4) { return USERSHARE_MALFORMED_FILE; } - if (!strequal(lines[0], "#VERSION 1")) { + if (strcmp(lines[0], "#VERSION 1") == 0) { + us_vers = 1; + } else if (strcmp(lines[0], "#VERSION 2") == 0) { + us_vers = 2; + if (numlines < 5) { + return USERSHARE_MALFORMED_FILE; + } + } else { return USERSHARE_BAD_VERSION; } - if (!strnequal(lines[1], "path=", 5)) { + if (strncmp(lines[1], "path=", 5) != 0) { return USERSHARE_MALFORMED_PATH; } pstrcpy(sharepath, &lines[1][5]); trim_string(sharepath, " ", " "); - if (!strnequal(lines[2], "comment=", 8)) { + if (strncmp(lines[2], "comment=", 8) != 0) { return USERSHARE_MALFORMED_COMMENT_DEF; } @@ -4348,7 +4364,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, trim_string(comment, " ", " "); trim_char(comment, '"', '"'); - if (!strnequal(lines[3], "usershare_acl=", 14)) { + if (strncmp(lines[3], "usershare_acl=", 14) != 0) { return USERSHARE_MALFORMED_ACL_DEF; } @@ -4356,7 +4372,16 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, return USERSHARE_ACL_ERR; } - if (snum != -1 && strequal(sharepath, ServicePtrs[snum]->szPath)) { + if (us_vers == 2) { + if (strncmp(lines[4], "guest_ok=", 9) != 0) { + return USERSHARE_MALFORMED_ACL_DEF; + } + if (lines[4][9] == 'y') { + *pallow_guest = True; + } + } + + if (snum != -1 && (strcmp(sharepath, ServicePtrs[snum]->szPath) == 0)) { /* Path didn't change, no checks needed. */ return USERSHARE_OK; } @@ -4468,6 +4493,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i int iService = -1; TALLOC_CTX *ctx = NULL; SEC_DESC *psd = NULL; + BOOL guest_ok = False; /* Ensure share name doesn't contain invalid characters. */ if (!validate_net_name(file_name, INVALID_SHARENAME_CHARS, strlen(file_name))) { @@ -4561,7 +4587,9 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i return 1; } - if (parse_usershare_file(ctx, &sbuf, service_name, iService, lines, numlines, sharepath, comment, &psd) != USERSHARE_OK) { + if (parse_usershare_file(ctx, &sbuf, service_name, + iService, lines, numlines, sharepath, + comment, &psd, &guest_ok) != USERSHARE_OK) { talloc_destroy(ctx); SAFE_FREE(lines); return -1; @@ -4605,6 +4633,11 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i /* Set the service as a valid usershare. */ ServicePtrs[iService]->usershare = USERSHARE_VALID; + /* Set guest access. */ + if (lp_usershare_allow_guests()) { + ServicePtrs[iService]->bGuest_ok = guest_ok; + } + /* And note when it was loaded. */ ServicePtrs[iService]->usershare_last_mod = sbuf.st_mtime; string_set(&ServicePtrs[iService]->szPath, sharepath); -- cgit From 256690098256dc5205ae246ff49de10324defdf6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 7 May 2006 17:40:52 +0000 Subject: r15496: current_user_info is not referenced in loadparm.c (This used to be commit 800f4cd158c5de8a0031abf4d030f633d784999f) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fc34c067c8..919a482e39 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -56,7 +56,6 @@ BOOL in_client = False; /* Not in the client by default */ BOOL bLoaded = False; -extern userdom_struct current_user_info; extern pstring user_socket_options; extern enum protocol_types Protocol; -- cgit From 745e2490ae406737cc720acd5b757687c26269b0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 12 May 2006 20:40:22 +0000 Subject: r15547: say goodbye to --with-ldapsam (although the ldapsam_compat passdb backend still exists (This used to be commit 7d99e05ee8f60b2b4d18405dc8be6f9ff822c3ad) --- source3/param/loadparm.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 919a482e39..9c0db5648b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -234,10 +234,6 @@ typedef struct { char *szLdapUserSuffix; char *szLdapIdmapSuffix; char *szLdapGroupSuffix; -#ifdef WITH_LDAP_SAMCONFIG - int ldap_port; - char *szLdapServer; -#endif int ldap_ssl; char *szLdapSuffix; char *szLdapAdminDn; @@ -671,12 +667,6 @@ static const struct enum_list enum_printing[] = { }; static const struct enum_list enum_ldap_ssl[] = { -#ifdef WITH_LDAP_SAMCONFIG - {LDAP_SSL_ON, "Yes"}, - {LDAP_SSL_ON, "yes"}, - {LDAP_SSL_ON, "on"}, - {LDAP_SSL_ON, "On"}, -#endif {LDAP_SSL_OFF, "no"}, {LDAP_SSL_OFF, "No"}, {LDAP_SSL_OFF, "off"}, @@ -1172,10 +1162,6 @@ static struct parm_struct parm_table[] = { {N_("Ldap Options"), P_SEP, P_SEPARATOR}, -#ifdef WITH_LDAP_SAMCONFIG - {"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 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 group suffix", P_STRING, P_GLOBAL, &Globals.szLdapGroupSuffix, NULL, NULL, FLAG_ADVANCED}, @@ -1574,13 +1560,7 @@ static void init_globals(BOOL first_time_only) a large number of sites (tridge) */ Globals.bHostnameLookups = False; -#ifdef WITH_LDAP_SAMCONFIG - string_set(&Globals.szLdapServer, "localhost"); - Globals.ldap_port = 636; - string_set(&Globals.szPassdbBackend, "ldapsam_compat"); -#else string_set(&Globals.szPassdbBackend, "smbpasswd"); -#endif /* WITH_LDAP_SAMCONFIG */ string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); @@ -1857,10 +1837,6 @@ FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) -#ifdef WITH_LDAP_SAMCONFIG -FN_GLOBAL_STRING(lp_ldap_server, &Globals.szLdapServer) -FN_GLOBAL_INTEGER(lp_ldap_port, &Globals.ldap_port) -#endif FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) FN_GLOBAL_STRING(lp_ldap_admin_dn, &Globals.szLdapAdminDn) FN_GLOBAL_INTEGER(lp_ldap_ssl, &Globals.ldap_ssl) -- cgit From 1d650a276b4545636d18ae65aabf985893c2c84e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 12 May 2006 20:45:30 +0000 Subject: r15548: remove unused 'wins partners' (This used to be commit 1316fd4267f37cd88ab5c63d22df81ace17205bc) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9c0db5648b..38e1bd6dd0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -163,7 +163,6 @@ typedef struct { char *szUsernameMapScript; char *szCheckPasswordScript; char *szWINSHook; - char *szWINSPartners; char *szUtmpDir; char *szWtmpDir; BOOL bUtmp; @@ -1140,7 +1139,6 @@ static struct parm_struct parm_table[] = { {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED}, - {"wins partners", P_STRING, P_GLOBAL, &Globals.szWINSPartners, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, {N_("Locking Options"), P_SEP, P_SEPARATOR}, @@ -1821,7 +1819,6 @@ FN_GLOBAL_STRING(lp_username_map_script, &Globals.szUsernameMapScript) 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_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -- cgit From 18d5a26f74ea49ba0a059cfb942c4c8ac9956d3b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 12 May 2006 21:00:52 +0000 Subject: r15549: removing rhosts and 'hosts equiv' authentication features (This used to be commit d19dad88155f985f113c667b6bdad5a1b25eca18) --- source3/param/loadparm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 38e1bd6dd0..c4ef9ef3ea 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -114,7 +114,6 @@ typedef struct { char *szGetQuota; char *szSetQuota; char *szMsgCommand; - char *szHostsEquiv; char *szServerString; char *szAutoServices; char *szPasswdProgram; @@ -852,7 +851,6 @@ static struct parm_struct parm_table[] = { {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, {"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}, {"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}, @@ -1773,7 +1771,6 @@ FN_GLOBAL_STRING(lp_defaultservice, &Globals.szDefaultService) FN_GLOBAL_STRING(lp_msg_command, &Globals.szMsgCommand) FN_GLOBAL_STRING(lp_get_quota_command, &Globals.szGetQuota) FN_GLOBAL_STRING(lp_set_quota_command, &Globals.szSetQuota) -FN_GLOBAL_STRING(lp_hosts_equiv, &Globals.szHostsEquiv) FN_GLOBAL_STRING(lp_auto_services, &Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program, &Globals.szPasswdProgram) FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat) -- cgit From 2602e5fab165d426e3a87e0cdcf8f7c67596e501 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 12 May 2006 23:10:01 +0000 Subject: r15555: Make "change notify timeout" a per-share parameter - used when there's no kernel or FAM change notify. If set to zero this will turn off change notify for the share except when we ourselves change something (renames / deletes etc. ). Designed to help on large directory shares where a new changenotify is issued between each delete. This will be fixed correctly when we move to internal change notify (eg. back-port Samba4 changenotify). Jeremy. (This used to be commit 5a17bffbcd5082fde79c241468a0ff2b5903d540) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c4ef9ef3ea..695e7f1aac 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -220,7 +220,6 @@ typedef struct { int lm_interval; int announce_as; /* This is initialised in init_globals */ int machine_password_timeout; - int change_notify_timeout; int map_to_guest; int oplock_break_wait_time; int winbind_cache_time; @@ -449,6 +448,7 @@ typedef struct { int iAioReadSize; int iAioWriteSize; int iMap_readonly; + int ichange_notify_timeout; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -587,6 +587,7 @@ static service sDefault = { 0, /* iAioReadSize */ 0, /* iAioWriteSize */ MAP_READONLY_YES, /* iMap_readonly */ + 60, /* ichange_notify_timeout = 1 minute default. */ NULL, /* Parametric options */ @@ -996,7 +997,7 @@ static struct parm_struct parm_table[] = { {N_("Tuning Options"), P_SEP, P_SEPARATOR}, {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"change notify timeout", P_INTEGER, P_GLOBAL, &Globals.change_notify_timeout, NULL, NULL, FLAG_ADVANCED}, + {"change notify timeout", P_INTEGER, P_LOCAL, &sDefault.ichange_notify_timeout, NULL, NULL, FLAG_ADVANCED}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED}, @@ -1507,7 +1508,6 @@ static void init_globals(BOOL first_time_only) Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */ Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */ 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.bFamChangeNotify = True; /* On if we have it. */ Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ @@ -1934,7 +1934,6 @@ static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout) -FN_GLOBAL_INTEGER(lp_change_notify_timeout, &Globals.change_notify_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) @@ -2066,6 +2065,7 @@ FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) +FN_LOCAL_INTEGER(lp_change_notify_timeout, ichange_notify_timeout) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) -- cgit From 0ed76af63d25fe98fc0366708675a514a3c5bddb Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 16 May 2006 02:50:49 +0000 Subject: r15631: Add a new option "enable core files". Administrators can use this to disable automatic core file dumping. Core files are enabled by default. (This used to be commit b59189280057849b67ac65f31cec23b859e21c91) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 695e7f1aac..fadd4d0ee3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -289,6 +289,7 @@ typedef struct { BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; + BOOL bEnableCoreFiles; BOOL bHostMSDfs; BOOL bUseMmap; BOOL bHostnameLookups; @@ -947,6 +948,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"enable core files", P_BOOL, P_GLOBAL, &Globals.bEnableCoreFiles, NULL, NULL, FLAG_ADVANCED}, {N_("Protocol Options"), P_SEP, P_SEPARATOR}, @@ -1504,6 +1506,7 @@ static void init_globals(BOOL first_time_only) Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; + Globals.bEnableCoreFiles = True; Globals.max_ttl = 60 * 60 * 24 * 3; /* 3 days default. */ Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */ Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */ @@ -1875,6 +1878,7 @@ FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) +FN_GLOBAL_BOOL(lp_enable_core_files, &Globals.bEnableCoreFiles) FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer) -- cgit From 6b1b66904dfea2060dbce5c403211c195abd0604 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 7 Jun 2006 12:01:54 +0000 Subject: r16078: Patch from Aleksey Fedoseev to correctly set the type of 'acl compatibility from string to integer after the changes in r14207. (This used to be commit b01f289f1a788fe8f62a213b67a73a9bfee01bb1) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fadd4d0ee3..61d2ccf9cd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -234,7 +234,7 @@ typedef struct { int ldap_ssl; char *szLdapSuffix; char *szLdapAdminDn; - char *szAclCompat; + int iAclCompat; char *szCupsServer; char *szIPrintServer; int ldap_passwd_sync; @@ -967,7 +967,7 @@ static struct parm_struct parm_table[] = { {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED}, {"reset on zero vc", P_BOOL, P_GLOBAL, &Globals.bResetOnZeroVC, NULL, NULL, FLAG_ADVANCED}, - {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, NULL, enum_acl_compat_vals, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"acl compatibility", P_ENUM, P_GLOBAL, &Globals.iAclCompat, NULL, enum_acl_compat_vals, 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}, @@ -1822,7 +1822,7 @@ FN_GLOBAL_STRING(lp_wins_hook, &Globals.szWINSHook) FN_GLOBAL_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -FN_GLOBAL_INTEGER(lp_acl_compatibility, &Globals.szAclCompat) +FN_GLOBAL_INTEGER(lp_acl_compatibility, &Globals.iAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) -- cgit From 564529b91afe4530da856227e2d047ff2ccd6fc5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 7 Jun 2006 12:35:16 +0000 Subject: r16079: How embarassing. :-( Broke the build. I will *always* compile before checking in... I will *always* compile before checking in... I will *always* compile before checking in... I will *always* compile before checking in... I will *always* compile before checking in... (This used to be commit f3bd1c8c7de93917787e7341f759699c8399f006) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 61d2ccf9cd..2ef1c4df2f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1611,7 +1611,6 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); string_set(&Globals.szWinbindSeparator, "\\"); - string_set(&Globals.szAclCompat, ""); string_set(&Globals.szCupsServer, ""); string_set(&Globals.szIPrintServer, ""); -- cgit From adc252c27511b8aee09a8b4ef6e7a50894514837 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Jun 2006 20:43:05 +0000 Subject: r16429: Fix final 4 Klocwork bugs we're going to fix before release - #785, #786, #787, #788. Jeremy. (This used to be commit 9017547cccadeecb80f3db58a43838dc656fce2f) --- source3/param/loadparm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2ef1c4df2f..a3a41c7664 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3244,9 +3244,9 @@ static BOOL handle_debug_list( int snum, const char *pszParmValueIn, char **ptr Handle ldap suffixes - default to ldapsuffix if sub-suffixes are not defined. ***************************************************************************/ -static char* append_ldap_suffix( const char *str ) +static const char *append_ldap_suffix( const char *str ) { - char *suffix_string; + const char *suffix_string; if (!lp_talloc) @@ -3255,13 +3255,13 @@ static char* append_ldap_suffix( const char *str ) suffix_string = talloc_asprintf( lp_talloc, "%s,%s", str, Globals.szLdapSuffix ); if ( !suffix_string ) { DEBUG(0,("append_ldap_suffix: talloc_asprintf() failed!\n")); - return NULL; + return ""; } return suffix_string; } -char *lp_ldap_machine_suffix(void) +const char *lp_ldap_machine_suffix(void) { if (Globals.szLdapMachineSuffix[0]) return append_ldap_suffix(Globals.szLdapMachineSuffix); @@ -3269,7 +3269,7 @@ char *lp_ldap_machine_suffix(void) return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_user_suffix(void) +const char *lp_ldap_user_suffix(void) { if (Globals.szLdapUserSuffix[0]) return append_ldap_suffix(Globals.szLdapUserSuffix); @@ -3277,7 +3277,7 @@ char *lp_ldap_user_suffix(void) return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_group_suffix(void) +const char *lp_ldap_group_suffix(void) { if (Globals.szLdapGroupSuffix[0]) return append_ldap_suffix(Globals.szLdapGroupSuffix); @@ -3285,7 +3285,7 @@ char *lp_ldap_group_suffix(void) return lp_string(Globals.szLdapSuffix); } -char *lp_ldap_idmap_suffix(void) +const char *lp_ldap_idmap_suffix(void) { if (Globals.szLdapIdmapSuffix[0]) return append_ldap_suffix(Globals.szLdapIdmapSuffix); -- cgit From 98118545c19ea4236dff9a2ec002efcfe60d81ff Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Tue, 27 Jun 2006 17:58:55 +0000 Subject: r16570: Corrected the copyright notice. I had requested and received permission from my management at the University to release under my own copyright. My mistake for entering the wrong info. (This used to be commit c65ebeb02810fb4039555c55779ec62a4a8de564) --- source3/param/params.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 6669e80191..6d036e40f6 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -3,9 +3,9 @@ * * This module Copyright (C) 1990-1998 Karl Auer * - * Rewritten almost completely by Christopher R. Hertel - * at the University of Minnesota, September, 1997. - * This module Copyright (C) 1997-1998 by the University of Minnesota + * Rewritten almost completely by Christopher R. Hertel, 1997. + * This module Copyright (C) 1997-1998 by Christopher R. Hertel + * * -------------------------------------------------------------------------- ** * * This program is free software; you can redistribute it and/or modify -- cgit From 355cbde8df75d429906e1e2f6e465b20222b4173 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 2 Jul 2006 22:04:29 +0000 Subject: r16766: A warning found by RHEL3. This might actually be 3.0.23 code, maybe there are vasprintf implementations that don't like a NULL format. Volker (This used to be commit 03c665c307e518c9ff66096904873266b145637c) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a3a41c7664..b6c027f871 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1670,7 +1670,7 @@ void lp_TALLOC_FREE(void) TALLOC_CTX *tmp_talloc_ctx(void) { if (lp_talloc == NULL) { - lp_talloc = talloc_init(NULL); + lp_talloc = talloc_init("tmp_talloc_ctx"); } if (lp_talloc == NULL) { -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/param/loadparm.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b6c027f871..c308378a22 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -58,6 +58,7 @@ BOOL bLoaded = False; extern pstring user_socket_options; extern enum protocol_types Protocol; +extern userdom_struct current_user_info; #ifndef GLOBAL_NAME #define GLOBAL_NAME "global" @@ -1702,11 +1703,13 @@ static char *lp_string(const char *s) if (!lp_talloc) lp_talloc = talloc_init("lp_talloc"); - tmpstr = alloc_sub_basic(get_current_username(), s); + tmpstr = alloc_sub_basic(get_current_username(), + current_user_info.domain, s); if (trim_char(tmpstr, '\"', '\"')) { if (strchr(tmpstr,'\"') != NULL) { SAFE_FREE(tmpstr); - tmpstr = alloc_sub_basic(get_current_username(),s); + tmpstr = alloc_sub_basic(get_current_username(), + current_user_info.domain, s); } } ret = talloc_strdup(lp_talloc, tmpstr); @@ -1741,11 +1744,16 @@ static char *lp_string(const char *s) const char **fn_name(int i) {return(const char **)(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_BOOL(fn_name,val) \ BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} -#define FN_LOCAL_CHAR(fn_name,val) \ - char fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} +#define FN_LOCAL_PARM_BOOL(fn_name,val) \ + BOOL fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} +#define FN_LOCAL_PARM_STRING(fn_name,val) \ + char *fn_name(const struct share_params *p) {return(lp_string((LP_SNUM_OK(p->service) && ServicePtrs[(p->service)]->val) ? ServicePtrs[(p->service)]->val : sDefault.val));} +#define FN_LOCAL_CHAR(fn_name,val) \ + char fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} + FN_GLOBAL_STRING(lp_smb_ports, &Globals.smb_ports) FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset) FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset) @@ -1981,7 +1989,7 @@ FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_LIST(lp_vfs_objects, szVfsObjects) FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy) static FN_LOCAL_STRING(lp_volume, volume) -FN_LOCAL_STRING(lp_mangled_map, szMangledMap) +FN_LOCAL_PARM_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) @@ -2015,7 +2023,7 @@ FN_LOCAL_BOOL(lp_share_modes, bShareModes) FN_LOCAL_BOOL(lp_oplocks, bOpLocks) FN_LOCAL_BOOL(lp_level2_oplocks, bLevel2OpLocks) FN_LOCAL_BOOL(lp_onlyuser, bOnlyUser) -FN_LOCAL_BOOL(lp_manglednames, bMangledNames) +FN_LOCAL_PARM_BOOL(lp_manglednames, bMangledNames) FN_LOCAL_BOOL(lp_widelinks, bWidelinks) FN_LOCAL_BOOL(lp_symlinks, bSymlinks) FN_LOCAL_BOOL(lp_syncalways, bSyncAlways) @@ -3002,7 +3010,9 @@ BOOL lp_file_list_changed(void) time_t mod_time; pstrcpy(n2, f->name); - standard_sub_basic( get_current_username(), n2, sizeof(n2) ); + standard_sub_basic( get_current_username(), + current_user_info.domain, + n2, sizeof(n2) ); DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", f->name, n2, ctime(&f->modtime))); @@ -3036,7 +3046,8 @@ static BOOL handle_netbios_name(int snum, const char *pszParmValue, char **ptr) pstrcpy(netbios_name, pszParmValue); - standard_sub_basic(get_current_username(), netbios_name,sizeof(netbios_name)); + standard_sub_basic(get_current_username(), current_user_info.domain, + netbios_name, sizeof(netbios_name)); ret = set_global_myname(netbios_name); string_set(&Globals.szNetbiosName,global_myname()); @@ -3094,7 +3105,8 @@ static BOOL handle_include(int snum, const char *pszParmValue, char **ptr) pstring fname; pstrcpy(fname, pszParmValue); - standard_sub_basic(get_current_username(), fname,sizeof(fname)); + standard_sub_basic(get_current_username(), current_user_info.domain, + fname,sizeof(fname)); add_to_file_list(pszParmValue, fname); @@ -4936,7 +4948,8 @@ BOOL lp_load(const char *pszFname, pstrcpy(n2, pszFname); - standard_sub_basic( get_current_username(), n2,sizeof(n2) ); + standard_sub_basic( get_current_username(), current_user_info.domain, + n2,sizeof(n2) ); add_to_file_list(pszFname, n2); @@ -5080,7 +5093,9 @@ int lp_servicenumber(const char *pszServiceName) * service names */ fstrcpy(serviceName, ServicePtrs[iService]->szService); - standard_sub_basic(get_current_username(), serviceName,sizeof(serviceName)); + standard_sub_basic(get_current_username(), + current_user_info.domain, + serviceName,sizeof(serviceName)); if (strequal(serviceName, pszServiceName)) { break; } @@ -5116,6 +5131,11 @@ int lp_servicenumber(const char *pszServiceName) return (iService); } +BOOL share_defined(const char *service_name) +{ + return (lp_servicenumber(service_name) != -1); +} + /******************************************************************* A useful volume label function. ********************************************************************/ -- cgit From f57c18b946091470817d208e28bb705ab49fdaa2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 13 Jul 2006 20:24:16 +0000 Subject: r17023: security = server should not be considerd ROLE_DOMAIN_MEMBER (This used to be commit 6eb77442a570b4ef3bb71dd5a1b7ea81ad18f09c) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c308378a22..89b07b4cda 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4199,7 +4199,8 @@ static void set_server_role(void) case SEC_SERVER: if (lp_domain_logons()) DEBUG(0, ("Server's Role (logon server) conflicts with server-level security\n")); - server_role = ROLE_DOMAIN_MEMBER; + /* this used to be considered ROLE_DOMAIN_MEMBER but that's just wrong */ + server_role = ROLE_STANDALONE; break; case SEC_DOMAIN: if (lp_domain_logons()) { -- cgit From 2203228c791761bcab07961da725488636bee8df Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 14 Jul 2006 22:06:38 +0000 Subject: r17039: Eliminate snum from enumshares and getshareinfo. Get rid of some pstrings. Volker (This used to be commit c5e393d5eda4e13a844171d9ff319d1f1bac3d84) --- source3/param/loadparm.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 89b07b4cda..b4b6c2bd10 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5137,6 +5137,65 @@ BOOL share_defined(const char *service_name) return (lp_servicenumber(service_name) != -1); } +struct share_params *get_share_params(TALLOC_CTX *mem_ctx, + const char *sharename) +{ + struct share_params *result; + fstring sname; + int snum; + + fstrcpy(sname, sharename); + + snum = find_service(sname); + if (snum < 0) { + return NULL; + } + + if (!(result = TALLOC_P(mem_ctx, struct share_params))) { + DEBUG(0, ("talloc failed\n")); + return NULL; + } + + result->service = snum; + return result; +} + +struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx) +{ + struct share_iterator *result; + + if (!(result = TALLOC_P(mem_ctx, struct share_iterator))) { + DEBUG(0, ("talloc failed\n")); + return NULL; + } + + result->next_id = 0; + return result; +} + +struct share_params *next_share(struct share_iterator *list) +{ + struct share_params *result; + + while (!lp_snum_ok(list->next_id) && + (list->next_id < lp_numservices())) { + list->next_id += 1; + } + + if (list->next_id >= lp_numservices()) { + return NULL; + } + + if (!(result = TALLOC_P(list, struct share_params))) { + DEBUG(0, ("talloc failed\n")); + return NULL; + } + + result->service = list->next_id; + list->next_id += 1; + return result; +} + /******************************************************************* A useful volume label function. ********************************************************************/ -- cgit From 1cd8d56fdab18a0bcedffba6476f8208d2185040 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Jul 2006 01:29:43 +0000 Subject: r17108: Make the default timeout parameter for lock waiting be lp_lock_spin(). lock spin count is no longer used. I'll update the man pages. Jeremy. (This used to be commit 0451a170c9be88399202abd225af35ddc45023f0) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b4b6c2bd10..acb54f25df 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1546,8 +1546,8 @@ static void init_globals(BOOL first_time_only) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; - Globals.iLockSpinCount = 3; /* Try 3 times. */ - Globals.iLockSpinTime = 10; /* usec. */ + Globals.iLockSpinCount = 0; /* Unused. */ + Globals.iLockSpinTime = WINDOWS_MINIMUM_LOCK_TIMEOUT_MS; /* msec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; #else @@ -1948,7 +1948,7 @@ FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) -FN_GLOBAL_INTEGER(lp_lock_sleep_time, &Globals.iLockSpinTime) +FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) FN_LOCAL_STRING(lp_preexec, szPreExec) -- cgit From ea4ff9bf23b491c396983605fbb0e4988ae91743 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 25 Aug 2006 14:52:30 +0000 Subject: r17832: Fix bug 4050 (This used to be commit 0504cf6d13c81d90a2457a01a78630d105af0ebc) --- source3/param/loadparm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index acb54f25df..b99fd8a514 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3864,7 +3864,6 @@ static void dump_a_service(service * pService, FILE * f) BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) { - service * pService = ServicePtrs[snum]; int i; BOOL result = False; parm_class p_class; @@ -3907,11 +3906,13 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) { void *ptr; - if (isGlobal) + if (isGlobal) { ptr = parm_table[i].ptr; - else + } else { + service * pService = ServicePtrs[snum]; ptr = ((char *)pService) + PTR_DIFF(parm_table[i].ptr, &sDefault); + } print_parameter(&parm_table[i], ptr, f); -- cgit From c3bbcc608e292397b7f9f12189572f463bb1e322 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Aug 2006 16:24:03 +0000 Subject: r17852: Remove a pointless NULL assignment (This used to be commit 9f27824257924485a39bb60f00c9de02f869c4ff) --- source3/param/params.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 6d036e40f6..c4ca5bb906 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -587,7 +587,6 @@ BOOL pm_process( const char *FileName, result = Parse( InFile, sfunc, pfunc ); SAFE_FREE( bufr ); - bufr = NULL; bSize = 0; } -- cgit From 9e69c4fbea8dc6e9bfa6773913a68d03b2a0a85a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 6 Oct 2006 19:49:16 +0000 Subject: r19157: Fix the build (This used to be commit 3fc328dadeb5b4b35c6d58ba26c3ac9d1fcf4015) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b99fd8a514..8f2258bb72 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5197,6 +5197,18 @@ struct share_params *next_share(struct share_iterator *list) return result; } +struct share_params *next_printer(struct share_iterator *list) +{ + struct share_params *result; + + while ((result = next_share(list)) != NULL) { + if (lp_print_ok(result->service)) { + break; + } + } + return result; +} + /******************************************************************* A useful volume label function. ********************************************************************/ -- cgit From 7399ab779d7100059475ed196e6e4435b2b33bbd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 12 Oct 2006 13:29:01 +0000 Subject: r19255: Add blacklist of accounts when NSS initgroups calls are coming in and "winbind use default domain" is set. Defaults to "root, nobody, lp" currently. Guenther (This used to be commit b5b42196a6f2869deefc700dc98060f5ab832e40) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8f2258bb72..0dff2e36c7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -181,6 +181,7 @@ typedef struct { BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; char **szIdmapBackend; + char **szWinbindInitgroupsBlacklist; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1278,6 +1279,7 @@ static struct parm_struct parm_table[] = { {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, + {"winbind initgroups blacklist", P_LIST, P_GLOBAL, &Globals.szWinbindInitgroupsBlacklist, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1624,6 +1626,7 @@ static void init_globals(BOOL first_time_only) Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; + Globals.szWinbindInitgroupsBlacklist = str_list_make("root nobody lp", NULL); Globals.bPassdbExpandExplicit = False; @@ -1839,6 +1842,7 @@ FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) +FN_GLOBAL_LIST(lp_winbind_initgroups_blacklist, &Globals.szWinbindInitgroupsBlacklist) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -- cgit From 2a10d7686553a2c2377165b7f80269d2dcae8847 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 21 Oct 2006 17:00:47 +0000 Subject: r19448: Convert delete_share_security to struct share_params plus some cleanups (This used to be commit c73d0815a3a1f58b951caa62fac601a8f4630894) --- source3/param/loadparm.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0dff2e36c7..fe1dc8ec50 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4879,7 +4879,7 @@ int load_usershare_shares(void) /* Remove from the share ACL db. */ DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n", lp_servicename(iService) )); - delete_share_security(iService); + delete_share_security(snum2params_static(iService)); free_service_byindex(iService); } } @@ -5113,7 +5113,7 @@ int lp_servicenumber(const char *pszServiceName) if (!usershare_exists(iService, &last_mod)) { /* Remove the share security tdb entry for it. */ - delete_share_security(iService); + delete_share_security(snum2params_static(iService)); /* Remove it from the array. */ free_service_byindex(iService); /* Doesn't exist anymore. */ @@ -5146,12 +5146,16 @@ struct share_params *get_share_params(TALLOC_CTX *mem_ctx, const char *sharename) { struct share_params *result; - fstring sname; + char *sname; int snum; - fstrcpy(sname, sharename); + if (!(sname = SMB_STRDUP(sharename))) { + return NULL; + } snum = find_service(sname); + SAFE_FREE(sname); + if (snum < 0) { return NULL; } @@ -5213,6 +5217,18 @@ struct share_params *next_printer(struct share_iterator *list) return result; } +/* + * This is a hack for a transition period until we transformed all code from + * service numbers to struct share_params. + */ + +struct share_params *snum2params_static(int snum) +{ + static struct share_params result; + result.service = snum; + return &result; +} + /******************************************************************* A useful volume label function. ********************************************************************/ -- cgit From b6fda7f8bd48e836e7ded2a610b69ff760f9d989 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 11 Nov 2006 16:50:38 +0000 Subject: r19665: Fix a memleak (This used to be commit bc6d4e52806eb1ace282e983566660928214374c) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fe1dc8ec50..fea41a880f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4573,7 +4573,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i /* Should we allow printers to be shared... ? */ ctx = talloc_init("usershare_sd_xctx"); if (!ctx) { - SAFE_FREE(lines); + file_lines_free(lines); return 1; } @@ -4581,11 +4581,11 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i iService, lines, numlines, sharepath, comment, &psd, &guest_ok) != USERSHARE_OK) { talloc_destroy(ctx); - SAFE_FREE(lines); + file_lines_free(lines); return -1; } - SAFE_FREE(lines); + file_lines_free(lines); /* Everything ok - add the service possibly using a template. */ if (iService < 0) { -- cgit From b6b84f98c0420f45c498b025d9edbeb7f830205a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 11 Nov 2006 17:05:11 +0000 Subject: r19668: Convert the locking params to use struct share_param instead of snum (This used to be commit 609dbec600048718b86cd1ecdc2ce49bbdeb803c) --- source3/param/loadparm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fea41a880f..68dd9d5a97 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1752,6 +1752,8 @@ static char *lp_string(const char *s) #define FN_LOCAL_PARM_BOOL(fn_name,val) \ BOOL fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} +#define FN_LOCAL_PARM_INTEGER(fn_name,val) \ + int fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} #define FN_LOCAL_PARM_STRING(fn_name,val) \ char *fn_name(const struct share_params *p) {return(lp_string((LP_SNUM_OK(p->service) && ServicePtrs[(p->service)]->val) ? ServicePtrs[(p->service)]->val : sDefault.val));} #define FN_LOCAL_CHAR(fn_name,val) \ @@ -2020,9 +2022,9 @@ 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_dmapi_support, bDmapiSupport) -FN_LOCAL_BOOL(lp_locking, bLocking) -FN_LOCAL_INTEGER(lp_strict_locking, iStrictLocking) -FN_LOCAL_BOOL(lp_posix_locking, bPosixLocking) +FN_LOCAL_PARM_BOOL(lp_locking, bLocking) +FN_LOCAL_PARM_INTEGER(lp_strict_locking, iStrictLocking) +FN_LOCAL_PARM_BOOL(lp_posix_locking, bPosixLocking) FN_LOCAL_BOOL(lp_share_modes, bShareModes) FN_LOCAL_BOOL(lp_oplocks, bOpLocks) FN_LOCAL_BOOL(lp_level2_oplocks, bLevel2OpLocks) -- cgit From bef92ebb257adda6634c559e0240ad4991840212 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 11 Nov 2006 18:07:51 +0000 Subject: r19669: set_share_security does not need a mem_ctx passed (This used to be commit 53eaa603eb84047263c27d57b8c0f5ce8e157189) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 68dd9d5a97..cb9f8306b0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4608,7 +4608,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i } /* Write the ACL of the new/modified share. */ - if (!set_share_security(ctx, service_name, psd)) { + if (!set_share_security(service_name, psd)) { DEBUG(0, ("process_usershare_file: Failed to set share " "security for user share %s\n", service_name )); -- cgit From 95bfb975472f5cf63bb0ef2d19ae89945232883f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 21 Nov 2006 00:00:43 +0000 Subject: r19809: remove winbind blacklist parameter (This used to be commit 40cff1449886449b34b896e31fd43b7dff436a3f) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cb9f8306b0..5e39544420 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -181,7 +181,6 @@ typedef struct { BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; char **szIdmapBackend; - char **szWinbindInitgroupsBlacklist; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -1279,7 +1278,6 @@ static struct parm_struct parm_table[] = { {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, - {"winbind initgroups blacklist", P_LIST, P_GLOBAL, &Globals.szWinbindInitgroupsBlacklist, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1626,7 +1624,6 @@ static void init_globals(BOOL first_time_only) Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.szWinbindInitgroupsBlacklist = str_list_make("root nobody lp", NULL); Globals.bPassdbExpandExplicit = False; @@ -1844,7 +1841,6 @@ FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) -FN_GLOBAL_LIST(lp_winbind_initgroups_blacklist, &Globals.szWinbindInitgroupsBlacklist) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -- cgit From eb96dddb281e5a6c69b12b05a8dda35b0e7f6de1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 21 Nov 2006 13:42:31 +0000 Subject: r19820: Limit the stat cache to 1MB by default (Bug 4244). Thanks to Bjoern Jacke Volker (This used to be commit b32c8356f783e0919f29b452be9417d7ff59b5bc) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5e39544420..81c642daf8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1534,7 +1534,7 @@ static void init_globals(BOOL first_time_only) Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTStatusSupport = True; /* Use NT status by default. */ Globals.bStatCache = True; /* use stat cache by default */ - Globals.iMaxStatCacheSize = 0; /* unlimited size in kb by default. */ + Globals.iMaxStatCacheSize = 1024; /* one Meg by default. */ Globals.restrict_anonymous = 0; Globals.bClientLanManAuth = True; /* Do use the LanMan hash if it is available */ Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ -- cgit From 575845ccbeb2acc5dcb5133b80fd19b1d80169f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 30 Nov 2006 07:38:40 +0000 Subject: r19963: Add 'registry shares = yes' and registry key security descriptors. (This used to be commit 6cab254c49e07b11c170511ec613f0f33914c3e6) --- source3/param/loadparm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 81c642daf8..60d686f245 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -304,6 +304,7 @@ typedef struct { BOOL bASUSupport; BOOL bUsershareOwnerOnly; BOOL bUsershareAllowGuests; + BOOL bRegistryShares; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -1225,6 +1226,7 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"registry shares", P_BOOL, P_GLOBAL, &Globals.bRegistryShares, NULL, NULL, FLAG_ADVANCED}, {"usershare allow guests", P_BOOL, P_GLOBAL, &Globals.bUsershareAllowGuests, NULL, NULL, FLAG_ADVANCED}, {"usershare max shares", P_INTEGER, P_GLOBAL, &Globals.iUsershareMaxShares, NULL, NULL, FLAG_ADVANCED}, {"usershare owner only", P_BOOL, P_GLOBAL, &Globals.bUsershareOwnerOnly, NULL, NULL, FLAG_ADVANCED}, @@ -1652,6 +1654,9 @@ static void init_globals(BOOL first_time_only) Globals.bUsershareOwnerOnly = True; /* By default disallow guest access to usershares. */ Globals.bUsershareAllowGuests = False; + + /* By default no shares out of the registry */ + Globals.bRegistryShares = False; } static TALLOC_CTX *lp_talloc; @@ -1860,6 +1865,7 @@ FN_GLOBAL_LIST(lp_usershare_prefix_deny_list, &Globals.szUsersharePrefixDenyList FN_GLOBAL_LIST(lp_eventlog_list, &Globals.szEventLogs) +FN_GLOBAL_BOOL(lp_registry_shares, &Globals.bRegistryShares) FN_GLOBAL_BOOL(lp_usershare_allow_guests, &Globals.bUsershareAllowGuests) FN_GLOBAL_BOOL(lp_usershare_owner_only, &Globals.bUsershareOwnerOnly) FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) @@ -2606,6 +2612,10 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService, int lp_add_service(const char *pszService, int iDefaultService) { + if (iDefaultService < 0) { + return add_a_service(&sDefault, pszService); + } + return (add_a_service(ServicePtrs[iDefaultService], pszService)); } -- cgit From 4225f9a4bd5eece4d57820bbabb7b882610aa7cc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 12 Dec 2006 14:52:13 +0000 Subject: r20116: Start merging in the work done to create the new idmap subsystem. Simo. (This used to be commit 50cd8bffeeed2cac755f75fc3d76fe41c451976b) --- source3/param/loadparm.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 60d686f245..10efa461b1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -180,7 +180,9 @@ typedef struct { BOOL bWinbindNestedGroups; BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; - char **szIdmapBackend; + char **szIdmapDomains; + char **szIdmapBackend; /* deprecated */ + char **szIdmapAllocBackend; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; @@ -310,6 +312,8 @@ typedef struct { int client_signing; int server_signing; int iUsershareMaxShares; + int iIdmapExpireTime; + int iIdmapNegativeTime; BOOL bResetOnZeroVC; param_opt_struct *param_opt; @@ -1263,11 +1267,15 @@ static struct parm_struct parm_table[] = { {N_("Winbind options"), P_SEP, P_SEPARATOR}, {"passdb expand explicit", P_BOOL, P_GLOBAL, &Globals.bPassdbExpandExplicit, 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}, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE}, + {"idmap domains", P_LIST, P_GLOBAL, &Globals.szIdmapDomains, NULL, NULL, FLAG_ADVANCED}, + {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, + {"idmap alloc backend", P_STRING, P_GLOBAL, &Globals.szIdmapAllocBackend, NULL, NULL, FLAG_ADVANCED}, + {"idmap expire time", P_INTEGER, P_GLOBAL, &Globals.iIdmapExpireTime, NULL, NULL, FLAG_ADVANCED}, + {"idmap negative time", P_INTEGER, P_GLOBAL, &Globals.iIdmapNegativeTime, NULL, NULL, FLAG_ADVANCED}, + {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, + {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_HIDE | FLAG_DEPRECATED }, + {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE | FLAG_DEPRECATED }, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, 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}, @@ -1627,6 +1635,9 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; + Globals.iIdmapExpireTime = 900; /* 15 minutes by default */ + Globals.iIdmapNegativeTime = 120; /* 2 minutes by default */ + Globals.bPassdbExpandExplicit = False; Globals.name_cache_timeout = 660; /* In seconds */ @@ -1845,7 +1856,11 @@ FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups) FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) -FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) +FN_GLOBAL_LIST(lp_idmap_domains, &Globals.szIdmapDomains) +FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ +FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend) +FN_GLOBAL_INTEGER(lp_idmap_expire_time, &Globals.iIdmapExpireTime) +FN_GLOBAL_INTEGER(lp_idmap_negative_time, &Globals.iIdmapNegativeTime) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -- cgit From 0ef4aadb9b05bd13a258c94cafb85c198cae329e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 16 Dec 2006 17:47:22 +0000 Subject: r20214: Fix a type-punned warning. Simo, Jerry, please check (This used to be commit b459096a151c482d387ec14c965aee43c850e46a) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 10efa461b1..2ebf3b8ed3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -182,7 +182,7 @@ typedef struct { BOOL bWinbindOfflineLogon; char **szIdmapDomains; char **szIdmapBackend; /* deprecated */ - char **szIdmapAllocBackend; + char *szIdmapAllocBackend; char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; -- cgit From 55ed1d59455566d90a03e7123fbf7a05a4bd4539 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 19 Dec 2006 20:16:52 +0000 Subject: r20261: merge 20260 from samba_3_0_24 clean up a bunch of no previous prototype warnings (This used to be commit c60687db112405262adf26dbf267804b04074e67) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2ebf3b8ed3..172d32b586 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2255,6 +2255,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum) * lp_parm_string is only used to let old modules find this symbol */ #undef lp_parm_string + char *lp_parm_string(const char *servicename, const char *type, const char *option); char *lp_parm_string(const char *servicename, const char *type, const char *option) { return lp_parm_talloc_string(lp_servicenumber(servicename), type, option, NULL); -- cgit From b9b26be1744b792a54f0a77af140237b4dc5a870 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 24 Jan 2007 01:48:08 +0000 Subject: r20986: Commit the prototype of the nss_info plugin interface. This allows a provider to supply the homedirectory, etc... attributes for a user without requiring support in core winbindd code. The idmap_ad.c module has been modified to provide the idmap 'ad' library as well as the rfc2307 and sfu "winbind nss info" support. The SID/id mapping is working in idmap_ad but the nss_info still has a few quirks that I'm in the process of resolving. (This used to be commit aaec0115e2c96935499052d9a637a20c6445986e) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 172d32b586..e1cce4b963 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1631,7 +1631,6 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; - Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; -- cgit From a94b044a5cba2d4e5d4dadbd7b3a433322748c2c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 31 Jan 2007 05:38:36 +0000 Subject: r21070: * Add the new boolean 'winbind normalize names' option as discussed on the samba-technical ml. The replacement character is hardcoded as a '_' for now. (This used to be commit bd8238417b8d692ed381a870901ff1ee4cfa80f6) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e1cce4b963..8634c48b31 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -180,6 +180,7 @@ typedef struct { BOOL bWinbindNestedGroups; BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; + BOOL bWinbindNormalizeNames; char **szIdmapDomains; char **szIdmapBackend; /* deprecated */ char *szIdmapAllocBackend; @@ -1288,6 +1289,7 @@ static struct parm_struct parm_table[] = { {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, + {"winbind normalize names", P_BOOL, P_GLOBAL, &Globals.bWinbindNormalizeNames, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1622,6 +1624,7 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); string_set(&Globals.szWinbindSeparator, "\\"); + string_set(&Globals.szCupsServer, ""); string_set(&Globals.szIPrintServer, ""); @@ -1854,6 +1857,7 @@ FN_GLOBAL_BOOL(lp_winbind_trusted_domains_only, &Globals.bWinbindTrustedDomainsO FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups) FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) +FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) FN_GLOBAL_LIST(lp_idmap_domains, &Globals.szIdmapDomains) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ -- cgit From bad8c39f1ce48229c1ca545c03de6b7c26b7ba9f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Feb 2007 15:11:06 +0000 Subject: r21111: Reorganize the change notify params a bit. We now have the per-share parameters change notify = [yes]/no # do we do it at all kernel change notify = [yes]/no # enable/disable inotify Those who want FAM need to say change notify = yes vfs objects = notify_fam Volker (This used to be commit c3a44d8b9606fc516faceb69b8e87bfc8be312f3) --- source3/param/loadparm.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8634c48b31..f7dd30475a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -299,8 +299,6 @@ typedef struct { BOOL bHostnameLookups; BOOL bUnixExtensions; BOOL bDisableNetbios; - BOOL bKernelChangeNotify; - BOOL bFamChangeNotify; BOOL bUseKerberosKeytab; BOOL bDeferSharingViolations; BOOL bEnablePrivileges; @@ -452,11 +450,12 @@ typedef struct { BOOL bAclCheckPermissions; BOOL bAclMapFullControl; BOOL bAclGroupControl; + BOOL bChangeNotify; + BOOL bKernelChangeNotify; int iallocation_roundup_size; int iAioReadSize; int iAioWriteSize; int iMap_readonly; - int ichange_notify_timeout; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -591,11 +590,12 @@ static service sDefault = { True, /* bAclCheckPermissions */ True, /* bAclMapFullControl */ False, /* bAclGroupControl */ + True, /* bChangeNotify */ + True, /* bKernelChangeNotify */ SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */ 0, /* iAioReadSize */ 0, /* iAioWriteSize */ MAP_READONLY_YES, /* iMap_readonly */ - 60, /* ichange_notify_timeout = 1 minute default. */ NULL, /* Parametric options */ @@ -1006,12 +1006,11 @@ static struct parm_struct parm_table[] = { {N_("Tuning Options"), P_SEP, P_SEPARATOR}, {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"change notify timeout", P_INTEGER, P_LOCAL, &sDefault.ichange_notify_timeout, NULL, NULL, FLAG_ADVANCED}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED}, - {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED}, - {"fam change notify", P_BOOL, P_GLOBAL, &Globals.bFamChangeNotify, NULL, NULL, FLAG_ADVANCED}, + {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, + {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED}, {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_ADVANCED}, @@ -1524,8 +1523,6 @@ static void init_globals(BOOL first_time_only) Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */ Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */ Globals.machine_password_timeout = 60 * 60 * 24 * 7; /* 7 days default. */ - Globals.bKernelChangeNotify = True; /* On if we have it. */ - Globals.bFamChangeNotify = True; /* On if we have it. */ Globals.lm_announce = 2; /* = Auto: send only if LM clients found */ Globals.lm_interval = 60; Globals.announce_as = ANNOUNCE_AS_NT_SERVER; @@ -1939,8 +1936,8 @@ FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions) FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego) 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_fam_change_notify, &Globals.bFamChangeNotify) +FN_LOCAL_PARM_BOOL(lp_change_notify, bChangeNotify) +FN_LOCAL_PARM_BOOL(lp_kernel_change_notify, 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) @@ -2102,7 +2099,6 @@ FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) -FN_LOCAL_INTEGER(lp_change_notify_timeout, ichange_notify_timeout) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) -- cgit From 7a5fa7f12ec439ef5a4af29aa86498f799b6b9a5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Feb 2007 21:05:34 +0000 Subject: r21191: Add in the POSIX open/mkdir/unlink calls. Move more error code returns to NTSTATUS. Client test code to follow... See if this passes the build-farm before I add it into 3.0.25. Jeremy. (This used to be commit 83dbbdff345fa9e427c9579183f4380004bf3dd7) --- source3/param/loadparm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f7dd30475a..d7b23f615f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5589,17 +5589,23 @@ void lp_set_posix_pathnames(void) Global state for POSIX lock processing - CIFS unix extensions. ********************************************************************/ +BOOL posix_default_lock_was_set; static enum brl_flavour posix_cifsx_locktype; /* By default 0 == WINDOWS_LOCK */ -enum brl_flavour lp_posix_cifsu_locktype(void) +enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp) { - return posix_cifsx_locktype; + if (posix_default_lock_was_set) { + return posix_cifsx_locktype; + } else { + return fsp->posix_open ? POSIX_LOCK : WINDOWS_LOCK; + } } /******************************************************************* ********************************************************************/ -void lp_set_posix_cifsx_locktype(enum brl_flavour val) +void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val) { + posix_default_lock_was_set = True; posix_cifsx_locktype = val; } -- cgit From d9a29aade0f01df1fa00ccdb8691b02b39bc1d14 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Feb 2007 14:39:21 +0000 Subject: r21279: Get rid of 'aio write behind', this is broken. It should probably better be integrated with our write cache. Volker (This used to be commit 58bfd168b046a97a895aaa3384fd7af8d077a1d5) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d7b23f615f..7abbd0ca4e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -368,7 +368,6 @@ typedef struct { char *fstype; char **szVfsObjects; char *szMSDfsProxy; - char *szAioWriteBehind; char *szDfree; int iMinPrintSpace; int iMaxPrintJobs; @@ -508,7 +507,6 @@ static service sDefault = { NULL, /* fstype */ NULL, /* vfs objects */ NULL, /* szMSDfsProxy */ - NULL, /* szAioWriteBehind */ NULL, /* szDfree */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ @@ -962,7 +960,6 @@ static struct parm_struct parm_table[] = { {"allocation roundup size", P_INTEGER, P_LOCAL, &sDefault.iallocation_roundup_size, NULL, NULL, FLAG_ADVANCED}, {"aio read size", P_INTEGER, P_LOCAL, &sDefault.iAioReadSize, NULL, NULL, FLAG_ADVANCED}, {"aio write size", P_INTEGER, P_LOCAL, &sDefault.iAioWriteSize, NULL, NULL, FLAG_ADVANCED}, - {"aio write behind", P_STRING, P_LOCAL, &sDefault.szAioWriteBehind, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 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}, @@ -2017,7 +2014,6 @@ FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) -FN_LOCAL_STRING(lp_aio_write_behind, szAioWriteBehind) FN_LOCAL_STRING(lp_dfree_command, szDfree) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) -- cgit From 8dbeb4dbebb3e8cdcb83df195a91e77ac86f240a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 19 Feb 2007 13:30:07 +0000 Subject: r21446: Karolins "printjob username" (This used to be commit 19ee6779255a269830fa8ee51468a4738dadf942) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7abbd0ca4e..8d7e3f06bb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -349,6 +349,7 @@ typedef struct { char *szQueuepausecommand; char *szQueueresumecommand; char *szPrintername; + char *szPrintjobUsername; char *szDontdescend; char **szHostsallow; char **szHostsdeny; @@ -488,6 +489,7 @@ static service sDefault = { NULL, /* szQueuepausecommand */ NULL, /* szQueueresumecommand */ NULL, /* szPrintername */ + NULL, /* szPrintjobUsername */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -1065,6 +1067,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"printjob username", P_STRING, P_LOCAL, &sDefault.szPrintjobUsername, 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}, @@ -1409,6 +1412,7 @@ static void init_globals(BOOL first_time_only) string_set((char **)parm_table[i].ptr, ""); string_set(&sDefault.fstype, FSTYPE_STRING); + string_set(&sDefault.szPrintjobUsername, "%U"); init_printer_values(&sDefault); @@ -1995,6 +1999,7 @@ FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) static FN_LOCAL_STRING(_lp_printername, szPrintername) +FN_LOCAL_CONST_STRING(lp_printjob_username, szPrintjobUsername) FN_LOCAL_LIST(lp_hostsallow, szHostsallow) FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny) FN_LOCAL_STRING(lp_magicscript, szMagicScript) -- cgit From 16a00634e972584a1040ccb128e36eb4882cc686 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 19 Feb 2007 13:52:29 +0000 Subject: r21449: Talked to Jerry on irc, he does not see what might break with this: Change back the 'msdfs root = yes' default to 'no'. Volker (This used to be commit ec6ebdcdbf1146af21ab66731e018e2834b2b118) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8d7e3f06bb..dbc02fc663 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -576,7 +576,7 @@ static service sDefault = { False, /* bInheritPerms */ False, /* bInheritACLS */ False, /* bInheritOwner */ - True, /* bMSDfsRoot */ + False, /* bMSDfsRoot */ False, /* bUseClientDriver */ True, /* bDefaultDevmode */ False, /* bForcePrintername */ -- cgit From 1945571e3b899bee8a33122bece723ce87b7daed Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Thu, 22 Feb 2007 17:52:23 +0000 Subject: r21506: Allow old pre 3.0.22 multi passdb backend configurations to work with post 3.0.23. This implementation considers spaces in ldapsam configs. Such configs are trunkated after the closing quote. (This used to be commit 5cd9a2e25872db1881f2f67026bfcd52d060fc4b) --- source3/param/loadparm.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dbc02fc663..4e51af7c4e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1821,7 +1821,49 @@ FN_GLOBAL_STRING(lp_socket_address, &Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName) static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) -FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) +/* FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend) + * lp_passdb_backend() should be replace by the this macro again after + * some releases. + * */ +const char *lp_passdb_backend() +{ + char *delim, *quote; + int pos, i; + + delim = strchr( Globals.szPassdbBackend, ' '); + /* no space at all */ + if (delim == NULL) { + goto out; + } + + quote = strchr(Globals.szPassdbBackend, '"'); + /* no quote char or non in the first part */ + if (quote == NULL || quote > delim) { + *delim = '\0'; + goto warn; + } + + quote = strchr(quote+1, '"'); + if (quote == NULL) { + DEBUG(0, ("WARNING: Your 'passdb backend' configuration is invalid due to a missing second \" char.\n")); + goto out; + } else if (*(quote+1) == '\0') { + /* space, fitting quote char, and one backend only */ + goto out; + } else { + /* terminate string after the fitting quote char */ + *(quote+1) = '\0'; + } + +warn: + DEBUG(0, ("WARNING: Your 'passdb backend' configuration includes multiple backends. This\n" + "is deprecated since Samba 3.0.23. Please check WHATSNEW.txt or the section 'Passdb\n" + "Changes' from the ChangeNotes as part of the Samba HOWTO collection. The first part\n" + "(%s) of your configuration is used instead.\n", Globals.szPassdbBackend)); + +out: + return Globals.szPassdbBackend; +} FN_GLOBAL_LIST(lp_preload_modules, &Globals.szPreloadModules) FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction) FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript) -- cgit From fde308d6a8ef7eed0b2ad3afd58fb8922a4bb249 Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Thu, 22 Feb 2007 23:12:36 +0000 Subject: r21509: Merge lp_passdb_backend() from rev 21506 to 3_0_25. Slightly change the DEBUG 0 message as suggested by Volker on samba-technical. (This used to be commit c02921e95d41fe93c5913d79dfb690fcc1d73de4) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4e51af7c4e..0be313b35a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1858,8 +1858,8 @@ const char *lp_passdb_backend() warn: DEBUG(0, ("WARNING: Your 'passdb backend' configuration includes multiple backends. This\n" "is deprecated since Samba 3.0.23. Please check WHATSNEW.txt or the section 'Passdb\n" - "Changes' from the ChangeNotes as part of the Samba HOWTO collection. The first part\n" - "(%s) of your configuration is used instead.\n", Globals.szPassdbBackend)); + "Changes' from the ChangeNotes as part of the Samba HOWTO collection. Only the first\n" + "backend (%s) is used. The rest is ignored.\n", Globals.szPassdbBackend)); out: return Globals.szPassdbBackend; -- cgit From d43dbee7133e069f0f34d6adea8d8b4ac0268797 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 23 Feb 2007 11:53:43 +0000 Subject: r21517: Fix build warnings. Guenther (This used to be commit 82f1da8117434c52c383b33a905b3765f0240d4a) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0be313b35a..8849d2dea7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1825,10 +1825,9 @@ FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases) * lp_passdb_backend() should be replace by the this macro again after * some releases. * */ -const char *lp_passdb_backend() +const char *lp_passdb_backend(void) { char *delim, *quote; - int pos, i; delim = strchr( Globals.szPassdbBackend, ' '); /* no space at all */ -- cgit From 28e2069d1f066f20b376d911d6ed582a76c4a713 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Feb 2007 20:14:35 +0000 Subject: r21547: Fix from Michael Adam : Refuse registry shares without path. Thanks, Volker (This used to be commit e795865d58472498097edc3fb68438ed08c38d8d) --- source3/param/loadparm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8849d2dea7..b90b53c16b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2157,7 +2157,6 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, service * pserviceSource, BOOL *pcopymapDest); -static BOOL service_ok(int iService); static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); static BOOL do_section(const char *pszSectionName); static void init_copymap(service * pservice); @@ -2977,7 +2976,7 @@ Check a service for consistency. Return False if the service is in any way incomplete or faulty, else True. ***************************************************************************/ -static BOOL service_ok(int iService) +BOOL service_ok(int iService) { BOOL bRetval; @@ -3010,7 +3009,7 @@ static BOOL service_ok(int iService) ServicePtrs[iService]->bAvailable = False; } - /* If a service is flagged unavailable, log the fact at level 0. */ + /* If a service is flagged unavailable, log the fact at level 1. */ if (!ServicePtrs[iService]->bAvailable) DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n", ServicePtrs[iService]->szService)); -- cgit From 93128b863bb10aeca6202f4d5ba7935e31cf5c5f Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 13 Mar 2007 17:39:06 +0000 Subject: r21825: add debug prefix timestamp to allow "short timestamps" to be added to debug messages (This used to be commit 4af2795e65f6bab156b300d720c7ea75c944bb87) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b90b53c16b..b9e9505b34 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -290,6 +290,7 @@ typedef struct { BOOL bClientNTLMv2Auth; BOOL bClientPlaintextAuth; BOOL bClientUseSpnego; + BOOL bDebugPrefixTimestamp; BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; @@ -952,6 +953,7 @@ static struct parm_struct parm_table[] = { {"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, 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 prefix timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugPrefixTimestamp, 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}, @@ -1516,6 +1518,7 @@ static void init_globals(BOOL first_time_only) Globals.bSyslogOnly = False; Globals.bTimestampLogs = True; string_set(&Globals.szLogLevel, "0"); + Globals.bDebugPrefixTimestamp = False; Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; @@ -1947,6 +1950,7 @@ FN_GLOBAL_INTEGER(lp_client_schannel, &Globals.clientSchannel) FN_GLOBAL_INTEGER(lp_server_schannel, &Globals.serverSchannel) FN_GLOBAL_BOOL(lp_syslog_only, &Globals.bSyslogOnly) FN_GLOBAL_BOOL(lp_timestamp_logs, &Globals.bTimestampLogs) +FN_GLOBAL_BOOL(lp_debug_prefix_timestamp, &Globals.bDebugPrefixTimestamp) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) -- cgit From 80a78b0aa86e064701b9b43a976f26fb8143d64a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 18 Mar 2007 09:54:18 +0000 Subject: r21866: Remove unused "lock spin count" parameter (This used to be commit 52f2c89c0a462a69fe945401ac1a7341e2a6e4ca) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b9e9505b34..13455101d8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -229,7 +229,6 @@ typedef struct { int winbind_cache_time; int winbind_max_idle_children; char **szWinbindNssInfo; - int iLockSpinCount; int iLockSpinTime; char *szLdapMachineSuffix; char *szLdapUserSuffix; @@ -1156,7 +1155,6 @@ static struct parm_struct parm_table[] = { {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"lock spin count", P_INTEGER, P_GLOBAL, &Globals.iLockSpinCount, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, @@ -1559,7 +1557,6 @@ static void init_globals(BOOL first_time_only) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ Globals.enhanced_browsing = True; - Globals.iLockSpinCount = 0; /* Unused. */ Globals.iLockSpinTime = WINDOWS_MINIMUM_LOCK_TIMEOUT_MS; /* msec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; @@ -2016,7 +2013,6 @@ FN_GLOBAL_INTEGER(lp_lm_interval, &Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout, &Globals.machine_password_timeout) FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) -FN_GLOBAL_INTEGER(lp_lock_spin_count, &Globals.iLockSpinCount) FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) -- cgit From 7c2bc9c07083e7035028cf22e97e0c31b3e9d6a5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 18 Mar 2007 10:57:46 +0000 Subject: r21869: Move sending keepalives out of the main processing loop into idle event. On the way, make lp_keepalive() a proper parameter. Volker (This used to be commit 9499fd9c803d030ce9827f8379c2e56d91bb786e) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 13455101d8..6d2ba9377d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -79,7 +79,6 @@ extern userdom_struct current_user_info; #define USERSHARE_VALID 1 #define USERSHARE_PENDING_DELETE 2 -int keepalive = DEFAULT_KEEPALIVE; BOOL use_getwd_cache = True; extern int extra_time_offset; @@ -315,6 +314,7 @@ typedef struct { int iIdmapNegativeTime; BOOL bResetOnZeroVC; + int iKeepalive; param_opt_struct *param_opt; } global; @@ -1008,7 +1008,7 @@ static struct parm_struct parm_table[] = { {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, - {"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED}, + {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, @@ -1666,6 +1666,8 @@ static void init_globals(BOOL first_time_only) /* By default disallow guest access to usershares. */ Globals.bUsershareAllowGuests = False; + Globals.iKeepalive = DEFAULT_KEEPALIVE; + /* By default no shares out of the registry */ Globals.bRegistryShares = False; } @@ -1903,6 +1905,7 @@ FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend) FN_GLOBAL_INTEGER(lp_idmap_expire_time, &Globals.iIdmapExpireTime) FN_GLOBAL_INTEGER(lp_idmap_negative_time, &Globals.iIdmapNegativeTime) +FN_GLOBAL_INTEGER(lp_keepalive, &Globals.iKeepalive) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) FN_GLOBAL_STRING(lp_ldap_suffix, &Globals.szLdapSuffix) -- cgit From 52d5e2a9353fdaf1278509c185079778ef982c3f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 20 Mar 2007 02:43:20 +0000 Subject: r21884: * Blacklist BUILTIN and MACHINE domains from the idmap domains as these should only be handled by the winbindd_passdb.c backend * Allow the alloc init to fail for backwards compatible configurations like idmap backend = ad idmap uid = 1000-100000 .... * Remove the deprecated flags from idmap backend, et. al. These are mutually exclusive with the new configuration options (idmap domains). Logging annoying messages about deprecated parameters is confusing. So we'll try this apprpach for now. (This used to be commit 5e30807b4e9c0211c9e2c02deee94543e8f0d855) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6d2ba9377d..b81d2688df 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1268,14 +1268,14 @@ static struct parm_struct parm_table[] = { {"passdb expand explicit", P_BOOL, P_GLOBAL, &Globals.bPassdbExpandExplicit, NULL, NULL, FLAG_ADVANCED}, {"idmap domains", P_LIST, P_GLOBAL, &Globals.szIdmapDomains, NULL, NULL, FLAG_ADVANCED}, - {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, + {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED }, {"idmap alloc backend", P_STRING, P_GLOBAL, &Globals.szIdmapAllocBackend, NULL, NULL, FLAG_ADVANCED}, {"idmap expire time", P_INTEGER, P_GLOBAL, &Globals.iIdmapExpireTime, NULL, NULL, FLAG_ADVANCED}, {"idmap negative time", P_INTEGER, P_GLOBAL, &Globals.iIdmapNegativeTime, NULL, NULL, FLAG_ADVANCED}, - {"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, - {"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_HIDE | FLAG_DEPRECATED }, - {"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED | FLAG_DEPRECATED }, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE | FLAG_DEPRECATED }, + {"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 }, + {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE }, {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, 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}, -- cgit From 93b2485c9bed5e00244acfd3de6942f091be9148 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 20 Mar 2007 20:47:17 +0000 Subject: r21892: Mini-Patch from Michael (This used to be commit 6cae3cf28155091a3951ecabd1c1b7e5c62d4c16) --- source3/param/loadparm.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b81d2688df..5d3a9c0c0a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3524,9 +3524,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue parm_ptr = ((char *)ServicePtrs[snum]) + PTR_DIFF(def_ptr, &sDefault); - } - if (snum >= 0) { if (!ServicePtrs[snum]->copymap) init_copymap(ServicePtrs[snum]); -- cgit From f8c2960d45df07a252ccb176cc691f5063a5231a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 21 Mar 2007 15:21:28 +0000 Subject: r21905: Rename idmap expire time -> idmap cache time idmap negative time -> idmap negative cache time (This used to be commit aac2d0af5e870190e99317e8e88b22a9562485b4) --- source3/param/loadparm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5d3a9c0c0a..6392da6f07 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -310,8 +310,8 @@ typedef struct { int client_signing; int server_signing; int iUsershareMaxShares; - int iIdmapExpireTime; - int iIdmapNegativeTime; + int iIdmapCacheTime; + int iIdmapNegativeCacheTime; BOOL bResetOnZeroVC; int iKeepalive; @@ -1270,8 +1270,8 @@ static struct parm_struct parm_table[] = { {"idmap domains", P_LIST, P_GLOBAL, &Globals.szIdmapDomains, NULL, NULL, FLAG_ADVANCED}, {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED }, {"idmap alloc backend", P_STRING, P_GLOBAL, &Globals.szIdmapAllocBackend, NULL, NULL, FLAG_ADVANCED}, - {"idmap expire time", P_INTEGER, P_GLOBAL, &Globals.iIdmapExpireTime, NULL, NULL, FLAG_ADVANCED}, - {"idmap negative time", P_INTEGER, P_GLOBAL, &Globals.iIdmapNegativeTime, NULL, NULL, FLAG_ADVANCED}, + {"idmap cache time", P_INTEGER, P_GLOBAL, &Globals.iIdmapCacheTime, NULL, NULL, FLAG_ADVANCED}, + {"idmap negative cache time", P_INTEGER, P_GLOBAL, &Globals.iIdmapNegativeCacheTime, 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 }, @@ -1635,8 +1635,8 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.iIdmapExpireTime = 900; /* 15 minutes by default */ - Globals.iIdmapNegativeTime = 120; /* 2 minutes by default */ + Globals.iIdmapCacheTime = 900; /* 15 minutes by default */ + Globals.iIdmapNegativeCacheTime = 120; /* 2 minutes by default */ Globals.bPassdbExpandExplicit = False; @@ -1903,8 +1903,8 @@ FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) FN_GLOBAL_LIST(lp_idmap_domains, &Globals.szIdmapDomains) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend) -FN_GLOBAL_INTEGER(lp_idmap_expire_time, &Globals.iIdmapExpireTime) -FN_GLOBAL_INTEGER(lp_idmap_negative_time, &Globals.iIdmapNegativeTime) +FN_GLOBAL_INTEGER(lp_idmap_cache_time, &Globals.iIdmapCacheTime) +FN_GLOBAL_INTEGER(lp_idmap_negative_cache_time, &Globals.iIdmapNegativeCacheTime) FN_GLOBAL_INTEGER(lp_keepalive, &Globals.iKeepalive) FN_GLOBAL_BOOL(lp_passdb_expand_explicit, &Globals.bPassdbExpandExplicit) -- cgit From 643157ff5ac13b15a4b501b00ffdca5fced0e7e9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 24 Mar 2007 18:01:39 +0000 Subject: r21959: Merge a comment fix from Michael Adam -- more to come :-) (This used to be commit 06a4d2ce5d4d5d637f19c7444a6510a1bbad7a9f) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6392da6f07..a049b2d47a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3995,7 +3995,8 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) } /*************************************************************************** - Return info about the next service in a service. snum==GLOBAL_SECTION_SNUM gives the globals. + Return info about the next parameter in a service. + snum==GLOBAL_SECTION_SNUM gives the globals. Return NULL when out of parameters. ***************************************************************************/ -- cgit From 74a07edb505c9f20a93c00da06cb5c997b6b3c8a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Apr 2007 19:10:16 +0000 Subject: r22266: Fix bug #4512 - we were returning a volume label greater than 32 unicode chars. Windows XP doesn't like that :-). Jeremy (This used to be commit e59b5276b56d6963ddd0598bbd1b15426d2d13e8) --- source3/param/loadparm.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a049b2d47a..ea434e4768 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5299,15 +5299,22 @@ struct share_params *snum2params_static(int snum) A useful volume label function. ********************************************************************/ -char *volume_label(int snum) +const char *volume_label(int snum) { - char *ret = lp_volume(snum); - if (!*ret) - return lp_servicename(snum); - return (ret); + char *ret; + const char *label = lp_volume(snum); + if (!*label) { + label = lp_servicename(snum); + } + + /* This returns a 33 byte guarenteed null terminated string. */ + ret = talloc_strndup(main_loop_talloc_get(), label, 32); + if (!ret) { + return ""; + } + return ret; } - /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ -- cgit From e459831b5a672683dcf63cac6ebb4b76e62e6549 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Apr 2007 22:42:45 +0000 Subject: r22285: Allow arbitrary bases in int and ulong parsing. Jeremy. (This used to be commit c1f1949ff134c343cb0ee8f8e46cf58b1dfe97c7) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ea434e4768..c37fe54418 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2232,7 +2232,7 @@ static int lp_int(const char *s) return (-1); } - return atoi(s); + return (int)strtol(s, NULL, 0); } /******************************************************************* @@ -2246,7 +2246,7 @@ static unsigned long lp_ulong(const char *s) return (0); } - return strtoul(s, NULL, 10); + return strtoul(s, NULL, 0); } /******************************************************************* -- cgit From 68d5d934bb405c0a1d6a4fecf5e647fcc18ce284 Mon Sep 17 00:00:00 2001 From: James Peach Date: Thu, 3 May 2007 16:14:22 +0000 Subject: r22648: Fix comment to match the code. (This used to be commit e93d33b4631e634499b2e74c31d483d306d10367) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c37fe54418..da2a7d1c68 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2577,7 +2577,7 @@ static int add_a_service(const service *pservice, const char *name) } /*************************************************************************** - Convert a string to uppercase and remove whitespaces. + Canonicalize by converting to lowercase. ***************************************************************************/ static char *canonicalize_servicename(const char *src) -- cgit From 4a99ee023609a3e753bb66e1fcd019a97447d9dd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 6 Jun 2007 13:02:24 +0000 Subject: r23368: Make "winbind:rpc only" a full blown parameter. Thanks to Karolin for the patch :-) (This used to be commit 07b71a02aef15b75d281cabeb7140db1bc0bb283) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index da2a7d1c68..9d8b7b195b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -180,6 +180,7 @@ typedef struct { BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; BOOL bWinbindNormalizeNames; + BOOL bWinbindRpcOnly; char **szIdmapDomains; char **szIdmapBackend; /* deprecated */ char *szIdmapAllocBackend; @@ -1289,6 +1290,7 @@ static struct parm_struct parm_table[] = { {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, {"winbind normalize names", P_BOOL, P_GLOBAL, &Globals.bWinbindNormalizeNames, NULL, NULL, FLAG_ADVANCED}, + {"winbind rpc only", P_BOOL, P_GLOBAL, &Globals.bWinbindRpcOnly, NULL, NULL, FLAG_ADVANCED}, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; @@ -1899,6 +1901,7 @@ FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups) FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) +FN_GLOBAL_BOOL(lp_winbind_rpc_only, &Globals.bWinbindRpcOnly) FN_GLOBAL_LIST(lp_idmap_domains, &Globals.szIdmapDomains) FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ -- cgit From de565785f5e1f097bd75f57331425c4185185f80 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Jun 2007 17:02:09 +0000 Subject: r23410: Merge the core of the cluster code. I'm 100% certain I've forgotten to merge something, but the main code should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and messages_ctdbd.c. There should be no changes to the non-cluster case, it does survive make test on my laptop. It survives some very basic tests with ctdbd enables, I did not do the full test suite for clusters yet. Phew... Volker (This used to be commit 15553d6327a3aecdd2b0b94a3656d04bf4106323) --- source3/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9d8b7b195b..b9386a6396 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -240,6 +240,8 @@ typedef struct { int iAclCompat; char *szCupsServer; char *szIPrintServer; + char *ctdbdSocket; + BOOL clustering; int ldap_passwd_sync; int ldap_replication_sleep; int ldap_timeout; /* This is initialised in init_globals */ @@ -1032,6 +1034,8 @@ static struct parm_struct parm_table[] = { {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED}, {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, + {"ctdbd socket", P_STRING, P_GLOBAL, &Globals.ctdbdSocket, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + {"clustering", P_BOOL, P_GLOBAL, &Globals.clustering, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {N_("Printing Options"), P_SEP, P_SEPARATOR}, @@ -1628,6 +1632,9 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.szCupsServer, ""); string_set(&Globals.szIPrintServer, ""); + string_set(&Globals.ctdbdSocket, ""); + Globals.clustering = False; + Globals.winbind_cache_time = 300; /* 5 minutes */ Globals.bWinbindEnumUsers = False; Globals.bWinbindEnumGroups = False; @@ -2038,6 +2045,8 @@ FN_GLOBAL_LIST(lp_svcctl_list, &Globals.szServicesList) FN_LOCAL_STRING(lp_cups_options, szCupsOptions) FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer) +FN_GLOBAL_CONST_STRING(lp_ctdbd_socket, &Globals.ctdbdSocket) +FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering); FN_LOCAL_STRING(lp_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) -- cgit From 78d6b95e18282f87dcabb311675f6565646aa3f9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 13 Jun 2007 20:40:54 +0000 Subject: r23471: Here's a rough patch for expanding domain group membership in the winbindd_getgrnam() call. Couple of comments: * Adds "winbind expand groups" parameter which defines the max depth winbindd will expand group members. The default is the current behavior of one level of expansion. * The entire getrgnam() interface should be async. I haven't done that. * Refactors the domain users hack in fill_grent_mem() into its own function. (This used to be commit 3d3a8130351753dc5caa2a270d130e2150da6b54) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b9386a6396..3fa9e859e1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -177,6 +177,7 @@ typedef struct { BOOL bWinbindUseDefaultDomain; BOOL bWinbindTrustedDomainsOnly; BOOL bWinbindNestedGroups; + int winbind_expand_groups; BOOL bWinbindRefreshTickets; BOOL bWinbindOfflineLogon; BOOL bWinbindNormalizeNames; @@ -1290,6 +1291,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"winbind expand groups", P_INTEGER, P_GLOBAL, &Globals.winbind_expand_groups, NULL, NULL, FLAG_ADVANCED}, {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, @@ -1641,6 +1643,7 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; + Globals.winbind_expand_groups = 1; Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; @@ -1905,6 +1908,7 @@ 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_INTEGER(lp_winbind_expand_groups, &Globals.winbind_expand_groups) FN_GLOBAL_BOOL(lp_winbind_refresh_tickets, &Globals.bWinbindRefreshTickets) FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) -- cgit From bfbf08adfffc3967a2866626d8e54fb8849a841b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 13 Jun 2007 20:43:49 +0000 Subject: r23472: add missing default setting for 'winbind nss info' (merge from 3.0.26) (This used to be commit 1f80f9d14553650fb9d24f1d4c36e5cf7986ce23) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3fa9e859e1..27357868da 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1644,6 +1644,7 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; Globals.winbind_expand_groups = 1; + Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; -- cgit From aa4110e6f2432d76926198ce7a2a4adea4e1860a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 15 Jun 2007 21:38:10 +0000 Subject: r23509: This activates the global options from the registry in loadparm. The global options are stored as values in the subkey "global" of the SMBCONF registry key. The activation is accomplished in smb.conf though a new special semantic of the "include" parameter: "include = registry" triggers the processing of the registry global options exactly at the position of the include statement. Options read from the registry take the same precedence as parameters loaded from a file via include. Need to reload the registry globals is detected by watching the tdb sequence number. Registry shares are automatically activated when the registry globals are processed. So a "registry only" configuration can be realized by an smb.conf that looks as follows: ================================ [global] include = registry ================================ The global options and registry shares can be conveniently edited with the "net conf" utility. Caveat: A possible pitfall consists in using "include = registry" together with the "lock directory" directive in the registry. This problem will be addressed in the next time. Note on the code: Processing of the registry options is accomplished by a function process_registry_globals() in loadparm.c The current version is only an interim solution: It is handcoded instead of using the infrastructure of reg_api.c. The reason for this is that using reg_api still has too large linker dependencies, bloating virtually all targets by PASSDB_OBJ, SMBLDAP_OBJ, GROUPDB_OBJ and LDB stuff. A version of process_registry_globals that uses reg_api is included but commented out. The goal is to eventually refactor and restructure the registry code so that one can use the reg_api to access only the registry tdb and not link all the dynamic backends with all their linking implications. (This used to be commit 24b0cbcb3741dd14b04728448a85cc04a057e7d0) --- source3/param/loadparm.c | 265 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 27357868da..86b82174a9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -72,6 +72,17 @@ extern userdom_struct current_user_info; #define HOMES_NAME "homes" #endif +/* the special value for the include parameter + * to be interpreted not as a file name but to + * trigger loading of the global smb.conf options + * from registry. */ +#ifndef INCLUDE_REGISTRY_NAME +#define INCLUDE_REGISTRY_NAME "registry" +#endif + +static int regdb_last_seqnum = 0; +static BOOL include_registry_globals = False; + /* some helpful bits */ #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid) #define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid) @@ -3037,6 +3048,237 @@ BOOL service_ok(int iService) return (bRetval); } +/* + * lp_regdb_open - regdb helper function + * + * this should be considered an interim solution that becomes + * superfluous once the registry code has been rewritten + * do allow use of the tdb portion of the registry alone. + * + * in the meanwhile this provides a lean access + * to the registry globals. + */ + +static struct tdb_wrap *lp_regdb_open(void) +{ + struct tdb_wrap *reg_tdb = NULL; + const char *vstring = "INFO/version"; + uint32 vers_id; + + become_root(); + reg_tdb = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, + REG_TDB_FLAGS, O_RDWR, 0600); + if (!reg_tdb) { + DEBUG(0, ("lp_regdb_open: failed to open %s: %s\n", + lock_path("registry.tdb"), strerror(errno))); + } + else { + DEBUG(10, ("lp_regdb_open: reg tdb opened.\n")); + } + unbecome_root(); + + vers_id = tdb_fetch_int32(reg_tdb->tdb, vstring); + if (vers_id != REGVER_V1) { + DEBUG(10, ("lp_regdb_open: INFO: registry tdb %s has wrong " + "INFO/version (got %d, expected %d)\n", + lock_path("registry.tdb"), vers_id, REGVER_V1)); + /* this is apparently not implemented in the tdb */ + } + + return reg_tdb; +} + +/* + * process_registry_globals + * + * this is the interim version of process_registry globals + * + * until we can do it as we would like using the api and only + * using the tdb portion of the registry (see below), + * this just provides the needed functionality of regdb_fetch_values + * and regdb_unpack_values, circumventing any fancy stuff, to + * give us access to the registry globals. + */ +static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) +{ + BOOL ret = False; + struct tdb_wrap *reg_tdb = NULL; + WERROR err; + char *keystr; + TDB_DATA data; + /* vars for the tdb unpack loop */ + int len = 0; + int i; + int buflen; + uint8 *buf; + uint32 type; + uint32 size; + uint32 num_values = 0; + uint8 *data_p; + pstring valname; + char * valstr; + struct registry_value *value = NULL; + + include_registry_globals = True; + + ZERO_STRUCT(data); + + reg_tdb = lp_regdb_open(); + if (!reg_tdb) { + DEBUG(1, ("Error opening the registry!\n")); + goto done; + } + + /* reg_tdb is from now on used as talloc ctx. + * freeing it closes the tdb (if refcount is 0) */ + + keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", VALUE_PREFIX, + KEY_SMBCONF, GLOBAL_NAME); + normalize_dbkey(keystr); + + DEBUG(10, ("process_registry_shares: fetching key '%s'\n", + keystr)); + + data = tdb_fetch_bystring(reg_tdb->tdb, keystr); + if (!data.dptr) { + ret = True; + goto done; + } + + buf = data.dptr; + buflen = data.dsize; + + /* unpack number of values */ + len = tdb_unpack(buf, buflen, "d", &num_values); + DEBUG(10, ("process_registry_shares: got %d values from tdb\n", + num_values)); + + /* unpack the values */ + for (i=0; i < num_values; i++) { + type = REG_NONE; + size = 0; + data_p = NULL; + len += tdb_unpack(buf+len, buflen-len, "fdB", + valname, + &type, + &size, + &data_p); + DEBUG(10, ("process_registry_shares: got value '%s'\n", + valname)); + if (size && data_p) { + err = registry_pull_value(reg_tdb, + &value, + type, + data_p, + size, + size); + SAFE_FREE(data_p); + if (!W_ERROR_IS_OK(err)) { + goto done; + } + switch(type) { + case REG_DWORD: + valstr = talloc_asprintf(reg_tdb, "%d", + value->v.dword); + pfunc(valname, valstr); + break; + case REG_SZ: + pfunc(valname, value->v.sz.str); + break; + default: + /* ignore other types */ + break; + } + } + } + + ret = pfunc("registry shares", "yes"); + regdb_last_seqnum = tdb_get_seqnum(reg_tdb->tdb); + +done: + TALLOC_FREE(reg_tdb); + SAFE_FREE(data.dptr); + return ret; +} + +#if 0 +/* + * this is process_registry_globals as it _should_ be (roughly) + * using the reg_api functions... + * + */ +static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) +{ + BOOL ret = False; + TALLOC_CTX *ctx = NULL; + char *regpath = NULL; + WERROR werr = WERR_OK; + struct registry_key *key = NULL; + struct registry_value *value = NULL; + char *valname = NULL; + char *valstr = NULL; + uint32 idx = 0; + NT_USER_TOKEN *token; + + ctx = talloc_init("process_registry_globals"); + if (!ctx) { + smb_panic("Failed to create talloc context!"); + } + + include_registry_globals = True; + + if (!registry_init_regdb()) { + DEBUG(1, ("Error initializing the registry.\n")); + goto done; + } + + if (!(token = registry_create_admin_token(ctx))) { + DEBUG(1, ("Error creating admin token\n")); + goto done; + } + + regpath = talloc_asprintf(ctx,"%s\\%s", KEY_SMBCONF, GLOBAL_NAME); + werr = reg_open_path(ctx, regpath, REG_KEY_READ, token, &key); + if (!W_ERROR_IS_OK(werr)) { + DEBUG(1, ("Registry smbconf global section does not exist.\n")); + DEBUGADD(1, ("Error opening registry path '%s\\%s: %s\n", + KEY_SMBCONF, GLOBAL_NAME, dos_errstr(werr))); + goto done; + } + + for (idx = 0; + W_ERROR_IS_OK(werr = reg_enumvalue(ctx, key, idx, &valname, + &value)); + idx++) + { + DEBUG(5, ("got global registry parameter '%s'\n", valname)); + switch(value->type) { + case REG_DWORD: + valstr = talloc_asprintf(ctx, "%d", value->v.dword); + pfunc(valname, valstr); + TALLOC_FREE(valstr); + break; + case REG_SZ: + pfunc(valname, value->v.sz.str); + break; + default: + /* ignore other types */ + break; + } + TALLOC_FREE(value); + TALLOC_FREE(valstr); + } + + ret = pfunc("registry shares", "yes"); + + regdb_last_seqnum = regdb_get_seqnum(); + +done: + talloc_destroy(ctx); + return ret; +} +#endif /* if 0 */ + static struct file_lists { struct file_lists *next; char *name; @@ -3090,9 +3332,21 @@ static void add_to_file_list(const char *fname, const char *subfname) BOOL lp_file_list_changed(void) { struct file_lists *f = file_lists; + struct tdb_wrap *reg_tdb = NULL; DEBUG(6, ("lp_file_list_changed()\n")); + if (include_registry_globals) { + reg_tdb = lp_regdb_open(); + if (reg_tdb && (regdb_last_seqnum != tdb_get_seqnum(reg_tdb->tdb))) + { + DEBUGADD(6, ("regdb seqnum changed: old = %d, new = %d\n", + regdb_last_seqnum, tdb_get_seqnum(reg_tdb->tdb))); + TALLOC_FREE(reg_tdb); + return True; + } + } + while (f) { pstring n2; time_t mod_time; @@ -3193,6 +3447,17 @@ static BOOL handle_include(int snum, const char *pszParmValue, char **ptr) pstring fname; pstrcpy(fname, pszParmValue); + if (strequal(fname, INCLUDE_REGISTRY_NAME)) { + if (bInGlobalSection) { + return process_registry_globals(do_parameter); + } + else { + DEBUG(1, ("\"include = registry\" only effective " + "in %s section\n", GLOBAL_NAME)); + return False; + } + } + standard_sub_basic(get_current_username(), current_user_info.domain, fname,sizeof(fname)); -- cgit From b1ce226af8b61ad7e3c37860a59c6715012e738b Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 15 Jun 2007 21:58:49 +0000 Subject: r23510: Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 86b82174a9..26c177d5fd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1717,7 +1717,7 @@ TALLOC_CTX *tmp_talloc_ctx(void) } if (lp_talloc == NULL) { - smb_panic("Could not create temporary talloc context\n"); + smb_panic("Could not create temporary talloc context"); } return lp_talloc; -- cgit From ebb53d72882f783798067f3c31424b5ba6caf2da Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 15 Jun 2007 23:52:01 +0000 Subject: r23513: Fix one more use of VALUE_PREFIX. Jeremy. (This used to be commit fca5637dc6c91a57c4e087670068688557e5bf32) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 26c177d5fd..856b7c4b0e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3132,7 +3132,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) /* reg_tdb is from now on used as talloc ctx. * freeing it closes the tdb (if refcount is 0) */ - keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", VALUE_PREFIX, + keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", REG_VALUE_PREFIX, KEY_SMBCONF, GLOBAL_NAME); normalize_dbkey(keystr); -- cgit From 0027ca86b6df471482b8082d6365c33fa0182c15 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 19 Jun 2007 21:06:31 +0000 Subject: r23547: Ignore parameter "include" in regsitry globals. Michael (This used to be commit f0992c0d79bb6a5810c84a9eac208d83390bb047) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 856b7c4b0e..01bc798449 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3163,6 +3163,11 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) &type, &size, &data_p); + if (strcmp(valname,"include")) { + DEBUG(10, ("process_registry_globals: Ignoring " + "parameter 'include' in registry.\n")); + continue; + } DEBUG(10, ("process_registry_shares: got value '%s'\n", valname)); if (size && data_p) { -- cgit From 0d4e977f5d4a05d01fe9a444623675d55a75b676 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 19 Jun 2007 21:08:46 +0000 Subject: r23548: Fix comments. Michael (This used to be commit 73e41c1d0a7af7488b35b54182ea532103b51fd4) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 01bc798449..09eeaeee56 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3136,7 +3136,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) KEY_SMBCONF, GLOBAL_NAME); normalize_dbkey(keystr); - DEBUG(10, ("process_registry_shares: fetching key '%s'\n", + DEBUG(10, ("process_registry_globals: fetching key '%s'\n", keystr)); data = tdb_fetch_bystring(reg_tdb->tdb, keystr); @@ -3150,7 +3150,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) /* unpack number of values */ len = tdb_unpack(buf, buflen, "d", &num_values); - DEBUG(10, ("process_registry_shares: got %d values from tdb\n", + DEBUG(10, ("process_registry_globals: got %d values from tdb\n", num_values)); /* unpack the values */ @@ -3168,7 +3168,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) "parameter 'include' in registry.\n")); continue; } - DEBUG(10, ("process_registry_shares: got value '%s'\n", + DEBUG(10, ("process_registry_globals: got value '%s'\n", valname)); if (size && data_p) { err = registry_pull_value(reg_tdb, -- cgit From 9b11c3e08fabe8b93df4d17019eaf8cdd61566af Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 20 Jun 2007 08:47:13 +0000 Subject: r23552: Use proper comparison function an fix logic. Michael (This used to be commit a4714b34284f9e205556166166f41ce9dad4d3da) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 09eeaeee56..92d5f07e2a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3163,7 +3163,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) &type, &size, &data_p); - if (strcmp(valname,"include")) { + if (strwicmp(valname,"include") == 0) { DEBUG(10, ("process_registry_globals: Ignoring " "parameter 'include' in registry.\n")); continue; -- cgit From 04c75d9c95c5321d1fe5455671074b0e46f0df77 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 20 Jun 2007 10:08:31 +0000 Subject: r23553: Also ignore "lock directory" in registry global options. Michael (This used to be commit 3695a66166c6aa88051b21ad40a19f1cc8b87c7b) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 92d5f07e2a..5255c95c27 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3163,9 +3163,12 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) &type, &size, &data_p); - if (strwicmp(valname,"include") == 0) { + if ((strwicmp(valname,"include") == 0) || + (strwicmp(valname, "lock directory") == 0) || + (strwicmp(valname, "lock dir") == 0)) + { DEBUG(10, ("process_registry_globals: Ignoring " - "parameter 'include' in registry.\n")); + "parameter '%s' in registry.\n", valname)); continue; } DEBUG(10, ("process_registry_globals: got value '%s'\n", -- cgit From 510ba543ccf8ab4c58a18e35c2f63df5de49d0c3 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 21 Jun 2007 20:56:56 +0000 Subject: r23575: Fix a segfault when lp_load is called before init_registry. Michael (This used to be commit 235a5ae4cdf3ea238728c2e89a4318c18257426a) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5255c95c27..ed77cfda43 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3071,6 +3071,7 @@ static struct tdb_wrap *lp_regdb_open(void) if (!reg_tdb) { DEBUG(0, ("lp_regdb_open: failed to open %s: %s\n", lock_path("registry.tdb"), strerror(errno))); + goto done; } else { DEBUG(10, ("lp_regdb_open: reg tdb opened.\n")); @@ -3085,6 +3086,7 @@ static struct tdb_wrap *lp_regdb_open(void) /* this is apparently not implemented in the tdb */ } +done: return reg_tdb; } -- cgit From de81984b5e9a7ac77a275722f45c827afa54cb17 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 21 Jun 2007 23:11:21 +0000 Subject: r23579: Up to now, the "allparameters" argument to lp_next_parameter was not effective for the global section (snum < 0). This checkin makes it effective for the global section, too. This does not produce changes in the results of the present calls of lp_next_parameter: Beside the new use in utils/net_conf.c (which is hereby fixed), the only calls of lp_next_parameter are in web/swat.c, where it is effectively always called with allparameters == 1. Michael (This used to be commit 56f82485ec3b14ddcbcf7f5823926a94b17683f3) --- source3/param/loadparm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ed77cfda43..a04c0f2fbd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4308,6 +4308,9 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) && (parm_table[*i].ptr == parm_table[(*i) - 1].ptr)) continue; + + if (is_default(*i) && !allparameters) + continue; return &parm_table[(*i)++]; } -- cgit From e8f99045c44cedd64e736dda4b84fb8d7eaf31a6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jun 2007 22:30:01 +0000 Subject: r23592: Change a debuglevel to not clutter output when calling net as a non-root user, e.g. Michael (This used to be commit bbbfd7f41ab85f269d115f19601729f16079b552) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a04c0f2fbd..f654dff37f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3069,7 +3069,7 @@ static struct tdb_wrap *lp_regdb_open(void) reg_tdb = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600); if (!reg_tdb) { - DEBUG(0, ("lp_regdb_open: failed to open %s: %s\n", + DEBUG(1, ("lp_regdb_open: failed to open %s: %s\n", lock_path("registry.tdb"), strerror(errno))); goto done; } -- cgit From 72f468088f8d58443e307a2f8b35f3058ae2dc5e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 28 Jun 2007 10:32:52 +0000 Subject: r23641: Put check for forbidden values in smbconf into a function. (This will be used in a next step to prevent storing these values in reg_smbconf.c.) Michael (This used to be commit 00be68a8416405e12a27186506f9eb15bca055b3) --- source3/param/loadparm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f654dff37f..c43a032560 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3165,10 +3165,7 @@ static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) &type, &size, &data_p); - if ((strwicmp(valname,"include") == 0) || - (strwicmp(valname, "lock directory") == 0) || - (strwicmp(valname, "lock dir") == 0)) - { + if (registry_smbconf_valname_forbidden(valname)) { DEBUG(10, ("process_registry_globals: Ignoring " "parameter '%s' in registry.\n", valname)); continue; -- cgit From 20733036644c11a6b4fa7466f9a5b3aa1cae3916 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 29 Jun 2007 12:30:41 +0000 Subject: r23656: Add initial checking of the validity of a paramter given to "net conf setparm". Add a utility function lp_parameter_valid() for this to loadparm.c. Michael (This used to be commit 639051e58d4da9fb1116c19f0790250640b6ac7a) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c43a032560..58ea751fa5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2776,6 +2776,18 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) return (True); } + +/*************************************************************************** + Check whether the given parameter name is valid. + Parametric options (names containing a colon) are considered valid. +***************************************************************************/ + +BOOL lp_parameter_valid(const char *pszParmName) +{ + return ((map_parameter(pszParmName) != -1) || + (strchr(pszParmName, ':') != NULL)); +} + /*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. -- cgit From e388130aa63b9bbe1b27999aad6052585fc2e16b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 29 Jun 2007 13:07:54 +0000 Subject: r23657: Prevent setting of a global option in a share definition in "net conf setparm". Michael (This used to be commit bf92d567984f00ebb998fb2485d0aac87d30b924) --- source3/param/loadparm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 58ea751fa5..8c6c0f1afe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2788,6 +2788,24 @@ BOOL lp_parameter_valid(const char *pszParmName) (strchr(pszParmName, ':') != NULL)); } +/*************************************************************************** + Check whether the given name is the name of a global parameter. + Returns True for strings belonging to parameters of class + P_GLOBAL, False for all other strings, also for parametric options + and strings not belonging to any option. +***************************************************************************/ + +BOOL lp_parameter_is_global(const char *pszParmName) +{ + int num = map_parameter(pszParmName); + + if (num >= 0) { + return (parm_table[num].p_class == P_GLOBAL); + } + + return False; +} + /*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. -- cgit From f26abd78b17a4fc1ee3e05dd8fd89d7ae61aabad Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 30 Jun 2007 21:35:39 +0000 Subject: r23666: Rename lp_parameter_valid -> lp_parameter_is_valid. Michael (This used to be commit 7f85cff49dfe1ae90e37162d35f1a48baaa9fe79) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8c6c0f1afe..759c24ca73 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2782,7 +2782,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) Parametric options (names containing a colon) are considered valid. ***************************************************************************/ -BOOL lp_parameter_valid(const char *pszParmName) +BOOL lp_parameter_is_valid(const char *pszParmName) { return ((map_parameter(pszParmName) != -1) || (strchr(pszParmName, ':') != NULL)); -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/param/loadparm.c | 2 +- source3/param/params.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 759c24ca73..7e68070208 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -12,7 +12,7 @@ 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 + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/source3/param/params.c b/source3/param/params.c index c4ca5bb906..887afff86b 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -10,7 +10,7 @@ * * 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 + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7e68070208..e62eaaf3fb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -21,8 +21,7 @@ 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. + along with this program. If not, see . */ /* -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/param/params.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 887afff86b..08c35d0967 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -19,8 +19,7 @@ * 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. + * along with this program; if not, see . * * -------------------------------------------------------------------------- ** * -- cgit From 4ce5c3636714e80f740c141587c1e7a9ca3b67bb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 24 Jul 2007 10:24:27 +0000 Subject: r24027: merge from http://people.samba.org/bzr/metze/samba/3_2-ctdb-metze/: add in any cluster addresses. We need to response to these, but not listen on them. This allows us to run nmbd on every node in the cluster, and have all of them register with a WINS server correctly metze (This used to be commit 98c57562c4dcf04b72a1e4ad5d9f5cf48e7d0b28) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e62eaaf3fb..372cfd529d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -252,6 +252,7 @@ typedef struct { char *szCupsServer; char *szIPrintServer; char *ctdbdSocket; + char **szClusterAddresses; BOOL clustering; int ldap_passwd_sync; int ldap_replication_sleep; @@ -1046,6 +1047,7 @@ static struct parm_struct parm_table[] = { {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, {"ctdbd socket", P_STRING, P_GLOBAL, &Globals.ctdbdSocket, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + {"cluster addresses", P_LIST, P_GLOBAL, &Globals.szClusterAddresses, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {"clustering", P_BOOL, P_GLOBAL, &Globals.clustering, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {N_("Printing Options"), P_SEP, P_SEPARATOR}, @@ -1645,6 +1647,7 @@ static void init_globals(BOOL first_time_only) string_set(&Globals.szIPrintServer, ""); string_set(&Globals.ctdbdSocket, ""); + Globals.szClusterAddresses = NULL; Globals.clustering = False; Globals.winbind_cache_time = 300; /* 5 minutes */ @@ -2061,6 +2064,7 @@ FN_LOCAL_STRING(lp_cups_options, szCupsOptions) FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer) FN_GLOBAL_CONST_STRING(lp_ctdbd_socket, &Globals.ctdbdSocket) +FN_GLOBAL_LIST(lp_cluster_addresses, &Globals.szClusterAddresses) FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering); FN_LOCAL_STRING(lp_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) -- cgit From 31dc9126c1f401ac8668b3c46e28c5a47d34a090 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 30 Jul 2007 08:22:45 +0000 Subject: r24072: Add "client ldap sasl wrapping" parameter. Possible values are "plain" (default), "sign" or "seal". metze (This used to be commit 26ccbad7212e9acd480b98789f04b71c1e940ea8) --- source3/param/loadparm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 372cfd529d..873fd885c5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -324,6 +324,7 @@ typedef struct { int name_cache_timeout; int client_signing; int server_signing; + int client_ldap_sasl_wrapping; int iUsershareMaxShares; int iIdmapCacheTime; int iIdmapNegativeCacheTime; @@ -688,6 +689,13 @@ static const struct enum_list enum_printing[] = { {-1, NULL} }; +static const struct enum_list enum_ldap_sasl_wrapping[] = { + {0, "plain"}, + {ADS_AUTH_SASL_SIGN, "sign"}, + {ADS_AUTH_SASL_SEAL, "seal"}, + {-1, NULL} +}; + static const struct enum_list enum_ldap_ssl[] = { {LDAP_SSL_OFF, "no"}, {LDAP_SSL_OFF, "No"}, @@ -1014,7 +1022,7 @@ static struct parm_struct parm_table[] = { {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, - + {"client ldap sasl wrapping", P_ENUM, P_GLOBAL, &Globals.client_ldap_sasl_wrapping, NULL, enum_ldap_sasl_wrapping, FLAG_ADVANCED}, {"enable asu support", P_BOOL, P_GLOBAL, &Globals.bASUSupport, NULL, NULL, FLAG_ADVANCED}, {"svcctl list", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, @@ -2182,6 +2190,7 @@ FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) FN_GLOBAL_INTEGER(lp_server_signing, &Globals.server_signing) +FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrapping) /* local prototypes */ -- cgit From 28210588edc39eb2b6cd237f11b488fa4d6b6985 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 7 Aug 2007 11:28:04 +0000 Subject: r24266: Remove the "open files database hash size" parameter This has been superseded by the "tdb_hashsize:" parameter (This used to be commit df40d336afd256f05a0ec3724cc2096fb7114d81) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 873fd885c5..24cab4d218 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1042,7 +1042,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"open files database hash size", P_INTEGER, P_GLOBAL, &Globals.open_files_db_hash_size, 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}, -- cgit From 24f42c5cefff01cc69118cb714a053cddb68e4d9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 15 Aug 2007 09:52:09 +0000 Subject: r24453: Remove the read and write bmpx calls Talked to both Tridge and Jeremy about this, Tridge said that there is a special error message persuading OS/2 to fall back to other methods. The calls now checked in always return the error message we used to return when "read bmpx = False" was set (the default): ERRSRV, ERRuseSTD. If someone has a reproducable test case where this is really needed, we can always dig it up from version control and convert it to the new API. But that time without that silly parameter, and with a torture test case for "make test" please :-) Volker (This used to be commit d941aae2dfd11609e807bf4ce712571a2e354627) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 24cab4d218..2d64d541a0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -278,7 +278,6 @@ typedef struct { BOOL bLargeReadwrite; BOOL bReadRaw; BOOL bWriteRaw; - BOOL bReadbmpx; BOOL bSyslogOnly; BOOL bBrowseList; BOOL bNISHomeMap; @@ -991,7 +990,6 @@ static struct parm_struct parm_table[] = { {"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}, - {"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}, @@ -1536,7 +1534,6 @@ static void init_globals(BOOL first_time_only) Globals.serverSchannel = Auto; Globals.bReadRaw = True; Globals.bWriteRaw = True; - Globals.bReadbmpx = False; Globals.bNullPasswords = False; Globals.bObeyPamRestrictions = False; Globals.syslog = 1; @@ -1973,7 +1970,6 @@ FN_GLOBAL_BOOL(lp_wins_proxy, &Globals.bWINSproxy) 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_readbmpx, &Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw) FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite) FN_GLOBAL_BOOL(lp_writeraw, &Globals.bWriteRaw) -- cgit From bf374d3d3d12ed352ba8add9b5633855f2851c01 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 16 Aug 2007 15:27:06 +0000 Subject: r24495: Add a function lp_canonicalize_parameter: It takes a name of a parameter and produces the "canonical" (or main) name of the parameter (the one synonym that does not have the flag FLAG_HIDE). The function also sets a flag as to whether the synonym is a reverse boolean synonym. Add some functions for the handling of string representations of boolean values: return the canonical string representation of a bool, invert a bool given as a string, canonicalize a bool given as a string. Michael (This used to be commit 113ac07199aaf2271af6eba2611dad429ee4c416) --- source3/param/loadparm.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2d64d541a0..0fd251c6f9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2191,6 +2191,7 @@ FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrappi static int map_parameter(const char *pszParmName); static BOOL set_boolean(BOOL *pb, const char *pszParmValue); +static const char *get_boolean(BOOL bool_value); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, @@ -2813,6 +2814,49 @@ BOOL lp_parameter_is_global(const char *pszParmName) return False; } +/************************************************************************** + Determine the canonical name for a parameter. + Indicate when it is an inverse (boolean) synonym instead of a + "usual" synonym. +**************************************************************************/ + +BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, + BOOL *inverse) +{ + int num, canon_num; + + if (!lp_parameter_is_valid(parm_name)) { + *canon_parm = NULL; + return False; + } + + *inverse = False; + num = map_parameter(parm_name); + if (num < 0 && !(parm_table[num].flags & FLAG_HIDE)) { + /* it is already canonical (parametric are canonical anyways) */ + *canon_parm = parm_name; + return True; + } + + for (canon_num = 0; parm_table[canon_num].label; canon_num++) { + if (!(parm_table[canon_num].flags & FLAG_HIDE) && + (parm_table[num].ptr == parm_table[canon_num].ptr)) + { + *canon_parm = parm_table[canon_num].label; + if ((parm_table[canon_num].type == P_BOOL) && + (parm_table[num].type == P_BOOLREV)) + { + *inverse = True; + } + return True; + } + } + + /* 'include', 'copy', 'config file' and friends left */ + *canon_parm = parm_name; + return True; +} + /*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. @@ -2919,6 +2963,54 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue) return (bRetval); } +/*************************************************************************** + Get the standard string representation of a boolean value ("yes" or "no") +***************************************************************************/ + +static const char *get_boolean(BOOL bool_value) +{ + static const char *yes_str = "yes"; + static const char *no_str = "no"; + + return (bool_value ? yes_str : no_str); +} + +/*************************************************************************** + Provide the string of the negated boolean value associated to the boolean + given as a string. Returns False if the passed string does not correctly + represent a boolean. +***************************************************************************/ + +BOOL lp_invert_boolean(const char *str, const char **inverse_str) +{ + BOOL val; + + if (!set_boolean(&val, str)) { + return False; + } + + *inverse_str = get_boolean(!val); + return True; +} + +/*************************************************************************** + Provide the canonical string representation of a boolean value given + as a string. Return True on success, False if the string given does + not correctly represent a boolean. +***************************************************************************/ + +BOOL lp_canonicalize_boolean(const char *str, const char**canon_str) +{ + BOOL val; + + if (!set_boolean(&val, str)) { + return False; + } + + *canon_str = get_boolean(val); + return True; +} + /*************************************************************************** Find a service by name. Otherwise works like get_service. ***************************************************************************/ @@ -4320,6 +4412,22 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) return result; } +/*************************************************************************** + Return info about the requested parameter (given as a string). + Return NULL when the string is not a valid parameter name. +***************************************************************************/ + +struct parm_struct *lp_get_parameter(const char *param_name) +{ + int num = map_parameter(param_name); + + if (num < 0) { + return NULL; + } + + return &parm_table[num]; +} + /*************************************************************************** Return info about the next parameter in a service. snum==GLOBAL_SECTION_SNUM gives the globals. -- cgit From ed4b40e9cbf8c3f67ca2736eacba5bfd891200f1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 17 Aug 2007 09:09:04 +0000 Subject: r24510: Fix logic. Thanks to Volker for the hint! Michael (This used to be commit ce1d7ad1acb48a254add3ddfac5f13e05b8ec646) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0fd251c6f9..200006e22f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2832,7 +2832,7 @@ BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, *inverse = False; num = map_parameter(parm_name); - if (num < 0 && !(parm_table[num].flags & FLAG_HIDE)) { + if ((num < 0) || !(parm_table[num].flags & FLAG_HIDE)) { /* it is already canonical (parametric are canonical anyways) */ *canon_parm = parm_name; return True; -- cgit From b2455bb8d2dc6f89c961c705c9d1285fe9c157d9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 17 Aug 2007 13:07:52 +0000 Subject: r24519: Refactor printing of one parameter into a helper function of its own. (This used to be commit 70dfe5d098b5d815e652b82fca57be0eb826f820) --- source3/param/loadparm.c | 72 ++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 30 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 200006e22f..be06ba90fe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2202,6 +2202,7 @@ static void init_copymap(service * pservice); static BOOL hash_a_service(const char *name, int number); static void free_service_byindex(int iService); static char * canonicalize_servicename(const char *name); +static void show_parameter(int parmIndex); /* This is a helper function for parametrical options support. */ /* It returns a pointer to parametrical option value if it exists or NULL otherwise */ @@ -2883,14 +2884,14 @@ static int map_parameter(const char *pszParmName) } /*************************************************************************** - Show all parameter's name, type, [values,] and flags. + Show one parameter's name, type, [values,] and flags. + (helper functions for show_parameter_list) ***************************************************************************/ -void show_parameter_list(void) +static void show_parameter(int parmIndex) { - int classIndex, parmIndex, enumIndex, flagIndex; + int enumIndex, flagIndex; BOOL hadFlag; - const char *section_names[] = { "local", "global", NULL}; const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", "P_UGSTRING", "P_ENUM", "P_SEP"}; @@ -2901,35 +2902,46 @@ void show_parameter_list(void) "FLAG_GLOBAL", "FLAG_WIZARD", "FLAG_ADVANCED", "FLAG_DEVELOPER", "FLAG_DEPRECATED", "FLAG_HIDE", "FLAG_DOS_STRING", NULL}; - for ( classIndex=0; section_names[classIndex]; classIndex++) { + printf("%s=%s", parm_table[parmIndex].label, + type[parm_table[parmIndex].type]); + if (parm_table[parmIndex].type == P_ENUM) { + printf(","); + for (enumIndex=0; + parm_table[parmIndex].enum_list[enumIndex].name; + enumIndex++) + { + printf("%s%s", + enumIndex ? "|" : "", + parm_table[parmIndex].enum_list[enumIndex].name); + } + } + printf(","); + hadFlag = False; + for (flagIndex=0; flag_names[flagIndex]; flagIndex++) { + if (parm_table[parmIndex].flags & flags[flagIndex]) { + printf("%s%s", + hadFlag ? "|" : "", + flag_names[flagIndex]); + hadFlag = True; + } + } + printf("\n"); +} + +/*************************************************************************** + Show all parameter's name, type, [values,] and flags. +***************************************************************************/ + +void show_parameter_list(void) +{ + int classIndex, parmIndex; + const char *section_names[] = { "local", "global", NULL}; + + for (classIndex=0; section_names[classIndex]; classIndex++) { printf("[%s]\n", section_names[classIndex]); for (parmIndex = 0; parm_table[parmIndex].label; parmIndex++) { if (parm_table[parmIndex].p_class == classIndex) { - printf("%s=%s", - parm_table[parmIndex].label, - type[parm_table[parmIndex].type]); - switch (parm_table[parmIndex].type) { - case P_ENUM: - printf(","); - for (enumIndex=0; parm_table[parmIndex].enum_list[enumIndex].name; enumIndex++) - printf("%s%s", - enumIndex ? "|" : "", - parm_table[parmIndex].enum_list[enumIndex].name); - break; - default: - break; - } - printf(","); - hadFlag = False; - for ( flagIndex=0; flag_names[flagIndex]; flagIndex++ ) { - if (parm_table[parmIndex].flags & flags[flagIndex]) { - printf("%s%s", - hadFlag ? "|" : "", - flag_names[flagIndex]); - hadFlag = True; - } - } - printf("\n"); + show_parameter(parmIndex); } } } -- cgit From 7190e7515b93f2756d49c493b9b633bf3ea63c81 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 17 Aug 2007 14:10:49 +0000 Subject: r24525: Add output of synonym information to show_parameter_list(). Also simplify lp_canonicalize_parameter by making use of the new function "is_synonym_of". Michael Note: If anything depends on the exact former output format of show_parameter list, I would trigger the output of synonym information by a boolean verbose switch (that could be passed to testparm via the "-v" command line switch). (This used to be commit fd2dbae82594c6d6ab10a7318f127aea0a9a61ea) --- source3/param/loadparm.c | 60 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index be06ba90fe..c867c5f508 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2203,6 +2203,7 @@ static BOOL hash_a_service(const char *name, int number); static void free_service_byindex(int iService); static char * canonicalize_servicename(const char *name); static void show_parameter(int parmIndex); +static BOOL is_synonym_of(int parm1, int parm2, BOOL *inverse); /* This is a helper function for parametrical options support. */ /* It returns a pointer to parametrical option value if it exists or NULL otherwise */ @@ -2840,15 +2841,8 @@ BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, } for (canon_num = 0; parm_table[canon_num].label; canon_num++) { - if (!(parm_table[canon_num].flags & FLAG_HIDE) && - (parm_table[num].ptr == parm_table[canon_num].ptr)) - { + if (is_synonym_of(num, canon_num, inverse)) { *canon_parm = parm_table[canon_num].label; - if ((parm_table[canon_num].type == P_BOOL) && - (parm_table[num].type == P_BOOLREV)) - { - *inverse = True; - } return True; } } @@ -2883,6 +2877,31 @@ static int map_parameter(const char *pszParmName) return (-1); } +/*************************************************************************** + return true if parameter number parm1 is a synonym of parameter + number parm2 (parm2 being the principal name). + set inverse to True if parm1 is P_BOOLREV and parm2 is P_BOOL, + False otherwise. +***************************************************************************/ + +static BOOL is_synonym_of(int parm1, int parm2, BOOL *inverse) +{ + if ((parm_table[parm1].ptr == parm_table[parm2].ptr) && + (parm_table[parm1].flags & FLAG_HIDE) && + !(parm_table[parm2].flags & FLAG_HIDE)) + { + if ((parm_table[parm1].type == P_BOOLREV) && + (parm_table[parm2].type == P_BOOL)) + { + *inverse = True; + } else { + *inverse = False; + } + return True; + } + return False; +} + /*************************************************************************** Show one parameter's name, type, [values,] and flags. (helper functions for show_parameter_list) @@ -2891,7 +2910,10 @@ static int map_parameter(const char *pszParmName) static void show_parameter(int parmIndex) { int enumIndex, flagIndex; + int parmIndex2; BOOL hadFlag; + BOOL hadSyn; + BOOL inverse; const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", "P_UGSTRING", "P_ENUM", "P_SEP"}; @@ -2925,6 +2947,28 @@ static void show_parameter(int parmIndex) hadFlag = True; } } + + /* output synonyms */ + hadSyn = False; + for (parmIndex2=0; parm_table[parmIndex2].label; parmIndex2++) { + if (is_synonym_of(parmIndex, parmIndex2, &inverse)) { + printf(" (%ssynonym of %s)", inverse ? "inverse " : "", + parm_table[parmIndex2].label); + } else if (is_synonym_of(parmIndex2, parmIndex, &inverse)) { + if (!hadSyn) { + printf(" (synonyms: "); + hadSyn = True; + } else { + printf(", "); + } + printf("%s%s", parm_table[parmIndex2].label, + inverse ? "[i]" : ""); + } + } + if (hadSyn) { + printf(")"); + } + printf("\n"); } -- cgit From bb76f3f98ed2e49ad4114a34a2a7fa0e6655f33d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 17 Aug 2007 15:38:19 +0000 Subject: r24526: Refactor determiniation of the index of the canonical form of a parameter given in string representation into a function of its own (map_parameter_canonical). Michael (This used to be commit 0dfb5eee25e287c129f7d34e4d079c60d56dce59) --- source3/param/loadparm.c | 50 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c867c5f508..ea1bb0a23f 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2190,6 +2190,7 @@ FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrappi /* local prototypes */ static int map_parameter(const char *pszParmName); +static int map_parameter_canonical(const char *pszParmName, BOOL *inverse); static BOOL set_boolean(BOOL *pb, const char *pszParmValue); static const char *get_boolean(BOOL bool_value); static int getservicebyname(const char *pszServiceName, @@ -2825,31 +2826,23 @@ BOOL lp_parameter_is_global(const char *pszParmName) BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, BOOL *inverse) { - int num, canon_num; + int num; if (!lp_parameter_is_valid(parm_name)) { *canon_parm = NULL; return False; } - *inverse = False; - num = map_parameter(parm_name); - if ((num < 0) || !(parm_table[num].flags & FLAG_HIDE)) { - /* it is already canonical (parametric are canonical anyways) */ + num = map_parameter_canonical(parm_name, inverse); + if (num < 0) { + /* parametric option */ *canon_parm = parm_name; - return True; - } - - for (canon_num = 0; parm_table[canon_num].label; canon_num++) { - if (is_synonym_of(num, canon_num, inverse)) { - *canon_parm = parm_table[canon_num].label; - return True; - } + } else { + *canon_parm = parm_table[num].label; } - /* 'include', 'copy', 'config file' and friends left */ - *canon_parm = parm_name; return True; + } /*************************************************************************** @@ -2877,6 +2870,33 @@ static int map_parameter(const char *pszParmName) return (-1); } +/*************************************************************************** + Map a parameter's string representation to the index of the canonical + form of the parameter (it might be a synonym). + Returns -1 if the parameter string is not recognised. +***************************************************************************/ + +static int map_parameter_canonical(const char *pszParmName, BOOL *inverse) +{ + int parm_num, canon_num; + + *inverse = False; + + parm_num = map_parameter(pszParmName); + if ((parm_num < 0) || !(parm_table[parm_num].flags & FLAG_HIDE)) { + /* invalid, parametric or no canidate for synonyms ... */ + return parm_num; + } + + for (canon_num = 0; parm_table[canon_num].label; canon_num++) { + if (is_synonym_of(parm_num, canon_num, inverse)) { + return canon_num; + } + } + + return parm_num; +} + /*************************************************************************** return true if parameter number parm1 is a synonym of parameter number parm2 (parm2 being the principal name). -- cgit From c56874d1129c6e5759acc5b125b5e8edd44a997c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 17 Aug 2007 16:03:18 +0000 Subject: r24527: Add a function lp_canonicalize_parameter_with_value that turns a parameter and value into the canonical paramter with the value inverted if it was in invers boolean synonym. Make net conf use this function when storing parameters. Michael (This used to be commit 3b762ab18392fd06427957b0263262e3b8e34b9d) --- source3/param/loadparm.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ea1bb0a23f..bd318791b5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2845,6 +2845,51 @@ BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, } +/************************************************************************** + Determine the canonical name for a parameter. + Turn the value given into the inverse boolean expression when + the synonym is an invers boolean synonym. + + Return True if parm_name is a valid parameter name and + in case it is an invers boolean synonym, if the val string could + successfully be converted to the reverse bool. + Return false in all other cases. +**************************************************************************/ + +BOOL lp_canonicalize_parameter_with_value(const char *parm_name, + const char *val, + const char **canon_parm, + const char **canon_val) +{ + int num; + BOOL inverse; + + if (!lp_parameter_is_valid(parm_name)) { + *canon_parm = NULL; + *canon_val = NULL; + return False; + } + + num = map_parameter_canonical(parm_name, &inverse); + if (num < 0) { + /* parametric option */ + *canon_parm = parm_name; + *canon_val = val; + } else { + *canon_parm = parm_table[num].label; + if (inverse) { + if (!lp_invert_boolean(val, canon_val)) { + *canon_val = NULL; + return False; + } + } else { + *canon_val = val; + } + } + + return True; +} + /*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. -- cgit From 987d7010f827464191a9f29cdc7a72591c6b806b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 20 Aug 2007 09:32:30 +0000 Subject: r24572: Allow for functions map_parameter_canonical() and is_synonym_of() to be called with inverse == NULL. Add a new function lp_parameter_is_canonical() to check whether a parameter name is the canonical name (as apposed to an alias). Michael (This used to be commit 07dc0fecf5116b34e468bddae8b36920c492717a) --- source3/param/loadparm.c | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bd318791b5..e65a649584 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2817,6 +2817,22 @@ BOOL lp_parameter_is_global(const char *pszParmName) return False; } +/************************************************************************** + Check whether the given name is the canonical name of a parameter. + Returns False if it is not a valid parameter Name. + For parametric options, True is returned. +**************************************************************************/ + +BOOL lp_parameter_is_canonical(const char *parm_name) +{ + if (!lp_parameter_is_valid(parm_name)) { + return False; + } + + return (map_parameter(parm_name) == + map_parameter_canonical(parm_name, NULL)); +} + /************************************************************************** Determine the canonical name for a parameter. Indicate when it is an inverse (boolean) synonym instead of a @@ -2924,21 +2940,25 @@ static int map_parameter(const char *pszParmName) static int map_parameter_canonical(const char *pszParmName, BOOL *inverse) { int parm_num, canon_num; - - *inverse = False; + BOOL loc_inverse = False; parm_num = map_parameter(pszParmName); if ((parm_num < 0) || !(parm_table[parm_num].flags & FLAG_HIDE)) { /* invalid, parametric or no canidate for synonyms ... */ - return parm_num; + goto done; } for (canon_num = 0; parm_table[canon_num].label; canon_num++) { - if (is_synonym_of(parm_num, canon_num, inverse)) { - return canon_num; + if (is_synonym_of(parm_num, canon_num, &loc_inverse)) { + parm_num = canon_num; + goto done; } } +done: + if (inverse != NULL) { + *inverse = loc_inverse; + } return parm_num; } @@ -2955,12 +2975,14 @@ static BOOL is_synonym_of(int parm1, int parm2, BOOL *inverse) (parm_table[parm1].flags & FLAG_HIDE) && !(parm_table[parm2].flags & FLAG_HIDE)) { - if ((parm_table[parm1].type == P_BOOLREV) && - (parm_table[parm2].type == P_BOOL)) - { - *inverse = True; - } else { - *inverse = False; + if (inverse != NULL) { + if ((parm_table[parm1].type == P_BOOLREV) && + (parm_table[parm2].type == P_BOOL)) + { + *inverse = True; + } else { + *inverse = False; + } } return True; } -- cgit From b9a7a2b966f3fb9757d8ff7e4c94e78d6728e74a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Aug 2007 14:47:15 +0000 Subject: r24602: Add function lp_string_is_valid_boolean() to check if a string contains a correct representation of a boolean value (in the understanding of loadparm.c). Make set_boolean() catch passing NULL for the boolean target. Michael (This used to be commit d13eaa60f504987445b7333ef6972491c9483e6a) --- source3/param/loadparm.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e65a649584..6e05e5e554 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3087,25 +3087,41 @@ void show_parameter_list(void) static BOOL set_boolean(BOOL *pb, const char *pszParmValue) { BOOL bRetval; + BOOL value; bRetval = True; if (strwicmp(pszParmValue, "yes") == 0 || strwicmp(pszParmValue, "true") == 0 || strwicmp(pszParmValue, "1") == 0) - *pb = True; + value = True; else if (strwicmp(pszParmValue, "no") == 0 || strwicmp(pszParmValue, "False") == 0 || strwicmp(pszParmValue, "0") == 0) - *pb = False; + value = False; else { DEBUG(0, ("ERROR: Badly formed boolean in configuration file: \"%s\".\n", pszParmValue)); bRetval = False; } + + if (pb != NULL) { + *pb = value; + } + return (bRetval); } + +/*************************************************************************** + Check if a given string correctly represents a boolean value. +***************************************************************************/ + +BOOL lp_string_is_valid_boolean(const char *parm_value) +{ + return set_boolean(NULL, parm_value); +} + /*************************************************************************** Get the standard string representation of a boolean value ("yes" or "no") ***************************************************************************/ -- cgit From aa1c863063619524361d0e4003149edd2c3fa3a8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 22 Aug 2007 10:47:32 +0000 Subject: r24616: In set_boolean(), only pass the result back to the caller if parsing of the boolean string was successful. Also, initialize the local result variable (although not strictly necessary anymore, now.) (This used to be commit bf0daa74fadcd506b80c29d04ccf6ec7345ee0e1) --- source3/param/loadparm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6e05e5e554..adcf3522ee 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3090,6 +3090,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue) BOOL value; bRetval = True; + value = False; if (strwicmp(pszParmValue, "yes") == 0 || strwicmp(pszParmValue, "true") == 0 || strwicmp(pszParmValue, "1") == 0) @@ -3105,7 +3106,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue) bRetval = False; } - if (pb != NULL) { + if ((pb != NULL) && (bRetval != False)) { *pb = value; } -- cgit From 85d0c15da47ac920b291b8bbfe36e7c12922c5c0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 23 Aug 2007 14:32:00 +0000 Subject: r24636: Raise one debug level, since the callers (that want to do so) issue a level 0 debug message. Michael (This used to be commit c0022ff9278a06b92a550cf0d6a8e75af31a673c) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index adcf3522ee..45d2f87913 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3100,7 +3100,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue) strwicmp(pszParmValue, "0") == 0) value = False; else { - DEBUG(0, + DEBUG(2, ("ERROR: Badly formed boolean in configuration file: \"%s\".\n", pszParmValue)); bRetval = False; -- cgit From f1041f98ced8ef50373ca37d541d7ca8b1d46638 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Aug 2007 21:53:00 +0000 Subject: r24639: Add parameter "directory name cache size" - parameterize use of directory name cache, 100 by default. Will be needed to turn this off for *BSD systems. Jeremy. (This used to be commit bea8e9840fd65268e649f813eba10502b0c4d721) --- source3/param/loadparm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 45d2f87913..7e573052e1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -471,6 +471,7 @@ typedef struct { int iAioReadSize; int iAioWriteSize; int iMap_readonly; + int iDirectoryNameCacheSize; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -611,7 +612,11 @@ static service sDefault = { 0, /* iAioReadSize */ 0, /* iAioWriteSize */ MAP_READONLY_YES, /* iMap_readonly */ - +#ifdef BROKEN_DIRECTORY_HANDLING + 0, /* iDirectoryNameCacheSize */ +#else + 100, /* iDirectoryNameCacheSize */ +#endif NULL, /* Parametric options */ "" /* dummy */ @@ -1031,6 +1036,7 @@ static struct parm_struct parm_table[] = { {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, + {"directory name cache size", P_INTEGER, P_LOCAL, &sDefault.iDirectoryNameCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED}, @@ -2178,6 +2184,7 @@ FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) +FN_LOCAL_INTEGER(lp_directory_name_cache_size, iDirectoryNameCacheSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) -- cgit From 929e1d99209e20a9c2c95c8bdfc8eaa37b2c2291 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 30 Aug 2007 19:48:31 +0000 Subject: r24809: Consolidate the use of temporary talloc contexts. This adds the two functions talloc_stackframe() and talloc_tos(). * When a new talloc stackframe is allocated with talloc_stackframe(), then * the TALLOC_CTX returned with talloc_tos() is reset to that new * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse * happens: The previous talloc_tos() is restored. * * This API is designed to be robust in the sense that if someone forgets to * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and * resets the talloc_tos(). The original motivation for this patch was to get rid of the sid_string_static & friends buffers. Explicitly passing talloc context everywhere clutters code too much for my taste, so an implicit talloc_tos() is introduced here. Many of these static buffers are replaced by a single static pointer. The intended use would thus be that low-level functions can rather freely push stuff to talloc_tos, the upper layers clean up by freeing the stackframe. The more of these stackframes are used and correctly freed the more exact the memory cleanup happens. This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and lp_talloc_ctx (did I forget any?) So, never do a tmp_ctx = talloc_init("foo"); anymore, instead, use tmp_ctx = talloc_stackframe() :-) Volker (This used to be commit 6585ea2cb7f417e14540495b9c7380fe9c8c717b) --- source3/param/loadparm.c | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7e573052e1..3dd94645fd 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1708,33 +1708,6 @@ static void init_globals(BOOL first_time_only) Globals.bRegistryShares = False; } -static TALLOC_CTX *lp_talloc; - -/******************************************************************* a - Free up temporary memory - called from the main loop. -********************************************************************/ - -void lp_TALLOC_FREE(void) -{ - if (!lp_talloc) - return; - TALLOC_FREE(lp_talloc); - lp_talloc = NULL; -} - -TALLOC_CTX *tmp_talloc_ctx(void) -{ - if (lp_talloc == NULL) { - lp_talloc = talloc_init("tmp_talloc_ctx"); - } - - if (lp_talloc == NULL) { - smb_panic("Could not create temporary talloc context"); - } - - return lp_talloc; -} - /******************************************************************* Convenience routine to grab string parameters into temporary memory and run standard_sub_basic on them. The buffers can be written to by @@ -1754,9 +1727,6 @@ static char *lp_string(const char *s) DEBUG(10, ("lp_string(%s)\n", s)); #endif - if (!lp_talloc) - lp_talloc = talloc_init("lp_talloc"); - tmpstr = alloc_sub_basic(get_current_username(), current_user_info.domain, s); if (trim_char(tmpstr, '\"', '\"')) { @@ -1766,7 +1736,7 @@ static char *lp_string(const char *s) current_user_info.domain, s); } } - ret = talloc_strdup(lp_talloc, tmpstr); + ret = talloc_strdup(talloc_tos(), tmpstr); SAFE_FREE(tmpstr); return (ret); @@ -2352,7 +2322,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum) /* Return parametric option from a given service. Type is a part of option before ':' */ /* Parametric option has following syntax: 'Type: option = value' */ -/* the returned value is talloced in lp_talloc */ +/* the returned value is talloced on the talloc_tos() */ char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def) { param_opt_struct *data = get_parametrics(snum, type, option); @@ -3917,10 +3887,8 @@ static const char *append_ldap_suffix( const char *str ) const char *suffix_string; - if (!lp_talloc) - lp_talloc = talloc_init("lp_talloc"); - - suffix_string = talloc_asprintf( lp_talloc, "%s,%s", str, Globals.szLdapSuffix ); + suffix_string = talloc_asprintf(talloc_tos(), "%s,%s", str, + Globals.szLdapSuffix ); if ( !suffix_string ) { DEBUG(0,("append_ldap_suffix: talloc_asprintf() failed!\n")); return ""; @@ -5567,8 +5535,6 @@ void gfree_loadparm(void) struct file_lists *next; int i; - lp_TALLOC_FREE(); - /* Free the file lists */ f = file_lists; @@ -5912,7 +5878,7 @@ const char *volume_label(int snum) } /* This returns a 33 byte guarenteed null terminated string. */ - ret = talloc_strndup(main_loop_talloc_get(), label, 32); + ret = talloc_strndup(talloc_tos(), label, 32); if (!ret) { return ""; } -- cgit From 132ee3990af5d31573978f5a3abf43db2303880b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Sep 2007 20:57:01 +0000 Subject: r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based interface. More development will come on top of this. Remove the "mangled map" parameter. Jeremy. (This used to be commit dee8beba7a92b8a3f68bbcc59fd0a827f68c7736) --- source3/param/loadparm.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3dd94645fd..9e089cf8a2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -370,7 +370,6 @@ typedef struct { char **szHostsdeny; char *szMagicScript; char *szMagicOutput; - char *szMangledMap; char *szVetoFiles; char *szHideFiles; char *szVetoOplockFiles; @@ -511,7 +510,6 @@ static service sDefault = { NULL, /* szHostsdeny */ NULL, /* szMagicScript */ NULL, /* szMagicOutput */ - NULL, /* szMangledMap */ NULL, /* szVetoFiles */ NULL, /* szHideFiles */ NULL, /* szVetoOplockFiles */ @@ -1122,7 +1120,6 @@ static struct parm_struct parm_table[] = { {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"map readonly", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, 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 }, {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, {"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}, @@ -2068,7 +2065,6 @@ FN_LOCAL_STRING(lp_fstype, fstype) FN_LOCAL_LIST(lp_vfs_objects, szVfsObjects) FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy) static FN_LOCAL_STRING(lp_volume, volume) -FN_LOCAL_PARM_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) -- cgit From 325b342f313369a8cbd8c7851ddcbe37d8ee4470 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 8 Sep 2007 17:08:59 +0000 Subject: r25036: Fix a become/unbecome_root() pair (This used to be commit 9e53f50e9489a5f6cfa40eed59be39e8a294db7d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9e089cf8a2..2c6a5df3e5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3330,6 +3330,7 @@ static struct tdb_wrap *lp_regdb_open(void) become_root(); reg_tdb = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600); + unbecome_root(); if (!reg_tdb) { DEBUG(1, ("lp_regdb_open: failed to open %s: %s\n", lock_path("registry.tdb"), strerror(errno))); @@ -3338,7 +3339,6 @@ static struct tdb_wrap *lp_regdb_open(void) else { DEBUG(10, ("lp_regdb_open: reg tdb opened.\n")); } - unbecome_root(); vers_id = tdb_fetch_int32(reg_tdb->tdb, vstring); if (vers_id != REGVER_V1) { -- cgit From 3428c63aa74f46c3db65736bf1c56502fad2362c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 10 Sep 2007 02:14:18 +0000 Subject: r25049: Set new, more secure defaults for Samba 3.2. Andrew Bartlett (This used to be commit 87d39f61b498c1327c2b3a818e41bb6451fe7518) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2c6a5df3e5..b49d7b54a9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1574,10 +1574,10 @@ static void init_globals(BOOL first_time_only) Globals.bStatCache = True; /* use stat cache by default */ Globals.iMaxStatCacheSize = 1024; /* one Meg by default. */ Globals.restrict_anonymous = 0; - Globals.bClientLanManAuth = True; /* Do use the LanMan hash if it is available */ - Globals.bClientPlaintextAuth = True; /* Do use a plaintext password if is requested by the server */ - Globals.bLanmanAuth = True; /* Do use the LanMan hash if it is available */ - Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is available (otherwise NTLMv2) */ + Globals.bClientLanManAuth = False; /* Do NOT use the LanMan hash if it is available */ + Globals.bClientPlaintextAuth = False; /* Do NOT use a plaintext password even if is requested by the server */ + Globals.bLanmanAuth = False; /* Do NOT use the LanMan hash, even if it is supplied */ + Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is supplied by the client (otherwise NTLMv2) */ Globals.bClientNTLMv2Auth = False; /* Client should not use NTLMv2, as we can't tell that the server supports it. */ /* Note, that we will use NTLM2 session security (which is different), if it is available */ -- cgit From b6a6fbd49309630e00983f9c2e654b805336ffae Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 30 Sep 2007 08:07:06 +0000 Subject: r25434: Add the option to print the debug class (DBGC_CLASS) in the debug header. Control this by a new boolean smb.conf option "debug class" which is by default set to "no" to keep the default debug header unchanged. Michael Note: You need to make clean for this patch. (This used to be commit 066a46ba91ca734d9e20cb9d6db36fec209a27d7) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b49d7b54a9..d7e15226e9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -306,6 +306,7 @@ typedef struct { BOOL bDebugHiresTimestamp; BOOL bDebugPid; BOOL bDebugUid; + BOOL bDebugClass; BOOL bEnableCoreFiles; BOOL bHostMSDfs; BOOL bUseMmap; @@ -981,6 +982,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"debug class", P_BOOL, P_GLOBAL, &Globals.bDebugClass, NULL, NULL, FLAG_ADVANCED}, {"enable core files", P_BOOL, P_GLOBAL, &Globals.bEnableCoreFiles, NULL, NULL, FLAG_ADVANCED}, {N_("Protocol Options"), P_SEP, P_SEPARATOR}, @@ -1547,6 +1549,7 @@ static void init_globals(BOOL first_time_only) Globals.bDebugHiresTimestamp = False; Globals.bDebugPid = False; Globals.bDebugUid = False; + Globals.bDebugClass = False; Globals.bEnableCoreFiles = True; Globals.max_ttl = 60 * 60 * 24 * 3; /* 3 days default. */ Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */ @@ -1958,6 +1961,7 @@ FN_GLOBAL_BOOL(lp_debug_prefix_timestamp, &Globals.bDebugPrefixTimestamp) FN_GLOBAL_BOOL(lp_debug_hires_timestamp, &Globals.bDebugHiresTimestamp) FN_GLOBAL_BOOL(lp_debug_pid, &Globals.bDebugPid) FN_GLOBAL_BOOL(lp_debug_uid, &Globals.bDebugUid) +FN_GLOBAL_BOOL(lp_debug_class, &Globals.bDebugClass) FN_GLOBAL_BOOL(lp_enable_core_files, &Globals.bEnableCoreFiles) FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList) FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap) -- cgit From b5535567c11552ed675ecc489d440558f91f1d1d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 7 Oct 2007 17:58:48 +0000 Subject: r25564: Pass sharename to delete_share_security() (This used to be commit d100bfffe2a503b8820889faedc6ed57100ca7af) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d7e15226e9..84e3658e84 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5517,7 +5517,7 @@ int load_usershare_shares(void) /* Remove from the share ACL db. */ DEBUG(10,("load_usershare_shares: Removing deleted usershare %s\n", lp_servicename(iService) )); - delete_share_security(snum2params_static(iService)); + delete_share_security(lp_servicename(iService)); free_service_byindex(iService); } } @@ -5749,7 +5749,7 @@ int lp_servicenumber(const char *pszServiceName) if (!usershare_exists(iService, &last_mod)) { /* Remove the share security tdb entry for it. */ - delete_share_security(snum2params_static(iService)); + delete_share_security(lp_servicename(iService)); /* Remove it from the array. */ free_service_byindex(iService); /* Doesn't exist anymore. */ -- cgit From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/param/loadparm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 84e3658e84..8b15073ed0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -384,6 +384,7 @@ typedef struct { char *fstype; char **szVfsObjects; char *szMSDfsProxy; + char *szAioWriteBehind; char *szDfree; int iMinPrintSpace; int iMaxPrintJobs; @@ -524,6 +525,7 @@ static service sDefault = { NULL, /* fstype */ NULL, /* vfs objects */ NULL, /* szMSDfsProxy */ + NULL, /* szAioWriteBehind */ NULL, /* szDfree */ 0, /* iMinPrintSpace */ 1000, /* iMaxPrintJobs */ @@ -990,6 +992,7 @@ static struct parm_struct parm_table[] = { {"allocation roundup size", P_INTEGER, P_LOCAL, &sDefault.iallocation_roundup_size, NULL, NULL, FLAG_ADVANCED}, {"aio read size", P_INTEGER, P_LOCAL, &sDefault.iAioReadSize, NULL, NULL, FLAG_ADVANCED}, {"aio write size", P_INTEGER, P_LOCAL, &sDefault.iAioWriteSize, NULL, NULL, FLAG_ADVANCED}, + {"aio write behind", P_STRING, P_LOCAL, &sDefault.szAioWriteBehind, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 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}, @@ -1034,7 +1037,7 @@ static struct parm_struct parm_table[] = { {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, - {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, + {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"directory name cache size", P_INTEGER, P_LOCAL, &sDefault.iDirectoryNameCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, @@ -1666,7 +1669,7 @@ static void init_globals(BOOL first_time_only) Globals.bWinbindUseDefaultDomain = False; Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; - Globals.winbind_expand_groups = 1; + Globals.winbind_expand_groups = 1; Globals.szWinbindNssInfo = str_list_make("template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; @@ -2073,6 +2076,7 @@ FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) +FN_LOCAL_STRING(lp_aio_write_behind, szAioWriteBehind) FN_LOCAL_STRING(lp_dfree_command, szDfree) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) @@ -2593,7 +2597,7 @@ static int add_a_service(const service *pservice, const char *name) } /*************************************************************************** - Canonicalize by converting to lowercase. + Convert a string to uppercase and remove whitespaces. ***************************************************************************/ static char *canonicalize_servicename(const char *src) @@ -4077,7 +4081,9 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue parm_ptr = ((char *)ServicePtrs[snum]) + PTR_DIFF(def_ptr, &sDefault); + } + if (snum >= 0) { if (!ServicePtrs[snum]->copymap) init_copymap(ServicePtrs[snum]); -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/param/loadparm.c | 565 +++++++++++++++++++++++------------------------ source3/param/params.c | 18 +- 2 files changed, 291 insertions(+), 292 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b15073ed0..80462ee968 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -52,8 +52,8 @@ #include "includes.h" -BOOL in_client = False; /* Not in the client by default */ -BOOL bLoaded = False; +bool in_client = False; /* Not in the client by default */ +bool bLoaded = False; extern pstring user_socket_options; extern enum protocol_types Protocol; @@ -80,7 +80,7 @@ extern userdom_struct current_user_info; #endif static int regdb_last_seqnum = 0; -static BOOL include_registry_globals = False; +static bool include_registry_globals = False; /* some helpful bits */ #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid) @@ -89,11 +89,11 @@ static BOOL include_registry_globals = False; #define USERSHARE_VALID 1 #define USERSHARE_PENDING_DELETE 2 -BOOL use_getwd_cache = True; +bool use_getwd_cache = True; extern int extra_time_offset; -static BOOL defaults_saved = False; +static bool defaults_saved = False; typedef struct _param_opt_struct param_opt_struct; struct _param_opt_struct { @@ -174,24 +174,24 @@ typedef struct { char *szWINSHook; char *szUtmpDir; char *szWtmpDir; - BOOL bUtmp; + bool bUtmp; char *szIdmapUID; char *szIdmapGID; - BOOL bPassdbExpandExplicit; + bool bPassdbExpandExplicit; int AlgorithmicRidBase; char *szTemplateHomedir; char *szTemplateShell; char *szWinbindSeparator; - BOOL bWinbindEnumUsers; - BOOL bWinbindEnumGroups; - BOOL bWinbindUseDefaultDomain; - BOOL bWinbindTrustedDomainsOnly; - BOOL bWinbindNestedGroups; - int winbind_expand_groups; - BOOL bWinbindRefreshTickets; - BOOL bWinbindOfflineLogon; - BOOL bWinbindNormalizeNames; - BOOL bWinbindRpcOnly; + bool bWinbindEnumUsers; + bool bWinbindEnumGroups; + bool bWinbindUseDefaultDomain; + bool bWinbindTrustedDomainsOnly; + bool bWinbindNestedGroups; + int winbind_expand_groups; + bool bWinbindRefreshTickets; + bool bWinbindOfflineLogon; + bool bWinbindNormalizeNames; + bool bWinbindRpcOnly; char **szIdmapDomains; char **szIdmapBackend; /* deprecated */ char *szIdmapAllocBackend; @@ -220,11 +220,11 @@ typedef struct { int minprotocol; int security; char **AuthMethods; - BOOL paranoid_server_security; + bool paranoid_server_security; int maxdisksize; int lpqcachetime; int iMaxSmbdProcesses; - BOOL bDisableSpoolss; + bool bDisableSpoolss; int syslog; int os_level; int enhanced_browsing; @@ -253,73 +253,73 @@ typedef struct { char *szIPrintServer; char *ctdbdSocket; char **szClusterAddresses; - BOOL clustering; - int ldap_passwd_sync; + bool clustering; + int ldap_passwd_sync; int ldap_replication_sleep; int ldap_timeout; /* This is initialised in init_globals */ int ldap_page_size; - BOOL ldap_delete_dn; - BOOL bMsAddPrinterWizard; - BOOL bDNSproxy; - BOOL bWINSsupport; - BOOL bWINSproxy; - BOOL bLocalMaster; - BOOL bPreferredMaster; - BOOL bDomainMaster; - BOOL bDomainLogons; - BOOL bEncryptPasswords; - BOOL bUpdateEncrypt; + bool ldap_delete_dn; + bool bMsAddPrinterWizard; + bool bDNSproxy; + bool bWINSsupport; + bool bWINSproxy; + bool bLocalMaster; + int iPreferredMaster; + int iDomainMaster; + bool bDomainLogons; + bool bEncryptPasswords; + bool bUpdateEncrypt; int clientSchannel; int serverSchannel; - BOOL bNullPasswords; - BOOL bObeyPamRestrictions; - BOOL bLoadPrinters; + bool bNullPasswords; + bool bObeyPamRestrictions; + bool bLoadPrinters; int PrintcapCacheTime; - BOOL bLargeReadwrite; - BOOL bReadRaw; - BOOL bWriteRaw; - BOOL bSyslogOnly; - BOOL bBrowseList; - BOOL bNISHomeMap; - BOOL bTimeServer; - BOOL bBindInterfacesOnly; - BOOL bPamPasswordChange; - BOOL bUnixPasswdSync; - BOOL bPasswdChatDebug; + bool bLargeReadwrite; + bool bReadRaw; + bool bWriteRaw; + bool bSyslogOnly; + bool bBrowseList; + bool bNISHomeMap; + bool bTimeServer; + bool bBindInterfacesOnly; + bool bPamPasswordChange; + bool bUnixPasswdSync; + bool bPasswdChatDebug; int iPasswdChatTimeout; - BOOL bTimestampLogs; - BOOL bNTSmbSupport; - BOOL bNTPipeSupport; - BOOL bNTStatusSupport; - BOOL bStatCache; + bool bTimestampLogs; + bool bNTSmbSupport; + bool bNTPipeSupport; + bool bNTStatusSupport; + bool bStatCache; int iMaxStatCacheSize; - BOOL bKernelOplocks; - BOOL bAllowTrustedDomains; - BOOL bLanmanAuth; - BOOL bNTLMAuth; - BOOL bUseSpnego; - BOOL bClientLanManAuth; - BOOL bClientNTLMv2Auth; - BOOL bClientPlaintextAuth; - BOOL bClientUseSpnego; - BOOL bDebugPrefixTimestamp; - BOOL bDebugHiresTimestamp; - BOOL bDebugPid; - BOOL bDebugUid; - BOOL bDebugClass; - BOOL bEnableCoreFiles; - BOOL bHostMSDfs; - BOOL bUseMmap; - BOOL bHostnameLookups; - BOOL bUnixExtensions; - BOOL bDisableNetbios; - BOOL bUseKerberosKeytab; - BOOL bDeferSharingViolations; - BOOL bEnablePrivileges; - BOOL bASUSupport; - BOOL bUsershareOwnerOnly; - BOOL bUsershareAllowGuests; - BOOL bRegistryShares; + bool bKernelOplocks; + bool bAllowTrustedDomains; + bool bLanmanAuth; + bool bNTLMAuth; + bool bUseSpnego; + bool bClientLanManAuth; + bool bClientNTLMv2Auth; + bool bClientPlaintextAuth; + bool bClientUseSpnego; + bool bDebugPrefixTimestamp; + bool bDebugHiresTimestamp; + bool bDebugPid; + bool bDebugUid; + bool bDebugClass; + bool bEnableCoreFiles; + bool bHostMSDfs; + bool bUseMmap; + bool bHostnameLookups; + bool bUnixExtensions; + bool bDisableNetbios; + bool bUseKerberosKeytab; + bool bDeferSharingViolations; + bool bEnablePrivileges; + bool bASUSupport; + bool bUsershareOwnerOnly; + bool bUsershareAllowGuests; + bool bRegistryShares; int restrict_anonymous; int name_cache_timeout; int client_signing; @@ -329,7 +329,7 @@ typedef struct { int iIdmapCacheTime; int iIdmapNegativeCacheTime; - BOOL bResetOnZeroVC; + bool bResetOnZeroVC; int iKeepalive; param_opt_struct *param_opt; } global; @@ -340,8 +340,8 @@ static global Globals; * This structure describes a single service. */ typedef struct { - BOOL valid; - BOOL autoloaded; + bool valid; + bool autoloaded; int usershare; time_t usershare_last_mod; char *szService; @@ -405,69 +405,69 @@ typedef struct { int iCSCPolicy; int iBlock_size; int iDfreeCacheTime; - BOOL bPreexecClose; - BOOL bRootpreexecClose; + bool bPreexecClose; + bool bRootpreexecClose; int iCaseSensitive; - BOOL bCasePreserve; - BOOL bShortCasePreserve; - BOOL bHideDotFiles; - BOOL bHideSpecialFiles; - BOOL bHideUnReadable; - BOOL bHideUnWriteableFiles; - BOOL bBrowseable; - BOOL bAvailable; - BOOL bRead_only; - BOOL bNo_set_dir; - BOOL bGuest_only; - BOOL bGuest_ok; - BOOL bPrint_ok; - BOOL bMap_system; - BOOL bMap_hidden; - BOOL bMap_archive; - BOOL bStoreDosAttributes; - BOOL bDmapiSupport; - BOOL bLocking; + bool bCasePreserve; + bool bShortCasePreserve; + bool bHideDotFiles; + bool bHideSpecialFiles; + bool bHideUnReadable; + bool bHideUnWriteableFiles; + bool bBrowseable; + bool bAvailable; + bool bRead_only; + bool bNo_set_dir; + bool bGuest_only; + bool bGuest_ok; + bool bPrint_ok; + bool bMap_system; + bool bMap_hidden; + bool bMap_archive; + bool bStoreDosAttributes; + bool bDmapiSupport; + bool bLocking; int iStrictLocking; - BOOL bPosixLocking; - BOOL bShareModes; - BOOL bOpLocks; - BOOL bLevel2OpLocks; - BOOL bOnlyUser; - BOOL bMangledNames; - BOOL bWidelinks; - BOOL bSymlinks; - BOOL bSyncAlways; - BOOL bStrictAllocate; - BOOL bStrictSync; + bool bPosixLocking; + bool bShareModes; + bool bOpLocks; + bool bLevel2OpLocks; + bool bOnlyUser; + bool bMangledNames; + bool bWidelinks; + bool bSymlinks; + bool bSyncAlways; + bool bStrictAllocate; + bool bStrictSync; char magic_char; - BOOL *copymap; - BOOL bDeleteReadonly; - BOOL bFakeOplocks; - BOOL bDeleteVetoFiles; - BOOL bDosFilemode; - BOOL bDosFiletimes; - BOOL bDosFiletimeResolution; - BOOL bFakeDirCreateTimes; - BOOL bBlockingLocks; - BOOL bInheritPerms; - BOOL bInheritACLS; - BOOL bInheritOwner; - 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; - BOOL bAclCheckPermissions; - BOOL bAclMapFullControl; - BOOL bAclGroupControl; - BOOL bChangeNotify; - BOOL bKernelChangeNotify; + bool *copymap; + bool bDeleteReadonly; + bool bFakeOplocks; + bool bDeleteVetoFiles; + bool bDosFilemode; + bool bDosFiletimes; + bool bDosFiletimeResolution; + bool bFakeDirCreateTimes; + bool bBlockingLocks; + bool bInheritPerms; + bool bInheritACLS; + bool bInheritOwner; + 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; + bool bAclCheckPermissions; + bool bAclMapFullControl; + bool bAclGroupControl; + bool bChangeNotify; + bool bKernelChangeNotify; int iallocation_roundup_size; int iAioReadSize; int iAioWriteSize; @@ -630,25 +630,25 @@ static int iServiceIndex = 0; static TDB_CONTEXT *ServiceHash; static int *invalid_services = NULL; static int num_invalid_services = 0; -static BOOL bInGlobalSection = True; -static BOOL bGlobalOnly = False; +static bool bInGlobalSection = True; +static bool bGlobalOnly = False; static int server_role; static int default_server_announce; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) /* prototypes for the special type handlers */ -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_printing( int snum, 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_printing( int snum, const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -1161,10 +1161,10 @@ static struct parm_struct parm_table[] = { {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED}, {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, FLAG_ADVANCED}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.bPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, + {"preferred master", P_ENUM, P_GLOBAL, &Globals.iPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, + {"prefered master", P_ENUM, P_GLOBAL, &Globals.iPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.bDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, + {"domain master", P_ENUM, P_GLOBAL, &Globals.iDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, FLAG_ADVANCED}, {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, @@ -1416,9 +1416,9 @@ static void init_printer_values(service *pService) Initialise the global parameter structure. ***************************************************************************/ -static void init_globals(BOOL first_time_only) +static void init_globals(bool first_time_only) { - static BOOL done_init = False; + static bool done_init = False; pstring s; /* If requested to initialize only once and we've already done it... */ @@ -1636,10 +1636,9 @@ static void init_globals(BOOL first_time_only) */ Globals.bMsAddPrinterWizard = True; - Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */ Globals.os_level = 20; Globals.bLocalMaster = True; - Globals.bDomainMaster = Auto; /* depending on bDomainLogons */ + Globals.iDomainMaster = Auto; /* depending on bDomainLogons */ Globals.bDomainLogons = False; Globals.bBrowseList = True; Globals.bWINSsupport = False; @@ -1757,7 +1756,7 @@ static char *lp_string(const char *s) #define FN_GLOBAL_LIST(fn_name,ptr) \ const char **fn_name(void) {return(*(const char ***)(ptr));} #define FN_GLOBAL_BOOL(fn_name,ptr) \ - BOOL fn_name(void) {return(*(BOOL *)(ptr));} + bool fn_name(void) {return(*(bool *)(ptr));} #define FN_GLOBAL_CHAR(fn_name,ptr) \ char fn_name(void) {return(*(char *)(ptr));} #define FN_GLOBAL_INTEGER(fn_name,ptr) \ @@ -1770,12 +1769,12 @@ static char *lp_string(const char *s) #define FN_LOCAL_LIST(fn_name,val) \ const char **fn_name(int i) {return(const char **)(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_BOOL(fn_name,val) \ - BOOL fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} + bool fn_name(int i) {return(bool)(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_INTEGER(fn_name,val) \ int fn_name(int i) {return(LP_SNUM_OK(i)? ServicePtrs[(i)]->val : sDefault.val);} #define FN_LOCAL_PARM_BOOL(fn_name,val) \ - BOOL fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} + bool fn_name(const struct share_params *p) {return(bool)(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} #define FN_LOCAL_PARM_INTEGER(fn_name,val) \ int fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} #define FN_LOCAL_PARM_STRING(fn_name,val) \ @@ -2171,28 +2170,28 @@ FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrappi /* local prototypes */ static int map_parameter(const char *pszParmName); -static int map_parameter_canonical(const char *pszParmName, BOOL *inverse); -static BOOL set_boolean(BOOL *pb, const char *pszParmValue); -static const char *get_boolean(BOOL bool_value); +static int map_parameter_canonical(const char *pszParmName, bool *inverse); +static bool set_boolean(bool *pb, const char *pszParmValue); +static const char *get_boolean(bool bool_value); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, - service * pserviceSource, BOOL *pcopymapDest); -static BOOL do_parameter(const char *pszParmName, const char *pszParmValue); -static BOOL do_section(const char *pszSectionName); + service * pserviceSource, bool *pcopymapDest); +static bool do_parameter(const char *pszParmName, const char *pszParmValue); +static bool do_section(const char *pszSectionName); static void init_copymap(service * pservice); -static BOOL hash_a_service(const char *name, int number); +static bool hash_a_service(const char *name, int number); static void free_service_byindex(int iService); static char * canonicalize_servicename(const char *name); static void show_parameter(int parmIndex); -static BOOL is_synonym_of(int parm1, int parm2, BOOL *inverse); +static bool is_synonym_of(int parm1, int parm2, bool *inverse); /* This is a helper function for parametrical options support. */ /* It returns a pointer to parametrical option value if it exists or NULL otherwise */ /* Actual parametrical functions are quite simple */ static param_opt_struct *get_parametrics(int snum, const char *type, const char *option) { - BOOL global_section = False; + bool global_section = False; char* param_key; param_opt_struct *data; @@ -2272,9 +2271,9 @@ static unsigned long lp_ulong(const char *s) /******************************************************************* convenience routine to return boolean parameters. ********************************************************************/ -static BOOL lp_bool(const char *s) +static bool lp_bool(const char *s) { - BOOL ret = False; + bool ret = False; if (!s || !*s) { MISSING_PARAMETER(lp_bool); @@ -2400,7 +2399,7 @@ unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsi /* Return parametric option from a given service. Type is a part of option before ':' */ /* Parametric option has following syntax: 'Type: option = value' */ -BOOL lp_parm_bool(int snum, const char *type, const char *option, BOOL def) +bool lp_parm_bool(int snum, const char *type, const char *option, bool def) { param_opt_struct *data = get_parametrics(snum, type, option); @@ -2619,7 +2618,7 @@ static char *canonicalize_servicename(const char *src) Add a name/index pair for the services array to the hash table. ***************************************************************************/ -static BOOL hash_a_service(const char *name, int idx) +static bool hash_a_service(const char *name, int idx) { char *canon_name; @@ -2649,7 +2648,7 @@ static BOOL hash_a_service(const char *name, int idx) from service ifrom. ***************************************************************************/ -BOOL lp_add_home(const char *pszHomename, int iDefaultService, +bool lp_add_home(const char *pszHomename, int iDefaultService, const char *user, const char *pszHomedir) { int i; @@ -2702,7 +2701,7 @@ int lp_add_service(const char *pszService, int iDefaultService) Add the IPC service. ***************************************************************************/ -static BOOL lp_add_ipc(const char *ipc_name, BOOL guest_ok) +static bool lp_add_ipc(const char *ipc_name, bool guest_ok) { pstring comment; int i = add_a_service(&sDefault, ipc_name); @@ -2734,7 +2733,7 @@ static BOOL lp_add_ipc(const char *ipc_name, BOOL guest_ok) Add a new printer service, with defaults coming from service iFrom. ***************************************************************************/ -BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) +bool lp_add_printer(const char *pszPrintername, int iDefaultService) { const char *comment = "From Printcap"; int i = add_a_service(ServicePtrs[iDefaultService], pszPrintername); @@ -2774,7 +2773,7 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService) Parametric options (names containing a colon) are considered valid. ***************************************************************************/ -BOOL lp_parameter_is_valid(const char *pszParmName) +bool lp_parameter_is_valid(const char *pszParmName) { return ((map_parameter(pszParmName) != -1) || (strchr(pszParmName, ':') != NULL)); @@ -2787,7 +2786,7 @@ BOOL lp_parameter_is_valid(const char *pszParmName) and strings not belonging to any option. ***************************************************************************/ -BOOL lp_parameter_is_global(const char *pszParmName) +bool lp_parameter_is_global(const char *pszParmName) { int num = map_parameter(pszParmName); @@ -2804,7 +2803,7 @@ BOOL lp_parameter_is_global(const char *pszParmName) For parametric options, True is returned. **************************************************************************/ -BOOL lp_parameter_is_canonical(const char *parm_name) +bool lp_parameter_is_canonical(const char *parm_name) { if (!lp_parameter_is_valid(parm_name)) { return False; @@ -2820,8 +2819,8 @@ BOOL lp_parameter_is_canonical(const char *parm_name) "usual" synonym. **************************************************************************/ -BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, - BOOL *inverse) +bool lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, + bool *inverse) { int num; @@ -2853,13 +2852,13 @@ BOOL lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, Return false in all other cases. **************************************************************************/ -BOOL lp_canonicalize_parameter_with_value(const char *parm_name, +bool lp_canonicalize_parameter_with_value(const char *parm_name, const char *val, const char **canon_parm, const char **canon_val) { int num; - BOOL inverse; + bool inverse; if (!lp_parameter_is_valid(parm_name)) { *canon_parm = NULL; @@ -2918,10 +2917,10 @@ static int map_parameter(const char *pszParmName) Returns -1 if the parameter string is not recognised. ***************************************************************************/ -static int map_parameter_canonical(const char *pszParmName, BOOL *inverse) +static int map_parameter_canonical(const char *pszParmName, bool *inverse) { int parm_num, canon_num; - BOOL loc_inverse = False; + bool loc_inverse = False; parm_num = map_parameter(pszParmName); if ((parm_num < 0) || !(parm_table[parm_num].flags & FLAG_HIDE)) { @@ -2950,7 +2949,7 @@ done: False otherwise. ***************************************************************************/ -static BOOL is_synonym_of(int parm1, int parm2, BOOL *inverse) +static bool is_synonym_of(int parm1, int parm2, bool *inverse) { if ((parm_table[parm1].ptr == parm_table[parm2].ptr) && (parm_table[parm1].flags & FLAG_HIDE) && @@ -2979,9 +2978,9 @@ static void show_parameter(int parmIndex) { int enumIndex, flagIndex; int parmIndex2; - BOOL hadFlag; - BOOL hadSyn; - BOOL inverse; + bool hadFlag; + bool hadSyn; + bool inverse; const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", "P_UGSTRING", "P_ENUM", "P_SEP"}; @@ -3065,10 +3064,10 @@ void show_parameter_list(void) represent a boolean. ***************************************************************************/ -static BOOL set_boolean(BOOL *pb, const char *pszParmValue) +static bool set_boolean(bool *pb, const char *pszParmValue) { - BOOL bRetval; - BOOL value; + bool bRetval; + bool value; bRetval = True; value = False; @@ -3099,7 +3098,7 @@ static BOOL set_boolean(BOOL *pb, const char *pszParmValue) Check if a given string correctly represents a boolean value. ***************************************************************************/ -BOOL lp_string_is_valid_boolean(const char *parm_value) +bool lp_string_is_valid_boolean(const char *parm_value) { return set_boolean(NULL, parm_value); } @@ -3108,7 +3107,7 @@ BOOL lp_string_is_valid_boolean(const char *parm_value) Get the standard string representation of a boolean value ("yes" or "no") ***************************************************************************/ -static const char *get_boolean(BOOL bool_value) +static const char *get_boolean(bool bool_value) { static const char *yes_str = "yes"; static const char *no_str = "no"; @@ -3122,9 +3121,9 @@ static const char *get_boolean(BOOL bool_value) represent a boolean. ***************************************************************************/ -BOOL lp_invert_boolean(const char *str, const char **inverse_str) +bool lp_invert_boolean(const char *str, const char **inverse_str) { - BOOL val; + bool val; if (!set_boolean(&val, str)) { return False; @@ -3140,9 +3139,9 @@ BOOL lp_invert_boolean(const char *str, const char **inverse_str) not correctly represent a boolean. ***************************************************************************/ -BOOL lp_canonicalize_boolean(const char *str, const char**canon_str) +bool lp_canonicalize_boolean(const char *str, const char**canon_str) { - BOOL val; + bool val; if (!set_boolean(&val, str)) { return False; @@ -3184,12 +3183,12 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) If pcopymapDest is NULL then copy all fields ***************************************************************************/ -static void copy_service(service * pserviceDest, service * pserviceSource, BOOL *pcopymapDest) +static void copy_service(service * pserviceDest, service * pserviceSource, bool *pcopymapDest) { int i; - BOOL bcopyall = (pcopymapDest == NULL); + bool bcopyall = (pcopymapDest == NULL); param_opt_struct *data, *pdata, *paramo; - BOOL not_added; + bool not_added; for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && @@ -3205,7 +3204,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL switch (parm_table[i].type) { case P_BOOL: case P_BOOLREV: - *(BOOL *)dest_ptr = *(BOOL *)src_ptr; + *(bool *)dest_ptr = *(bool *)src_ptr; break; case P_INTEGER: @@ -3242,7 +3241,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL if (pserviceSource->copymap) memcpy((void *)pserviceDest->copymap, (void *)pserviceSource->copymap, - sizeof(BOOL) * NUMPARAMETERS); + sizeof(bool) * NUMPARAMETERS); } data = pserviceSource->param_opt; @@ -3277,9 +3276,9 @@ Check a service for consistency. Return False if the service is in any way incomplete or faulty, else True. ***************************************************************************/ -BOOL service_ok(int iService) +bool service_ok(int iService) { - BOOL bRetval; + bool bRetval; bRetval = True; if (ServicePtrs[iService]->szService[0] == '\0') { @@ -3371,9 +3370,9 @@ done: * and regdb_unpack_values, circumventing any fancy stuff, to * give us access to the registry globals. */ -static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) +static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) { - BOOL ret = False; + bool ret = False; struct tdb_wrap *reg_tdb = NULL; WERROR err; char *keystr; @@ -3484,9 +3483,9 @@ done: * using the reg_api functions... * */ -static BOOL process_registry_globals(BOOL (*pfunc)(const char *, const char *)) +static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) { - BOOL ret = False; + bool ret = False; TALLOC_CTX *ctx = NULL; char *regpath = NULL; WERROR werr = WERR_OK; @@ -3606,7 +3605,7 @@ static void add_to_file_list(const char *fname, const char *subfname) Check if a config file has changed date. ********************************************************************/ -BOOL lp_file_list_changed(void) +bool lp_file_list_changed(void) { struct file_lists *f = file_lists; struct tdb_wrap *reg_tdb = NULL; @@ -3658,9 +3657,9 @@ BOOL lp_file_list_changed(void) Note: We must *NOT* use string_set() here as ptr points to global_myname. ***************************************************************************/ -static BOOL handle_netbios_name(int snum, const char *pszParmValue, char **ptr) +static bool handle_netbios_name(int snum, const char *pszParmValue, char **ptr) { - BOOL ret; + bool ret; pstring netbios_name; pstrcpy(netbios_name, pszParmValue); @@ -3677,7 +3676,7 @@ static BOOL handle_netbios_name(int snum, const char *pszParmValue, char **ptr) return ret; } -static BOOL handle_charset(int snum, 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); @@ -3688,9 +3687,9 @@ static BOOL handle_charset(int snum, const char *pszParmValue, char **ptr) -static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr) +static bool handle_workgroup(int snum, const char *pszParmValue, char **ptr) { - BOOL ret; + bool ret; ret = set_global_myworkgroup(pszParmValue); string_set(&Globals.szWorkgroup,lp_workgroup()); @@ -3698,9 +3697,9 @@ static BOOL handle_workgroup(int snum, const char *pszParmValue, char **ptr) return ret; } -static BOOL handle_netbios_scope(int snum, const char *pszParmValue, char **ptr) +static bool handle_netbios_scope(int snum, const char *pszParmValue, char **ptr) { - BOOL ret; + bool ret; ret = set_global_scope(pszParmValue); string_set(&Globals.szNetbiosScope,global_scope()); @@ -3708,7 +3707,7 @@ static BOOL handle_netbios_scope(int snum, const char *pszParmValue, char **ptr) return ret; } -static BOOL handle_netbios_aliases(int snum, 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); @@ -3719,7 +3718,7 @@ static BOOL handle_netbios_aliases(int snum, const char *pszParmValue, char **pt Handle the include operation. ***************************************************************************/ -static BOOL handle_include(int snum, const char *pszParmValue, char **ptr) +static bool handle_include(int snum, const char *pszParmValue, char **ptr) { pstring fname; pstrcpy(fname, pszParmValue); @@ -3754,9 +3753,9 @@ static BOOL handle_include(int snum, const char *pszParmValue, char **ptr) Handle the interpretation of the copy parameter. ***************************************************************************/ -static BOOL handle_copy(int snum, const char *pszParmValue, char **ptr) +static bool handle_copy(int snum, const char *pszParmValue, char **ptr) { - BOOL bRetval; + bool bRetval; int iTemp; service serviceTemp; @@ -3805,7 +3804,7 @@ static BOOL handle_copy(int snum, const char *pszParmValue, char **ptr) static uid_t idmap_uid_low, idmap_uid_high; static gid_t idmap_gid_low, idmap_gid_high; -BOOL lp_idmap_uid(uid_t *low, uid_t *high) +bool lp_idmap_uid(uid_t *low, uid_t *high) { if (idmap_uid_low == 0 || idmap_uid_high == 0) return False; @@ -3819,7 +3818,7 @@ BOOL lp_idmap_uid(uid_t *low, uid_t *high) return True; } -BOOL lp_idmap_gid(gid_t *low, gid_t *high) +bool lp_idmap_gid(gid_t *low, gid_t *high) { if (idmap_gid_low == 0 || idmap_gid_high == 0) return False; @@ -3835,7 +3834,7 @@ BOOL lp_idmap_gid(gid_t *low, gid_t *high) /* Do some simple checks on "idmap [ug]id" parameter values */ -static BOOL handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) +static bool handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) { uint32 low, high; @@ -3852,7 +3851,7 @@ static BOOL handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) return True; } -static BOOL handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) +static bool handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) { uint32 low, high; @@ -3873,7 +3872,7 @@ static BOOL handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) Handle the DEBUG level list. ***************************************************************************/ -static BOOL handle_debug_list( int snum, const char *pszParmValueIn, char **ptr ) +static bool handle_debug_list( int snum, const char *pszParmValueIn, char **ptr ) { pstring pszParmValue; @@ -3953,7 +3952,7 @@ static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue /*************************************************************************** ***************************************************************************/ -static BOOL handle_printing(int snum, const char *pszParmValue, char **ptr) +static bool handle_printing(int snum, const char *pszParmValue, char **ptr) { static int parm_num = -1; service *s; @@ -3982,7 +3981,7 @@ static void init_copymap(service * pservice) { int i; SAFE_FREE(pservice->copymap); - pservice->copymap = SMB_MALLOC_ARRAY(BOOL,NUMPARAMETERS); + pservice->copymap = SMB_MALLOC_ARRAY(bool,NUMPARAMETERS); if (!pservice->copymap) DEBUG(0, ("Couldn't allocate copymap!! (size %d)\n", @@ -4007,7 +4006,7 @@ void *lp_local_ptr(int snum, void *ptr) then assume we are in the globals. ***************************************************************************/ -BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue) +bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue) { int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ @@ -4015,7 +4014,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue pstring param_key; char *sep; param_opt_struct *paramo, *data; - BOOL not_added; + bool not_added; parmnum = map_parameter(pszParmName); @@ -4104,11 +4103,11 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue switch (parm_table[parmnum].type) { case P_BOOL: - *(BOOL *)parm_ptr = lp_bool(pszParmValue); + *(bool *)parm_ptr = lp_bool(pszParmValue); break; case P_BOOLREV: - *(BOOL *)parm_ptr = !lp_bool(pszParmValue); + *(bool *)parm_ptr = !lp_bool(pszParmValue); break; case P_INTEGER: @@ -4163,7 +4162,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue Process a parameter. ***************************************************************************/ -static BOOL do_parameter(const char *pszParmName, const char *pszParmValue) +static bool do_parameter(const char *pszParmName, const char *pszParmValue) { if (!bInGlobalSection && bGlobalOnly) return (True); @@ -4194,11 +4193,11 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) break; case P_BOOL: - fprintf(f, "%s", BOOLSTR(*(BOOL *)ptr)); + fprintf(f, "%s", BOOLSTR(*(bool *)ptr)); break; case P_BOOLREV: - fprintf(f, "%s", BOOLSTR(!*(BOOL *)ptr)); + fprintf(f, "%s", BOOLSTR(!*(bool *)ptr)); break; case P_INTEGER: @@ -4249,12 +4248,12 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) Check if two parameters are equal. ***************************************************************************/ -static BOOL equal_parameter(parm_type type, void *ptr1, void *ptr2) +static bool equal_parameter(parm_type type, void *ptr1, void *ptr2) { switch (type) { case P_BOOL: case P_BOOLREV: - return (*((BOOL *)ptr1) == *((BOOL *)ptr2)); + return (*((bool *)ptr1) == *((bool *)ptr2)); case P_INTEGER: case P_ENUM: @@ -4308,10 +4307,10 @@ void init_locals(void) Returns True on success, False on failure. ***************************************************************************/ -static BOOL do_section(const char *pszSectionName) +static bool do_section(const char *pszSectionName) { - BOOL bRetval; - BOOL isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || + bool bRetval; + bool isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || (strwicmp(pszSectionName, GLOBAL_NAME2) == 0)); bRetval = False; @@ -4358,7 +4357,7 @@ static BOOL do_section(const char *pszSectionName) Determine if a partcular base parameter is currentl set to the default value. ***************************************************************************/ -static BOOL is_default(int i) +static bool is_default(int i) { if (!defaults_saved) return False; @@ -4377,7 +4376,7 @@ static BOOL is_default(int i) case P_BOOL: case P_BOOLREV: return parm_table[i].def.bvalue == - *(BOOL *)parm_table[i].ptr; + *(bool *)parm_table[i].ptr; case P_CHAR: return parm_table[i].def.cvalue == *(char *)parm_table[i].ptr; @@ -4427,7 +4426,7 @@ static void dump_globals(FILE *f) Return True if a local parameter is currently set to the global default. ***************************************************************************/ -BOOL lp_is_default(int snum, struct parm_struct *parm) +bool lp_is_default(int snum, struct parm_struct *parm) { int pdiff = PTR_DIFF(parm->ptr, &sDefault); @@ -4490,10 +4489,10 @@ static void dump_a_service(service * pService, FILE * f) Display the contents of a parameter of a single services record. ***************************************************************************/ -BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal) +bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal) { int i; - BOOL result = False; + bool result = False; parm_class p_class; unsigned flag = 0; fstring local_parm_name; @@ -4636,7 +4635,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) /*************************************************************************** Display the contents of a single copy structure. ***************************************************************************/ -static void dump_copy_map(BOOL *pcopymap) +static void dump_copy_map(bool *pcopymap) { int i; if (!pcopymap) @@ -4658,7 +4657,7 @@ static void dump_copy_map(BOOL *pcopymap) Return TRUE if the passed service number is within range. ***************************************************************************/ -BOOL lp_snum_ok(int iService) +bool lp_snum_ok(int iService) { return (LP_SNUM_OK(iService) && ServicePtrs[iService]->bAvailable); } @@ -4716,7 +4715,7 @@ void lp_add_one_printer(char *name, char *comment) Have we loaded a services file yet? ***************************************************************************/ -BOOL lp_loaded(void) +bool lp_loaded(void) { return (bLoaded); } @@ -4725,7 +4724,7 @@ BOOL lp_loaded(void) Unload unused services. ***************************************************************************/ -void lp_killunused(BOOL (*snumused) (int)) +void lp_killunused(bool (*snumused) (int)) { int i; for (i = 0; i < iNumServices; i++) { @@ -4791,7 +4790,7 @@ static void lp_save_defaults(void) case P_BOOL: case P_BOOLREV: parm_table[i].def.bvalue = - *(BOOL *)parm_table[i].ptr; + *(bool *)parm_table[i].ptr; break; case P_CHAR: parm_table[i].def.cvalue = @@ -4869,7 +4868,7 @@ static void set_server_role(void) case SEC_USER: if (lp_domain_logons()) { - if (Globals.bDomainMaster) /* auto or yes */ + if (Globals.iDomainMaster) /* auto or yes */ server_role = ROLE_DOMAIN_PDC; else server_role = ROLE_DOMAIN_BDC; @@ -4916,7 +4915,7 @@ static void set_allowed_client_auth(void) get their sorry ass fired. ***************************************************************************/ -static BOOL check_usershare_stat(const char *fname, SMB_STRUCT_STAT *psbuf) +static bool check_usershare_stat(const char *fname, SMB_STRUCT_STAT *psbuf) { if (!S_ISREG(psbuf->st_mode)) { DEBUG(0,("check_usershare_stat: file %s owned by uid %u is " @@ -4958,7 +4957,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, pstring sharepath, pstring comment, SEC_DESC **ppsd, - BOOL *pallow_guest) + bool *pallow_guest) { const char **prefixallowlist = lp_usershare_prefix_allow_list(); const char **prefixdenylist = lp_usershare_prefix_deny_list(); @@ -5127,7 +5126,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i int iService = -1; TALLOC_CTX *ctx = NULL; SEC_DESC *psd = NULL; - BOOL guest_ok = False; + bool guest_ok = False; /* Ensure share name doesn't contain invalid characters. */ if (!validate_net_name(file_name, INVALID_SHARENAME_CHARS, strlen(file_name))) { @@ -5284,7 +5283,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i Checks if a usershare entry has been modified since last load. ***************************************************************************/ -static BOOL usershare_exists(int iService, time_t *last_mod) +static bool usershare_exists(int iService, time_t *last_mod) { SMB_STRUCT_STAT lsbuf; const char *usersharepath = Globals.szUsersharePath; @@ -5584,14 +5583,14 @@ void gfree_loadparm(void) False on failure. ***************************************************************************/ -BOOL lp_load(const char *pszFname, - BOOL global_only, - BOOL save_defaults, - BOOL add_ipc, - BOOL initialize_globals) +bool lp_load(const char *pszFname, + bool global_only, + bool save_defaults, + bool add_ipc, + bool initialize_globals) { pstring n2; - BOOL bRetval; + bool bRetval; param_opt_struct *data, *pdata; pstrcpy(n2, pszFname); @@ -5688,7 +5687,7 @@ int lp_numservices(void) Display the contents of the services array in human-readable form. ***************************************************************************/ -void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) +void lp_dump(FILE *f, bool show_defaults, int maxtoprint) { int iService; @@ -5709,7 +5708,7 @@ void lp_dump(FILE *f, BOOL show_defaults, int maxtoprint) Display the contents of one service in human-readable form. ***************************************************************************/ -void lp_dump_one(FILE * f, BOOL show_defaults, int snum) +void lp_dump_one(FILE * f, bool show_defaults, int snum) { if (VALID(snum)) { if (ServicePtrs[snum]->szService[0] == '\0') @@ -5779,7 +5778,7 @@ int lp_servicenumber(const char *pszServiceName) return (iService); } -BOOL share_defined(const char *service_name) +bool share_defined(const char *service_name) { return (lp_servicenumber(service_name) != -1); } @@ -5959,24 +5958,24 @@ int lp_server_role(void) If we are PDC then prefer us as DMB ************************************************************/ -BOOL lp_domain_master(void) +bool lp_domain_master(void) { - if (Globals.bDomainMaster == Auto) + if (Globals.iDomainMaster == Auto) return (lp_server_role() == ROLE_DOMAIN_PDC); - return Globals.bDomainMaster; + return (bool)Globals.iDomainMaster; } /*********************************************************** If we are DMB then prefer us as LMB ************************************************************/ -BOOL lp_preferred_master(void) +bool lp_preferred_master(void) { - if (Globals.bPreferredMaster == Auto) + if (Globals.iPreferredMaster == Auto) return (lp_local_master() && lp_domain_master()); - return Globals.bPreferredMaster; + return (bool)Globals.iPreferredMaster; } /******************************************************************* @@ -6019,7 +6018,7 @@ int lp_default_server_announce(void) int lp_major_announce_version(void) { - static BOOL got_major = False; + static bool got_major = False; static int major_version = DEFAULT_MAJOR_VERSION; char *vers; char *p; @@ -6041,7 +6040,7 @@ int lp_major_announce_version(void) int lp_minor_announce_version(void) { - static BOOL got_minor = False; + static bool got_minor = False; static int minor_version = DEFAULT_MINOR_VERSION; char *vers; char *p; @@ -6129,7 +6128,7 @@ const char *lp_printcapname(void) static uint32 spoolss_state; -BOOL lp_disable_spoolss( void ) +bool lp_disable_spoolss( void ) { if ( spoolss_state == SVCCTL_STATE_UNKNOWN ) spoolss_state = _lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING; @@ -6153,7 +6152,7 @@ uint32 lp_get_spoolss_state( void ) Ensure we don't use sendfile if server smb signing is active. ********************************************************************/ -BOOL lp_use_sendfile(int snum) +bool lp_use_sendfile(int snum) { /* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */ if (Protocol < PROTOCOL_NT1) { @@ -6166,7 +6165,7 @@ BOOL lp_use_sendfile(int snum) Turn off sendfile if we find the underlying OS doesn't support it. ********************************************************************/ -void set_use_sendfile(int snum, BOOL val) +void set_use_sendfile(int snum, bool val) { if (LP_SNUM_OK(snum)) ServicePtrs[snum]->bUseSendfile = val; @@ -6178,7 +6177,7 @@ void set_use_sendfile(int snum, BOOL val) Turn off storing DOS attributes if this share doesn't support it. ********************************************************************/ -void set_store_dos_attributes(int snum, BOOL val) +void set_store_dos_attributes(int snum, bool val) { if (!LP_SNUM_OK(snum)) return; @@ -6194,9 +6193,9 @@ void lp_set_mangling_method(const char *new_method) Global state for POSIX pathname processing. ********************************************************************/ -static BOOL posix_pathnames; +static bool posix_pathnames; -BOOL lp_posix_pathnames(void) +bool lp_posix_pathnames(void) { return posix_pathnames; } @@ -6215,7 +6214,7 @@ void lp_set_posix_pathnames(void) Global state for POSIX lock processing - CIFS unix extensions. ********************************************************************/ -BOOL posix_default_lock_was_set; +bool posix_default_lock_was_set; static enum brl_flavour posix_cifsx_locktype; /* By default 0 == WINDOWS_LOCK */ enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp) diff --git a/source3/param/params.c b/source3/param/params.c index 08c35d0967..24bef0a506 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -80,7 +80,7 @@ #include "includes.h" -extern BOOL in_client; +extern bool in_client; /* -------------------------------------------------------------------------- ** * Constants... @@ -235,7 +235,7 @@ static int Continuation(char *line, int pos ) * ------------------------------------------------------------------------ ** */ -static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) +static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) { int c; int i; @@ -341,7 +341,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) * ------------------------------------------------------------------------ ** */ -static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *), int c ) +static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *), int c ) { int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ @@ -471,9 +471,9 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *) * ------------------------------------------------------------------------ ** */ -static BOOL Parse( myFILE *InFile, - BOOL (*sfunc)(const char *), - BOOL (*pfunc)(const char *, const char *) ) +static bool Parse( myFILE *InFile, + bool (*sfunc)(const char *), + bool (*pfunc)(const char *, const char *) ) { int c; @@ -556,9 +556,9 @@ static myFILE *OpenConfFile( const char *FileName ) * ------------------------------------------------------------------------ ** */ -BOOL pm_process( const char *FileName, - BOOL (*sfunc)(const char *), - BOOL (*pfunc)(const char *, const char *) ) +bool pm_process( const char *FileName, + bool (*sfunc)(const char *), + bool (*pfunc)(const char *, const char *) ) { int result; myFILE *InFile; -- cgit From 611479fd44433fe8bd26e05eae765bcab032edad Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 20 Oct 2007 16:24:46 +0200 Subject: Fix two type-punned warnings (This used to be commit 04d660bbb371f859cc50a9f3ea7d358f74acfa8b) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 80462ee968..dcec6bce89 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -227,7 +227,7 @@ typedef struct { bool bDisableSpoolss; int syslog; int os_level; - int enhanced_browsing; + bool enhanced_browsing; int max_ttl; int max_wins_ttl; int min_wins_ttl; @@ -1589,7 +1589,7 @@ static void init_globals(bool first_time_only) Globals.map_to_guest = 0; /* By Default, "Never" */ Globals.oplock_break_wait_time = 0; /* By Default, 0 msecs. */ - Globals.enhanced_browsing = True; + Globals.enhanced_browsing = true; Globals.iLockSpinTime = WINDOWS_MINIMUM_LOCK_TIMEOUT_MS; /* msec. */ #ifdef MMAP_BLACKLIST Globals.bUseMmap = False; @@ -2018,7 +2018,7 @@ FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) -FN_GLOBAL_INTEGER(_lp_disable_spoolss, &Globals.bDisableSpoolss) +FN_GLOBAL_BOOL(_lp_disable_spoolss, &Globals.bDisableSpoolss) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) -- cgit From c3250149e12338fac5093991b385ad2807c92d1f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 30 Oct 2007 16:22:24 -0700 Subject: Add new parameter, "min receivefile size" (by default set to zero). If non-zero, writeX calls greater than this value will be left in the socket buffer for later handling with recvfile (or userspace equivalent). Definition of recvfile for your system is left as an exercise for the reader (I'm working on getting splice working :-). Jeremy. (This used to be commit 11c03b75ddbcb6e36b231bb40a1773d1c550621c) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dcec6bce89..a5b2647567 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -331,6 +331,7 @@ typedef struct { bool bResetOnZeroVC; int iKeepalive; + int iminreceivefile; param_opt_struct *param_opt; } global; @@ -998,6 +999,7 @@ static struct parm_struct parm_table[] = { {"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}, + {"min receivefile size", P_INTEGER, P_GLOBAL, &Globals.iminreceivefile, 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}, @@ -1708,6 +1710,8 @@ static void init_globals(bool first_time_only) /* By default no shares out of the registry */ Globals.bRegistryShares = False; + + Globals.iminreceivefile = 0; } /******************************************************************* @@ -2165,6 +2169,7 @@ FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) FN_GLOBAL_INTEGER(lp_server_signing, &Globals.server_signing) +FN_GLOBAL_INTEGER(lp_min_receive_file_size, &Globals.iminreceivefile); FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrapping) /* local prototypes */ -- cgit From 456ca680f24f13e72a529e6e280b1fffa744a1ff Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 31 Oct 2007 15:06:22 +0100 Subject: save memory Hi! Attached find a patch that I've wanted to check in for ages. The whole area probably needs a major rewrite, but this is a minimal patch that on a 32-bit box saves 1.5k per smbd per defined share, twice as much on a 64-bit box. Volker From ebb80e664ecc49eb597a45cb57e1067fbae49e62 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 31 Oct 2007 15:04:34 +0100 Subject: [PATCH] Change global->copymap from bool* to a bitmap We right now have 401 parameters, so with bool being represented as a 64-bit integer this saves about 3k of memory per smbd per share that is defined in smb.conf. (This used to be commit 94f2c35a683eace7f9f3dad9748aaec93f7c534f) --- source3/param/loadparm.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a5b2647567..163f4179a6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -441,7 +441,7 @@ typedef struct { bool bStrictAllocate; bool bStrictSync; char magic_char; - bool *copymap; + struct bitmap *copymap; bool bDeleteReadonly; bool bFakeOplocks; bool bDeleteVetoFiles; @@ -2181,7 +2181,8 @@ static const char *get_boolean(bool bool_value); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, - service * pserviceSource, bool *pcopymapDest); + service * pserviceSource, + struct bitmap *pcopymapDest); static bool do_parameter(const char *pszParmName, const char *pszParmValue); static bool do_section(const char *pszSectionName); static void init_copymap(service * pservice); @@ -2455,7 +2456,7 @@ static void free_service(service *pservice) pservice->szService)); string_free(&pservice->szService); - SAFE_FREE(pservice->copymap); + bitmap_free(pservice->copymap); for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || @@ -3188,7 +3189,8 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) If pcopymapDest is NULL then copy all fields ***************************************************************************/ -static void copy_service(service * pserviceDest, service * pserviceSource, bool *pcopymapDest) +static void copy_service(service * pserviceDest, service * pserviceSource, + struct bitmap *pcopymapDest) { int i; bool bcopyall = (pcopymapDest == NULL); @@ -3197,7 +3199,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && - (bcopyall || pcopymapDest[i])) { + (bcopyall || bitmap_query(pcopymapDest,i))) { void *def_ptr = parm_table[i].ptr; void *src_ptr = ((char *)pserviceSource) + PTR_DIFF(def_ptr, @@ -3244,9 +3246,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool if (bcopyall) { init_copymap(pserviceDest); if (pserviceSource->copymap) - memcpy((void *)pserviceDest->copymap, - (void *)pserviceSource->copymap, - sizeof(bool) * NUMPARAMETERS); + bitmap_copy(pserviceDest->copymap, + pserviceSource->copymap); } data = pserviceSource->param_opt; @@ -3985,15 +3986,17 @@ static bool handle_printing(int snum, const char *pszParmValue, char **ptr) static void init_copymap(service * pservice) { int i; - SAFE_FREE(pservice->copymap); - pservice->copymap = SMB_MALLOC_ARRAY(bool,NUMPARAMETERS); + if (pservice->copymap) { + bitmap_free(pservice->copymap); + } + pservice->copymap = bitmap_allocate(NUMPARAMETERS); if (!pservice->copymap) DEBUG(0, ("Couldn't allocate copymap!! (size %d)\n", (int)NUMPARAMETERS)); else for (i = 0; i < NUMPARAMETERS; i++) - pservice->copymap[i] = True; + bitmap_set(pservice->copymap, i); } /*************************************************************************** @@ -4095,7 +4098,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue the same data pointer */ for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr == parm_table[parmnum].ptr) - ServicePtrs[snum]->copymap[i] = False; + bitmap_clear(ServicePtrs[snum]->copymap, i); } /* if it is a special case then go ahead */ -- cgit From 88ee61625a5de5e443d14c54eab91a90d87cda85 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Thu, 1 Nov 2007 15:53:44 -0400 Subject: Patch 2 of 3 from Debian Samba packagers: The point is doing the following associations: - non discardable state data (all TDB files that may need to be backed up) go to statedir - shared data (codepage stuff) go to codepagedir The patch *does not change* the default location for these directories. So, there is no behaviour change when applying it. The main change is for samba developers who have to think when dealing with files that previously pertained to libdir whether they: - go in statedir - go in codepagedir - stay in libdir (This used to be commit d6cdbfd875bb2653e831d314726c3240beb0a96b) --- source3/param/loadparm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a5b2647567..e59aa99048 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1696,7 +1696,7 @@ static void init_globals(bool first_time_only) Globals.bASUSupport = False; /* User defined shares. */ - pstrcpy(s, dyn_LOCKDIR); + pstrcpy(s, dyn_STATEDIR()); pstrcat(s, "/usershares"); string_set(&Globals.szUsersharePath, s); string_set(&Globals.szUsershareTemplateShare, ""); @@ -3340,12 +3340,12 @@ static struct tdb_wrap *lp_regdb_open(void) uint32 vers_id; become_root(); - reg_tdb = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, + reg_tdb = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600); unbecome_root(); if (!reg_tdb) { DEBUG(1, ("lp_regdb_open: failed to open %s: %s\n", - lock_path("registry.tdb"), strerror(errno))); + state_path("registry.tdb"), strerror(errno))); goto done; } else { @@ -3356,7 +3356,7 @@ static struct tdb_wrap *lp_regdb_open(void) if (vers_id != REGVER_V1) { DEBUG(10, ("lp_regdb_open: INFO: registry tdb %s has wrong " "INFO/version (got %d, expected %d)\n", - lock_path("registry.tdb"), vers_id, REGVER_V1)); + state_path("registry.tdb"), vers_id, REGVER_V1)); /* this is apparently not implemented in the tdb */ } -- cgit From ae74aa9993863be8f75f203201b338e98824ce06 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Nov 2007 21:47:00 -0800 Subject: Constrain "min receivefile size" to max of BUFFER_SIZE (128k). Add debug error messages so we can see why writeX large is denied. Ensure we don't allow recvfile writes on IPC$. Jeremy. (This used to be commit 6bf053a6a17749a3bc73c8cc5fd490aa5f93b763) --- source3/param/loadparm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 19af6aa3cf..07f8dc4144 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2169,7 +2169,6 @@ FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) FN_GLOBAL_INTEGER(lp_server_signing, &Globals.server_signing) -FN_GLOBAL_INTEGER(lp_min_receive_file_size, &Globals.iminreceivefile); FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrapping) /* local prototypes */ @@ -6242,3 +6241,11 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val) posix_default_lock_was_set = True; posix_cifsx_locktype = val; } + +int lp_min_receive_file_size(void) +{ + if (Globals.iminreceivefile < 0) { + return 0; + } + return MIN(Globals.iminreceivefile, BUFFER_SIZE); +} -- cgit From e63bcdd720d801df278ef84063c46144df087793 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Nov 2007 18:13:00 +0100 Subject: Remove the silly "user_socket_options" global variable This is better done with a 'lp_do_parameter(-1, "socket options", ..); (This used to be commit 814bed029efa391e664ac432d0d68dfeab26381f) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 07f8dc4144..94f1c0e5b6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -55,7 +55,6 @@ bool in_client = False; /* Not in the client by default */ bool bLoaded = False; -extern pstring user_socket_options; extern enum protocol_types Protocol; extern userdom_struct current_user_info; @@ -1052,7 +1051,7 @@ static struct parm_struct parm_table[] = { {"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}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED}, + {"socket options", P_STRING, P_GLOBAL, &Globals.szSocketOptions, NULL, NULL, FLAG_ADVANCED}, {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, @@ -1505,7 +1504,7 @@ static void init_globals(bool first_time_only) string_set(&Globals.szPanicAction, "/bin/sleep 999999999"); #endif - pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); + string_set(&Globals.szSocketOptions, DEFAULT_SOCKET_OPTIONS); string_set(&Globals.szLogonDrive, ""); /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ @@ -2032,6 +2031,7 @@ FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) +FN_GLOBAL_CONST_STRING(lp_socket_options, &Globals.szSocketOptions) FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) -- cgit From 7a3ece4145b9f8631dc29717f165858ee5c80a2d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 13 Nov 2007 18:42:42 -0800 Subject: Remove pstring from param/ This was a little tricky..... I'll watch the build farm. Jeremy. (This used to be commit d6e2519c67fd015e1089021769de04085fd90894) --- source3/param/loadparm.c | 246 +++++++++++++++++++++++++++++------------------ 1 file changed, 152 insertions(+), 94 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 94f1c0e5b6..bc5fe5e8f1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1420,7 +1420,7 @@ static void init_printer_values(service *pService) static void init_globals(bool first_time_only) { static bool done_init = False; - pstring s; + char *s = NULL; /* If requested to initialize only once and we've already done it... */ if (first_time_only && done_init) { @@ -1483,23 +1483,29 @@ static void init_globals(bool first_time_only) * Allow the default PASSWD_CHAT to be overridden in local.h. */ string_set(&Globals.szPasswdChat, DEFAULT_PASSWD_CHAT); - + set_global_myname(myhostname()); string_set(&Globals.szNetbiosName,global_myname()); set_global_myworkgroup(WORKGROUP); string_set(&Globals.szWorkgroup, lp_workgroup()); - + string_set(&Globals.szPasswdProgram, ""); string_set(&Globals.szPidDir, dyn_PIDDIR); string_set(&Globals.szLockDir, dyn_LOCKDIR); string_set(&Globals.szSocketAddress, "0.0.0.0"); - pstrcpy(s, "Samba "); - pstrcat(s, SAMBA_VERSION_STRING); + + if (asprintf(&s, "Samba %s", SAMBA_VERSION_STRING) < 0) { + smb_panic("init_globals: ENOMEM"); + } string_set(&Globals.szServerString, s); - slprintf(s, sizeof(s) - 1, "%d.%d", DEFAULT_MAJOR_VERSION, - DEFAULT_MINOR_VERSION); + SAFE_FREE(s); + if (asprintf(&s, "%d.%d", DEFAULT_MAJOR_VERSION, + DEFAULT_MINOR_VERSION) < 0) { + smb_panic("init_globals: ENOMEM"); + } string_set(&Globals.szAnnounceVersion, s); + SAFE_FREE(s); #ifdef DEVELOPER string_set(&Globals.szPanicAction, "/bin/sleep 999999999"); #endif @@ -1693,11 +1699,13 @@ static void init_globals(bool first_time_only) Globals.bEnablePrivileges = True; Globals.bHostMSDfs = True; Globals.bASUSupport = False; - + /* User defined shares. */ - pstrcpy(s, dyn_STATEDIR()); - pstrcat(s, "/usershares"); + if (asprintf(&s, "%s/usershares", dyn_STATEDIR()) < 0) { + smb_panic("init_globals: ENOMEM"); + } string_set(&Globals.szUsersharePath, s); + SAFE_FREE(s); string_set(&Globals.szUsershareTemplateShare, ""); Globals.iUsershareMaxShares = 0; /* By default disallow sharing of directories not owned by the sharer. */ @@ -2649,15 +2657,14 @@ static bool hash_a_service(const char *name, int idx) } /*************************************************************************** - Add a new home service, with the specified home directory, defaults coming + Add a new home service, with the specified home directory, defaults coming from service ifrom. ***************************************************************************/ -bool lp_add_home(const char *pszHomename, int iDefaultService, +bool lp_add_home(const char *pszHomename, int iDefaultService, const char *user, const char *pszHomedir) { int i; - pstring newHomedir; i = add_a_service(ServicePtrs[iDefaultService], pszHomename); @@ -2666,15 +2673,16 @@ bool lp_add_home(const char *pszHomename, int iDefaultService, if (!(*(ServicePtrs[iDefaultService]->szPath)) || strequal(ServicePtrs[iDefaultService]->szPath, lp_pathname(GLOBAL_SECTION_SNUM))) { - pstrcpy(newHomedir, pszHomedir); - string_set(&ServicePtrs[i]->szPath, newHomedir); - } + string_set(&ServicePtrs[i]->szPath, pszHomedir); + } if (!(*(ServicePtrs[i]->comment))) { - pstring comment; - slprintf(comment, sizeof(comment) - 1, - "Home directory of %s", user); + char *comment = NULL; + if (asprintf(&comment, "Home directory of %s", user) < 0) { + return false; + } string_set(&ServicePtrs[i]->comment, comment); + SAFE_FREE(comment); } /* set the browseable flag from the global default */ @@ -2685,7 +2693,7 @@ bool lp_add_home(const char *pszHomename, int iDefaultService, DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, user, ServicePtrs[i]->szPath )); - + return (True); } @@ -2708,14 +2716,16 @@ int lp_add_service(const char *pszService, int iDefaultService) static bool lp_add_ipc(const char *ipc_name, bool guest_ok) { - pstring comment; + char *comment = NULL; int i = add_a_service(&sDefault, ipc_name); if (i < 0) return (False); - slprintf(comment, sizeof(comment) - 1, - "IPC Service (%s)", Globals.szServerString); + if (asprintf(&comment, "IPC Service (%s)", + Globals.szServerString) < 0) { + return (False); + } string_set(&ServicePtrs[i]->szPath, tmpdir()); string_set(&ServicePtrs[i]->szUsername, ""); @@ -2731,6 +2741,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok) DEBUG(3, ("adding IPC service\n")); + SAFE_FREE(comment); return (True); } @@ -3391,7 +3402,6 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) uint32 size; uint32 num_values = 0; uint8 *data_p; - pstring valname; char * valstr; struct registry_value *value = NULL; @@ -3408,7 +3418,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) /* reg_tdb is from now on used as talloc ctx. * freeing it closes the tdb (if refcount is 0) */ - keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", REG_VALUE_PREFIX, + keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", REG_VALUE_PREFIX, KEY_SMBCONF, GLOBAL_NAME); normalize_dbkey(keystr); @@ -3431,6 +3441,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) /* unpack the values */ for (i=0; i < num_values; i++) { + fstring valname; type = REG_NONE; size = 0; data_p = NULL; @@ -3447,7 +3458,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) DEBUG(10, ("process_registry_globals: got value '%s'\n", valname)); if (size && data_p) { - err = registry_pull_value(reg_tdb, + err = registry_pull_value(reg_tdb, &value, type, data_p, @@ -3459,7 +3470,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) } switch(type) { case REG_DWORD: - valstr = talloc_asprintf(reg_tdb, "%d", + valstr = talloc_asprintf(reg_tdb, "%d", value->v.dword); pfunc(valname, valstr); break; @@ -3624,19 +3635,20 @@ bool lp_file_list_changed(void) DEBUGADD(6, ("regdb seqnum changed: old = %d, new = %d\n", regdb_last_seqnum, tdb_get_seqnum(reg_tdb->tdb))); TALLOC_FREE(reg_tdb); - return True; + return true; } } while (f) { - pstring n2; + char *n2 = NULL; time_t mod_time; - pstrcpy(n2, f->name); - standard_sub_basic( get_current_username(), + n2 = alloc_sub_basic(get_current_username(), current_user_info.domain, - n2, sizeof(n2) ); - + f->name); + if (!n2) { + return false; + } DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", f->name, n2, ctime(&f->modtime))); @@ -3648,9 +3660,12 @@ bool lp_file_list_changed(void) ctime(&mod_time))); f->modtime = mod_time; SAFE_FREE(f->subfname); - f->subfname = SMB_STRDUP(n2); - return (True); + f->subfname = n2; /* Passing ownership of + return from alloc_sub_basic + above. */ + return true; } + SAFE_FREE(n2); f = f->next; } return (False); @@ -3665,16 +3680,14 @@ bool lp_file_list_changed(void) static bool handle_netbios_name(int snum, const char *pszParmValue, char **ptr) { bool ret; - pstring netbios_name; - - pstrcpy(netbios_name, pszParmValue); - - standard_sub_basic(get_current_username(), current_user_info.domain, - netbios_name, sizeof(netbios_name)); + char *netbios_name = alloc_sub_basic(get_current_username(), + current_user_info.domain, + pszParmValue); ret = set_global_myname(netbios_name); + SAFE_FREE(netbios_name); string_set(&Globals.szNetbiosName,global_myname()); - + DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n", global_myname())); @@ -3725,33 +3738,36 @@ static bool handle_netbios_aliases(int snum, const char *pszParmValue, char **pt static bool handle_include(int snum, const char *pszParmValue, char **ptr) { - pstring fname; - pstrcpy(fname, pszParmValue); + char *fname; - if (strequal(fname, INCLUDE_REGISTRY_NAME)) { + if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { if (bInGlobalSection) { return process_registry_globals(do_parameter); } else { DEBUG(1, ("\"include = registry\" only effective " "in %s section\n", GLOBAL_NAME)); - return False; + return false; } } - standard_sub_basic(get_current_username(), current_user_info.domain, - fname,sizeof(fname)); + fname = alloc_sub_basic(get_current_username(), + current_user_info.domain, + pszParmValue); add_to_file_list(pszParmValue, fname); string_set(ptr, fname); - if (file_exist(fname, NULL)) - return (pm_process(fname, do_section, do_parameter)); + if (file_exist(fname, NULL)) { + bool ret = pm_process(fname, do_section, do_parameter); + SAFE_FREE(fname); + return ret; + } DEBUG(2, ("Can't find include file %s\n", fname)); - - return (False); + SAFE_FREE(fname); + return false; } /*************************************************************************** @@ -3879,11 +3895,8 @@ static bool handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) static bool handle_debug_list( int snum, const char *pszParmValueIn, char **ptr ) { - pstring pszParmValue; - - pstrcpy(pszParmValue, pszParmValueIn); string_set(ptr, pszParmValueIn); - return debug_parse_levels( pszParmValue ); + return debug_parse_levels(pszParmValueIn); } /*************************************************************************** @@ -4018,7 +4031,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue int parmnum, i, slen; void *parm_ptr = NULL; /* where we are going to store the result */ void *def_ptr = NULL; - pstring param_key; + char *param_key = NULL; char *sep; param_opt_struct *paramo, *data; bool not_added; @@ -4027,14 +4040,23 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue if (parmnum < 0) { if ((sep=strchr(pszParmName, ':')) != NULL) { + TALLOC_CTX *frame = talloc_stackframe(); + *sep = '\0'; - ZERO_STRUCT(param_key); - pstr_sprintf(param_key, "%s:", pszParmName); + param_key = talloc_asprintf(frame, "%s:", pszParmName); + if (!param_key) { + TALLOC_FREE(frame); + return false; + } slen = strlen(param_key); - pstrcat(param_key, sep+1); + param_key = talloc_asprintf_append(param_key, sep+1); + if (!param_key) { + TALLOC_FREE(frame); + return false; + } trim_char(param_key+slen, ' ', ' '); not_added = True; - data = (snum < 0) ? Globals.param_opt : + data = (snum < 0) ? Globals.param_opt : ServicePtrs[snum]->param_opt; /* Traverse destination */ while (data) { @@ -4061,6 +4083,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue } *sep = ':'; + TALLOC_FREE(frame); return (True); } DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); @@ -4955,14 +4978,14 @@ static bool check_usershare_stat(const char *fname, SMB_STRUCT_STAT *psbuf) Parse the contents of a usershare file. ***************************************************************************/ -enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, +enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, SMB_STRUCT_STAT *psbuf, const char *servicename, int snum, char **lines, int numlines, - pstring sharepath, - pstring comment, + char **pp_sharepath, + char **pp_comment, SEC_DESC **ppsd, bool *pallow_guest) { @@ -4971,6 +4994,11 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, int us_vers; SMB_STRUCT_DIR *dp; SMB_STRUCT_STAT sbuf; + char *sharepath = NULL; + char *comment = NULL; + + *pp_sharepath = NULL; + *pp_comment = NULL; *pallow_guest = False; @@ -4993,14 +5021,20 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, return USERSHARE_MALFORMED_PATH; } - pstrcpy(sharepath, &lines[1][5]); + sharepath = talloc_strdup(ctx, &lines[1][5]); + if (!sharepath) { + return USERSHARE_POSIX_ERR; + } trim_string(sharepath, " ", " "); if (strncmp(lines[2], "comment=", 8) != 0) { return USERSHARE_MALFORMED_COMMENT_DEF; } - pstrcpy(comment, &lines[2][8]); + comment = talloc_strdup(ctx, &lines[2][8]); + if (!comment) { + return USERSHARE_POSIX_ERR; + } trim_string(comment, " ", " "); trim_char(comment, '"', '"'); @@ -5023,6 +5057,8 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, if (snum != -1 && (strcmp(sharepath, ServicePtrs[snum]->szPath) == 0)) { /* Path didn't change, no checks needed. */ + *pp_sharepath = sharepath; + *pp_comment = comment; return USERSHARE_OK; } @@ -5107,6 +5143,8 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, } } + *pp_sharepath = sharepath; + *pp_comment = comment; return USERSHARE_OK; } @@ -5123,9 +5161,9 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i { SMB_STRUCT_STAT sbuf; SMB_STRUCT_STAT lsbuf; - pstring fname; - pstring sharepath; - pstring comment; + char *fname = NULL; + char *sharepath = NULL; + char *comment = NULL; fstring service_name; char **lines = NULL; int numlines = 0; @@ -5145,9 +5183,8 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i fstrcpy(service_name, file_name); - pstrcpy(fname, dir_name); - pstrcat(fname, "/"); - pstrcat(fname, file_name); + if (asprintf(&fname, "%s/%s", dir_name, file_name) < 0) { + } /* Minimize the race condition by doing an lstat before we open and fstat. Ensure this isn't a symlink link. */ @@ -5155,12 +5192,14 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i if (sys_lstat(fname, &lsbuf) != 0) { DEBUG(0,("process_usershare_file: stat of %s failed. %s\n", fname, strerror(errno) )); + SAFE_FREE(fname); return -1; } /* This must be a regular file, not a symlink, directory or other strange filetype. */ if (!check_usershare_stat(fname, &lsbuf)) { + SAFE_FREE(fname); return -1; } @@ -5173,6 +5212,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i DEBUG(10,("process_usershare_file: service %s not changed.\n", service_name )); ServicePtrs[iService]->usershare = USERSHARE_VALID; + SAFE_FREE(fname); return iService; } @@ -5186,6 +5226,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i if (fd == -1) { DEBUG(0,("process_usershare_file: unable to open %s. %s\n", fname, strerror(errno) )); + SAFE_FREE(fname); return -1; } @@ -5194,6 +5235,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i close(fd); DEBUG(0,("process_usershare_file: fstat of %s failed. %s\n", fname, strerror(errno) )); + SAFE_FREE(fname); return -1; } @@ -5202,12 +5244,14 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i close(fd); DEBUG(0,("process_usershare_file: fstat of %s is a different file from lstat. " "Symlink spoofing going on ?\n", fname )); + SAFE_FREE(fname); return -1; } /* This must be a regular file, not a symlink, directory or other strange filetype. */ if (!check_usershare_stat(fname, &sbuf)) { + SAFE_FREE(fname); return -1; } @@ -5217,9 +5261,12 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i if (lines == NULL) { DEBUG(0,("process_usershare_file: loading file %s owned by %u failed.\n", fname, (unsigned int)sbuf.st_uid )); + SAFE_FREE(fname); return -1; } + SAFE_FREE(fname); + /* Should we allow printers to be shared... ? */ ctx = talloc_init("usershare_sd_xctx"); if (!ctx) { @@ -5228,8 +5275,8 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i } if (parse_usershare_file(ctx, &sbuf, service_name, - iService, lines, numlines, sharepath, - comment, &psd, &guest_ok) != USERSHARE_OK) { + iService, lines, numlines, &sharepath, + &comment, &psd, &guest_ok) != USERSHARE_OK) { talloc_destroy(ctx); file_lines_free(lines); return -1; @@ -5265,8 +5312,6 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i return -1; } - talloc_destroy(ctx); - /* If from a template it may be marked invalid. */ ServicePtrs[iService]->valid = True; @@ -5283,6 +5328,8 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i string_set(&ServicePtrs[iService]->szPath, sharepath); string_set(&ServicePtrs[iService]->comment, comment); + talloc_destroy(ctx); + return iService; } @@ -5294,22 +5341,27 @@ static bool usershare_exists(int iService, time_t *last_mod) { SMB_STRUCT_STAT lsbuf; const char *usersharepath = Globals.szUsersharePath; - pstring fname; + char *fname; - pstrcpy(fname, usersharepath); - pstrcat(fname, "/"); - pstrcat(fname, ServicePtrs[iService]->szService); + if (asprintf(&fname, "%s/%s", + usersharepath, + ServicePtrs[iService]->szService) < 0) { + return false; + } if (sys_lstat(fname, &lsbuf) != 0) { - return False; + SAFE_FREE(fname); + return false; } if (!S_ISREG(lsbuf.st_mode)) { - return False; + SAFE_FREE(fname); + return false; } + SAFE_FREE(fname); *last_mod = lsbuf.st_mtime; - return True; + return true; } /*************************************************************************** @@ -5596,21 +5648,23 @@ bool lp_load(const char *pszFname, bool add_ipc, bool initialize_globals) { - pstring n2; + char *n2 = NULL; bool bRetval; param_opt_struct *data, *pdata; - pstrcpy(n2, pszFname); - - standard_sub_basic( get_current_username(), current_user_info.domain, - n2,sizeof(n2) ); + n2 = alloc_sub_basic(get_current_username(), + current_user_info.domain, + pszFname); + if (!n2) { + smb_panic("lp_load: out of memory"); + } add_to_file_list(pszFname, n2); bRetval = False; DEBUG(3, ("lp_load: refreshing parameters\n")); - + bInGlobalSection = True; bGlobalOnly = global_only; @@ -5634,16 +5688,19 @@ bool lp_load(const char *pszFname, } Globals.param_opt = NULL; } - + /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter); + SAFE_FREE(n2); /* finish up the last section */ DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval))); - if (bRetval) - if (iServiceIndex >= 0) + if (bRetval) { + if (iServiceIndex >= 0) { bRetval = service_ok(iServiceIndex); + } + } lp_add_auto_services(lp_auto_services()); @@ -5651,8 +5708,9 @@ bool lp_load(const char *pszFname, /* When 'restrict anonymous = 2' guest connections to ipc$ are denied */ lp_add_ipc("IPC$", (lp_restrict_anonymous() < 2)); - if ( lp_enable_asu_support() ) - lp_add_ipc("ADMIN$", False); + if ( lp_enable_asu_support() ) { + lp_add_ipc("ADMIN$", false); + } } set_server_role(); -- cgit From 68be9a820059ee96dd26c527efd7c14e679d3f2c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 15 Nov 2007 14:19:52 -0800 Subject: More pstring removal. This one was tricky. I had to add one horror (pstring_clean_name()) which will have to remain until I've removed all pstrings from the client code. Jeremy. (This used to be commit 1ea3ac80146b83c2522b69e7747c823366a2b47d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bc5fe5e8f1..80eac747c6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6151,7 +6151,7 @@ const char *lp_printername(int snum) void lp_set_logfile(const char *name) { string_set(&Globals.szLogFile, name); - pstrcpy(debugf, name); + debug_set_logfile(name); } /******************************************************************* -- cgit From b11e6f21589a00c1803985f202be9cd360944d43 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 Nov 2007 19:12:42 -0800 Subject: Save one extra strdup per lp_string. Use talloc_sub_basic() directly. Jeremy. (This used to be commit f1e401ef5c89ecf12921b7adb228da438521a693) --- source3/param/loadparm.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 80eac747c6..16c6c59c7d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1729,7 +1729,8 @@ static void init_globals(bool first_time_only) static char *lp_string(const char *s) { - char *ret, *tmpstr; + char *ret; + TALLOC_CTX *ctx = talloc_tos(); /* The follow debug is useful for tracking down memory problems especially if you have an inner loop that is calling a lp_*() @@ -1740,19 +1741,20 @@ static char *lp_string(const char *s) DEBUG(10, ("lp_string(%s)\n", s)); #endif - tmpstr = alloc_sub_basic(get_current_username(), - current_user_info.domain, s); - if (trim_char(tmpstr, '\"', '\"')) { - if (strchr(tmpstr,'\"') != NULL) { - SAFE_FREE(tmpstr); - tmpstr = alloc_sub_basic(get_current_username(), - current_user_info.domain, s); + ret = talloc_sub_basic(ctx, + get_current_username(), + current_user_info.domain, + s); + if (trim_char(ret, '\"', '\"')) { + if (strchr(ret,'\"') != NULL) { + TALLOC_FREE(ret); + ret = talloc_sub_basic(ctx, + get_current_username(), + current_user_info.domain, + s); } } - ret = talloc_strdup(talloc_tos(), tmpstr); - SAFE_FREE(tmpstr); - - return (ret); + return ret; } /* -- cgit From 4b9f336a62cd4992956a68c8a17764a3f768b3f1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 30 Nov 2007 18:47:25 +0100 Subject: Move param helper routines to one place. Guenther (This used to be commit 6bf2c8038c4bc7a52b7f260209ade0bdeb95c685) --- source3/param/util.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 source3/param/util.c (limited to 'source3/param') diff --git a/source3/param/util.c b/source3/param/util.c new file mode 100644 index 0000000000..f953484256 --- /dev/null +++ b/source3/param/util.c @@ -0,0 +1,50 @@ +/* + * Unix SMB/CIFS implementation. + * param helper routines + * Copyright (C) Gerald Carter 2003 + * + * 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 3 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, see . + */ + +#include "includes.h" + +/********************************************************* + utility function to parse an integer parameter from + "parameter = value" +**********************************************************/ +uint32 get_int_param( const char* param ) +{ + char *p; + + p = strchr( param, '=' ); + if ( !p ) + return 0; + + return atoi(p+1); +} + +/********************************************************* + utility function to parse an integer parameter from + "parameter = value" +**********************************************************/ +char* get_string_param( const char* param ) +{ + char *p; + + p = strchr( param, '=' ); + if ( !p ) + return NULL; + + return (p+1); +} -- cgit From 78c6ee0090f4122bc25baaacb5546517ad4b7bc6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 24 Nov 2007 17:27:54 +0100 Subject: Remove some globals (This used to be commit 31d0a846db08d845e6cdfd85def4ac1c34031e02) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 16c6c59c7d..dcb9b243f4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4240,9 +4240,12 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) fprintf(f, "%c", *(char *)ptr); break; - case P_OCTAL: - fprintf(f, "%s", octal_string(*(int *)ptr)); + case P_OCTAL: { + char *o = octal_string(*(int *)ptr); + fprintf(f, "%s", o); + TALLOC_FREE(o); break; + } case P_LIST: if ((char ***)ptr && *(char ***)ptr) { -- cgit From acf15ae730c95443681404c76b67ccfca0253d8b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Dec 2007 12:26:32 -0800 Subject: Don't build rpctorture anymore - not maintained. Just remove. Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy (This used to be commit 4c32a22ac50ada3275d2ffba3c1aa08bee7d1549) --- source3/param/loadparm.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index dcb9b243f4..89b1299a5d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2999,9 +2999,15 @@ static void show_parameter(int parmIndex) bool hadFlag; bool hadSyn; bool inverse; +#if 0 const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", "P_UGSTRING", "P_ENUM", "P_SEP"}; +#else + const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", + "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", + "P_ENUM", "P_SEP"}; +#endif unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, FLAG_HIDE, FLAG_DOS_STRING}; @@ -4171,6 +4177,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue strupper_m(*(char **)parm_ptr); break; +#if 0 case P_GSTRING: pstrcpy((char *)parm_ptr, pszParmValue); break; @@ -4179,6 +4186,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue pstrcpy((char *)parm_ptr, pszParmValue); strupper_m((char *)parm_ptr); break; +#endif case P_ENUM: lp_set_enum_parm( &parm_table[parmnum], pszParmValue, (int*)parm_ptr ); @@ -4250,7 +4258,6 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) case P_LIST: if ((char ***)ptr && *(char ***)ptr) { char **list = *(char ***)ptr; - for (; *list; list++) { /* surround strings with whitespace in double quotes */ if ( strchr_m( *list, ' ' ) ) @@ -4261,12 +4268,14 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) } break; +#if 0 case P_GSTRING: case P_UGSTRING: if ((char *)ptr) { fprintf(f, "%s", (char *)ptr); } break; +#endif case P_STRING: case P_USTRING: @@ -4297,10 +4306,11 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_CHAR: return (*((char *)ptr1) == *((char *)ptr2)); - + case P_LIST: return str_list_compare(*(char ***)ptr1, *(char ***)ptr2); +#if 0 case P_GSTRING: case P_UGSTRING: { @@ -4311,6 +4321,7 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2) p2 = NULL; return (p1 == p2 || strequal(p1, p2)); } +#endif case P_STRING: case P_USTRING: { @@ -4404,10 +4415,12 @@ static bool is_default(int i) case P_USTRING: return strequal(parm_table[i].def.svalue, *(char **)parm_table[i].ptr); +#if 0 case P_GSTRING: case P_UGSTRING: return strequal(parm_table[i].def.svalue, (char *)parm_table[i].ptr); +#endif case P_BOOL: case P_BOOLREV: return parm_table[i].def.bvalue == @@ -4814,6 +4827,7 @@ static void lp_save_defaults(void) parm_table[i].def.svalue = NULL; } break; +#if 0 case P_GSTRING: case P_UGSTRING: if (parm_table[i].ptr) { @@ -4822,6 +4836,8 @@ static void lp_save_defaults(void) parm_table[i].def.svalue = NULL; } break; +#endif + case P_BOOL: case P_BOOLREV: parm_table[i].def.bvalue = -- cgit From ade51769d5f7291f912893e5f959b651223a68c1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Dec 2007 12:43:10 -0800 Subject: We don't need P_GSTRING or P_UGSTRING anymore. Jeremy. (This used to be commit 78dc75600099b5b3b5a8ecffec747a227ff51d70) --- source3/param/loadparm.c | 55 ------------------------------------------------ 1 file changed, 55 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 89b1299a5d..529f4bfb3b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2999,15 +2999,9 @@ static void show_parameter(int parmIndex) bool hadFlag; bool hadSyn; bool inverse; -#if 0 - const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", - "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_GSTRING", - "P_UGSTRING", "P_ENUM", "P_SEP"}; -#else const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER", "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING", "P_ENUM", "P_SEP"}; -#endif unsigned flags[] = { FLAG_BASIC, FLAG_SHARE, FLAG_PRINT, FLAG_GLOBAL, FLAG_WIZARD, FLAG_ADVANCED, FLAG_DEVELOPER, FLAG_DEPRECATED, FLAG_HIDE, FLAG_DOS_STRING}; @@ -4177,17 +4171,6 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue strupper_m(*(char **)parm_ptr); break; -#if 0 - case P_GSTRING: - pstrcpy((char *)parm_ptr, pszParmValue); - break; - - case P_UGSTRING: - pstrcpy((char *)parm_ptr, pszParmValue); - strupper_m((char *)parm_ptr); - break; -#endif - case P_ENUM: lp_set_enum_parm( &parm_table[parmnum], pszParmValue, (int*)parm_ptr ); break; @@ -4268,15 +4251,6 @@ static void print_parameter(struct parm_struct *p, void *ptr, FILE * f) } break; -#if 0 - case P_GSTRING: - case P_UGSTRING: - if ((char *)ptr) { - fprintf(f, "%s", (char *)ptr); - } - break; -#endif - case P_STRING: case P_USTRING: if (*(char **)ptr) { @@ -4310,18 +4284,6 @@ static bool equal_parameter(parm_type type, void *ptr1, void *ptr2) case P_LIST: return str_list_compare(*(char ***)ptr1, *(char ***)ptr2); -#if 0 - case P_GSTRING: - case P_UGSTRING: - { - char *p1 = (char *)ptr1, *p2 = (char *)ptr2; - if (p1 && !*p1) - p1 = NULL; - if (p2 && !*p2) - p2 = NULL; - return (p1 == p2 || strequal(p1, p2)); - } -#endif case P_STRING: case P_USTRING: { @@ -4415,12 +4377,6 @@ static bool is_default(int i) case P_USTRING: return strequal(parm_table[i].def.svalue, *(char **)parm_table[i].ptr); -#if 0 - case P_GSTRING: - case P_UGSTRING: - return strequal(parm_table[i].def.svalue, - (char *)parm_table[i].ptr); -#endif case P_BOOL: case P_BOOLREV: return parm_table[i].def.bvalue == @@ -4827,17 +4783,6 @@ static void lp_save_defaults(void) parm_table[i].def.svalue = NULL; } break; -#if 0 - case P_GSTRING: - case P_UGSTRING: - if (parm_table[i].ptr) { - parm_table[i].def.svalue = SMB_STRDUP((char *)parm_table[i].ptr); - } else { - parm_table[i].def.svalue = NULL; - } - break; -#endif - case P_BOOL: case P_BOOLREV: parm_table[i].def.bvalue = -- cgit From 307396435b3159a268834b3c11c812b3213b74fd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 24 Nov 2007 19:56:41 +0100 Subject: Convert ServiceHash to dbwrap (This used to be commit 66bd6837b593a7127bd5098afc990d3fb7a5a35a) --- source3/param/loadparm.c | 73 +++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 529f4bfb3b..cb19fda741 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -627,7 +627,7 @@ static service sDefault = { static service **ServicePtrs = NULL; static int iNumServices = 0; static int iServiceIndex = 0; -static TDB_CONTEXT *ServiceHash; +static struct db_context *ServiceHash; static int *invalid_services = NULL; static int num_invalid_services = 0; static bool bInGlobalSection = True; @@ -2514,9 +2514,11 @@ static void free_service_byindex(int idx) /* we have to cleanup the hash record */ if (ServicePtrs[idx]->szService) { - char *canon_name = canonicalize_servicename( ServicePtrs[idx]->szService ); + char *canon_name = canonicalize_servicename( + ServicePtrs[idx]->szService ); - tdb_delete_bystring(ServiceHash, canon_name ); + dbwrap_delete_bystring(ServiceHash, canon_name ); + TALLOC_FREE(canon_name); } free_service(ServicePtrs[idx]); @@ -2616,17 +2618,18 @@ static int add_a_service(const service *pservice, const char *name) static char *canonicalize_servicename(const char *src) { - static fstring canon; /* is fstring large enough? */ + char *result; if ( !src ) { DEBUG(0,("canonicalize_servicename: NULL source name!\n")); return NULL; } - fstrcpy( canon, src ); - strlower_m( canon ); + result = talloc_strdup(talloc_tos(), src); + SMB_ASSERT(result != NULL); - return canon; + strlower_m(result); + return result; } /*************************************************************************** @@ -2639,8 +2642,9 @@ static bool hash_a_service(const char *name, int idx) if ( !ServiceHash ) { DEBUG(10,("hash_a_service: creating tdb servicehash\n")); - ServiceHash = tdb_open("servicehash", 1031, TDB_INTERNAL, - (O_RDWR|O_CREAT), 0600); + ServiceHash = db_open_tdb(NULL, "servicehash", 1031, + TDB_INTERNAL, (O_RDWR|O_CREAT), + 0600); if ( !ServiceHash ) { DEBUG(0,("hash_a_service: open tdb servicehash failed!\n")); return False; @@ -2650,10 +2654,13 @@ static bool hash_a_service(const char *name, int idx) DEBUG(10,("hash_a_service: hashing index %d for service name %s\n", idx, name)); - if ( !(canon_name = canonicalize_servicename( name )) ) - return False; + canon_name = canonicalize_servicename( name ); + + dbwrap_store_bystring(ServiceHash, canon_name, + make_tdb_data((uint8 *)&idx, sizeof(idx)), + TDB_REPLACE); - tdb_store_int32(ServiceHash, canon_name, idx); + TALLOC_FREE(canon_name); return True; } @@ -3177,20 +3184,25 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) { int iService = -1; char *canon_name; + TDB_DATA data; - if (ServiceHash != NULL) { - if ( !(canon_name = canonicalize_servicename( pszServiceName )) ) - return -1; + if (ServiceHash == NULL) { + return -1; + } - iService = tdb_fetch_int32(ServiceHash, canon_name ); + canon_name = canonicalize_servicename(pszServiceName); - if (LP_SNUM_OK(iService)) { - if (pserviceDest != NULL) { - copy_service(pserviceDest, ServicePtrs[iService], NULL); - } - } else { - iService = -1; - } + data = dbwrap_fetch_bystring(ServiceHash, canon_name, canon_name); + + if ((data.dptr != NULL) && (data.dsize == sizeof(iService))) { + iService = *(int *)data.dptr; + } + + TALLOC_FREE(canon_name); + + if ((iService != -1) && (LP_SNUM_OK(iService)) + && (pserviceDest != NULL)) { + copy_service(pserviceDest, ServicePtrs[iService], NULL); } return (iService); @@ -5169,9 +5181,18 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i return -1; } - /* See if there is already a servicenum for this name. */ - /* tdb_fetch_int32 returns -1 if not found. */ - iService = (int)tdb_fetch_int32(ServiceHash, canonicalize_servicename(service_name) ); + { + char *canon_name = canonicalize_servicename(service_name); + TDB_DATA data = dbwrap_fetch_bystring( + ServiceHash, canon_name, canon_name); + + iService = -1; + + if ((data.dptr != NULL) && (data.dsize == sizeof(iService))) { + iService = *(int *)data.dptr; + } + TALLOC_FREE(canon_name); + } if (iService != -1 && ServicePtrs[iService]->usershare_last_mod == lsbuf.st_mtime) { /* Nothing changed - Mark valid and return. */ -- cgit From 0c0054fe1615a504d103da94149d1c1729abb8e2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 24 Nov 2007 21:42:46 +0100 Subject: use dbwrap_rbt in loadparm.c (This used to be commit e81629339589e2e7f464b3dca55730ff2d0877e4) --- source3/param/loadparm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cb19fda741..608acb12e7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2641,10 +2641,8 @@ static bool hash_a_service(const char *name, int idx) char *canon_name; if ( !ServiceHash ) { - DEBUG(10,("hash_a_service: creating tdb servicehash\n")); - ServiceHash = db_open_tdb(NULL, "servicehash", 1031, - TDB_INTERNAL, (O_RDWR|O_CREAT), - 0600); + DEBUG(10,("hash_a_service: creating servicehash\n")); + ServiceHash = db_open_rbt(NULL); if ( !ServiceHash ) { DEBUG(0,("hash_a_service: open tdb servicehash failed!\n")); return False; -- cgit From 7faee02d0d351c5c039e8f1be7e82ce3a93cbe96 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Dec 2007 11:30:37 -0800 Subject: Remove the char[1024] strings from dynconfig. Replace them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 608acb12e7..e676edf37c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1456,8 +1456,8 @@ static void init_globals(bool first_time_only) DEBUG(3, ("Initialising global parameters\n")); - string_set(&Globals.szSMBPasswdFile, dyn_SMB_PASSWD_FILE); - string_set(&Globals.szPrivateDir, dyn_PRIVATE_DIR); + string_set(&Globals.szSMBPasswdFile, get_dyn_SMB_PASSWD_FILE()); + string_set(&Globals.szPrivateDir, get_dyn_PRIVATE_DIR()); /* use the new 'hash2' method by default, with a prefix of 1 */ string_set(&Globals.szManglingMethod, "hash2"); @@ -1491,8 +1491,8 @@ static void init_globals(bool first_time_only) string_set(&Globals.szWorkgroup, lp_workgroup()); string_set(&Globals.szPasswdProgram, ""); - string_set(&Globals.szPidDir, dyn_PIDDIR); - string_set(&Globals.szLockDir, dyn_LOCKDIR); + string_set(&Globals.szPidDir, get_dyn_PIDDIR()); + string_set(&Globals.szLockDir, get_dyn_LOCKDIR()); string_set(&Globals.szSocketAddress, "0.0.0.0"); if (asprintf(&s, "Samba %s", SAMBA_VERSION_STRING) < 0) { @@ -1701,7 +1701,7 @@ static void init_globals(bool first_time_only) Globals.bASUSupport = False; /* User defined shares. */ - if (asprintf(&s, "%s/usershares", dyn_STATEDIR()) < 0) { + if (asprintf(&s, "%s/usershares", get_dyn_STATEDIR()) < 0) { smb_panic("init_globals: ENOMEM"); } string_set(&Globals.szUsersharePath, s); -- cgit From ff1a79f24bd0dcc69f7f38b13d6780255174a2b6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 9 Dec 2007 17:40:48 +0100 Subject: Remove two completely unnecessary globals Can someone look over this? To me it looks as if bufr was only made static to save a malloc during an included smb.conf file. I think that's pretty much pointless. (This used to be commit 068e8de72ceb49ef2e02cca1913b6d2197bab5e0) --- source3/param/params.c | 112 ++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 61 deletions(-) (limited to 'source3/param') diff --git a/source3/param/params.c b/source3/param/params.c index 24bef0a506..44b44d99b6 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -99,9 +99,6 @@ extern bool in_client; * bSize - The size of the global buffer . */ -static char *bufr = NULL; -static int bSize = 0; - /* we can't use FILE* due to the 256 fd limit - use this cheap hack instead */ typedef struct { @@ -212,7 +209,7 @@ static int EatComment( myFILE *InFile ) * *****************************************************************************/ -static int Continuation(char *line, int pos ) +static int Continuation(uint8_t *line, int pos ) { pos--; while( (pos >= 0) && isspace((int)line[pos])) @@ -235,7 +232,7 @@ static int Continuation(char *line, int pos ) * ------------------------------------------------------------------------ ** */ -static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) +static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *) ) { int c; int i; @@ -260,37 +257,37 @@ static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) while( (EOF != c) && (c > 0) ) { /* Check that the buffer is big enough for the next character. */ - if( i > (bSize - 2) ) { - char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize +BUFR_INC ); + if( i > (buf->length - 2) ) { + uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR(buf->data, buf->length+BUFR_INC ); if(!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; } - bufr = tb; - bSize += BUFR_INC; + buf->data = tb; + buf->length += BUFR_INC; } /* Handle a single character other than section end. */ switch( c ) { case '\n': /* Got newline before closing ']'. */ - i = Continuation( bufr, i ); /* Check for line continuation. */ + i = Continuation( buf->data, i ); /* Check for line continuation. */ if( i < 0 ) { - bufr[end] = '\0'; - DEBUG(0, ("%s Badly formed line in configuration file: %s\n", func, bufr )); + buf->data[end] = '\0'; + DEBUG(0, ("%s Badly formed line in configuration file: %s\n", func, buf->data )); return False; } - end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + end = ( (i > 0) && (' ' == buf->data[i - 1]) ) ? (i - 1) : (i); c = mygetc( InFile ); /* Continue with next line. */ break; default: /* All else are a valid name chars. */ if(isspace( c )) { /* One space per whitespace region. */ - bufr[end] = ' '; + buf->data[end] = ' '; i = end + 1; c = EatWhitespace( InFile ); } else { - bufr[i++] = c; + buf->data[i++] = c; end = i; c = mygetc( InFile ); } @@ -298,13 +295,13 @@ static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) if (AtSectionEnd(InFile)) { /* Got to the closing bracket. */ - bufr[end] = '\0'; + buf->data[end] = '\0'; if( 0 == end ) { /* Don't allow an empty name. */ DEBUG(0, ("%s Empty section name in configuration file.\n", func )); return False; } - if( !sfunc(bufr) ) /* Got a valid name. Deal with it. */ + if( !sfunc((char *)buf->data) ) /* Got a valid name. Deal with it. */ return False; EatComment( InFile ); /* Finish off the line. */ return True; @@ -313,7 +310,7 @@ static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) } /* We arrive here if we've met the EOF before the closing bracket. */ - DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, bufr )); + DEBUG(0, ("%s Unexpected EOF in the configuration file: %s\n", func, buf->data )); return False; } @@ -341,7 +338,7 @@ static bool Section( myFILE *InFile, bool (*sfunc)(const char *) ) * ------------------------------------------------------------------------ ** */ -static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *), int c ) +static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char *, const char *), int c ) { int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ @@ -351,15 +348,15 @@ static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *) /* Read the parameter name. */ while( 0 == vstart ) { /* Loop until we've found the start of the value. */ - if( i > (bSize - 2) ) { + if( i > (buf->length - 2) ) { /* Ensure there's space for next char. */ - char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC ); + uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR( buf->data, buf->length + BUFR_INC ); if (!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return False; } - bufr = tb; - bSize += BUFR_INC; + buf->data = tb; + buf->length += BUFR_INC; } switch(c) { @@ -369,37 +366,37 @@ static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *) DEBUG(0, ("%s Invalid parameter name in config. file.\n", func )); return False; } - bufr[end++] = '\0'; /* Mark end of string & advance. */ + buf->data[end++] = '\0'; /* Mark end of string & advance. */ i = end; /* New string starts here. */ vstart = end; /* New string is parameter value. */ - bufr[i] = '\0'; /* New string is nul, for now. */ + buf->data[i] = '\0'; /* New string is nul, for now. */ break; case '\n': /* Find continuation char, else error. */ - i = Continuation( bufr, i ); + i = Continuation( buf->data, i ); if( i < 0 ) { - bufr[end] = '\0'; - DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", func, bufr )); + buf->data[end] = '\0'; + DEBUG(1,("%s Ignoring badly formed line in configuration file: %s\n", func, buf->data )); return True; } - end = ( (i > 0) && (' ' == bufr[i - 1]) ) ? (i - 1) : (i); + end = ( (i > 0) && (' ' == buf->data[i - 1]) ) ? (i - 1) : (i); c = mygetc( InFile ); /* Read past eoln. */ break; case '\0': /* Shouldn't have EOF within param name. */ case EOF: - bufr[i] = '\0'; - DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, bufr )); + buf->data[i] = '\0'; + DEBUG(1,("%s Unexpected end-of-file at: %s\n", func, buf->data )); return True; default: if(isspace( c )) { /* One ' ' per whitespace region. */ - bufr[end] = ' '; + buf->data[end] = ' '; i = end + 1; c = EatWhitespace( InFile ); } else { - bufr[i++] = c; + buf->data[i++] = c; end = i; c = mygetc( InFile ); } @@ -409,15 +406,15 @@ static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *) /* Now parse the value. */ c = EatWhitespace( InFile ); /* Again, trim leading whitespace. */ while( (EOF !=c) && (c > 0) ) { - if( i > (bSize - 2) ) { + if( i > (buf->length - 2) ) { /* Make sure there's enough room. */ - char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC ); + uint8_t *tb = (uint8_t *)SMB_REALLOC_KEEP_OLD_ON_ERROR( buf->data, buf->length + BUFR_INC ); if (!tb) { DEBUG(0, ("%s Memory re-allocation failure.", func)); return False; } - bufr = tb; - bSize += BUFR_INC; + buf->data = tb; + buf->length += BUFR_INC; } switch(c) { @@ -426,27 +423,27 @@ static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *) break; /* removes them. */ case '\n': /* Marks end of value unless there's a '\'. */ - i = Continuation( bufr, i ); + i = Continuation( buf->data, i ); if( i < 0 ) { c = 0; } else { - for( end = i; (end >= 0) && isspace((int)bufr[end]); end-- ) + for( end = i; (end >= 0) && isspace((int)buf->data[end]); end-- ) ; c = mygetc( InFile ); } break; default: /* All others verbatim. Note that spaces do not advance . This allows trimming */ - bufr[i++] = c; + buf->data[i++] = c; if( !isspace( c ) ) /* of whitespace at the end of the line. */ end = i; c = mygetc( InFile ); break; } } - bufr[end] = '\0'; /* End of value. */ + buf->data[end] = '\0'; /* End of value. */ - return( pfunc( bufr, &bufr[vstart] ) ); /* Pass name & value to pfunc(). */ + return( pfunc( (char *)buf->data, (char *)&buf->data[vstart] ) ); /* Pass name & value to pfunc(). */ } /* ------------------------------------------------------------------------ ** @@ -471,7 +468,7 @@ static bool Parameter( myFILE *InFile, bool (*pfunc)(const char *, const char *) * ------------------------------------------------------------------------ ** */ -static bool Parse( myFILE *InFile, +static bool Parse( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *), bool (*pfunc)(const char *, const char *) ) { @@ -490,7 +487,7 @@ static bool Parse( myFILE *InFile, break; case '[': /* Section Header. */ - if( !Section( InFile, sfunc ) ) + if( !Section( buf, InFile, sfunc ) ) return False; c = EatWhitespace( InFile ); break; @@ -500,7 +497,7 @@ static bool Parse( myFILE *InFile, break; default: /* Parameter line. */ - if( !Parameter( InFile, pfunc, c ) ) + if( !Parameter( buf, InFile, pfunc, c ) ) return False; c = EatWhitespace( InFile ); break; @@ -563,6 +560,7 @@ bool pm_process( const char *FileName, int result; myFILE *InFile; const char *func = "params.c:pm_process() -"; + DATA_BLOB buf; InFile = OpenConfFile( FileName ); /* Open the config file. */ if( NULL == InFile ) @@ -570,25 +568,17 @@ bool pm_process( const char *FileName, DEBUG( 3, ("%s Processing configuration file \"%s\"\n", func, FileName) ); - if( NULL != bufr ) { - /* If we already have a buffer */ - /* (recursive call), then just */ - /* use it. */ - result = Parse( InFile, sfunc, pfunc ); - } else { - bSize = BUFR_INC; - bufr = (char *)SMB_MALLOC( bSize ); - if( NULL == bufr ) { - DEBUG(0,("%s memory allocation failure.\n", func)); - myfile_close(InFile); - return False; - } + buf = data_blob(NULL, 256); - result = Parse( InFile, sfunc, pfunc ); - SAFE_FREE( bufr ); - bSize = 0; + if (buf.data == NULL) { + DEBUG(0,("%s memory allocation failure.\n", func)); + myfile_close(InFile); + return False; } + result = Parse( &buf, InFile, sfunc, pfunc ); + data_blob_free(&buf); + myfile_close(InFile); if( !result ) { -- cgit From b0614071bf25f24a40b7657205edc0a5d8877b3a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 11 Dec 2007 17:40:52 +0100 Subject: Add lp_include_registry_globals(). Guenther (This used to be commit d30b945e99390761e405492e40c90e84da4fe482) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e676edf37c..881bcece7c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3629,6 +3629,11 @@ static void add_to_file_list(const char *fname, const char *subfname) } } +bool lp_include_registry_globals(void) +{ + return include_registry_globals; +} + /******************************************************************* Check if a config file has changed date. ********************************************************************/ -- cgit From f427d4ce65659419c8989d87acd97d00b4db41e6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 18 Dec 2007 09:41:03 +0100 Subject: Add a in-memory cache This is a more general API that caches data with a LRU scheme. See include/cache.h. No comments yet, I'm still working on it. But Jeremy has given me a hint in one of his checkins that he would like to make use of this now. The idea is that we get rid of all our silly little caches and merge them all into one cache that we can then very easily trim, for example even with a smbcontrol message if someone decides memory is tight. The main user is the stat cache, this patch also converts the getwd cache. More caches to come. (This used to be commit 7a911b35713538d82001a3c9f34152e293fe1943) --- source3/param/loadparm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 881bcece7c..eea3ecec2b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -88,8 +88,6 @@ static bool include_registry_globals = False; #define USERSHARE_VALID 1 #define USERSHARE_PENDING_DELETE 2 -bool use_getwd_cache = True; - extern int extra_time_offset; static bool defaults_saved = False; @@ -215,6 +213,7 @@ typedef struct { int pwordlevel; int unamelevel; int deadtime; + bool getwd_cache; int maxprotocol; int minprotocol; int security; @@ -1037,7 +1036,7 @@ static struct parm_struct parm_table[] = { {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, - {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED}, + {"getwd cache", P_BOOL, P_GLOBAL, &Globals.getwd_cache, NULL, NULL, FLAG_ADVANCED}, {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, {"directory name cache size", P_INTEGER, P_LOCAL, &sDefault.iDirectoryNameCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, @@ -1535,6 +1534,7 @@ static void init_globals(bool first_time_only) Globals.pwordlevel = 0; Globals.unamelevel = 0; Globals.deadtime = 0; + Globals.getwd_cache = true; Globals.bLargeReadwrite = True; Globals.max_log_size = 5000; Globals.max_open_files = MAX_OPEN_FILES; @@ -2023,6 +2023,7 @@ 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_deadtime, &Globals.deadtime) +FN_GLOBAL_BOOL(lp_getwd_cache, &Globals.getwd_cache) FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol) FN_GLOBAL_INTEGER(lp_security, &Globals.security) -- cgit From e518e19bc0000019f131354f55e9f5b55f6a2c5e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 19 Dec 2007 15:02:59 +0100 Subject: Remove Get_Pwnam and its associated static variable All callers are replaced by Get_Pwnam_alloc (This used to be commit 735f59315497113aebadcf9ad387e3dbfffa284a) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index eea3ecec2b..4eb8a1ce65 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4702,13 +4702,17 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) { - char *home = get_user_home_dir(p); + char *home; if (lp_servicenumber(p) >= 0) continue; + home = get_user_home_dir(talloc_tos(), p); + if (home && homes >= 0) lp_add_home(p, homes, p, home); + + TALLOC_FREE(home); } SAFE_FREE(s); } -- cgit From eeb92cedde4bc45603be4fdcf2f53dd2cc29f1d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 20 Dec 2007 21:25:00 +0100 Subject: Fix a C++ warning (This used to be commit c31c7e3e24875ce75bc18f0ad7529320eab8e50a) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4eb8a1ce65..5b009fc964 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3473,7 +3473,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) if (size && data_p) { err = registry_pull_value(reg_tdb, &value, - type, + (enum winreg_Type)type, data_p, size, size); -- cgit From afc93255d183eefb68e45b8ec6275f6a62cf9795 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 26 Dec 2007 17:12:36 -0800 Subject: Add SMB encryption. Still fixing client decrypt but negotiation works. Jeremy. (This used to be commit d78045601af787731f0737b8627450018902b104) --- source3/param/loadparm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5b009fc964..7186d4f075 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6209,7 +6209,7 @@ uint32 lp_get_spoolss_state( void ) } /******************************************************************* - Ensure we don't use sendfile if server smb signing is active. + Ensure we don't use sendfile if server smb signing or selaing is active. ********************************************************************/ bool lp_use_sendfile(int snum) @@ -6218,7 +6218,10 @@ bool lp_use_sendfile(int snum) if (Protocol < PROTOCOL_NT1) { return False; } - return (_lp_use_sendfile(snum) && (get_remote_arch() != RA_WIN95) && !srv_is_signing_active()); + return (_lp_use_sendfile(snum) && + (get_remote_arch() != RA_WIN95) && + !srv_is_signing_active() && + !srv_encryption_on()); } /******************************************************************* -- cgit From 675f41dc144fc0c150b44d931a9242f1ac1ebe5f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Dec 2007 16:54:07 -0800 Subject: Add "smb encrypt" parameter. Can be set to "no, yes, required". Currently if set required this is not enforced. I'll be adding that soon. Jeremy. (This used to be commit df7e447623ac03d81bec384f5cfe83c3976cf7b2) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7186d4f075..16e9372009 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -472,6 +472,7 @@ typedef struct { int iAioWriteSize; int iMap_readonly; int iDirectoryNameCacheSize; + int ismb_encrypt; param_opt_struct *param_opt; char dummy[3]; /* for alignment */ @@ -617,6 +618,7 @@ static service sDefault = { #else 100, /* iDirectoryNameCacheSize */ #endif + Auto, /* ismb_encrypt */ NULL, /* Parametric options */ "" /* dummy */ @@ -1027,6 +1029,7 @@ static struct parm_struct parm_table[] = { {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_ADVANCED}, {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, + {"smb encrypt", P_ENUM, P_LOCAL, &sDefault.ismb_encrypt, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, {"client ldap sasl wrapping", P_ENUM, P_GLOBAL, &Globals.client_ldap_sasl_wrapping, NULL, enum_ldap_sasl_wrapping, FLAG_ADVANCED}, {"enable asu support", P_BOOL, P_GLOBAL, &Globals.bASUSupport, NULL, NULL, FLAG_ADVANCED}, @@ -2173,6 +2176,7 @@ FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly) FN_LOCAL_INTEGER(lp_directory_name_cache_size, iDirectoryNameCacheSize) +FN_LOCAL_INTEGER(lp_smb_encrypt, ismb_encrypt) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) -- cgit From 9254bb4ef1c3c3a52ea8e935edb0e7a86ec3ea7a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Jan 2008 12:56:23 -0800 Subject: Refactor the crypto code after a very helpful conversation with Volker. Mostly making sure we have data on the incoming packet type, not stored in the smb header. Jeremy. (This used to be commit c4e5a505043965eec77b5bb9bc60957e8f3b97c8) --- source3/param/loadparm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 16e9372009..29166cf02e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6213,7 +6213,7 @@ uint32 lp_get_spoolss_state( void ) } /******************************************************************* - Ensure we don't use sendfile if server smb signing or selaing is active. + Ensure we don't use sendfile if server smb signing is active. ********************************************************************/ bool lp_use_sendfile(int snum) @@ -6224,8 +6224,7 @@ bool lp_use_sendfile(int snum) } return (_lp_use_sendfile(snum) && (get_remote_arch() != RA_WIN95) && - !srv_is_signing_active() && - !srv_encryption_on()); + !srv_is_signing_active()); } /******************************************************************* -- cgit From 3ff1fc3932a019abfb1fd475d68477c16379b10d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Jan 2008 15:21:08 +0100 Subject: Extend a comment. Michael (This used to be commit 081435250709af734ec1e49e2539b091f2d92dfb) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 29166cf02e..358fabfb2a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3514,7 +3514,9 @@ done: /* * this is process_registry_globals as it _should_ be (roughly) * using the reg_api functions... - * + * + * We are *not* currently doing it like this due to the large + * linker dependecies of the registry code (see above). */ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) { -- cgit From 22068a0c167b27cf1d74a32ac516df25dce0f70a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 9 Jan 2008 01:17:13 +0100 Subject: Change registry_create_admin_token() to return NTSTATUS. Michael (This used to be commit 9cd30fb25c42e79946b5140994d0bf2ef4c62f90) --- source3/param/loadparm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 358fabfb2a..9700cd1320 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3529,7 +3529,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) char *valname = NULL; char *valstr = NULL; uint32 idx = 0; - NT_USER_TOKEN *token; + NT_USER_TOKEN *token = NULL; ctx = talloc_init("process_registry_globals"); if (!ctx) { @@ -3543,8 +3543,9 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) goto done; } - if (!(token = registry_create_admin_token(ctx))) { - DEBUG(1, ("Error creating admin token\n")); + werr = ntstatus_to_werror(registry_create_admin_token(ctx, &token)); + if (!W_ERROR_IS_OK(werr)) { + DEBUG(1, ("Error creating admin token: %s\n",dos_errstr(werr))); goto done; } -- cgit From 059be4dda06b51d04ed33c752d688ce46018fbdd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Jan 2008 10:17:05 +0100 Subject: Reduce stat cache size default Now that we have a LRU scheme for the stat cache we can live with a lot less (This used to be commit 9e736aab07b91744d4c14a55f6f7c55f51dd80f6) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9700cd1320..eaf19b746a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1588,7 +1588,7 @@ static void init_globals(bool first_time_only) Globals.bNTPipeSupport = True; /* Do NT pipes by default. */ Globals.bNTStatusSupport = True; /* Use NT status by default. */ Globals.bStatCache = True; /* use stat cache by default */ - Globals.iMaxStatCacheSize = 1024; /* one Meg by default. */ + Globals.iMaxStatCacheSize = 256; /* 256k by default */ Globals.restrict_anonymous = 0; Globals.bClientLanManAuth = False; /* Do NOT use the LanMan hash if it is available */ Globals.bClientPlaintextAuth = False; /* Do NOT use a plaintext password even if is requested by the server */ -- cgit From f2b2e01fd83666289d0e6771fbccb33b54e94393 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Jan 2008 13:44:51 +0100 Subject: Re-order an option block in parm_table to re-unite the misc options. Michael (This used to be commit 9e11768256623636e69eda67b3bb888426f9ab84) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index eaf19b746a..475b6b61fa 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1215,14 +1215,14 @@ static struct parm_struct parm_table[] = { {"ldap page size", P_INTEGER, P_GLOBAL, &Globals.ldap_page_size, NULL, NULL, FLAG_ADVANCED}, {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED}, + {N_("EventLog Options"), P_SEP, P_SEPARATOR}, + {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED}, {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, - {N_("EventLog Options"), P_SEP, P_SEPARATOR}, - {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, -- cgit From 789720e0ed8506d7373c2879187dd7b43f76c040 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Jan 2008 13:46:02 +0100 Subject: Add "MSDFS options" separator to parm_table. Michael (This used to be commit a103509a467bf6a93fbb21ec5e64456c5f086d6c) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 475b6b61fa..d226ebe20a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1294,6 +1294,8 @@ static struct parm_struct parm_table[] = { {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_HIDE}, + {N_("MSDFS options"), P_SEP, P_SEPARATOR}, + {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED}, -- cgit From 89b1c68b37dd5f020982de82ba6ef9790986d8c7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jan 2008 16:18:28 +0100 Subject: Add config parameter "config backend = registry". This adds a new config parameter "config backend" that can have values "file" (default) and "registry". When lp_load() encounters a "config backend = registry", then all config read up to that point is discarded and globals are read from registry. This is done in suche a way that as with "config file", there is no way back to non-registry config during the lifetime of a process: The file_list_changed mechanism does not look at files anymore once config backend is set to registry. This is modelled after the behaviour of the "config file" option. Note that only the global section is read by lp_load(). The shares are handled by the registry shares mechanism, thus allowing for a smaller memory footprint since share definitions are read on demand. This new parameter is intended as a substitute of the previously installed special semantics of "include = registry" which allows for messed up mixed configurations. This parameter (which has not yet been released) will vanish next. Michael (This used to be commit 77b33cf34c2aec6673dfab3962733a60a60d126a) --- source3/param/loadparm.c | 82 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 19 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d226ebe20a..4ec3c107e8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -81,6 +81,11 @@ extern userdom_struct current_user_info; static int regdb_last_seqnum = 0; static bool include_registry_globals = False; +#define CONFIG_BACKEND_FILE 0 +#define CONFIG_BACKEND_REGISTRY 1 + +static int config_backend = CONFIG_BACKEND_FILE; + /* some helpful bits */ #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid) #define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid) @@ -104,6 +109,7 @@ struct _param_opt_struct { * This structure describes global (ie., server-wide) parameters. */ typedef struct { + int ConfigBackend; char *smb_ports; char *dos_charset; char *unix_charset; @@ -842,6 +848,14 @@ static const struct enum_list enum_map_to_guest[] = { {-1, NULL} }; +/* Config backend options */ + +static const struct enum_list enum_config_backend[] = { + {CONFIG_BACKEND_FILE, "file"}, + {CONFIG_BACKEND_REGISTRY, "registry"}, + {-1, NULL} +}; + /* Note: We do not initialise the defaults union - it is not allowed in ANSI C * * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit @@ -880,6 +894,8 @@ static struct parm_struct parm_table[] = { {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + {"config backend", P_ENUM, P_GLOBAL, &Globals.ConfigBackend, NULL, enum_config_backend, FLAG_ADVANCED}, + {N_("Security Options"), P_SEP, P_SEPARATOR}, {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, @@ -1529,6 +1545,8 @@ static void init_globals(bool first_time_only) Globals.bLoadPrinters = True; Globals.PrintcapCacheTime = 750; /* 12.5 minutes */ + Globals.ConfigBackend = CONFIG_BACKEND_FILE; + /* 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; @@ -2048,6 +2066,7 @@ FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) FN_GLOBAL_CONST_STRING(lp_socket_options, &Globals.szSocketOptions) +FN_GLOBAL_INTEGER(lp_config_backend, &Globals.ConfigBackend); FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) @@ -3655,7 +3674,7 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); - if (include_registry_globals) { + if (config_backend == CONFIG_BACKEND_REGISTRY) { reg_tdb = lp_regdb_open(); if (reg_tdb && (regdb_last_seqnum != tdb_get_seqnum(reg_tdb->tdb))) { @@ -3663,6 +3682,15 @@ bool lp_file_list_changed(void) regdb_last_seqnum, tdb_get_seqnum(reg_tdb->tdb))); TALLOC_FREE(reg_tdb); return true; + } else { + /* + * Don't check files when config_backend is registry. + * Remove this to obtain checking of files even with + * registry config backend. That would enable switching + * off registry configuration by changing smb.conf even + * without restarting smbd. + */ + return false; } } @@ -3698,6 +3726,7 @@ bool lp_file_list_changed(void) return (False); } + /*************************************************************************** Run standard_sub_basic on netbios name... needed because global_myname is not accessed through any lp_ macro. @@ -5656,15 +5685,6 @@ bool lp_load(const char *pszFname, bool bRetval; param_opt_struct *data, *pdata; - n2 = alloc_sub_basic(get_current_username(), - current_user_info.domain, - pszFname); - if (!n2) { - smb_panic("lp_load: out of memory"); - } - - add_to_file_list(pszFname, n2); - bRetval = False; DEBUG(3, ("lp_load: refreshing parameters\n")); @@ -5693,17 +5713,41 @@ bool lp_load(const char *pszFname, Globals.param_opt = NULL; } - /* We get sections first, so have to start 'behind' to make up */ - iServiceIndex = -1; - bRetval = pm_process(n2, do_section, do_parameter); - SAFE_FREE(n2); + if (config_backend == CONFIG_BACKEND_FILE) { + n2 = alloc_sub_basic(get_current_username(), + current_user_info.domain, + pszFname); + if (!n2) { + smb_panic("lp_load: out of memory"); + } - /* finish up the last section */ - DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval))); - if (bRetval) { - if (iServiceIndex >= 0) { - bRetval = service_ok(iServiceIndex); + add_to_file_list(pszFname, n2); + + /* We get sections first, so have to start 'behind' to make up */ + iServiceIndex = -1; + bRetval = pm_process(n2, do_section, do_parameter); + SAFE_FREE(n2); + + /* finish up the last section */ + DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval))); + if (bRetval) { + if (iServiceIndex >= 0) { + bRetval = service_ok(iServiceIndex); + } } + + if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + config_backend = CONFIG_BACKEND_REGISTRY; + /* start over */ + return lp_load(pszFname, global_only, save_defaults, + add_ipc, initialize_globals); + } + } else if (config_backend == CONFIG_BACKEND_REGISTRY) { + bRetval = process_registry_globals(do_parameter); + } else { + DEBUG(0, ("Illegal config backend given: %d\n", + config_backend)); + bRetval = false; } lp_add_auto_services(lp_auto_services()); -- cgit From 1abc94e95b1cdeff0d85840b4dfc6e5cea3a71da Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jan 2008 16:58:29 +0100 Subject: Initialise Globals.ConfigBackend from global var config_backend. and use lp_config_backend() instead of config_backend. Michael (This used to be commit 9f69efe954cde6c6cce4283ba35a553ca980c347) --- source3/param/loadparm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ec3c107e8..4afef23103 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1545,7 +1545,7 @@ static void init_globals(bool first_time_only) Globals.bLoadPrinters = True; Globals.PrintcapCacheTime = 750; /* 12.5 minutes */ - Globals.ConfigBackend = CONFIG_BACKEND_FILE; + Globals.ConfigBackend = config_backend; /* Was 65535 (0xFFFF). 0x4101 matches W2K and causes major speed improvements... */ /* Discovered by 2 days of pain by Don McCall @ HP :-). */ @@ -3674,7 +3674,7 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); - if (config_backend == CONFIG_BACKEND_REGISTRY) { + if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { reg_tdb = lp_regdb_open(); if (reg_tdb && (regdb_last_seqnum != tdb_get_seqnum(reg_tdb->tdb))) { @@ -5713,7 +5713,7 @@ bool lp_load(const char *pszFname, Globals.param_opt = NULL; } - if (config_backend == CONFIG_BACKEND_FILE) { + if (lp_config_backend() == CONFIG_BACKEND_FILE) { n2 = alloc_sub_basic(get_current_username(), current_user_info.domain, pszFname); @@ -5737,16 +5737,22 @@ bool lp_load(const char *pszFname, } if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + /* + * We need to use this extra global variable here to + * survive restart: init_globals usese this as a default + * for ConfigBackend. Otherwise, init_globals would + * send us into an endless loop here. + */ config_backend = CONFIG_BACKEND_REGISTRY; /* start over */ return lp_load(pszFname, global_only, save_defaults, add_ipc, initialize_globals); } - } else if (config_backend == CONFIG_BACKEND_REGISTRY) { + } else if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { bRetval = process_registry_globals(do_parameter); } else { DEBUG(0, ("Illegal config backend given: %d\n", - config_backend)); + lp_config_backend())); bRetval = false; } -- cgit From d3be7a7bdd8b1ddbbcd39dd55d62467dc6c1a73b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jan 2008 17:03:21 +0100 Subject: Add utility function lp_config_backend_is_registry(). So external callers can determine if we are running on registry config without knowing the internals. Michael (This used to be commit d8a7c3ec8e2bd548509178f138d00a3b57119d10) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4afef23103..90b015b5a2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3663,6 +3663,14 @@ bool lp_include_registry_globals(void) return include_registry_globals; } +/** + * Utility function for outsiders to check if we're running on registry. + */ +bool lp_config_backend_is_registry(void) +{ + return (lp_config_backend() == CONFIG_BACKEND_REGISTRY); +} + /******************************************************************* Check if a config file has changed date. ********************************************************************/ -- cgit From 762ca95be758d00f0dacf05d38e650af89f0bfba Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jan 2008 17:09:07 +0100 Subject: Remove special semantics of "include = registry" from loadparm.c This is now replaced by "config backend = registry". Michael (This used to be commit 56801810253ae870437f694947f58c27661cef9b) --- source3/param/loadparm.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 90b015b5a2..4fc8b89ec1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -70,16 +70,7 @@ extern userdom_struct current_user_info; #define HOMES_NAME "homes" #endif -/* the special value for the include parameter - * to be interpreted not as a file name but to - * trigger loading of the global smb.conf options - * from registry. */ -#ifndef INCLUDE_REGISTRY_NAME -#define INCLUDE_REGISTRY_NAME "registry" -#endif - static int regdb_last_seqnum = 0; -static bool include_registry_globals = False; #define CONFIG_BACKEND_FILE 0 #define CONFIG_BACKEND_REGISTRY 1 @@ -3443,8 +3434,6 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) char * valstr; struct registry_value *value = NULL; - include_registry_globals = True; - ZERO_STRUCT(data); reg_tdb = lp_regdb_open(); @@ -3557,8 +3546,6 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) smb_panic("Failed to create talloc context!"); } - include_registry_globals = True; - if (!registry_init_regdb()) { DEBUG(1, ("Error initializing the registry.\n")); goto done; @@ -3658,11 +3645,6 @@ static void add_to_file_list(const char *fname, const char *subfname) } } -bool lp_include_registry_globals(void) -{ - return include_registry_globals; -} - /** * Utility function for outsiders to check if we're running on registry. */ @@ -3804,17 +3786,6 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr) { char *fname; - if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { - if (bInGlobalSection) { - return process_registry_globals(do_parameter); - } - else { - DEBUG(1, ("\"include = registry\" only effective " - "in %s section\n", GLOBAL_NAME)); - return false; - } - } - fname = alloc_sub_basic(get_current_username(), current_user_info.domain, pszParmValue); -- cgit From 422fbd0bbd5516a2175e922f500cf72ce08de4b4 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jan 2008 17:15:08 +0100 Subject: Add my (C) to loadparm.c. I think now that I have changed some substantial logic, I should confess.... :-) Michael (This used to be commit 704ac0ba49134d14dc00769b1cf2d9f55657bdfb) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4fc8b89ec1..0d3fbbf77c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -9,6 +9,7 @@ Copyright (C) Alexander Bokovoy 2002 Copyright (C) Stefan (metze) Metzmacher 2002 Copyright (C) Jim McDonough 2003 + Copyright (C) Michael Adam 2008 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 -- cgit From 088183896a6e46cc7e5a5ff94e2e94b948119a8a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jan 2008 20:34:45 +0100 Subject: default to tdbsam instead of smbpasswd (This used to be commit ab8ff39fd51929aae2f4088ca5b1d67e5cb7099e) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0d3fbbf77c..a6529a6cb8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1625,7 +1625,7 @@ static void init_globals(bool first_time_only) a large number of sites (tridge) */ Globals.bHostnameLookups = False; - string_set(&Globals.szPassdbBackend, "smbpasswd"); + string_set(&Globals.szPassdbBackend, "tdbsam"); string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); -- cgit From 60c3ec3fca08b7d36df760cd6093adb5a807afa0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jan 2008 21:26:16 +0100 Subject: Revert "default to tdbsam instead of smbpasswd" This reverts commit ab8ff39fd51929aae2f4088ca5b1d67e5cb7099e. (This used to be commit 5838a9f556f151dc7c1773dcdc598b8ba79fca44) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a6529a6cb8..0d3fbbf77c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1625,7 +1625,7 @@ static void init_globals(bool first_time_only) a large number of sites (tridge) */ Globals.bHostnameLookups = False; - string_set(&Globals.szPassdbBackend, "tdbsam"); + string_set(&Globals.szPassdbBackend, "smbpasswd"); string_set(&Globals.szLdapSuffix, ""); string_set(&Globals.szLdapMachineSuffix, ""); string_set(&Globals.szLdapUserSuffix, ""); -- cgit From 536bff422969f79e92e90ca959716624fbb96ed1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 18 Jan 2008 16:06:37 +0100 Subject: Do an explicit init_globals() when restarting for "config backend = registry". Michael (This used to be commit 487c43f9284598a3c60b06fc60e5c50844e11b87) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0d3fbbf77c..0796a78dd3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5725,6 +5725,7 @@ bool lp_load(const char *pszFname, */ config_backend = CONFIG_BACKEND_REGISTRY; /* start over */ + init_globals(false); return lp_load(pszFname, global_only, save_defaults, add_ipc, initialize_globals); } -- cgit From 587cf54c61c9f1f7bcae431a82035fd942716c32 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 23 Jan 2008 11:04:10 +0100 Subject: strtok -> strtok_r (This used to be commit fd34ce437057bb34cdc37f4b066e424000d36789) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0796a78dd3..c1d26af989 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4709,6 +4709,7 @@ static void lp_add_auto_services(char *str) char *s; char *p; int homes; + char *saveptr; if (!str) return; @@ -4719,7 +4720,8 @@ static void lp_add_auto_services(char *str) homes = lp_servicenumber(HOMES_NAME); - for (p = strtok(s, LIST_SEP); p; p = strtok(NULL, LIST_SEP)) { + for (p = strtok_r(s, LIST_SEP, &saveptr); p; + p = strtok_r(NULL, LIST_SEP, &saveptr)) { char *home; if (lp_servicenumber(p) >= 0) -- cgit From 2762b9a97582b9b28fd5985ba8e3d0299126820e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 4 Feb 2008 20:57:35 +0100 Subject: Always pass a TALLOC_CTX to str_list_make and str_list_copy (This used to be commit e2c9fc4cf5f0ff725330fa44f53782db65fca37e) --- source3/param/loadparm.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c1d26af989..5ecb3a4e70 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1691,7 +1691,7 @@ static void init_globals(bool first_time_only) Globals.bWinbindTrustedDomainsOnly = False; Globals.bWinbindNestedGroups = True; Globals.winbind_expand_groups = 1; - Globals.szWinbindNssInfo = str_list_make("template", NULL); + Globals.szWinbindNssInfo = str_list_make(NULL, "template", NULL); Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; @@ -2397,7 +2397,7 @@ const char **lp_parm_string_list(int snum, const char *type, const char *option, return (const char **)def; if (data->list==NULL) { - data->list = str_list_make(data->value, NULL); + data->list = str_list_make(NULL, data->value, NULL); } return (const char **)data->list; @@ -3276,7 +3276,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, break; case P_LIST: str_list_free((char ***)dest_ptr); - str_list_copy((char ***)dest_ptr, *(const char ***)src_ptr); + str_list_copy(NULL, (char ***)dest_ptr, + *(const char ***)src_ptr); break; default: break; @@ -3775,7 +3776,7 @@ static bool handle_netbios_scope(int snum, 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); + Globals.szNetbiosAliases = str_list_make(NULL, pszParmValue, NULL); return set_netbios_aliases((const char **)Globals.szNetbiosAliases); } @@ -4193,7 +4194,8 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue case P_LIST: str_list_free((char ***)parm_ptr); - *(char ***)parm_ptr = str_list_make(pszParmValue, NULL); + *(char ***)parm_ptr = str_list_make( + NULL, pszParmValue, NULL); break; case P_STRING: @@ -4812,8 +4814,9 @@ static void lp_save_defaults(void) continue; switch (parm_table[i].type) { case P_LIST: - str_list_copy(&(parm_table[i].def.lvalue), - *(const char ***)parm_table[i].ptr); + str_list_copy( + NULL, &(parm_table[i].def.lvalue), + *(const char ***)parm_table[i].ptr); break; case P_STRING: case P_USTRING: -- cgit From b361956942618ec2f7c2efc60cb190858adbc516 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 4 Feb 2008 21:05:41 +0100 Subject: str_list_free is not needed anymore (This used to be commit feddc1447d585fd108d22a36bccc576fa81197ef) --- source3/param/loadparm.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5ecb3a4e70..8edd32e937 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2494,9 +2494,10 @@ static void free_service(service *pservice) PTR_DIFF(parm_table[i].ptr, &sDefault))); else if (parm_table[i].type == P_LIST && parm_table[i].p_class == P_LOCAL) - str_list_free((char ***) - (((char *)pservice) + - PTR_DIFF(parm_table[i].ptr, &sDefault))); + TALLOC_FREE(*((char ***) + (((char *)pservice) + + PTR_DIFF(parm_table[i].ptr, + &sDefault)))); } data = pservice->param_opt; @@ -2506,7 +2507,7 @@ static void free_service(service *pservice) DEBUG(5,("[%s = %s]\n", data->key, data->value)); string_free(&data->key); string_free(&data->value); - str_list_free(&data->list); + TALLOC_FREE(data->list); pdata = data->next; SAFE_FREE(data); data = pdata; @@ -2566,7 +2567,7 @@ static int add_a_service(const service *pservice, const char *name) while (data) { string_free(&data->key); string_free(&data->value); - str_list_free(&data->list); + TALLOC_FREE(data->list); pdata = data->next; SAFE_FREE(data); data = pdata; @@ -3275,7 +3276,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, strupper_m(*(char **)dest_ptr); break; case P_LIST: - str_list_free((char ***)dest_ptr); + TALLOC_FREE(*((char ***)dest_ptr)); str_list_copy(NULL, (char ***)dest_ptr, *(const char ***)src_ptr); break; @@ -3300,7 +3301,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, /* If we already have same option, override it */ if (strcmp(pdata->key, data->key) == 0) { string_free(&pdata->value); - str_list_free(&data->list); + TALLOC_FREE(data->list); pdata->value = SMB_STRDUP(data->value); not_added = False; break; @@ -3775,7 +3776,7 @@ static bool handle_netbios_scope(int snum, const char *pszParmValue, char **ptr) static bool handle_netbios_aliases(int snum, const char *pszParmValue, char **ptr) { - str_list_free(&Globals.szNetbiosAliases); + TALLOC_FREE(Globals.szNetbiosAliases); Globals.szNetbiosAliases = str_list_make(NULL, pszParmValue, NULL); return set_netbios_aliases((const char **)Globals.szNetbiosAliases); } @@ -4100,7 +4101,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue /* If we already have same option, override it */ if (strcmp(data->key, param_key) == 0) { string_free(&data->value); - str_list_free(&data->list); + TALLOC_FREE(data->list); data->value = SMB_STRDUP(pszParmValue); not_added = False; break; @@ -4193,7 +4194,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue break; case P_LIST: - str_list_free((char ***)parm_ptr); + TALLOC_FREE(*((char ***)parm_ptr)); *(char ***)parm_ptr = str_list_make( NULL, pszParmValue, NULL); break; @@ -5650,7 +5651,7 @@ void gfree_loadparm(void) string_free( (char**)parm_table[i].ptr ); } else if (parm_table[i].type == P_LIST) { - str_list_free( (char***)parm_table[i].ptr ); + TALLOC_FREE( *((char***)parm_table[i].ptr) ); } } } @@ -5690,7 +5691,7 @@ bool lp_load(const char *pszFname, while (data) { string_free(&data->key); string_free(&data->value); - str_list_free(&data->list); + TALLOC_FREE(data->list); pdata = data->next; SAFE_FREE(data); data = pdata; -- cgit From 7183e5811e00b650bd271c765562b9dcea8e2d09 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 28 Jan 2008 14:47:01 +0100 Subject: Add support for LDAP debug output in Samba log file. Logging of the ldap libraries appears with a [LDAP] prefix inside the samba logs. This is controlled by two new parameters: * "ldap debug level" sets the debug level of the ldap libraries. It is the bit-field as understood by the openldap server. * "ldap debug threshold" is the samba debug level at which ldap logging appears inside the samba logs. This probably needs some configure tests since it makes use of the LBER_OPT_LOG_PRINT_FN option to redirect the debug output of the ldap libraries. Michael (This used to be commit 15c25990bd0bfa3145ab3c26d2bdda72993d005c) --- source3/param/loadparm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8edd32e937..3737224275 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -244,6 +244,8 @@ typedef struct { int ldap_ssl; char *szLdapSuffix; char *szLdapAdminDn; + int ldap_debug_level; + int ldap_debug_threshold; int iAclCompat; char *szCupsServer; char *szIPrintServer; @@ -648,6 +650,7 @@ static bool handle_netbios_aliases( int snum, const char *pszParmValue, char **p 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_printing( int snum, const char *pszParmValue, char **ptr); +static bool handle_ldap_debug_level( int snum, const char *pszParmValue, char **ptr); static void set_server_role(void); static void set_default_server_announce_type(void); @@ -1223,6 +1226,10 @@ static struct parm_struct parm_table[] = { {"ldap page size", P_INTEGER, P_GLOBAL, &Globals.ldap_page_size, NULL, NULL, FLAG_ADVANCED}, {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED}, + {"ldap debug level", P_INTEGER, P_GLOBAL, &Globals.ldap_debug_level, handle_ldap_debug_level, NULL, FLAG_ADVANCED}, + {"ldap debug threshold", P_INTEGER, P_GLOBAL, &Globals.ldap_debug_threshold, NULL, NULL, FLAG_ADVANCED}, + + {N_("EventLog Options"), P_SEP, P_SEPARATOR}, {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, @@ -1640,6 +1647,9 @@ static void init_globals(bool first_time_only) Globals.ldap_timeout = LDAP_CONNECT_DEFAULT_TIMEOUT; Globals.ldap_page_size = LDAP_PAGE_SIZE; + Globals.ldap_debug_level = 0; + Globals.ldap_debug_threshold = 10; + /* 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.*/ @@ -1954,6 +1964,8 @@ 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_INTEGER(lp_ldap_page_size, &Globals.ldap_page_size) +FN_GLOBAL_INTEGER(lp_ldap_debug_level, &Globals.ldap_debug_level) +FN_GLOBAL_INTEGER(lp_ldap_debug_threshold, &Globals.ldap_debug_threshold) 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) @@ -3844,6 +3856,13 @@ static bool handle_copy(int snum, const char *pszParmValue, char **ptr) return (bRetval); } +static bool handle_ldap_debug_level(int snum, const char *pszParmValue, char **ptr) +{ + Globals.ldap_debug_level = lp_int(pszParmValue); + init_ldap_debugging(); + return true; +} + /*************************************************************************** Handle idmap/non unix account uid and gid allocation parameters. The format of these parameters is: -- cgit From 9af84dd382aad55fcdfa803238d8edd57636f2aa Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 15 Feb 2008 13:57:31 +0100 Subject: Rename registry_init_regdb() to registry_init_smbconf(). That's what it actually is. Michael (This used to be commit 9d3c27f55726dbdce41fcf71c8bc1a7829340268) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3737224275..29de336df5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3561,7 +3561,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) smb_panic("Failed to create talloc context!"); } - if (!registry_init_regdb()) { + if (!registry_init_smbconf()) { DEBUG(1, ("Error initializing the registry.\n")); goto done; } -- cgit From 6d963a807d4798749fdfd228f30e28c67debee7f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 19 Feb 2008 01:22:32 +0100 Subject: Use linbet_conf code in loadparm's registry handling. This replaces the original hand-written tdb code, now that the linking dependencies have been significantly reduced. Michael (This used to be commit d08a3a195718725228bbafa61fd4f0be8aafb43f) --- source3/param/loadparm.c | 261 +++++++---------------------------------------- 1 file changed, 38 insertions(+), 223 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 29de336df5..4d067af5a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -52,6 +52,7 @@ */ #include "includes.h" +#include "libnet/libnet.h" bool in_client = False; /* Not in the client by default */ bool bLoaded = False; @@ -71,7 +72,8 @@ extern userdom_struct current_user_info; #define HOMES_NAME "homes" #endif -static int regdb_last_seqnum = 0; +static uint64_t conf_last_seqnum = 0; +static struct libnet_conf_ctx *conf_ctx = NULL; #define CONFIG_BACKEND_FILE 0 #define CONFIG_BACKEND_REGISTRY 1 @@ -3377,242 +3379,47 @@ bool service_ok(int iService) return (bRetval); } -/* - * lp_regdb_open - regdb helper function - * - * this should be considered an interim solution that becomes - * superfluous once the registry code has been rewritten - * do allow use of the tdb portion of the registry alone. - * - * in the meanwhile this provides a lean access - * to the registry globals. - */ - -static struct tdb_wrap *lp_regdb_open(void) -{ - struct tdb_wrap *reg_tdb = NULL; - const char *vstring = "INFO/version"; - uint32 vers_id; - - become_root(); - reg_tdb = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, - REG_TDB_FLAGS, O_RDWR, 0600); - unbecome_root(); - if (!reg_tdb) { - DEBUG(1, ("lp_regdb_open: failed to open %s: %s\n", - state_path("registry.tdb"), strerror(errno))); - goto done; - } - else { - DEBUG(10, ("lp_regdb_open: reg tdb opened.\n")); - } - - vers_id = tdb_fetch_int32(reg_tdb->tdb, vstring); - if (vers_id != REGVER_V1) { - DEBUG(10, ("lp_regdb_open: INFO: registry tdb %s has wrong " - "INFO/version (got %d, expected %d)\n", - state_path("registry.tdb"), vers_id, REGVER_V1)); - /* this is apparently not implemented in the tdb */ - } - -done: - return reg_tdb; -} - /* * process_registry_globals - * - * this is the interim version of process_registry globals - * - * until we can do it as we would like using the api and only - * using the tdb portion of the registry (see below), - * this just provides the needed functionality of regdb_fetch_values - * and regdb_unpack_values, circumventing any fancy stuff, to - * give us access to the registry globals. */ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) { - bool ret = False; - struct tdb_wrap *reg_tdb = NULL; - WERROR err; - char *keystr; - TDB_DATA data; - /* vars for the tdb unpack loop */ - int len = 0; - int i; - int buflen; - uint8 *buf; - uint32 type; - uint32 size; - uint32 num_values = 0; - uint8 *data_p; - char * valstr; - struct registry_value *value = NULL; - - ZERO_STRUCT(data); - - reg_tdb = lp_regdb_open(); - if (!reg_tdb) { - DEBUG(1, ("Error opening the registry!\n")); - goto done; - } - - /* reg_tdb is from now on used as talloc ctx. - * freeing it closes the tdb (if refcount is 0) */ - - keystr = talloc_asprintf(reg_tdb,"%s/%s/%s", REG_VALUE_PREFIX, - KEY_SMBCONF, GLOBAL_NAME); - normalize_dbkey(keystr); - - DEBUG(10, ("process_registry_globals: fetching key '%s'\n", - keystr)); - - data = tdb_fetch_bystring(reg_tdb->tdb, keystr); - if (!data.dptr) { - ret = True; - goto done; - } - - buf = data.dptr; - buflen = data.dsize; - - /* unpack number of values */ - len = tdb_unpack(buf, buflen, "d", &num_values); - DEBUG(10, ("process_registry_globals: got %d values from tdb\n", - num_values)); - - /* unpack the values */ - for (i=0; i < num_values; i++) { - fstring valname; - type = REG_NONE; - size = 0; - data_p = NULL; - len += tdb_unpack(buf+len, buflen-len, "fdB", - valname, - &type, - &size, - &data_p); - if (registry_smbconf_valname_forbidden(valname)) { - DEBUG(10, ("process_registry_globals: Ignoring " - "parameter '%s' in registry.\n", valname)); - continue; - } - DEBUG(10, ("process_registry_globals: got value '%s'\n", - valname)); - if (size && data_p) { - err = registry_pull_value(reg_tdb, - &value, - (enum winreg_Type)type, - data_p, - size, - size); - SAFE_FREE(data_p); - if (!W_ERROR_IS_OK(err)) { - goto done; - } - switch(type) { - case REG_DWORD: - valstr = talloc_asprintf(reg_tdb, "%d", - value->v.dword); - pfunc(valname, valstr); - break; - case REG_SZ: - pfunc(valname, value->v.sz.str); - break; - default: - /* ignore other types */ - break; - } + WERROR werr; + char **param_names; + char **param_values; + uint32_t num_params; + uint32_t count; + TALLOC_CTX *mem_ctx = talloc_stackframe(); + bool ret = false; + + if (conf_ctx == NULL) { + /* first time */ + werr = libnet_conf_open(NULL, &conf_ctx); + if (!W_ERROR_IS_OK(werr)) { + goto done; } } - ret = pfunc("registry shares", "yes"); - regdb_last_seqnum = tdb_get_seqnum(reg_tdb->tdb); - -done: - TALLOC_FREE(reg_tdb); - SAFE_FREE(data.dptr); - return ret; -} - -#if 0 -/* - * this is process_registry_globals as it _should_ be (roughly) - * using the reg_api functions... - * - * We are *not* currently doing it like this due to the large - * linker dependecies of the registry code (see above). - */ -static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) -{ - bool ret = False; - TALLOC_CTX *ctx = NULL; - char *regpath = NULL; - WERROR werr = WERR_OK; - struct registry_key *key = NULL; - struct registry_value *value = NULL; - char *valname = NULL; - char *valstr = NULL; - uint32 idx = 0; - NT_USER_TOKEN *token = NULL; - - ctx = talloc_init("process_registry_globals"); - if (!ctx) { - smb_panic("Failed to create talloc context!"); - } - - if (!registry_init_smbconf()) { - DEBUG(1, ("Error initializing the registry.\n")); - goto done; - } - - werr = ntstatus_to_werror(registry_create_admin_token(ctx, &token)); + werr = libnet_conf_get_share(mem_ctx, conf_ctx, GLOBAL_NAME, + &num_params, ¶m_names, ¶m_values); if (!W_ERROR_IS_OK(werr)) { - DEBUG(1, ("Error creating admin token: %s\n",dos_errstr(werr))); goto done; } - regpath = talloc_asprintf(ctx,"%s\\%s", KEY_SMBCONF, GLOBAL_NAME); - werr = reg_open_path(ctx, regpath, REG_KEY_READ, token, &key); - if (!W_ERROR_IS_OK(werr)) { - DEBUG(1, ("Registry smbconf global section does not exist.\n")); - DEBUGADD(1, ("Error opening registry path '%s\\%s: %s\n", - KEY_SMBCONF, GLOBAL_NAME, dos_errstr(werr))); - goto done; - } - - for (idx = 0; - W_ERROR_IS_OK(werr = reg_enumvalue(ctx, key, idx, &valname, - &value)); - idx++) - { - DEBUG(5, ("got global registry parameter '%s'\n", valname)); - switch(value->type) { - case REG_DWORD: - valstr = talloc_asprintf(ctx, "%d", value->v.dword); - pfunc(valname, valstr); - TALLOC_FREE(valstr); - break; - case REG_SZ: - pfunc(valname, value->v.sz.str); - break; - default: - /* ignore other types */ - break; + for (count = 0; count < num_params; count++) { + ret = pfunc(param_names[count], param_values[count]); + if (ret != true) { + goto done; } - TALLOC_FREE(value); - TALLOC_FREE(valstr); } ret = pfunc("registry shares", "yes"); - - regdb_last_seqnum = regdb_get_seqnum(); + conf_last_seqnum = libnet_conf_get_seqnum(conf_ctx, NULL, NULL); done: - talloc_destroy(ctx); + TALLOC_FREE(mem_ctx); return ret; } -#endif /* if 0 */ static struct file_lists { struct file_lists *next; @@ -3675,17 +3482,25 @@ bool lp_config_backend_is_registry(void) bool lp_file_list_changed(void) { struct file_lists *f = file_lists; - struct tdb_wrap *reg_tdb = NULL; DEBUG(6, ("lp_file_list_changed()\n")); if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { - reg_tdb = lp_regdb_open(); - if (reg_tdb && (regdb_last_seqnum != tdb_get_seqnum(reg_tdb->tdb))) + if (conf_ctx == NULL) { + WERROR werr; + werr = libnet_conf_open(NULL, &conf_ctx); + if (!W_ERROR_IS_OK(werr)) { + DEBUG(0, ("error opening configuration: %s\n", + dos_errstr(werr))); + return false; + } + } + if (conf_last_seqnum != + libnet_conf_get_seqnum(conf_ctx, NULL, NULL)) { - DEBUGADD(6, ("regdb seqnum changed: old = %d, new = %d\n", - regdb_last_seqnum, tdb_get_seqnum(reg_tdb->tdb))); - TALLOC_FREE(reg_tdb); + DEBUGADD(6, ("regdb seqnum changed: old = %lu, " + "new = %lu\n", conf_last_seqnum, + libnet_conf_get_seqnum(conf_ctx, NULL, NULL))); return true; } else { /* -- cgit From 317639287886181edf08ccecad1b324e4cc55d0b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Feb 2008 15:24:49 +0100 Subject: Fix some warnings warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result (This used to be commit ad37b7b0aee265a3e4d8b7552610f4b9a105434d) --- source3/param/loadparm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4d067af5a5..86446d5b75 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2251,8 +2251,7 @@ static param_opt_struct *get_parametrics(int snum, const char *type, const char data = ServicePtrs[snum]->param_opt; } - asprintf(¶m_key, "%s:%s", type, option); - if (!param_key) { + if (asprintf(¶m_key, "%s:%s", type, option) == -1) { DEBUG(0,("asprintf failed!\n")); return NULL; } -- cgit From d85c517b45b8feb8469f7073d770e7fedc818259 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 22 Feb 2008 17:35:53 +0100 Subject: Add variable to define if a share should be hidden. If you create a share on a Windows machine called foo$ then this share is of the type STYPE_DISKTREE. So it is possible to administrate this kind of share. Tested on Windows NT and 2003. In samba we assume that if a share with a $ at the end must be of the type STYPE_DISKTREE_HIDDEN. This is wrong, so we need a variable in the config to define if the share should be hidden or not. (This used to be commit a3da677bf0faed56e6731ee96708a7847a61d118) --- source3/param/loadparm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 86446d5b75..79c522f77c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -420,6 +420,7 @@ typedef struct { bool bRead_only; bool bNo_set_dir; bool bGuest_only; + bool bHidden; bool bGuest_ok; bool bPrint_ok; bool bMap_system; @@ -562,6 +563,7 @@ static service sDefault = { True, /* bRead_only */ True, /* bNo_set_dir */ False, /* bGuest_only */ + False, /* bHidden */ False, /* bGuest_ok */ False, /* bPrint_ok */ False, /* bMap_system */ @@ -971,6 +973,7 @@ static struct parm_struct parm_table[] = { {"inherit owner", P_BOOL, P_LOCAL, &sDefault.bInheritOwner, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, + {"hidden", P_BOOL, P_LOCAL, &sDefault.bHidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"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}, @@ -2137,6 +2140,7 @@ FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) FN_LOCAL_BOOL(lp_guest_only, bGuest_only) +FN_LOCAL_BOOL(lp_hidden, bHidden) FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) FN_LOCAL_BOOL(lp_map_archive, bMap_archive) @@ -2774,6 +2778,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok) ServicePtrs[i]->bAvailable = True; ServicePtrs[i]->bRead_only = True; ServicePtrs[i]->bGuest_only = False; + ServicePtrs[i]->bHidden = True; ServicePtrs[i]->bGuest_ok = guest_ok; ServicePtrs[i]->bPrint_ok = False; ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; -- cgit From 9d37794a6c1db3b15ff235d18df05b0d9601b6b7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Feb 2008 02:07:06 -0800 Subject: Fix debug %lu message. Jeremy. (This used to be commit 644a3be37a6760c9e25ac1b286c7c225096e8b0d) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 79c522f77c..71a5e90ea4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3503,8 +3503,8 @@ bool lp_file_list_changed(void) libnet_conf_get_seqnum(conf_ctx, NULL, NULL)) { DEBUGADD(6, ("regdb seqnum changed: old = %lu, " - "new = %lu\n", conf_last_seqnum, - libnet_conf_get_seqnum(conf_ctx, NULL, NULL))); + "new = %lu\n", (unsigned long)conf_last_seqnum, + (unsigned long)libnet_conf_get_seqnum(conf_ctx, NULL, NULL))); return true; } else { /* -- cgit From 22ac09c08c6e9ab56602ba44a799257d6435ae15 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Feb 2008 02:13:48 -0800 Subject: Remove my change (This used to be commit 7bf4216644187549697caace4a2a48803b57fa5a) --- source3/param/loadparm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 71a5e90ea4..e23c30789a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3490,6 +3490,7 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + uint64_t conf_cur_seqnum; if (conf_ctx == NULL) { WERROR werr; werr = libnet_conf_open(NULL, &conf_ctx); @@ -3499,12 +3500,12 @@ bool lp_file_list_changed(void) return false; } } - if (conf_last_seqnum != - libnet_conf_get_seqnum(conf_ctx, NULL, NULL)) - { - DEBUGADD(6, ("regdb seqnum changed: old = %lu, " - "new = %lu\n", (unsigned long)conf_last_seqnum, - (unsigned long)libnet_conf_get_seqnum(conf_ctx, NULL, NULL))); + conf_cur_seqnum = libnet_conf_get_seqnum(conf_ctx, NULL, NULL); + if (conf_last_seqnum != conf_cur_seqnum) { + DEBUGADD(6, ("regdb seqnum changed: old = %llu, " + "new = %llu\n", + (unsigned long long)conf_last_seqnum, + (unsigned long long)conf_cur_seqnum)); return true; } else { /* -- cgit From 1751b533f00ca75082b452ca9922c2c8f277be4b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 28 Feb 2008 14:06:11 +0100 Subject: Rename the 'hidden' variable to 'administrative share'. (This used to be commit eff3d3bad5a8860b99375cc0be9dc24f3679e416) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e23c30789a..5651a435de 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -420,7 +420,7 @@ typedef struct { bool bRead_only; bool bNo_set_dir; bool bGuest_only; - bool bHidden; + bool bAdministrative_share; bool bGuest_ok; bool bPrint_ok; bool bMap_system; @@ -563,7 +563,7 @@ static service sDefault = { True, /* bRead_only */ True, /* bNo_set_dir */ False, /* bGuest_only */ - False, /* bHidden */ + False, /* bAdministrative_share */ False, /* bGuest_ok */ False, /* bPrint_ok */ False, /* bMap_system */ @@ -973,7 +973,7 @@ static struct parm_struct parm_table[] = { {"inherit owner", P_BOOL, P_LOCAL, &sDefault.bInheritOwner, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, - {"hidden", P_BOOL, P_LOCAL, &sDefault.bHidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, + {"administrative share", P_BOOL, P_LOCAL, &sDefault.bAdministrative_share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"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}, @@ -2140,7 +2140,7 @@ FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) FN_LOCAL_BOOL(lp_guest_only, bGuest_only) -FN_LOCAL_BOOL(lp_hidden, bHidden) +FN_LOCAL_BOOL(lp_administrative_share, bAdministrative_share) FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) FN_LOCAL_BOOL(lp_map_archive, bMap_archive) @@ -2778,7 +2778,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok) ServicePtrs[i]->bAvailable = True; ServicePtrs[i]->bRead_only = True; ServicePtrs[i]->bGuest_only = False; - ServicePtrs[i]->bHidden = True; + ServicePtrs[i]->bAdministrative_share = True; ServicePtrs[i]->bGuest_ok = guest_ok; ServicePtrs[i]->bPrint_ok = False; ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; -- cgit From ddd8bdedcb96a3d9d580337e65491b1e957dbb46 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 6 Mar 2008 00:51:20 +0100 Subject: Fix lp_load with an empty registry and "config backend = registry". Michael, please check. Guenther (This used to be commit d9f4060c660da0ad671e061b123df71d109d51b9) --- source3/param/loadparm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5651a435de..25aa48b61b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3404,6 +3404,13 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) } } + if (!libnet_conf_share_exists(conf_ctx, GLOBAL_NAME)) { + /* nothing to read from the registry yet but make sure lp_load + * doesn't return false */ + ret = true; + goto done; + } + werr = libnet_conf_get_share(mem_ctx, conf_ctx, GLOBAL_NAME, &num_params, ¶m_names, ¶m_values); if (!W_ERROR_IS_OK(werr)) { -- cgit From 914cd3e483bd83fb4d8e769b90d9136336ea51e9 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Thu, 6 Mar 2008 10:41:42 -0500 Subject: Eliminate global variable in_client and a plethora of extern declarations. Derrell (This used to be commit b7f34e7ef2907b498a0645ce68f2773ed7d60cdc) --- source3/param/loadparm.c | 25 +++++++++++++++++++++++-- source3/param/params.c | 4 +--- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 25aa48b61b..833ca54084 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -54,7 +54,6 @@ #include "includes.h" #include "libnet/libnet.h" -bool in_client = False; /* Not in the client by default */ bool bLoaded = False; extern enum protocol_types Protocol; @@ -72,6 +71,7 @@ extern userdom_struct current_user_info; #define HOMES_NAME "homes" #endif +static bool in_client = False; /* Not in the client by default */ static uint64_t conf_last_seqnum = 0; static struct libnet_conf_ctx *conf_ctx = NULL; @@ -5502,6 +5502,27 @@ void gfree_loadparm(void) } } + +/*************************************************************************** + Allow client apps to specify that they are a client +***************************************************************************/ +void lp_set_in_client(bool b) +{ + in_client = b; +} + + +/*************************************************************************** + Determine if we're running in a client app +***************************************************************************/ +bool lp_is_in_client(void) +{ + return in_client; +} + + + + /*************************************************************************** Load the services array from the services file. Return True on success, False on failure. @@ -5608,7 +5629,7 @@ bool lp_load(const char *pszFname, /* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */ /* if bWINSsupport is true and we are in the client */ - if (in_client && Globals.bWINSsupport) { + if (lp_is_in_client() && Globals.bWINSsupport) { lp_do_parameter(GLOBAL_SECTION_SNUM, "wins server", "127.0.0.1"); } diff --git a/source3/param/params.c b/source3/param/params.c index 44b44d99b6..e69715e4a3 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -80,8 +80,6 @@ #include "includes.h" -extern bool in_client; - /* -------------------------------------------------------------------------- ** * Constants... */ @@ -519,7 +517,7 @@ static bool Parse( DATA_BLOB *buf, myFILE *InFile, static myFILE *OpenConfFile( const char *FileName ) { const char *func = "params.c:OpenConfFile() -"; - int lvl = in_client?1:0; + int lvl = lp_is_in_client() ? 1 : 0; myFILE *ret; ret = SMB_MALLOC_P(myFILE); -- cgit From d4c24fff3258fd48ec5738e9a80738a094b63f59 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 10 Mar 2008 14:03:41 +0100 Subject: loadparm: Reformat the parm table to use named initializers. This makes each entry in the parm table much more comprehensible at first glance (to me). On the other hand, roughly 9 lines are used instead of one for each entry which makes the overall list less clearly laid out, one might argue. But we have 400+ lines of parameter descriptions anyways... Michael (This used to be commit 869a17f1a9ba45d30211c230673c6f4482876b29) --- source3/param/loadparm.c | 3936 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 3524 insertions(+), 412 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 833ca54084..033a4cf8d0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -876,477 +876,3589 @@ static const struct enum_list enum_config_backend[] = { static struct parm_struct parm_table[] = { {N_("Base Options"), P_SEP, P_SEPARATOR}, - {"dos charset", P_STRING, P_GLOBAL, &Globals.dos_charset, handle_charset, NULL, FLAG_ADVANCED}, - {"unix charset", P_STRING, P_GLOBAL, &Globals.unix_charset, handle_charset, NULL, FLAG_ADVANCED}, - {"display charset", P_STRING, P_GLOBAL, &Globals.display_charset, handle_charset, NULL, FLAG_ADVANCED}, - {"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_HIDE}, - {"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkgroup, handle_workgroup, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + { + .label = "dos charset", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.dos_charset, + .special = handle_charset, + .enum_list = NULL, + .flags = FLAG_ADVANCED + }, + { + .label = "unix charset", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.unix_charset, + .special = handle_charset, + .enum_list = NULL, + .flags = FLAG_ADVANCED + }, + { + .label = "display charset", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.display_charset, + .special = handle_charset, + .enum_list = NULL, + .flags = FLAG_ADVANCED + }, + { + .label = "comment", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.comment, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT + }, + { + .label = "path", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPath, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "directory", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPath, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "workgroup", + .type = P_USTRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szWorkgroup, + .special = handle_workgroup, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, #ifdef WITH_ADS - {"realm", P_USTRING, P_GLOBAL, &Globals.szRealm, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, + { + .label = "realm", + .type = P_USTRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRealm, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, #endif - {"netbios name", P_USTRING, P_GLOBAL, &Globals.szNetbiosName, handle_netbios_name, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"netbios aliases", P_LIST, P_GLOBAL, &Globals.szNetbiosAliases, handle_netbios_aliases, NULL, FLAG_ADVANCED}, - {"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope, NULL, FLAG_ADVANCED}, - {"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED }, - {"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + { + .label = "netbios name", + .type = P_USTRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szNetbiosName, + .special = handle_netbios_name, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "netbios aliases", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szNetbiosAliases, + .special = handle_netbios_aliases, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "netbios scope", + .type = P_USTRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szNetbiosScope, + .special = handle_netbios_scope, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "server string", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szServerString, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "interfaces", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szInterfaces, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "bind interfaces only", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bBindInterfacesOnly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_WIZARD, + }, - {"config backend", P_ENUM, P_GLOBAL, &Globals.ConfigBackend, NULL, enum_config_backend, FLAG_ADVANCED}, + { + .label = "config backend", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.ConfigBackend, + .special = NULL, + .enum_list = enum_config_backend, + .flags = FLAG_ADVANCED, + }, {N_("Security Options"), P_SEP, P_SEPARATOR}, - {"security", P_ENUM, P_GLOBAL, &Globals.security, NULL, enum_security, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"auth methods", P_LIST, P_GLOBAL, &Globals.AuthMethods, NULL, NULL, FLAG_ADVANCED}, - {"encrypt passwords", P_BOOL, P_GLOBAL, &Globals.bEncryptPasswords, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"update encrypted", P_BOOL, P_GLOBAL, &Globals.bUpdateEncrypt, NULL, NULL, FLAG_ADVANCED}, - {"client schannel", P_ENUM, P_GLOBAL, &Globals.clientSchannel, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, - {"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}, - {"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}, - {"password server", P_STRING, P_GLOBAL, &Globals.szPasswordServer, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL, NULL, FLAG_ADVANCED}, - {"private dir", P_STRING, P_GLOBAL, &Globals.szPrivateDir, NULL, NULL, FLAG_ADVANCED}, - {"passdb backend", P_STRING, P_GLOBAL, &Globals.szPassdbBackend, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"algorithmic rid base", P_INTEGER, P_GLOBAL, &Globals.AlgorithmicRidBase, NULL, NULL, FLAG_ADVANCED}, - {"root directory", P_STRING, P_GLOBAL, &Globals.szRootdir, 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}, - {"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, FLAG_ADVANCED}, - {"restrict anonymous", P_INTEGER, P_GLOBAL, &Globals.restrict_anonymous, NULL, NULL, FLAG_ADVANCED}, - {"lanman auth", P_BOOL, P_GLOBAL, &Globals.bLanmanAuth, NULL, NULL, FLAG_ADVANCED}, - {"ntlm auth", P_BOOL, P_GLOBAL, &Globals.bNTLMAuth, NULL, NULL, FLAG_ADVANCED}, - {"client NTLMv2 auth", P_BOOL, P_GLOBAL, &Globals.bClientNTLMv2Auth, NULL, NULL, FLAG_ADVANCED}, - {"client lanman auth", P_BOOL, P_GLOBAL, &Globals.bClientLanManAuth, NULL, NULL, FLAG_ADVANCED}, - {"client plaintext auth", P_BOOL, P_GLOBAL, &Globals.bClientPlaintextAuth, NULL, NULL, FLAG_ADVANCED}, - - {"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, - {"users", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_HIDE}, - - {"invalid users", P_LIST, P_LOCAL, &sDefault.szInvalidUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"valid users", P_LIST, P_LOCAL, &sDefault.szValidUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"admin users", P_LIST, P_LOCAL, &sDefault.szAdminUsers, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"read list", P_LIST, P_LOCAL, &sDefault.readlist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"write list", P_LIST, P_LOCAL, &sDefault.writelist, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"printer admin", P_LIST, P_LOCAL, &sDefault.printer_admin, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT | FLAG_DEPRECATED }, - {"force user", P_STRING, P_LOCAL, &sDefault.force_user, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"force group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"group", P_STRING, P_LOCAL, &sDefault.force_group, NULL, NULL, FLAG_ADVANCED}, - - {"read only", P_BOOL, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE}, - {"write ok", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - {"writeable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - {"writable", P_BOOLREV, P_LOCAL, &sDefault.bRead_only, NULL, NULL, FLAG_HIDE}, - - {"acl check permissions", P_BOOL, P_LOCAL, &sDefault.bAclCheckPermissions, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"acl group control", P_BOOL, P_LOCAL, &sDefault.bAclGroupControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED }, - {"acl map full control", P_BOOL, P_LOCAL, &sDefault.bAclMapFullControl, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"create mask", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_mask, NULL, NULL, FLAG_HIDE}, - {"force create mode", P_OCTAL, P_LOCAL, &sDefault.iCreate_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"security mask", P_OCTAL, P_LOCAL, &sDefault.iSecurity_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"force security mode", P_OCTAL, P_LOCAL, &sDefault.iSecurity_force_mode, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"directory mask", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - {"directory mode", P_OCTAL, P_LOCAL, &sDefault.iDir_mask, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, - {"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}, - {"inherit owner", P_BOOL, P_LOCAL, &sDefault.bInheritOwner, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, - {"administrative share", P_BOOL, P_LOCAL, &sDefault.bAdministrative_share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - - {"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 | 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}, + { + .label = "security", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.security, + .special = NULL, + .enum_list = enum_security, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "auth methods", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.AuthMethods, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "encrypt passwords", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bEncryptPasswords, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "update encrypted", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUpdateEncrypt, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client schannel", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.clientSchannel, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "server schannel", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.serverSchannel, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "allow trusted domains", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bAllowTrustedDomains, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "map to guest", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.map_to_guest, + .special = NULL, + .enum_list = enum_map_to_guest, + .flags = FLAG_ADVANCED, + }, + { + .label = "null passwords", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bNullPasswords, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "obey pam restrictions", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bObeyPamRestrictions, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "password server", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPasswordServer, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "smb passwd file", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szSMBPasswdFile, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "private dir", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPrivateDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "passdb backend", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPassdbBackend, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "algorithmic rid base", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.AlgorithmicRidBase, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "root directory", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRootdir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "root dir", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRootdir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "root", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRootdir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "guest account", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szGuestaccount, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "enable privileges", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bEnablePrivileges, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "pam password change", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bPamPasswordChange, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "passwd program", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPasswdProgram, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "passwd chat", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPasswdChat, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "passwd chat debug", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bPasswdChatDebug, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "passwd chat timeout", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iPasswdChatTimeout, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "check password script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szCheckPasswordScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "username map", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsernameMap, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "password level", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.pwordlevel, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "username level", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.unamelevel, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "unix password sync", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUnixPasswdSync, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "restrict anonymous", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.restrict_anonymous, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "lanman auth", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bLanmanAuth, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ntlm auth", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bNTLMAuth, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client NTLMv2 auth", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bClientNTLMv2Auth, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client lanman auth", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bClientLanManAuth, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client plaintext auth", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bClientPlaintextAuth, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "username", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szUsername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "user", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szUsername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "users", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szUsername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + + { + .label = "invalid users", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szInvalidUsers, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "valid users", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szValidUsers, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "admin users", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szAdminUsers, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "read list", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.readlist, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "write list", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.writelist, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "printer admin", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.printer_admin, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_PRINT | FLAG_DEPRECATED, + }, + { + .label = "force user", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.force_user, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "force group", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.force_group, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "group", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.force_group, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "read only", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bRead_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "write ok", + .type = P_BOOLREV, + .p_class = P_LOCAL, + .ptr = &sDefault.bRead_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "writeable", + .type = P_BOOLREV, + .p_class = P_LOCAL, + .ptr = &sDefault.bRead_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "writable", + .type = P_BOOLREV, + .p_class = P_LOCAL, + .ptr = &sDefault.bRead_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + + { + .label = "acl check permissions", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAclCheckPermissions, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "acl group control", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAclGroupControl, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED, + }, + { + .label = "acl map full control", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAclMapFullControl, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "create mask", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iCreate_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "create mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iCreate_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "force create mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iCreate_force_mode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "security mask", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iSecurity_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "force security mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iSecurity_force_mode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "directory mask", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iDir_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "directory mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iDir_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "force directory mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iDir_force_mode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "directory security mask", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iDir_Security_mask, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "force directory security mode", + .type = P_OCTAL, + .p_class = P_LOCAL, + .ptr = &sDefault.iDir_Security_force_mode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "force unknown acl user", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bForceUnknownAclUser, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + { + .label = "inherit permissions", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bInheritPerms, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "inherit acls", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bInheritACLS, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "inherit owner", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bInheritOwner, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "guest only", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bGuest_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "only guest", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bGuest_only, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "administrative share", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAdministrative_share, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + + { + .label = "guest ok", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bGuest_ok, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "public", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bGuest_ok, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + + { + .label = "only user", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bOnlyUser, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED, + }, + { + .label = "hosts allow", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szHostsallow, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "allow hosts", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szHostsallow, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "hosts deny", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szHostsdeny, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_GLOBAL | FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "deny hosts", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szHostsdeny, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "preload modules", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szPreloadModules, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "use kerberos keytab", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUseKerberosKeytab, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Logging Options"), P_SEP, P_SEPARATOR}, - {"log level", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_ADVANCED}, - {"debuglevel", P_STRING, P_GLOBAL, &Globals.szLogLevel, handle_debug_list, NULL, FLAG_HIDE}, - {"syslog", P_INTEGER, P_GLOBAL, &Globals.syslog, NULL, NULL, FLAG_ADVANCED}, - {"syslog only", P_BOOL, P_GLOBAL, &Globals.bSyslogOnly, NULL, NULL, FLAG_ADVANCED}, - {"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}, - {"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 prefix timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugPrefixTimestamp, 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}, - {"debug class", P_BOOL, P_GLOBAL, &Globals.bDebugClass, NULL, NULL, FLAG_ADVANCED}, - {"enable core files", P_BOOL, P_GLOBAL, &Globals.bEnableCoreFiles, NULL, NULL, FLAG_ADVANCED}, + { + .label = "log level", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogLevel, + .special = handle_debug_list, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debuglevel", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogLevel, + .special = handle_debug_list, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "syslog", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.syslog, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "syslog only", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bSyslogOnly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "log file", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogFile, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "max log size", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_log_size, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug timestamp", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bTimestampLogs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "timestamp logs", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bTimestampLogs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug prefix timestamp", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDebugPrefixTimestamp, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug hires timestamp", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDebugHiresTimestamp, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug pid", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDebugPid, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug uid", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDebugUid, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "debug class", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDebugClass, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "enable core files", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bEnableCoreFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Protocol Options"), P_SEP, P_SEPARATOR}, - {"allocation roundup size", P_INTEGER, P_LOCAL, &sDefault.iallocation_roundup_size, NULL, NULL, FLAG_ADVANCED}, - {"aio read size", P_INTEGER, P_LOCAL, &sDefault.iAioReadSize, NULL, NULL, FLAG_ADVANCED}, - {"aio write size", P_INTEGER, P_LOCAL, &sDefault.iAioWriteSize, NULL, NULL, FLAG_ADVANCED}, - {"aio write behind", P_STRING, P_LOCAL, &sDefault.szAioWriteBehind, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, - {"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 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}, - {"min receivefile size", P_INTEGER, P_GLOBAL, &Globals.iminreceivefile, 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}, - {"reset on zero vc", P_BOOL, P_GLOBAL, &Globals.bResetOnZeroVC, NULL, NULL, FLAG_ADVANCED}, - - {"acl compatibility", P_ENUM, P_GLOBAL, &Globals.iAclCompat, NULL, enum_acl_compat_vals, 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}, - {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, - - {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, FLAG_ADVANCED}, - {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, FLAG_ADVANCED}, - {"map acl inherit", P_BOOL, P_LOCAL, &sDefault.bMap_acl_inherit, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"afs share", P_BOOL, P_LOCAL, &sDefault.bAfs_Share, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, FLAG_ADVANCED}, - {"max xmit", P_INTEGER, P_GLOBAL, &Globals.max_xmit, NULL, NULL, FLAG_ADVANCED}, - - {"name resolve order", P_STRING, P_GLOBAL, &Globals.szNameResolveOrder, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, - {"max ttl", P_INTEGER, P_GLOBAL, &Globals.max_ttl, NULL, NULL, FLAG_ADVANCED}, - {"max wins ttl", P_INTEGER, P_GLOBAL, &Globals.max_wins_ttl, NULL, NULL, FLAG_ADVANCED}, - {"min wins ttl", P_INTEGER, P_GLOBAL, &Globals.min_wins_ttl, NULL, NULL, FLAG_ADVANCED}, - {"time server", P_BOOL, P_GLOBAL, &Globals.bTimeServer, NULL, NULL, FLAG_ADVANCED}, - {"unix extensions", P_BOOL, P_GLOBAL, &Globals.bUnixExtensions, NULL, NULL, FLAG_ADVANCED}, - {"use spnego", P_BOOL, P_GLOBAL, &Globals.bUseSpnego, NULL, NULL, FLAG_ADVANCED}, - {"client signing", P_ENUM, P_GLOBAL, &Globals.client_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, - {"server signing", P_ENUM, P_GLOBAL, &Globals.server_signing, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, - {"smb encrypt", P_ENUM, P_LOCAL, &sDefault.ismb_encrypt, NULL, enum_smb_signing_vals, FLAG_ADVANCED}, - {"client use spnego", P_BOOL, P_GLOBAL, &Globals.bClientUseSpnego, NULL, NULL, FLAG_ADVANCED}, - {"client ldap sasl wrapping", P_ENUM, P_GLOBAL, &Globals.client_ldap_sasl_wrapping, NULL, enum_ldap_sasl_wrapping, FLAG_ADVANCED}, - {"enable asu support", P_BOOL, P_GLOBAL, &Globals.bASUSupport, NULL, NULL, FLAG_ADVANCED}, - {"svcctl list", P_LIST, P_GLOBAL, &Globals.szServicesList, NULL, NULL, FLAG_ADVANCED}, + { + .label = "allocation roundup size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iallocation_roundup_size, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "aio read size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iAioReadSize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "aio write size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iAioWriteSize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "aio write behind", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szAioWriteBehind, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "smb ports", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.smb_ports, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "large readwrite", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bLargeReadwrite, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max protocol", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.maxprotocol, + .special = NULL, + .enum_list = enum_protocol, + .flags = FLAG_ADVANCED, + }, + { + .label = "protocol", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.maxprotocol, + .special = NULL, + .enum_list = enum_protocol, + .flags = FLAG_ADVANCED, + }, + { + .label = "min protocol", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.minprotocol, + .special = NULL, + .enum_list = enum_protocol, + .flags = FLAG_ADVANCED, + }, + { + .label = "min receivefile size", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iminreceivefile, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "read raw", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bReadRaw, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "write raw", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWriteRaw, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "disable netbios", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDisableNetbios, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "reset on zero vc", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bResetOnZeroVC, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "acl compatibility", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.iAclCompat, + .special = NULL, + .enum_list = enum_acl_compat_vals, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "defer sharing violations", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDeferSharingViolations, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "ea support", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bEASupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "nt acl support", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bNTAclSupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "nt pipe support", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bNTPipeSupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "nt status support", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bNTStatusSupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "profile acls", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bProfileAcls, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, + + { + .label = "announce version", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAnnounceVersion, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "announce as", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.announce_as, + .special = NULL, + .enum_list = enum_announce_as, + .flags = FLAG_ADVANCED, + }, + { + .label = "map acl inherit", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMap_acl_inherit, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "afs share", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAfs_Share, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "max mux", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_mux, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max xmit", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_xmit, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "name resolve order", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szNameResolveOrder, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "max ttl", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_ttl, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max wins ttl", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_wins_ttl, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "min wins ttl", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.min_wins_ttl, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "time server", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bTimeServer, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "unix extensions", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUnixExtensions, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "use spnego", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUseSpnego, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client signing", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.client_signing, + .special = NULL, + .enum_list = enum_smb_signing_vals, + .flags = FLAG_ADVANCED, + }, + { + .label = "server signing", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.server_signing, + .special = NULL, + .enum_list = enum_smb_signing_vals, + .flags = FLAG_ADVANCED, + }, + { + .label = "smb encrypt", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.ismb_encrypt, + .special = NULL, + .enum_list = enum_smb_signing_vals, + .flags = FLAG_ADVANCED, + }, + { + .label = "client use spnego", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bClientUseSpnego, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "client ldap sasl wrapping", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.client_ldap_sasl_wrapping, + .special = NULL, + .enum_list = enum_ldap_sasl_wrapping, + .flags = FLAG_ADVANCED, + }, + { + .label = "enable asu support", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bASUSupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "svcctl list", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szServicesList, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Tuning Options"), P_SEP, P_SEPARATOR}, - {"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED}, - {"getwd cache", P_BOOL, P_GLOBAL, &Globals.getwd_cache, NULL, NULL, FLAG_ADVANCED}, - {"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED}, - {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, - {"directory name cache size", P_INTEGER, P_LOCAL, &sDefault.iDirectoryNameCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, - {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE }, - - {"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED}, - {"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_ADVANCED}, - {"max connections", P_INTEGER, P_LOCAL, &sDefault.iMaxConnections, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"paranoid server security", P_BOOL, P_GLOBAL, &Globals.paranoid_server_security, 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}, - - {"socket options", P_STRING, P_GLOBAL, &Globals.szSocketOptions, NULL, NULL, FLAG_ADVANCED}, - {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"use mmap", P_BOOL, P_GLOBAL, &Globals.bUseMmap, NULL, NULL, FLAG_ADVANCED}, - {"use sendfile", P_BOOL, P_LOCAL, &sDefault.bUseSendfile, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"hostname lookups", P_BOOL, P_GLOBAL, &Globals.bHostnameLookups, NULL, NULL, FLAG_ADVANCED}, - {"write cache size", P_INTEGER, P_LOCAL, &sDefault.iWriteCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED}, - - {"name cache timeout", P_INTEGER, P_GLOBAL, &Globals.name_cache_timeout, NULL, NULL, FLAG_ADVANCED}, - {"ctdbd socket", P_STRING, P_GLOBAL, &Globals.ctdbdSocket, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, - {"cluster addresses", P_LIST, P_GLOBAL, &Globals.szClusterAddresses, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, - {"clustering", P_BOOL, P_GLOBAL, &Globals.clustering, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, + { + .label = "block size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iBlock_size, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "deadtime", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.deadtime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "getwd cache", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.getwd_cache, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "keepalive", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iKeepalive, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "change notify", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bChangeNotify, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "directory name cache size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iDirectoryNameCacheSize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "kernel change notify", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bKernelChangeNotify, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + + { + .label = "lpq cache time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.lpqcachetime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max smbd processes", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iMaxSmbdProcesses, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max connections", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iMaxConnections, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "paranoid server security", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.paranoid_server_security, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max disk size", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.maxdisksize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "max open files", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.max_open_files, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "min print space", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iMinPrintSpace, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + + { + .label = "socket options", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szSocketOptions, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "strict allocate", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bStrictAllocate, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "strict sync", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bStrictSync, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "sync always", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bSyncAlways, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "use mmap", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUseMmap, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "use sendfile", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bUseSendfile, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "hostname lookups", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bHostnameLookups, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "write cache size", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iWriteCacheSize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED, + }, + + { + .label = "name cache timeout", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.name_cache_timeout, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ctdbd socket", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.ctdbdSocket, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "cluster addresses", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szClusterAddresses, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "clustering", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.clustering, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, {N_("Printing Options"), P_SEP, P_SEPARATOR}, - {"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, 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}, - {"iprint server", P_STRING, P_GLOBAL, &Globals.szIPrintServer, 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}, - {"enable spoolss", P_BOOLREV, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_HIDE}, - {"lpq command", P_STRING, P_LOCAL, &sDefault.szLpqcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - {"lprm command", P_STRING, P_LOCAL, &sDefault.szLprmcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - {"lppause command", P_STRING, P_LOCAL, &sDefault.szLppausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - {"lpresume command", P_STRING, P_LOCAL, &sDefault.szLpresumecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - {"queuepause command", P_STRING, P_LOCAL, &sDefault.szQueuepausecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - {"queueresume command", P_STRING, P_LOCAL, &sDefault.szQueueresumecommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL}, - - {"addport command", P_STRING, P_GLOBAL, &Globals.szAddPortCommand, NULL, NULL, FLAG_ADVANCED}, - {"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, FLAG_ADVANCED}, - {"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, FLAG_ADVANCED}, - {"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, FLAG_ADVANCED}, - {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, FLAG_ADVANCED}, - {"os2 driver map", P_STRING, P_GLOBAL, &Globals.szOs2DriverMap, NULL, NULL, FLAG_ADVANCED}, - - {"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, - {"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}, - {"printjob username", P_STRING, P_LOCAL, &sDefault.szPrintjobUsername, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, + { + .label = "max reported print jobs", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iMaxReportedPrintJobs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "max print jobs", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iMaxPrintJobs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "load printers", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bLoadPrinters, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "printcap cache time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.PrintcapCacheTime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "printcap name", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPrintcapname, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "printcap", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPrintcapname, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "printable", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bPrint_ok, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "print ok", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bPrint_ok, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "printing", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iPrinting, + .special = handle_printing, + .enum_list = enum_printing, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "cups options", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szCupsOptions, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "cups server", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szCupsServer, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "iprint server", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIPrintServer, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "print command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPrintcommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "disable spoolss", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDisableSpoolss, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "enable spoolss", + .type = P_BOOLREV, + .p_class = P_GLOBAL, + .ptr = &Globals.bDisableSpoolss, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "lpq command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szLpqcommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "lprm command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szLprmcommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "lppause command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szLppausecommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "lpresume command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szLpresumecommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "queuepause command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szQueuepausecommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + { + .label = "queueresume command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szQueueresumecommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, + }, + + { + .label = "addport command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddPortCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "enumports command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szEnumPortsCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "addprinter command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddPrinterCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "deleteprinter command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDeletePrinterCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "show add printer wizard", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bMsAddPrinterWizard, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "os2 driver map", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szOs2DriverMap, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "printer name", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPrintername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "printer", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPrintername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "use client driver", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bUseClientDriver, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "default devmode", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDefaultDevmode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "force printername", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bForcePrintername, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_PRINT, + }, + { + .label = "printjob username", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPrintjobUsername, + .special = NULL, + .enum_list = NULL, + .flags = 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_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}, - {"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}, - {"hide unreadable", P_BOOL, P_LOCAL, &sDefault.bHideUnReadable, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"hide unwriteable files", P_BOOL, P_LOCAL, &sDefault.bHideUnWriteableFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"delete veto files", P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, - {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, - {"veto oplock files", P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL }, - {"map archive", P_BOOL, P_LOCAL, &sDefault.bMap_archive, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"map hidden", P_BOOL, P_LOCAL, &sDefault.bMap_hidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"map system", P_BOOL, P_LOCAL, &sDefault.bMap_system, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"map readonly", P_ENUM, P_LOCAL, &sDefault.iMap_readonly, NULL, enum_map_readonly, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"mangled names", P_BOOL, P_LOCAL, &sDefault.bMangledNames, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"max stat cache size", P_INTEGER, P_GLOBAL, &Globals.iMaxStatCacheSize, NULL, NULL, FLAG_ADVANCED}, - {"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}, - {"dmapi support", P_BOOL, P_LOCAL, &sDefault.bDmapiSupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + { + .label = "mangling method", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szManglingMethod, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "mangle prefix", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.mangle_prefix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "default case", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iDefaultCase, + .special = NULL, + .enum_list = enum_case, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "case sensitive", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iCaseSensitive, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "casesignames", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iCaseSensitive, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL | FLAG_HIDE, + }, + { + .label = "preserve case", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bCasePreserve, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "short preserve case", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bShortCasePreserve, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "mangling char", + .type = P_CHAR, + .p_class = P_LOCAL, + .ptr = &sDefault.magic_char, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "hide dot files", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bHideDotFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "hide special files", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bHideSpecialFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "hide unreadable", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bHideUnReadable, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "hide unwriteable files", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bHideUnWriteableFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "delete veto files", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDeleteVetoFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "veto files", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szVetoFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "hide files", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szHideFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "veto oplock files", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szVetoOplockFiles, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "map archive", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMap_archive, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "map hidden", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMap_hidden, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "map system", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMap_system, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "map readonly", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iMap_readonly, + .special = NULL, + .enum_list = enum_map_readonly, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "mangled names", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMangledNames, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "max stat cache size", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iMaxStatCacheSize, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "stat cache", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bStatCache, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "store dos attributes", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bStoreDosAttributes, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "dmapi support", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDmapiSupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, {N_("Domain Options"), P_SEP, P_SEPARATOR}, - {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, + { + .label = "machine password timeout", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.machine_password_timeout, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_WIZARD, + }, {N_("Logon Options"), P_SEP, P_SEPARATOR}, - {"add user script", P_STRING, P_GLOBAL, &Globals.szAddUserScript, NULL, NULL, FLAG_ADVANCED}, - {"rename user script", P_STRING, P_GLOBAL, &Globals.szRenameUserScript, NULL, NULL, FLAG_ADVANCED}, - {"delete user script", P_STRING, P_GLOBAL, &Globals.szDelUserScript, NULL, NULL, FLAG_ADVANCED}, - {"add group script", P_STRING, P_GLOBAL, &Globals.szAddGroupScript, NULL, NULL, FLAG_ADVANCED}, - {"delete group script", P_STRING, P_GLOBAL, &Globals.szDelGroupScript, NULL, NULL, FLAG_ADVANCED}, - {"add user to group script", P_STRING, P_GLOBAL, &Globals.szAddUserToGroupScript, NULL, NULL, FLAG_ADVANCED}, - {"delete user from group script", P_STRING, P_GLOBAL, &Globals.szDelUserFromGroupScript, NULL, NULL, FLAG_ADVANCED}, - {"set primary group script", P_STRING, P_GLOBAL, &Globals.szSetPrimaryGroupScript, NULL, NULL, FLAG_ADVANCED}, - {"add machine script", P_STRING, P_GLOBAL, &Globals.szAddMachineScript, NULL, NULL, FLAG_ADVANCED}, - {"shutdown script", P_STRING, P_GLOBAL, &Globals.szShutdownScript, NULL, NULL, FLAG_ADVANCED}, - {"abort shutdown script", P_STRING, P_GLOBAL, &Globals.szAbortShutdownScript, NULL, NULL, FLAG_ADVANCED}, - {"username map script", P_STRING, P_GLOBAL, &Globals.szUsernameMapScript, NULL, NULL, FLAG_ADVANCED}, - - {"logon script", P_STRING, P_GLOBAL, &Globals.szLogonScript, NULL, NULL, FLAG_ADVANCED}, - {"logon path", P_STRING, P_GLOBAL, &Globals.szLogonPath, NULL, NULL, FLAG_ADVANCED}, - {"logon drive", P_STRING, P_GLOBAL, &Globals.szLogonDrive, NULL, NULL, FLAG_ADVANCED}, - {"logon home", P_STRING, P_GLOBAL, &Globals.szLogonHome, NULL, NULL, FLAG_ADVANCED}, - {"domain logons", P_BOOL, P_GLOBAL, &Globals.bDomainLogons, NULL, NULL, FLAG_ADVANCED}, + { + .label = "add user script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddUserScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "rename user script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRenameUserScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "delete user script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDelUserScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "add group script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddGroupScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "delete group script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDelGroupScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "add user to group script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddUserToGroupScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "delete user from group script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDelUserFromGroupScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "set primary group script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szSetPrimaryGroupScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "add machine script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddMachineScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "shutdown script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szShutdownScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "abort shutdown script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAbortShutdownScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "username map script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsernameMapScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "logon script", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogonScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "logon path", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogonPath, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "logon drive", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogonDrive, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "logon home", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogonHome, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "domain logons", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDomainLogons, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Browse Options"), P_SEP, P_SEPARATOR}, - {"os level", P_INTEGER, P_GLOBAL, &Globals.os_level, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, - {"lm announce", P_ENUM, P_GLOBAL, &Globals.lm_announce, NULL, enum_bool_auto, FLAG_ADVANCED}, - {"lm interval", P_INTEGER, P_GLOBAL, &Globals.lm_interval, NULL, NULL, FLAG_ADVANCED}, - {"preferred master", P_ENUM, P_GLOBAL, &Globals.iPreferredMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, - {"prefered master", P_ENUM, P_GLOBAL, &Globals.iPreferredMaster, NULL, enum_bool_auto, FLAG_HIDE}, - {"local master", P_BOOL, P_GLOBAL, &Globals.bLocalMaster, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED}, - {"domain master", P_ENUM, P_GLOBAL, &Globals.iDomainMaster, NULL, enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, - {"browse list", P_BOOL, P_GLOBAL, &Globals.bBrowseList, NULL, NULL, FLAG_ADVANCED}, - {"browseable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"browsable", P_BOOL, P_LOCAL, &sDefault.bBrowseable, NULL, NULL, FLAG_HIDE}, - {"enhanced browsing", P_BOOL, P_GLOBAL, &Globals.enhanced_browsing, NULL, NULL, FLAG_ADVANCED}, + { + .label = "os level", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.os_level, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "lm announce", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.lm_announce, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_ADVANCED, + }, + { + .label = "lm interval", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.lm_interval, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "preferred master", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.iPreferredMaster, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "prefered master", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.iPreferredMaster, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_HIDE, + }, + { + .label = "local master", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bLocalMaster, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "domain master", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.iDomainMaster, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_BASIC | FLAG_ADVANCED, + }, + { + .label = "browse list", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bBrowseList, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "browseable", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bBrowseable, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "browsable", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bBrowseable, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "enhanced browsing", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.enhanced_browsing, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("WINS Options"), P_SEP, P_SEPARATOR}, - {"dns proxy", P_BOOL, P_GLOBAL, &Globals.bDNSproxy, NULL, NULL, FLAG_ADVANCED}, - {"wins proxy", P_BOOL, P_GLOBAL, &Globals.bWINSproxy, NULL, NULL, FLAG_ADVANCED}, + { + .label = "dns proxy", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bDNSproxy, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "wins proxy", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWINSproxy, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, - {"wins server", P_LIST, P_GLOBAL, &Globals.szWINSservers, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"wins support", P_BOOL, P_GLOBAL, &Globals.bWINSsupport, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, - {"wins hook", P_STRING, P_GLOBAL, &Globals.szWINSHook, NULL, NULL, FLAG_ADVANCED}, + { + .label = "wins server", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szWINSservers, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "wins support", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWINSsupport, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD, + }, + { + .label = "wins hook", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szWINSHook, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Locking Options"), P_SEP, P_SEPARATOR}, - {"blocking locks", P_BOOL, P_LOCAL, &sDefault.bBlockingLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"csc policy", P_ENUM, P_LOCAL, &sDefault.iCSCPolicy, NULL, enum_csc_policy, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"fake oplocks", P_BOOL, P_LOCAL, &sDefault.bFakeOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"kernel oplocks", P_BOOL, P_GLOBAL, &Globals.bKernelOplocks, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, - {"locking", P_BOOL, P_LOCAL, &sDefault.bLocking, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"lock spin time", P_INTEGER, P_GLOBAL, &Globals.iLockSpinTime, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, - - {"oplocks", P_BOOL, P_LOCAL, &sDefault.bOpLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"level2 oplocks", P_BOOL, P_LOCAL, &sDefault.bLevel2OpLocks, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"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_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}, + { + .label = "blocking locks", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bBlockingLocks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "csc policy", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iCSCPolicy, + .special = NULL, + .enum_list = enum_csc_policy, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "fake oplocks", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bFakeOplocks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "kernel oplocks", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bKernelOplocks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "locking", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bLocking, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "lock spin time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iLockSpinTime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + + { + .label = "oplocks", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bOpLocks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "level2 oplocks", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bLevel2OpLocks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "oplock break wait time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.oplock_break_wait_time, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL, + }, + { + .label = "oplock contention limit", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iOplockContentionLimit, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "posix locking", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bPosixLocking, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "strict locking", + .type = P_ENUM, + .p_class = P_LOCAL, + .ptr = &sDefault.iStrictLocking, + .special = NULL, + .enum_list = enum_bool_auto, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "share modes", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bShareModes, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, {N_("Ldap Options"), P_SEP, P_SEPARATOR}, - {"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 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 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 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 page size", P_INTEGER, P_GLOBAL, &Globals.ldap_page_size, NULL, NULL, FLAG_ADVANCED}, - {"ldap user suffix", P_STRING, P_GLOBAL, &Globals.szLdapUserSuffix, NULL, NULL, FLAG_ADVANCED}, + { + .label = "ldap admin dn", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapAdminDn, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap delete dn", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_delete_dn, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap group suffix", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapGroupSuffix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap idmap suffix", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapIdmapSuffix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap machine suffix", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapMachineSuffix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap passwd sync", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_passwd_sync, + .special = NULL, + .enum_list = enum_ldap_passwd_sync, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap password sync", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_passwd_sync, + .special = NULL, + .enum_list = enum_ldap_passwd_sync, + .flags = FLAG_HIDE, + }, + { + .label = "ldap replication sleep", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_replication_sleep, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap suffix", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapSuffix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap ssl", + .type = P_ENUM, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_ssl, + .special = NULL, + .enum_list = enum_ldap_ssl, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap timeout", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_timeout, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap page size", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_page_size, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap user suffix", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLdapUserSuffix, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, - {"ldap debug level", P_INTEGER, P_GLOBAL, &Globals.ldap_debug_level, handle_ldap_debug_level, NULL, FLAG_ADVANCED}, - {"ldap debug threshold", P_INTEGER, P_GLOBAL, &Globals.ldap_debug_threshold, NULL, NULL, FLAG_ADVANCED}, + { + .label = "ldap debug level", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_debug_level, + .special = handle_ldap_debug_level, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "ldap debug threshold", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_debug_threshold, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("EventLog Options"), P_SEP, P_SEPARATOR}, - {"eventlog list", P_LIST, P_GLOBAL, &Globals.szEventLogs, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE}, + { + .label = "eventlog list", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szEventLogs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, + }, {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, - {"add share command", P_STRING, P_GLOBAL, &Globals.szAddShareCommand, NULL, NULL, FLAG_ADVANCED}, - {"change share command", P_STRING, P_GLOBAL, &Globals.szChangeShareCommand, NULL, NULL, FLAG_ADVANCED}, - {"delete share command", P_STRING, P_GLOBAL, &Globals.szDeleteShareCommand, NULL, NULL, FLAG_ADVANCED}, - - {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE}, - {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, - {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED}, - {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED}, - {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE}, - {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED}, + { + .label = "add share command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAddShareCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "change share command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szChangeShareCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "delete share command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDeleteShareCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "config file", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szConfigFile, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "preload", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAutoServices, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "auto services", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAutoServices, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "lock directory", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLockDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "lock dir", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLockDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "pid directory", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPidDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, #ifdef WITH_UTMP - {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED}, - {"wtmp directory", P_STRING, P_GLOBAL, &Globals.szWtmpDir, NULL, NULL, FLAG_ADVANCED}, - {"utmp", P_BOOL, P_GLOBAL, &Globals.bUtmp, NULL, NULL, FLAG_ADVANCED}, + { + .label = "utmp directory", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szUtmpDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "wtmp directory", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szWtmpDir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "utmp", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUtmp, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, #endif - {"default service", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, - {"default", P_STRING, P_GLOBAL, &Globals.szDefaultService, NULL, NULL, FLAG_ADVANCED}, - {"message command", P_STRING, P_GLOBAL, &Globals.szMsgCommand, NULL, NULL, FLAG_ADVANCED}, - {"dfree cache time", P_INTEGER, P_LOCAL, &sDefault.iDfreeCacheTime, NULL, NULL, FLAG_ADVANCED}, - {"dfree command", P_STRING, P_LOCAL, &sDefault.szDfree, NULL, NULL, FLAG_ADVANCED}, - {"get quota command", P_STRING, P_GLOBAL, &Globals.szGetQuota, NULL, NULL, FLAG_ADVANCED}, - {"set quota command", P_STRING, P_GLOBAL, &Globals.szSetQuota, NULL, NULL, FLAG_ADVANCED}, - {"remote announce", P_STRING, P_GLOBAL, &Globals.szRemoteAnnounce, 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_STRING, P_GLOBAL, &Globals.szAfsUsernameMap, NULL, NULL, FLAG_ADVANCED}, - {"afs token lifetime", P_INTEGER, P_GLOBAL, &Globals.iAfsTokenLifetime, NULL, NULL, FLAG_ADVANCED}, - {"log nt token command", P_STRING, P_GLOBAL, &Globals.szLogNtTokenCommand, 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}, - {"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}, - {"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, - {"registry shares", P_BOOL, P_GLOBAL, &Globals.bRegistryShares, NULL, NULL, FLAG_ADVANCED}, - {"usershare allow guests", P_BOOL, P_GLOBAL, &Globals.bUsershareAllowGuests, NULL, NULL, FLAG_ADVANCED}, - {"usershare max shares", P_INTEGER, P_GLOBAL, &Globals.iUsershareMaxShares, NULL, NULL, FLAG_ADVANCED}, - {"usershare owner only", P_BOOL, P_GLOBAL, &Globals.bUsershareOwnerOnly, NULL, NULL, FLAG_ADVANCED}, - {"usershare path", P_STRING, P_GLOBAL, &Globals.szUsersharePath, NULL, NULL, FLAG_ADVANCED}, - {"usershare prefix allow list", P_LIST, P_GLOBAL, &Globals.szUsersharePrefixAllowList, NULL, NULL, FLAG_ADVANCED}, - {"usershare prefix deny list", P_LIST, P_GLOBAL, &Globals.szUsersharePrefixDenyList, NULL, NULL, FLAG_ADVANCED}, - {"usershare template share", P_STRING, P_GLOBAL, &Globals.szUsershareTemplateShare, NULL, NULL, FLAG_ADVANCED}, - {"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}, - {"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}, - {"magic script", P_STRING, P_LOCAL, &sDefault.szMagicScript, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"magic output", P_STRING, P_LOCAL, &sDefault.szMagicOutput, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"delete readonly", P_BOOL, P_LOCAL, &sDefault.bDeleteReadonly, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"dos filemode", P_BOOL, P_LOCAL, &sDefault.bDosFilemode, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetimes", P_BOOL, P_LOCAL, &sDefault.bDosFiletimes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"dos filetime resolution", P_BOOL, P_LOCAL, &sDefault.bDosFiletimeResolution, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - - {"fake directory create times", P_BOOL, P_LOCAL, &sDefault.bFakeDirCreateTimes, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, - {"panic action", P_STRING, P_GLOBAL, &Globals.szPanicAction, NULL, NULL, FLAG_ADVANCED}, + { + .label = "default service", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDefaultService, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "default", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szDefaultService, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "message command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szMsgCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "dfree cache time", + .type = P_INTEGER, + .p_class = P_LOCAL, + .ptr = &sDefault.iDfreeCacheTime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "dfree command", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szDfree, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "get quota command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szGetQuota, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "set quota command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szSetQuota, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "remote announce", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRemoteAnnounce, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "remote browse sync", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szRemoteBrowseSync, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "socket address", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szSocketAddress, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "homedir map", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szNISHomeMapName, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "afs username map", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szAfsUsernameMap, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "afs token lifetime", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iAfsTokenLifetime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "log nt token command", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szLogNtTokenCommand, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "time offset", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &extra_time_offset, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "NIS homedir", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bNISHomeMap, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "-valid", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.valid, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + + { + .label = "copy", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szCopy, + .special = handle_copy, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "include", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szInclude, + .special = handle_include, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "preexec", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPreExec, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "exec", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPreExec, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + + { + .label = "preexec close", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bPreexecClose, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "postexec", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szPostExec, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "root preexec", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szRootPreExec, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "root preexec close", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bRootpreexecClose, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "root postexec", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szRootPostExec, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "available", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bAvailable, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT, + }, + { + .label = "registry shares", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bRegistryShares, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare allow guests", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUsershareAllowGuests, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare max shares", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iUsershareMaxShares, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare owner only", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bUsershareOwnerOnly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare path", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsersharePath, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare prefix allow list", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsersharePrefixAllowList, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare prefix deny list", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsersharePrefixDenyList, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "usershare template share", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szUsershareTemplateShare, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "volume", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.volume, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "fstype", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.fstype, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "set directory", + .type = P_BOOLREV, + .p_class = P_LOCAL, + .ptr = &sDefault.bNo_set_dir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "wide links", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bWidelinks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "follow symlinks", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bSymlinks, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "dont descend", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szDontdescend, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "magic script", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szMagicScript, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "magic output", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szMagicOutput, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "delete readonly", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDeleteReadonly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "dos filemode", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDosFilemode, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "dos filetimes", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDosFiletimes, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "dos filetime resolution", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bDosFiletimeResolution, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + + { + .label = "fake directory create times", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bFakeDirCreateTimes, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, + }, + { + .label = "panic action", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szPanicAction, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("VFS module options"), P_SEP, P_SEPARATOR}, - {"vfs objects", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"vfs object", P_LIST, P_LOCAL, &sDefault.szVfsObjects, NULL, NULL, FLAG_HIDE}, + { + .label = "vfs objects", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szVfsObjects, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "vfs object", + .type = P_LIST, + .p_class = P_LOCAL, + .ptr = &sDefault.szVfsObjects, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, {N_("MSDFS options"), P_SEP, P_SEPARATOR}, - {"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, - {"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED}, + { + .label = "msdfs root", + .type = P_BOOL, + .p_class = P_LOCAL, + .ptr = &sDefault.bMSDfsRoot, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "msdfs proxy", + .type = P_STRING, + .p_class = P_LOCAL, + .ptr = &sDefault.szMSDfsProxy, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, + { + .label = "host msdfs", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bHostMSDfs, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {N_("Winbind options"), P_SEP, P_SEPARATOR}, - {"passdb expand explicit", P_BOOL, P_GLOBAL, &Globals.bPassdbExpandExplicit, NULL, NULL, FLAG_ADVANCED}, - {"idmap domains", P_LIST, P_GLOBAL, &Globals.szIdmapDomains, NULL, NULL, FLAG_ADVANCED}, - {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED }, - {"idmap alloc backend", P_STRING, P_GLOBAL, &Globals.szIdmapAllocBackend, NULL, NULL, FLAG_ADVANCED}, - {"idmap cache time", P_INTEGER, P_GLOBAL, &Globals.iIdmapCacheTime, NULL, NULL, FLAG_ADVANCED}, - {"idmap negative cache time", P_INTEGER, P_GLOBAL, &Globals.iIdmapNegativeCacheTime, 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 }, - {"winbind gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_HIDE }, - {"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, 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 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}, - {"winbind expand groups", P_INTEGER, P_GLOBAL, &Globals.winbind_expand_groups, NULL, NULL, FLAG_ADVANCED}, - {"winbind nss info", P_LIST, P_GLOBAL, &Globals.szWinbindNssInfo, NULL, NULL, FLAG_ADVANCED}, - {"winbind refresh tickets", P_BOOL, P_GLOBAL, &Globals.bWinbindRefreshTickets, NULL, NULL, FLAG_ADVANCED}, - {"winbind offline logon", P_BOOL, P_GLOBAL, &Globals.bWinbindOfflineLogon, NULL, NULL, FLAG_ADVANCED}, - {"winbind normalize names", P_BOOL, P_GLOBAL, &Globals.bWinbindNormalizeNames, NULL, NULL, FLAG_ADVANCED}, - {"winbind rpc only", P_BOOL, P_GLOBAL, &Globals.bWinbindRpcOnly, NULL, NULL, FLAG_ADVANCED}, + { + .label = "passdb expand explicit", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bPassdbExpandExplicit, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap domains", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapDomains, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap backend", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapBackend, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap alloc backend", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapAllocBackend, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap cache time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iIdmapCacheTime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap negative cache time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.iIdmapNegativeCacheTime, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "idmap uid", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapUID, + .special = handle_idmap_uid, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind uid", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapUID, + .special = handle_idmap_uid, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "idmap gid", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapGID, + .special = handle_idmap_gid, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind gid", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szIdmapGID, + .special = handle_idmap_gid, + .enum_list = NULL, + .flags = FLAG_HIDE, + }, + { + .label = "template homedir", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szTemplateHomedir, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "template shell", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szTemplateShell, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind separator", + .type = P_STRING, + .p_class = P_GLOBAL, + .ptr = &Globals.szWinbindSeparator, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind cache time", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.winbind_cache_time, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind enum users", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindEnumUsers, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind enum groups", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindEnumGroups, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind use default domain", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindUseDefaultDomain, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind trusted domains only", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindTrustedDomainsOnly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind nested groups", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindNestedGroups, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind expand groups", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.winbind_expand_groups, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind nss info", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szWinbindNssInfo, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind refresh tickets", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindRefreshTickets, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind offline logon", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindOfflineLogon, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind normalize names", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindNormalizeNames, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, + { + .label = "winbind rpc only", + .type = P_BOOL, + .p_class = P_GLOBAL, + .ptr = &Globals.bWinbindRpcOnly, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, {NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0} }; -- cgit From b99ca190401995044d03c33a3387e2c560977e87 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 10 Mar 2008 14:10:58 +0100 Subject: loadparm: fix spacing in parm_table (training spaces and empty lines). Michael (This used to be commit 91aab823fc6ec4c38e3461aae57bec0c6a567150) --- source3/param/loadparm.c | 59 ++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 033a4cf8d0..a8883e0631 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -874,7 +874,7 @@ static const struct enum_list enum_config_backend[] = { */ static struct parm_struct parm_table[] = { - {N_("Base Options"), P_SEP, P_SEPARATOR}, + {N_("Base Options"), P_SEP, P_SEPARATOR}, { .label = "dos charset", @@ -1004,7 +1004,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_WIZARD, }, - { .label = "config backend", .type = P_ENUM, @@ -1015,7 +1014,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Security Options"), P_SEP, P_SEPARATOR}, + {N_("Security Options"), P_SEP, P_SEPARATOR}, { .label = "security", @@ -1342,7 +1341,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "username", .type = P_STRING, @@ -1370,7 +1368,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_HIDE, }, - { .label = "invalid users", .type = P_LIST, @@ -1452,7 +1449,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "read only", .type = P_BOOL, @@ -1489,7 +1485,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_HIDE, }, - { .label = "acl check permissions", .type = P_BOOL, @@ -1689,7 +1684,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_HIDE, }, - { .label = "only user", .type = P_BOOL, @@ -1754,7 +1748,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Logging Options"), P_SEP, P_SEPARATOR}, + {N_("Logging Options"), P_SEP, P_SEPARATOR}, { .label = "log level", @@ -1801,7 +1795,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "max log size", .type = P_INTEGER, @@ -1884,7 +1877,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Protocol Options"), P_SEP, P_SEPARATOR}, + {N_("Protocol Options"), P_SEP, P_SEPARATOR}, { .label = "allocation roundup size", @@ -2012,7 +2005,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "acl compatibility", .type = P_ENUM, @@ -2076,7 +2068,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, }, - { .label = "announce version", .type = P_STRING, @@ -2131,7 +2122,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "name resolve order", .type = P_STRING, @@ -2259,7 +2249,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Tuning Options"), P_SEP, P_SEPARATOR}, + {N_("Tuning Options"), P_SEP, P_SEPARATOR}, { .label = "block size", @@ -2324,7 +2314,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_SHARE, }, - { .label = "lpq cache time", .type = P_INTEGER, @@ -2388,7 +2377,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_PRINT, }, - { .label = "socket options", .type = P_STRING, @@ -2461,7 +2449,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_DEPRECATED, }, - { .label = "name cache timeout", .type = P_INTEGER, @@ -2499,7 +2486,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_GLOBAL, }, - {N_("Printing Options"), P_SEP, P_SEPARATOR}, + {N_("Printing Options"), P_SEP, P_SEPARATOR}, { .label = "max reported print jobs", @@ -2690,7 +2677,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL, }, - { .label = "addport command", .type = P_STRING, @@ -2801,7 +2787,8 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_PRINT, }, - {N_("Filename Handling"), P_SEP, P_SEPARATOR}, + {N_("Filename Handling"), P_SEP, P_SEPARATOR}, + { .label = "mangling method", .type = P_STRING, @@ -3030,7 +3017,7 @@ static struct parm_struct parm_table[] = { }, - {N_("Domain Options"), P_SEP, P_SEPARATOR}, + {N_("Domain Options"), P_SEP, P_SEPARATOR}, { .label = "machine password timeout", @@ -3042,7 +3029,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_WIZARD, }, - {N_("Logon Options"), P_SEP, P_SEPARATOR}, + {N_("Logon Options"), P_SEP, P_SEPARATOR}, { .label = "add user script", @@ -3152,7 +3139,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "logon script", .type = P_STRING, @@ -3199,7 +3185,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Browse Options"), P_SEP, P_SEPARATOR}, + {N_("Browse Options"), P_SEP, P_SEPARATOR}, { .label = "os level", @@ -3301,7 +3287,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("WINS Options"), P_SEP, P_SEPARATOR}, + {N_("WINS Options"), P_SEP, P_SEPARATOR}, { .label = "dns proxy", @@ -3321,7 +3307,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "wins server", .type = P_LIST, @@ -3350,7 +3335,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Locking Options"), P_SEP, P_SEPARATOR}, + {N_("Locking Options"), P_SEP, P_SEPARATOR}, { .label = "blocking locks", @@ -3406,7 +3391,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_GLOBAL, }, - { .label = "oplocks", .type = P_BOOL, @@ -3471,7 +3455,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, }, - {N_("Ldap Options"), P_SEP, P_SEPARATOR}, + {N_("Ldap Options"), P_SEP, P_SEPARATOR}, { .label = "ldap admin dn", @@ -3590,7 +3574,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "ldap debug level", .type = P_INTEGER, @@ -3610,8 +3593,8 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, + {N_("EventLog Options"), P_SEP, P_SEPARATOR}, - {N_("EventLog Options"), P_SEP, P_SEPARATOR}, { .label = "eventlog list", .type = P_LIST, @@ -3622,7 +3605,8 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, }, - {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, + {N_("Miscellaneous Options"), P_SEP, P_SEPARATOR}, + { .label = "add share command", .type = P_STRING, @@ -3650,7 +3634,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "config file", .type = P_STRING, @@ -3734,7 +3717,6 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, #endif - { .label = "default service", .type = P_STRING, @@ -3888,7 +3870,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_HIDE, }, - { .label = "copy", .type = P_STRING, @@ -3925,7 +3906,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { .label = "preexec close", .type = P_BOOL, @@ -4160,7 +4140,6 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, }, - { .label = "fake directory create times", .type = P_BOOL, @@ -4180,7 +4159,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("VFS module options"), P_SEP, P_SEPARATOR}, + {N_("VFS module options"), P_SEP, P_SEPARATOR}, { .label = "vfs objects", @@ -4232,7 +4211,7 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, - {N_("Winbind options"), P_SEP, P_SEPARATOR}, + {N_("Winbind options"), P_SEP, P_SEPARATOR}, { .label = "passdb expand explicit", -- cgit From ffb45fd8f89e00ae9ad4fc27b5f76009302fbac8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 10 Mar 2008 14:23:02 +0100 Subject: loadparm: fix whitespaces in global and service parameter structs. Michael (This used to be commit 10ab0681e60e3b91958639a2b0ad359440076c4a) --- source3/param/loadparm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a8883e0631..b33b1dcfd4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -99,7 +99,7 @@ struct _param_opt_struct { char **list; }; -/* +/* * This structure describes global (ie., server-wide) parameters. */ typedef struct { @@ -136,7 +136,7 @@ typedef struct { char *szRealm; char *szAfsUsernameMap; int iAfsTokenLifetime; - char *szLogNtTokenCommand; + char *szLogNtTokenCommand; char *szUsernameMap; char *szLogonScript; char *szLogonPath; @@ -156,7 +156,7 @@ typedef struct { char *szNameResolveOrder; char *szPanicAction; char *szAddUserScript; - char *szRenameUserScript; + char *szRenameUserScript; char *szDelUserScript; char *szAddGroupScript; char *szDelGroupScript; @@ -195,7 +195,7 @@ typedef struct { char *szAddShareCommand; char *szChangeShareCommand; char *szDeleteShareCommand; - char **szEventLogs; + char **szEventLogs; char *szGuestaccount; char *szManglingMethod; char **szServicesList; @@ -328,7 +328,6 @@ typedef struct { int iUsershareMaxShares; int iIdmapCacheTime; int iIdmapNegativeCacheTime; - bool bResetOnZeroVC; int iKeepalive; int iminreceivefile; @@ -337,8 +336,8 @@ typedef struct { static global Globals; -/* - * This structure describes a single service. +/* + * This structure describes a single service. */ typedef struct { bool valid; -- cgit From 080fedd25ee56ebd437a4b86469922d00babf619 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 10 Mar 2008 14:39:19 +0100 Subject: loadparm: replace typedef struct {} global/service by struct global/struct service. Michael (This used to be commit ab70e781b2d4cc7f8a7f6cf95825f8412d9be2ca) --- source3/param/loadparm.c | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b33b1dcfd4..d17fa16cbb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -102,7 +102,7 @@ struct _param_opt_struct { /* * This structure describes global (ie., server-wide) parameters. */ -typedef struct { +struct global { int ConfigBackend; char *smb_ports; char *dos_charset; @@ -332,14 +332,14 @@ typedef struct { int iKeepalive; int iminreceivefile; param_opt_struct *param_opt; -} global; +}; -static global Globals; +static struct global Globals; /* * This structure describes a single service. */ -typedef struct { +struct service { bool valid; bool autoloaded; int usershare; @@ -478,11 +478,11 @@ typedef struct { param_opt_struct *param_opt; char dummy[3]; /* for alignment */ -} service; +}; /* This is a default service used to prime a services structure */ -static service sDefault = { +static struct service sDefault = { True, /* valid */ False, /* not autoloaded */ 0, /* not a usershare */ @@ -628,7 +628,7 @@ static service sDefault = { }; /* local variables */ -static service **ServicePtrs = NULL; +static struct service **ServicePtrs = NULL; static int iNumServices = 0; static int iServiceIndex = 0; static struct db_context *ServiceHash; @@ -4445,7 +4445,7 @@ static struct parm_struct parm_table[] = { Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ -static void init_printer_values(service *pService) +static void init_printer_values(struct service *pService) { /* choose defaults depending on the type of printing */ switch (pService->iPrinting) { @@ -5314,13 +5314,13 @@ static int map_parameter_canonical(const char *pszParmName, bool *inverse); static bool set_boolean(bool *pb, const char *pszParmValue); static const char *get_boolean(bool bool_value); static int getservicebyname(const char *pszServiceName, - service * pserviceDest); -static void copy_service(service * pserviceDest, - service * pserviceSource, + struct service *pserviceDest); +static void copy_service(struct service *pserviceDest, + struct service *pserviceSource, struct bitmap *pcopymapDest); static bool do_parameter(const char *pszParmName, const char *pszParmValue); static bool do_section(const char *pszSectionName); -static void init_copymap(service * pservice); +static void init_copymap(struct service *pservice); static bool hash_a_service(const char *name, int number); static void free_service_byindex(int iService); static char * canonicalize_servicename(const char *name); @@ -5568,9 +5568,9 @@ int lp_parm_enum(int snum, const char *type, const char *option, Initialise a service to the defaults. ***************************************************************************/ -static void init_service(service * pservice) +static void init_service(struct service *pservice) { - memset((char *)pservice, '\0', sizeof(service)); + memset((char *)pservice, '\0', sizeof(struct service)); copy_service(pservice, &sDefault, NULL); } @@ -5578,7 +5578,7 @@ static void init_service(service * pservice) Free the dynamically allocated parts of a service struct. ***************************************************************************/ -static void free_service(service *pservice) +static void free_service(struct service *pservice) { int i; param_opt_struct *data, *pdata; @@ -5655,10 +5655,10 @@ static void free_service_byindex(int idx) service. ***************************************************************************/ -static int add_a_service(const service *pservice, const char *name) +static int add_a_service(const struct service *pservice, const char *name) { int i; - service tservice; + struct service tservice; int num_to_alloc = iNumServices + 1; param_opt_struct *data, *pdata; @@ -5692,16 +5692,16 @@ static int add_a_service(const service *pservice, const char *name) /* if not, then create one */ if (i == iNumServices) { - service **tsp; + struct service **tsp; int *tinvalid; - tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, service *, num_to_alloc); + tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct service *, num_to_alloc); if (tsp == NULL) { DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n")); return (-1); } ServicePtrs = tsp; - ServicePtrs[iNumServices] = SMB_MALLOC_P(service); + ServicePtrs[iNumServices] = SMB_MALLOC_P(struct service); if (!ServicePtrs[iNumServices]) { DEBUG(0,("add_a_service: out of memory!\n")); return (-1); @@ -6305,7 +6305,7 @@ bool lp_canonicalize_boolean(const char *str, const char**canon_str) Find a service by name. Otherwise works like get_service. ***************************************************************************/ -static int getservicebyname(const char *pszServiceName, service * pserviceDest) +static int getservicebyname(const char *pszServiceName, struct service *pserviceDest) { int iService = -1; char *canon_name; @@ -6338,7 +6338,7 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) If pcopymapDest is NULL then copy all fields ***************************************************************************/ -static void copy_service(service * pserviceDest, service * pserviceSource, +static void copy_service(struct service *pserviceDest, struct service *pserviceSource, struct bitmap *pcopymapDest) { int i; @@ -6745,7 +6745,7 @@ static bool handle_copy(int snum, const char *pszParmValue, char **ptr) { bool bRetval; int iTemp; - service serviceTemp; + struct service serviceTemp; string_set(ptr, pszParmValue); @@ -6947,7 +6947,7 @@ static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue static bool handle_printing(int snum, const char *pszParmValue, char **ptr) { static int parm_num = -1; - service *s; + struct service *s; if ( parm_num == -1 ) parm_num = map_parameter( "printing" ); @@ -6969,7 +6969,7 @@ static bool handle_printing(int snum, const char *pszParmValue, char **ptr) Initialise a copymap. ***************************************************************************/ -static void init_copymap(service * pservice) +static void init_copymap(struct service *pservice) { int i; if (pservice->copymap) { @@ -7416,7 +7416,7 @@ bool lp_is_default(int snum, struct parm_struct *parm) Display the contents of a single services record. ***************************************************************************/ -static void dump_a_service(service * pService, FILE * f) +static void dump_a_service(struct service *pService, FILE * f) { int i; param_opt_struct *data; @@ -7513,7 +7513,7 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal) if (isGlobal) { ptr = parm_table[i].ptr; } else { - service * pService = ServicePtrs[snum]; + struct service *pService = ServicePtrs[snum]; ptr = ((char *)pService) + PTR_DIFF(parm_table[i].ptr, &sDefault); } @@ -7574,7 +7574,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters) return &parm_table[(*i)++]; } } else { - service *pService = ServicePtrs[snum]; + struct service *pService = ServicePtrs[snum]; for (; parm_table[*i].label; (*i)++) { if (parm_table[*i].p_class == P_SEPARATOR) @@ -8241,7 +8241,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i /* Everything ok - add the service possibly using a template. */ if (iService < 0) { - const service *sp = &sDefault; + const struct service *sp = &sDefault; if (snum_template != -1) { sp = ServicePtrs[snum_template]; } -- cgit From 9fa02847b7c07ec3b1136261d54bbed7706dd0af Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 10 Mar 2008 17:16:01 +0100 Subject: loadparm: fix init_globals() to re-init all options event when called 2nd time. Up to the globals had only been fully reset when init_globals() was called for the first time. But a full restart is needed for use with "config backend = registry". (And should be with "config file = ...", but in this case the restart is outsourced to the daemons.) This left some options (like e.g. "realm") set to values that were set in smb.conf before the occurence of "config backend = registry". Now this misbehaviour is fixed with this change. Michael (This used to be commit f12259d9c4c34b99f5b655cab4b210159cb0e188) --- source3/param/loadparm.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d17fa16cbb..aaeafac21e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4535,6 +4535,7 @@ static void init_globals(bool first_time_only) { static bool done_init = False; char *s = NULL; + int i; /* If requested to initialize only once and we've already done it... */ if (first_time_only && done_init) { @@ -4543,30 +4544,39 @@ static void init_globals(bool first_time_only) } 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++) + done_init = True; + } else { + for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || parm_table[i].type == P_USTRING) && parm_table[i].ptr) - string_set((char **)parm_table[i].ptr, ""); - - string_set(&sDefault.fstype, FSTYPE_STRING); - string_set(&sDefault.szPrintjobUsername, "%U"); + { + string_free((char **)parm_table[i].ptr); + } + } + } - init_printer_values(&sDefault); + memset((void *)&Globals, '\0', sizeof(Globals)); - done_init = True; + for (i = 0; parm_table[i].label; i++) { + if ((parm_table[i].type == P_STRING || + parm_table[i].type == P_USTRING) && + parm_table[i].ptr) + { + string_set((char **)parm_table[i].ptr, ""); + } } + string_set(&sDefault.fstype, FSTYPE_STRING); + string_set(&sDefault.szPrintjobUsername, "%U"); + + init_printer_values(&sDefault); + DEBUG(3, ("Initialising global parameters\n")); -- cgit From 4f739abea5524153942bbb8b14bc8d2978738f34 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 11 Mar 2008 12:36:18 +0100 Subject: loadparm: use a function to check for the registry config backend. Michael (This used to be commit 4ac52a5a1dfe8f4f22e960db2e4ca99f9e262427) --- source3/param/loadparm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index aaeafac21e..c47e70492a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6596,7 +6596,7 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); - if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + if (lp_config_backend_is_registry()) { uint64_t conf_cur_seqnum; if (conf_ctx == NULL) { WERROR werr; @@ -8689,7 +8689,7 @@ bool lp_load(const char *pszFname, } } - if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + if (lp_config_backend_is_registry()) { /* * We need to use this extra global variable here to * survive restart: init_globals usese this as a default @@ -8702,7 +8702,7 @@ bool lp_load(const char *pszFname, return lp_load(pszFname, global_only, save_defaults, add_ipc, initialize_globals); } - } else if (lp_config_backend() == CONFIG_BACKEND_REGISTRY) { + } else if (lp_config_backend_is_registry()) { bRetval = process_registry_globals(do_parameter); } else { DEBUG(0, ("Illegal config backend given: %d\n", -- cgit From 62c9c6be22c453fb73970eb7da356bc8dbe5c133 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 11 Mar 2008 12:41:20 +0100 Subject: loadparm: add utility function to check for config backend file. Michael (This used to be commit 288495ec1a9b0c37bb3f98043f8f8dd946072bac) --- source3/param/loadparm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c47e70492a..8dfc432924 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6586,6 +6586,14 @@ bool lp_config_backend_is_registry(void) return (lp_config_backend() == CONFIG_BACKEND_REGISTRY); } +/** + * Utility function to check if the config backend is FILE. + */ +bool lp_config_backend_is_file(void) +{ + return (lp_config_backend() == CONFIG_BACKEND_FILE); +} + /******************************************************************* Check if a config file has changed date. ********************************************************************/ @@ -8666,7 +8674,7 @@ bool lp_load(const char *pszFname, Globals.param_opt = NULL; } - if (lp_config_backend() == CONFIG_BACKEND_FILE) { + if (lp_config_backend_is_file()) { n2 = alloc_sub_basic(get_current_username(), current_user_info.domain, pszFname); -- cgit From e14e348d067c0fd88a1c6e298f7e29082473a09a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Mar 2008 00:42:06 +0100 Subject: loadparm: fix a comment typo. Michael (This used to be commit 0a619d4dc476c945130fe47126d98cd47b39c34d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8dfc432924..12015540bb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8700,7 +8700,7 @@ bool lp_load(const char *pszFname, if (lp_config_backend_is_registry()) { /* * We need to use this extra global variable here to - * survive restart: init_globals usese this as a default + * survive restart: init_globals uses this as a default * for ConfigBackend. Otherwise, init_globals would * send us into an endless loop here. */ -- cgit From a3eae3039d9428f49e029cd1b7fbcbc1ec92f798 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Mar 2008 00:43:19 +0100 Subject: loadparm: add a comment Michael (This used to be commit 05eda1252572f310499b28123d0f9e4211b7d54c) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 12015540bb..f1bac54251 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8698,6 +8698,7 @@ bool lp_load(const char *pszFname, } if (lp_config_backend_is_registry()) { + /* config backend changed to registry in config file */ /* * We need to use this extra global variable here to * survive restart: init_globals uses this as a default -- cgit From 90fd5082a2084cf2436105938b47591cce6a9f82 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Mar 2008 00:54:48 +0100 Subject: loadparm: add convenience wrapper lp_kill_all_services() Michael (This used to be commit 32bfd131e33d06be9dfaef02b57f5401d2bc7639) --- source3/param/loadparm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f1bac54251..f02607f875 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7744,6 +7744,14 @@ void lp_killunused(bool (*snumused) (int)) } } +/** + * Kill all except autoloaded and usershare services - convenience wrapper + */ +void lp_kill_all_services(void) +{ + lp_killunused(NULL); +} + /*************************************************************************** Unload a service. ***************************************************************************/ -- cgit From 7af7afc59425d2480f220298e09b51e7647ec510 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Mar 2008 00:56:33 +0100 Subject: loadparm: remove services read from smb.conf when starting over for config backend registry. Michael (This used to be commit b942ff6b7f0be4898e05525558b354533dea312b) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f02607f875..05eece72b0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8716,6 +8716,7 @@ bool lp_load(const char *pszFname, config_backend = CONFIG_BACKEND_REGISTRY; /* start over */ init_globals(false); + lp_kill_all_services(); return lp_load(pszFname, global_only, save_defaults, add_ipc, initialize_globals); } -- cgit From 646f3b6fecdd98c6ded2966e4f672fd8c2f86f32 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Mar 2008 01:03:26 +0100 Subject: loadparm: add a debug message. Michael (This used to be commit ce943aeb581027daf813528481b44177d391b61d) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 05eece72b0..e144c03b61 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8715,6 +8715,8 @@ bool lp_load(const char *pszFname, */ config_backend = CONFIG_BACKEND_REGISTRY; /* start over */ + DEBUG(1, ("lp_load: changing to config backend " + "registry\n")); init_globals(false); lp_kill_all_services(); return lp_load(pszFname, global_only, save_defaults, -- cgit From 6274929b1e1ddf89f4c5e93414121eaf06b6ab14 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 17 Mar 2008 18:01:33 +0100 Subject: libsmbconf: rename all occurrences of libnet_conf_ to smbconf_ . Michael (This used to be commit 097af0309d7c3e9342058ba5266667293b23c80d) --- source3/param/loadparm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e144c03b61..900790498e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -73,7 +73,7 @@ extern userdom_struct current_user_info; static bool in_client = False; /* Not in the client by default */ static uint64_t conf_last_seqnum = 0; -static struct libnet_conf_ctx *conf_ctx = NULL; +static struct smbconf_ctx *conf_ctx = NULL; #define CONFIG_BACKEND_FILE 0 #define CONFIG_BACKEND_REGISTRY 1 @@ -6498,21 +6498,21 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) if (conf_ctx == NULL) { /* first time */ - werr = libnet_conf_open(NULL, &conf_ctx); + werr = smbconf_open(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { goto done; } } - if (!libnet_conf_share_exists(conf_ctx, GLOBAL_NAME)) { + if (!smbconf_share_exists(conf_ctx, GLOBAL_NAME)) { /* nothing to read from the registry yet but make sure lp_load * doesn't return false */ ret = true; goto done; } - werr = libnet_conf_get_share(mem_ctx, conf_ctx, GLOBAL_NAME, - &num_params, ¶m_names, ¶m_values); + werr = smbconf_get_share(mem_ctx, conf_ctx, GLOBAL_NAME, + &num_params, ¶m_names, ¶m_values); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6525,7 +6525,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) } ret = pfunc("registry shares", "yes"); - conf_last_seqnum = libnet_conf_get_seqnum(conf_ctx, NULL, NULL); + conf_last_seqnum = smbconf_get_seqnum(conf_ctx, NULL, NULL); done: TALLOC_FREE(mem_ctx); @@ -6608,14 +6608,14 @@ bool lp_file_list_changed(void) uint64_t conf_cur_seqnum; if (conf_ctx == NULL) { WERROR werr; - werr = libnet_conf_open(NULL, &conf_ctx); + werr = smbconf_open(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("error opening configuration: %s\n", dos_errstr(werr))); return false; } } - conf_cur_seqnum = libnet_conf_get_seqnum(conf_ctx, NULL, NULL); + conf_cur_seqnum = smbconf_get_seqnum(conf_ctx, NULL, NULL); if (conf_last_seqnum != conf_cur_seqnum) { DEBUGADD(6, ("regdb seqnum changed: old = %llu, " "new = %llu\n", -- cgit From 78d37365d4cdc459dc3839ed53b1ef5867ef8683 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 19 Mar 2008 11:00:29 +0100 Subject: loadparm: remove unneeded include. libnet.h unneeded after separation of libsmbconf from libnet. Michael (This used to be commit 5c3f14e02fa7baf11d9a6531f2de3e6b16d843b0) --- source3/param/loadparm.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 900790498e..6e66e51c3e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -52,7 +52,6 @@ */ #include "includes.h" -#include "libnet/libnet.h" bool bLoaded = False; -- cgit From f18722f88987ca2a8edc43552a4e0ff682b80214 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 19 Mar 2008 15:18:06 +0100 Subject: loadparm: reenable checking files for updates while in registry configuration. This is necessary now that includes (to files) are enabled from registry. Michael (This used to be commit 7dc64d1021e0b8f3339f811c8c144f7013a649a8) --- source3/param/loadparm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6e66e51c3e..04fade5789 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6621,15 +6621,6 @@ bool lp_file_list_changed(void) (unsigned long long)conf_last_seqnum, (unsigned long long)conf_cur_seqnum)); return true; - } else { - /* - * Don't check files when config_backend is registry. - * Remove this to obtain checking of files even with - * registry config backend. That would enable switching - * off registry configuration by changing smb.conf even - * without restarting smbd. - */ - return false; } } -- cgit From 7621b4c3d80f411aac6e40ea5cce787cec108af5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Mar 2008 23:29:11 +0100 Subject: libsmbconf: change smbconf_get_seqnum() to smbconf_changed(). The former seqnum is hidden inside a struct smbconf_csn. And the get_seqnum is united with a changed function that stores the seqnum inside the given csn. Michael (This used to be commit 5b6b90900a1a3eab24cb5612d78f9678a363cf73) --- source3/param/loadparm.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 04fade5789..37d68ba4af 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -71,7 +71,7 @@ extern userdom_struct current_user_info; #endif static bool in_client = False; /* Not in the client by default */ -static uint64_t conf_last_seqnum = 0; +static struct smbconf_csn conf_last_csn; static struct smbconf_ctx *conf_ctx = NULL; #define CONFIG_BACKEND_FILE 0 @@ -6524,7 +6524,8 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) } ret = pfunc("registry shares", "yes"); - conf_last_seqnum = smbconf_get_seqnum(conf_ctx, NULL, NULL); + /* store the csn */ + smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL); done: TALLOC_FREE(mem_ctx); @@ -6604,7 +6605,6 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); if (lp_config_backend_is_registry()) { - uint64_t conf_cur_seqnum; if (conf_ctx == NULL) { WERROR werr; werr = smbconf_open(NULL, &conf_ctx); @@ -6614,12 +6614,8 @@ bool lp_file_list_changed(void) return false; } } - conf_cur_seqnum = smbconf_get_seqnum(conf_ctx, NULL, NULL); - if (conf_last_seqnum != conf_cur_seqnum) { - DEBUGADD(6, ("regdb seqnum changed: old = %llu, " - "new = %llu\n", - (unsigned long long)conf_last_seqnum, - (unsigned long long)conf_cur_seqnum)); + if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL)) { + DEBUGADD(6, ("registry config changed\n")); return true; } } -- cgit From 153ed797e61db7feef32af0d256818e66460d064 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 19 Mar 2008 10:47:23 +0100 Subject: libsmbconf: change the API to always take the smbconf_ctx parameter first. ..for consistency. Exception: the open/init function, where the smbconf_ctx is created from the given talloc context. Michael (This used to be commit 304dba6cb2184437f3edad065a530d03fb704036) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 37d68ba4af..a97f8e9c03 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6510,7 +6510,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) goto done; } - werr = smbconf_get_share(mem_ctx, conf_ctx, GLOBAL_NAME, + werr = smbconf_get_share(conf_ctx, mem_ctx, GLOBAL_NAME, &num_params, ¶m_names, ¶m_values); if (!W_ERROR_IS_OK(werr)) { goto done; -- cgit From adf5bf554cd6bfdc5c6e7b1ed54f7f9329b15c50 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 20 Mar 2008 23:41:39 +0100 Subject: libsmbconf: rename smbconf_open() to smbconf_init(). That's more appropriate. Michael (This used to be commit d7bd9bb8aa2003ec0a9860df26857f67255febe2) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a97f8e9c03..bb3b6141f0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6497,7 +6497,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) if (conf_ctx == NULL) { /* first time */ - werr = smbconf_open(NULL, &conf_ctx); + werr = smbconf_init(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6607,7 +6607,7 @@ bool lp_file_list_changed(void) if (lp_config_backend_is_registry()) { if (conf_ctx == NULL) { WERROR werr; - werr = smbconf_open(NULL, &conf_ctx); + werr = smbconf_init(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("error opening configuration: %s\n", dos_errstr(werr))); -- cgit From fececde1815bf0469bb56e07cf23f54011c9b4ae Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 21 Mar 2008 02:20:16 +0100 Subject: libsmbconf: add backend specific init function. Hide generic init function taking smbconf_ops argument from public api. Michael (This used to be commit b3f6920ccb9a27fde26e889a7f1f3afaf56b784f) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bb3b6141f0..7212969344 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6497,7 +6497,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) if (conf_ctx == NULL) { /* first time */ - werr = smbconf_init(NULL, &conf_ctx); + werr = smbconf_init_reg(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6607,7 +6607,7 @@ bool lp_file_list_changed(void) if (lp_config_backend_is_registry()) { if (conf_ctx == NULL) { WERROR werr; - werr = smbconf_init(NULL, &conf_ctx); + werr = smbconf_init_reg(NULL, &conf_ctx); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("error opening configuration: %s\n", dos_errstr(werr))); -- cgit From 6f7cfeddd61f728e2452a7b89f5ee2ff36ca394f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 21 Mar 2008 17:55:31 +0100 Subject: libsmbconf: add a "path" variable to the conf context. This is passed to the module init routines. In case of the registry, this is the path of the basekey in registry, that is to be used, defaulting to KEY_SMBCONF (HKLM\software\samba\smbconf), when NULL is given. This is the only case currently used. In order to support other keys, registry initialization for smbconf has to be changed to support different keys. Michael (This used to be commit 96434d9dc7a66773e313cc128af57493dee245a1) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7212969344..f61d0d8fdc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6497,7 +6497,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) if (conf_ctx == NULL) { /* first time */ - werr = smbconf_init_reg(NULL, &conf_ctx); + werr = smbconf_init_reg(NULL, &conf_ctx, NULL); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6607,7 +6607,7 @@ bool lp_file_list_changed(void) if (lp_config_backend_is_registry()) { if (conf_ctx == NULL) { WERROR werr; - werr = smbconf_init_reg(NULL, &conf_ctx); + werr = smbconf_init_reg(NULL, &conf_ctx, NULL); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("error opening configuration: %s\n", dos_errstr(werr))); -- cgit From 2b84aea424410a1c4d5b29849bfe4ee411c78fac Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 25 Mar 2008 22:53:47 +0100 Subject: loadparm: add userdata parameter to do_section() and do_parameter(). The userdata is currently unused. It can be used in the future for passing a context like in samba4 code. Michael (This used to be commit 31b31171bd88c41443268d3300c492e2347b9e73) --- source3/param/loadparm.c | 22 ++++++++++++---------- source3/param/params.c | 24 +++++++++++++----------- 2 files changed, 25 insertions(+), 21 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index f61d0d8fdc..8b6e431270 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5327,8 +5327,9 @@ static int getservicebyname(const char *pszServiceName, static void copy_service(struct service *pserviceDest, struct service *pserviceSource, struct bitmap *pcopymapDest); -static bool do_parameter(const char *pszParmName, const char *pszParmValue); -static bool do_section(const char *pszSectionName); +static bool do_parameter(const char *pszParmName, const char *pszParmValue, + void *userdata); +static bool do_section(const char *pszSectionName, void *userdata); static void init_copymap(struct service *pservice); static bool hash_a_service(const char *name, int number); static void free_service_byindex(int iService); @@ -6485,7 +6486,7 @@ bool service_ok(int iService) /* * process_registry_globals */ -static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) +static bool process_registry_globals(bool (*pfunc)(const char *, const char *, void *)) { WERROR werr; char **param_names; @@ -6517,13 +6518,13 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *)) } for (count = 0; count < num_params; count++) { - ret = pfunc(param_names[count], param_values[count]); + ret = pfunc(param_names[count], param_values[count], NULL); if (ret != true) { goto done; } } - ret = pfunc("registry shares", "yes"); + ret = pfunc("registry shares", "yes", NULL); /* store the csn */ smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL); @@ -6731,7 +6732,7 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr) string_set(ptr, fname); if (file_exist(fname, NULL)) { - bool ret = pm_process(fname, do_section, do_parameter); + bool ret = pm_process(fname, do_section, do_parameter, NULL); SAFE_FREE(fname); return ret; } @@ -7162,7 +7163,8 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue Process a parameter. ***************************************************************************/ -static bool do_parameter(const char *pszParmName, const char *pszParmValue) +static bool do_parameter(const char *pszParmName, const char *pszParmValue, + void *userdata) { if (!bInGlobalSection && bGlobalOnly) return (True); @@ -7292,7 +7294,7 @@ void init_locals(void) Returns True on success, False on failure. ***************************************************************************/ -static bool do_section(const char *pszSectionName) +static bool do_section(const char *pszSectionName, void *userdata) { bool bRetval; bool isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) || @@ -8680,7 +8682,7 @@ bool lp_load(const char *pszFname, /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; - bRetval = pm_process(n2, do_section, do_parameter); + bRetval = pm_process(n2, do_section, do_parameter, NULL); SAFE_FREE(n2); /* finish up the last section */ @@ -9073,7 +9075,7 @@ void lp_remove_service(int snum) void lp_copy_service(int snum, const char *new_name) { - do_section(new_name); + do_section(new_name, NULL); if (snum >= 0) { snum = lp_servicenumber(new_name); if (snum >= 0) diff --git a/source3/param/params.c b/source3/param/params.c index e69715e4a3..478376c9e9 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -230,7 +230,7 @@ static int Continuation(uint8_t *line, int pos ) * ------------------------------------------------------------------------ ** */ -static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *) ) +static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *, void *), void *userdata ) { int c; int i; @@ -299,7 +299,7 @@ static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *) DEBUG(0, ("%s Empty section name in configuration file.\n", func )); return False; } - if( !sfunc((char *)buf->data) ) /* Got a valid name. Deal with it. */ + if( !sfunc((char *)buf->data, userdata) ) /* Got a valid name. Deal with it. */ return False; EatComment( InFile ); /* Finish off the line. */ return True; @@ -336,7 +336,7 @@ static bool Section( DATA_BLOB *buf, myFILE *InFile, bool (*sfunc)(const char *) * ------------------------------------------------------------------------ ** */ -static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char *, const char *), int c ) +static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char *, const char *, void *), int c, void *userdata ) { int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ @@ -441,7 +441,7 @@ static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char } buf->data[end] = '\0'; /* End of value. */ - return( pfunc( (char *)buf->data, (char *)&buf->data[vstart] ) ); /* Pass name & value to pfunc(). */ + return( pfunc( (char *)buf->data, (char *)&buf->data[vstart], userdata ) ); /* Pass name & value to pfunc(). */ } /* ------------------------------------------------------------------------ ** @@ -467,8 +467,9 @@ static bool Parameter( DATA_BLOB *buf, myFILE *InFile, bool (*pfunc)(const char */ static bool Parse( DATA_BLOB *buf, myFILE *InFile, - bool (*sfunc)(const char *), - bool (*pfunc)(const char *, const char *) ) + bool (*sfunc)(const char *, void *), + bool (*pfunc)(const char *, const char *, void *), + void *userdata) { int c; @@ -485,7 +486,7 @@ static bool Parse( DATA_BLOB *buf, myFILE *InFile, break; case '[': /* Section Header. */ - if( !Section( buf, InFile, sfunc ) ) + if( !Section( buf, InFile, sfunc, userdata ) ) return False; c = EatWhitespace( InFile ); break; @@ -495,7 +496,7 @@ static bool Parse( DATA_BLOB *buf, myFILE *InFile, break; default: /* Parameter line. */ - if( !Parameter( buf, InFile, pfunc, c ) ) + if( !Parameter( buf, InFile, pfunc, c, userdata ) ) return False; c = EatWhitespace( InFile ); break; @@ -552,8 +553,9 @@ static myFILE *OpenConfFile( const char *FileName ) */ bool pm_process( const char *FileName, - bool (*sfunc)(const char *), - bool (*pfunc)(const char *, const char *) ) + bool (*sfunc)(const char *, void *), + bool (*pfunc)(const char *, const char *, void *), + void *userdata) { int result; myFILE *InFile; @@ -574,7 +576,7 @@ bool pm_process( const char *FileName, return False; } - result = Parse( &buf, InFile, sfunc, pfunc ); + result = Parse( &buf, InFile, sfunc, pfunc, userdata ); data_blob_free(&buf); myfile_close(InFile); -- cgit From 92f52469a93a6648c2b0aa6d740f047f19d6a530 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 9 Apr 2008 01:28:43 +0200 Subject: loadparm: drop debug level in map_parameter from 0 to 1 we don't want to see this all the times in tests. Michael (This used to be commit fd43a4a1e05a2d259dc75bdcb4c0a3d9d8b41739) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8b6e431270..ccc24b8837 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6064,7 +6064,7 @@ static int map_parameter(const char *pszParmName) /* Warn only if it isn't parametric option */ if (strchr(pszParmName, ':') == NULL) - DEBUG(0, ("Unknown parameter encountered: \"%s\"\n", pszParmName)); + DEBUG(1, ("Unknown parameter encountered: \"%s\"\n", pszParmName)); /* We do return 'fail' for parametric options as well because they are stored in different storage */ -- cgit From 67be6b3af7b338cdcc03e5d0bcdbe6e8c46f4a2b Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Wed, 9 Apr 2008 18:20:07 +0200 Subject: fix some extrasemi compile warnings (This used to be commit cbdb79b7a1044945e515a294f487e4c1a9c91be5) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ccc24b8837..27bf1e8ce1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5174,7 +5174,7 @@ FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) FN_GLOBAL_CONST_STRING(lp_socket_options, &Globals.szSocketOptions) -FN_GLOBAL_INTEGER(lp_config_backend, &Globals.ConfigBackend); +FN_GLOBAL_INTEGER(lp_config_backend, &Globals.ConfigBackend) FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) @@ -5194,7 +5194,7 @@ FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer) FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer) FN_GLOBAL_CONST_STRING(lp_ctdbd_socket, &Globals.ctdbdSocket) FN_GLOBAL_LIST(lp_cluster_addresses, &Globals.szClusterAddresses) -FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering); +FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering) FN_LOCAL_STRING(lp_printcommand, szPrintcommand) FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand) -- cgit From 9fd9060e53fc9ccff7e8f34c95e39480a040a26e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 13 Apr 2008 17:22:52 +0200 Subject: loadparm: use the new smbconf_init() dispatcher for loading registry config. Michael (This used to be commit 78afb30f8073c3804dfa0cecadf973d5af5dd612) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 27bf1e8ce1..d5fd571ce4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6498,7 +6498,7 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *, v if (conf_ctx == NULL) { /* first time */ - werr = smbconf_init_reg(NULL, &conf_ctx, NULL); + werr = smbconf_init(NULL, &conf_ctx, "registry:"); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6608,7 +6608,7 @@ bool lp_file_list_changed(void) if (lp_config_backend_is_registry()) { if (conf_ctx == NULL) { WERROR werr; - werr = smbconf_init_reg(NULL, &conf_ctx, NULL); + werr = smbconf_init(NULL, &conf_ctx, "registry:"); if (!W_ERROR_IS_OK(werr)) { DEBUG(0, ("error opening configuration: %s\n", dos_errstr(werr))); -- cgit From b7bb61eff019fc529067a10e63dec5340cebff8d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 13 Apr 2008 21:57:55 +0200 Subject: loadparm: remove pfunc parameter from process_registry_globals(). Use do_parameter() directly. Michael (This used to be commit 59b81bfd0abecb190d0c49e62581b26f10b96829) --- source3/param/loadparm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d5fd571ce4..71632cd753 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6486,7 +6486,7 @@ bool service_ok(int iService) /* * process_registry_globals */ -static bool process_registry_globals(bool (*pfunc)(const char *, const char *, void *)) +static bool process_registry_globals(void) { WERROR werr; char **param_names; @@ -6518,13 +6518,14 @@ static bool process_registry_globals(bool (*pfunc)(const char *, const char *, v } for (count = 0; count < num_params; count++) { - ret = pfunc(param_names[count], param_values[count], NULL); + ret = do_parameter(param_names[count], param_values[count], + NULL); if (ret != true) { goto done; } } - ret = pfunc("registry shares", "yes", NULL); + ret = do_parameter("registry shares", "yes", NULL); /* store the csn */ smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL); @@ -8711,7 +8712,7 @@ bool lp_load(const char *pszFname, add_ipc, initialize_globals); } } else if (lp_config_backend_is_registry()) { - bRetval = process_registry_globals(do_parameter); + bRetval = process_registry_globals(); } else { DEBUG(0, ("Illegal config backend given: %d\n", lp_config_backend())); -- cgit From 2e1e83b4c0744bbd0974ab6cccf1f7fec516773c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 6 Apr 2008 22:23:54 +0200 Subject: loadparm: reactivate special semantics of "include = registry" for now. This includes the configuration stored in HKLM/Software/Samba/smbconf . Michael (This used to be commit 42c7fb4ddfab9ff7592593533099ae872c1edca7) --- source3/param/loadparm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 71632cd753..9595ebdb18 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -70,6 +70,14 @@ extern userdom_struct current_user_info; #define HOMES_NAME "homes" #endif +/* the special value for the include parameter + * to be interpreted not as a file name but to + * trigger loading of the global smb.conf options + * from registry. */ +#ifndef INCLUDE_REGISTRY_NAME +#define INCLUDE_REGISTRY_NAME "registry" +#endif + static bool in_client = False; /* Not in the client by default */ static struct smbconf_csn conf_last_csn; static struct smbconf_ctx *conf_ctx = NULL; @@ -6724,6 +6732,16 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr) { char *fname; + if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { + if (bInGlobalSection) { + return process_registry_globals(); + } else { + DEBUG(1, ("\"include = registry\" only effective " + "in %s section\n", GLOBAL_NAME)); + return false; + } + } + fname = alloc_sub_basic(get_current_username(), current_user_info.domain, pszParmValue); -- cgit From 49bf9d35cd7fd87830ee2240e00919bd1bf3a1df Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 18 Apr 2008 10:20:01 +0200 Subject: loadparm: make it possible to just load the config without following "include =" statements metze (This used to be commit 6b5c76bf1e880ec60d6b044c58115940549049e5) --- source3/param/loadparm.c | 53 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9595ebdb18..84e8c1a2b7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6727,11 +6727,16 @@ static bool handle_netbios_aliases(int snum, const char *pszParmValue, char **pt /*************************************************************************** Handle the include operation. ***************************************************************************/ +static bool bNoIncludes = false; static bool handle_include(int snum, const char *pszParmValue, char **ptr) { char *fname; + if (bNoIncludes) { + return true; + } + if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { if (bInGlobalSection) { return process_registry_globals(); @@ -8651,11 +8656,12 @@ bool lp_is_in_client(void) False on failure. ***************************************************************************/ -bool lp_load(const char *pszFname, - bool global_only, - bool save_defaults, - bool add_ipc, - bool initialize_globals) +bool lp_load_ex(const char *pszFname, + bool global_only, + bool save_defaults, + bool add_ipc, + bool initialize_globals, + bool no_includes) { char *n2 = NULL; bool bRetval; @@ -8663,10 +8669,11 @@ bool lp_load(const char *pszFname, bRetval = False; - DEBUG(3, ("lp_load: refreshing parameters\n")); + DEBUG(3, ("lp_load_ex: refreshing parameters\n")); bInGlobalSection = True; bGlobalOnly = global_only; + bNoIncludes = no_includes; init_globals(! initialize_globals); debug_init(); @@ -8694,7 +8701,7 @@ bool lp_load(const char *pszFname, current_user_info.domain, pszFname); if (!n2) { - smb_panic("lp_load: out of memory"); + smb_panic("lp_load_ex: out of memory"); } add_to_file_list(pszFname, n2); @@ -8722,12 +8729,12 @@ bool lp_load(const char *pszFname, */ config_backend = CONFIG_BACKEND_REGISTRY; /* start over */ - DEBUG(1, ("lp_load: changing to config backend " + DEBUG(1, ("lp_load_ex: changing to config backend " "registry\n")); init_globals(false); lp_kill_all_services(); - return lp_load(pszFname, global_only, save_defaults, - add_ipc, initialize_globals); + return lp_load_ex(pszFname, global_only, save_defaults, + add_ipc, initialize_globals, no_includes); } } else if (lp_config_backend_is_registry()) { bRetval = process_registry_globals(); @@ -8762,9 +8769,35 @@ bool lp_load(const char *pszFname, init_iconv(); + bNoIncludes = false; + return (bRetval); } +bool lp_load(const char *pszFname, + bool global_only, + bool save_defaults, + bool add_ipc, + bool initialize_globals) +{ + return lp_load_ex(pszFname, + global_only, + save_defaults, + add_ipc, + initialize_globals, + false); +} + +bool lp_load_initial_only(const char *pszFname) +{ + return lp_load_ex(pszFname, + true, + false, + false, + true, + true); +} + /*************************************************************************** Reset the max number of services. ***************************************************************************/ -- cgit From 318c983d829dce6ed7f1428ad025f6a9b97ddda6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 21 Apr 2008 00:06:45 +0200 Subject: loadparm: make lo_load_initial() only skip registry include. This is only to be able to set everything properly for registry before reading registry includes. This fixes "make test" as non-root user in a directory, where root-daemons have already created a messaging.tdb in the compiled in lockdir... Michael (This used to be commit 1bb28bc1d8e83d174cd171e9d96f22ac524187c3) --- source3/param/loadparm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 84e8c1a2b7..a60118ad83 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6733,11 +6733,10 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr) { char *fname; - if (bNoIncludes) { - return true; - } - if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { + if (bNoIncludes) { + return true; + } if (bInGlobalSection) { return process_registry_globals(); } else { -- cgit From 4244655e5b7419c7e2fc0d337baf1df4ee4443b0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 21 Apr 2008 00:17:49 +0200 Subject: loadparm: rename bNoIncludes to bAllowIncludeRegistry (inverting logic) This is what that variable controls now... Michael (This used to be commit bba04a8fba6fd5cf62578733cfdabea590e8ff51) --- source3/param/loadparm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a60118ad83..cdac0f1ccc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6727,14 +6727,14 @@ static bool handle_netbios_aliases(int snum, const char *pszParmValue, char **pt /*************************************************************************** Handle the include operation. ***************************************************************************/ -static bool bNoIncludes = false; +static bool bAllowIncludeRegistry = true; static bool handle_include(int snum, const char *pszParmValue, char **ptr) { char *fname; if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { - if (bNoIncludes) { + if (!bAllowIncludeRegistry) { return true; } if (bInGlobalSection) { @@ -8660,7 +8660,7 @@ bool lp_load_ex(const char *pszFname, bool save_defaults, bool add_ipc, bool initialize_globals, - bool no_includes) + bool allow_include_registry) { char *n2 = NULL; bool bRetval; @@ -8672,7 +8672,7 @@ bool lp_load_ex(const char *pszFname, bInGlobalSection = True; bGlobalOnly = global_only; - bNoIncludes = no_includes; + bAllowIncludeRegistry = allow_include_registry; init_globals(! initialize_globals); debug_init(); @@ -8733,7 +8733,8 @@ bool lp_load_ex(const char *pszFname, init_globals(false); lp_kill_all_services(); return lp_load_ex(pszFname, global_only, save_defaults, - add_ipc, initialize_globals, no_includes); + add_ipc, initialize_globals, + allow_include_registry); } } else if (lp_config_backend_is_registry()) { bRetval = process_registry_globals(); @@ -8768,7 +8769,7 @@ bool lp_load_ex(const char *pszFname, init_iconv(); - bNoIncludes = false; + bAllowIncludeRegistry = true; return (bRetval); } -- cgit From 00210d773b64578992ed936290cc7ab9a6d4d187 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 21 Apr 2008 00:20:35 +0200 Subject: loadparm: reformat - fix whitespace/tab Michael (This used to be commit 3acc0d84dc8f29b67ddaa1124224a93cb43b07ad) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index cdac0f1ccc..962c0a4627 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8733,7 +8733,7 @@ bool lp_load_ex(const char *pszFname, init_globals(false); lp_kill_all_services(); return lp_load_ex(pszFname, global_only, save_defaults, - add_ipc, initialize_globals, + add_ipc, initialize_globals, allow_include_registry); } } else if (lp_config_backend_is_registry()) { -- cgit From fb9232c0a98d9ce600e379dd03ee6fa3cd73cba5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 22 Apr 2008 16:31:16 +0200 Subject: libsmbconf: rewrite API to use smbconf_service struct instead of lists of strings and counters directly... Michael (This used to be commit 17415e2dc457ce41793a7e28e71f72c538c19c61) --- source3/param/loadparm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 962c0a4627..09049db9ff 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6497,9 +6497,7 @@ bool service_ok(int iService) static bool process_registry_globals(void) { WERROR werr; - char **param_names; - char **param_values; - uint32_t num_params; + struct smbconf_service *service = NULL; uint32_t count; TALLOC_CTX *mem_ctx = talloc_stackframe(); bool ret = false; @@ -6519,14 +6517,14 @@ static bool process_registry_globals(void) goto done; } - werr = smbconf_get_share(conf_ctx, mem_ctx, GLOBAL_NAME, - &num_params, ¶m_names, ¶m_values); + werr = smbconf_get_share(conf_ctx, mem_ctx, GLOBAL_NAME, &service); if (!W_ERROR_IS_OK(werr)) { goto done; } - for (count = 0; count < num_params; count++) { - ret = do_parameter(param_names[count], param_values[count], + for (count = 0; count < service->num_params; count++) { + ret = do_parameter(service->param_names[count], + service->param_values[count], NULL); if (ret != true) { goto done; -- cgit From 1e161b8c81631254c077f96d33641158ae4bae80 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 10 May 2008 00:13:11 +0200 Subject: loadparm: Fix activation of registry globals in lp_load_*. This completes bba04a8fba6fd5cf62578733cfdabea590e8ff51: The reverted logic has to be put into the callers lp_load() and lp_load_initial_only() of lp_load_ex(), too. Silly bug. Michael (This used to be commit c1f300c76e882f2d108596aa3dbc211d545c665a) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 09049db9ff..b539684457 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8783,7 +8783,7 @@ bool lp_load(const char *pszFname, save_defaults, add_ipc, initialize_globals, - false); + true); } bool lp_load_initial_only(const char *pszFname) @@ -8793,7 +8793,7 @@ bool lp_load_initial_only(const char *pszFname) false, false, true, - true); + false); } /*************************************************************************** -- cgit From 18b385ccef221af356c1b776aaa0c8c2f3ba4a74 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 01:40:11 +0200 Subject: loadparm: refactor initalization of registry config out into lp_smbconf_ctx(). Michael (This used to be commit 83cd9f74d57c462ad5c8956b3ce3c81bea429b67) --- source3/param/loadparm.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b539684457..ee19a38013 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -80,7 +80,6 @@ extern userdom_struct current_user_info; static bool in_client = False; /* Not in the client by default */ static struct smbconf_csn conf_last_csn; -static struct smbconf_ctx *conf_ctx = NULL; #define CONFIG_BACKEND_FILE 0 #define CONFIG_BACKEND_REGISTRY 1 @@ -6491,6 +6490,23 @@ bool service_ok(int iService) return (bRetval); } +static struct smbconf_ctx *lp_smbconf_ctx(void) +{ + WERROR werr; + static struct smbconf_ctx *conf_ctx = NULL; + + if (conf_ctx == NULL) { + werr = smbconf_init(NULL, &conf_ctx, "registry:"); + if (!W_ERROR_IS_OK(werr)) { + DEBUG(1, ("error initializing registry configuration: " + "%s\n", dos_errstr(werr))); + conf_ctx = NULL; + } + } + + return conf_ctx; +} + /* * process_registry_globals */ @@ -6500,14 +6516,11 @@ static bool process_registry_globals(void) struct smbconf_service *service = NULL; uint32_t count; TALLOC_CTX *mem_ctx = talloc_stackframe(); + struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); bool ret = false; if (conf_ctx == NULL) { - /* first time */ - werr = smbconf_init(NULL, &conf_ctx, "registry:"); - if (!W_ERROR_IS_OK(werr)) { - goto done; - } + goto done; } if (!smbconf_share_exists(conf_ctx, GLOBAL_NAME)) { @@ -6613,14 +6626,10 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); if (lp_config_backend_is_registry()) { + struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); + if (conf_ctx == NULL) { - WERROR werr; - werr = smbconf_init(NULL, &conf_ctx, "registry:"); - if (!W_ERROR_IS_OK(werr)) { - DEBUG(0, ("error opening configuration: %s\n", - dos_errstr(werr))); - return false; - } + return false; } if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL)) { DEBUGADD(6, ("registry config changed\n")); -- cgit From 8cb4461044d3020736d985012e4beb9c5db358ad Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:08:14 +0200 Subject: loadparm: refactor processing of service out of process_registry_globals() into new function process_registry_service(). Michael (This used to be commit 2986e5174e69527465ae7ef8e108110416752b56) --- source3/param/loadparm.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ee19a38013..5774b22795 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6507,6 +6507,26 @@ static struct smbconf_ctx *lp_smbconf_ctx(void) return conf_ctx; } +static bool process_registry_service(struct smbconf_service *service) +{ + uint32_t count; + bool ret; + + if (service == NULL) { + return false; + } + + for (count = 0; count < service->num_params; count++) { + ret = do_parameter(service->param_names[count], + service->param_values[count], + NULL); + if (ret != true) { + return false; + } + } + return true; +} + /* * process_registry_globals */ @@ -6514,7 +6534,6 @@ static bool process_registry_globals(void) { WERROR werr; struct smbconf_service *service = NULL; - uint32_t count; TALLOC_CTX *mem_ctx = talloc_stackframe(); struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); bool ret = false; @@ -6535,13 +6554,9 @@ static bool process_registry_globals(void) goto done; } - for (count = 0; count < service->num_params; count++) { - ret = do_parameter(service->param_names[count], - service->param_values[count], - NULL); - if (ret != true) { - goto done; - } + ret = process_registry_service(service); + if (!ret) { + goto done; } ret = do_parameter("registry shares", "yes", NULL); -- cgit From 86766b522018973e1c5e37b45e8b5b01dbcbd202 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:15:20 +0200 Subject: loadparm: add a function process_registry_shares() This loads the shares defined in registry into the services array. Michael (This used to be commit b3a90b72517c2e25d972796908aec4d2b85a030e) --- source3/param/loadparm.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5774b22795..9eee1691a8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6568,6 +6568,43 @@ done: return ret; } +static bool process_registry_shares(void) +{ + WERROR werr; + uint32_t count; + struct smbconf_service **service = NULL; + uint32_t num_shares = 0; + TALLOC_CTX *mem_ctx = talloc_stackframe(); + struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); + bool ret = false; + + if (conf_ctx == NULL) { + goto done; + } + + werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &service); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + for (count = 0; count < num_shares; count++) { + if (strequal(service[count]->name, GLOBAL_NAME)) { + continue; + } + ret = process_registry_service(service[count]); + if (!ret) { + goto done; + } + } + + /* store the csn */ + smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL); + +done: + TALLOC_FREE(mem_ctx); + return ret; +} + static struct file_lists { struct file_lists *next; char *name; -- cgit From 0ba819dd21f8676385b05702d88066c86a4578ee Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:25:34 +0200 Subject: loadparm: add parameter allow_registry_shares to lp_load_ex(). This allows for registry shares to be activated, i.e. loaded into the services array at lp_load() time. Michael (This used to be commit b3233ecefd5df745ba7e10511f9ab36064036b10) --- source3/param/loadparm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9eee1691a8..0d116f8790 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8719,7 +8719,8 @@ bool lp_load_ex(const char *pszFname, bool save_defaults, bool add_ipc, bool initialize_globals, - bool allow_include_registry) + bool allow_include_registry, + bool allow_registry_shares) { char *n2 = NULL; bool bRetval; @@ -8793,7 +8794,8 @@ bool lp_load_ex(const char *pszFname, lp_kill_all_services(); return lp_load_ex(pszFname, global_only, save_defaults, add_ipc, initialize_globals, - allow_include_registry); + allow_include_registry, + allow_registry_shares); } } else if (lp_config_backend_is_registry()) { bRetval = process_registry_globals(); @@ -8803,6 +8805,10 @@ bool lp_load_ex(const char *pszFname, bRetval = false; } + if (bRetval && lp_registry_shares() && allow_registry_shares) { + bRetval = process_registry_shares(); + } + lp_add_auto_services(lp_auto_services()); if (add_ipc) { @@ -8844,7 +8850,7 @@ bool lp_load(const char *pszFname, save_defaults, add_ipc, initialize_globals, - true); + true, false); } bool lp_load_initial_only(const char *pszFname) @@ -8854,6 +8860,7 @@ bool lp_load_initial_only(const char *pszFname) false, false, true, + false, false); } -- cgit From 0589c607a7998a93eb6e77e00e1238791f0d0133 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:39:02 +0200 Subject: loadparm: add call to do_section() to process_registry_service(). Michael (This used to be commit e1b76cd5d646bb9083cfca0d15a84183cad72882) --- source3/param/loadparm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0d116f8790..5c6cd071b7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6516,6 +6516,10 @@ static bool process_registry_service(struct smbconf_service *service) return false; } + ret = do_section(service->name, NULL); + if (ret != true) { + return false; + } for (count = 0; count < service->num_params; count++) { ret = do_parameter(service->param_names[count], service->param_values[count], -- cgit From 42beddc99143ac615b4d5aafb508a018dda144f0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:39:45 +0200 Subject: loadparm: add funcion lp_load_with_registry_shares(). This is like lp_load(), except that it will load the registry shares into the services aarray when registry shares are activated. Michael (This used to be commit b387c614ba8d1d3960f6917f03f0fd433cf2b2ee) --- source3/param/loadparm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5c6cd071b7..e45c8b89b7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8868,6 +8868,21 @@ bool lp_load_initial_only(const char *pszFname) false); } +bool lp_load_with_registry_shares(const char *pszFname, + bool global_only, + bool save_defaults, + bool add_ipc, + bool initialize_globals) +{ + return lp_load_ex(pszFname, + global_only, + save_defaults, + add_ipc, + initialize_globals, + true, + true); +} + /*************************************************************************** Reset the max number of services. ***************************************************************************/ -- cgit From 33f632b8b5d39c06da37adf4feb0d1552dd96647 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 26 May 2008 11:58:11 +0200 Subject: loadarm: fix testparm with "config backend = registry". Set the iServiceIndex to "-1" for starup with either config backend (originally only for text backend). Otherwise, process_registry_shares() will fail. Currently, the only user of lp_load_with_registry_shares() is testparm. Michael (This used to be commit 5e2b925367241c41793b2eb7a628e9fc9f3ac8ff) --- source3/param/loadparm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e45c8b89b7..c272274837 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8746,6 +8746,9 @@ bool lp_load_ex(const char *pszFname, lp_save_defaults(); } + /* We get sections first, so have to start 'behind' to make up */ + iServiceIndex = -1; + if (Globals.param_opt != NULL) { data = Globals.param_opt; while (data) { @@ -8769,8 +8772,6 @@ bool lp_load_ex(const char *pszFname, add_to_file_list(pszFname, n2); - /* We get sections first, so have to start 'behind' to make up */ - iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter, NULL); SAFE_FREE(n2); -- cgit From 2f446d9e55d6b442a318d8fd27a935e31737675f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 27 May 2008 10:59:11 +0200 Subject: loadparm: fix process_registry_shares() when there is only [global] in registry. This fixes testparm printing "Error loading services." when there is only the global section in registry and no other service definition. Michael (This used to be commit 28d197220038b9a47af177b88a8587f865e45de5) --- source3/param/loadparm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c272274837..a5623a25c0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6591,6 +6591,8 @@ static bool process_registry_shares(void) goto done; } + ret = true; + for (count = 0; count < num_shares; count++) { if (strequal(service[count]->name, GLOBAL_NAME)) { continue; -- cgit From d8b234648cbc18c02d2c79a32be766080c61b42a Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Mon, 26 May 2008 11:29:24 +0200 Subject: Add ldap connection timeout for OpenLDAP and Netscape LDAP libs. This can be controlled via the ldap connection timeout parameter. This fixes fallbacks to secondary LDAP servers in multi LDAP server setups like in #4544 (This used to be commit 8e59a2fedc940b081222b0e8f90fe0c5a0981c06) --- source3/param/loadparm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a5623a25c0..ef6648aec1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -263,6 +263,7 @@ struct global { int ldap_passwd_sync; int ldap_replication_sleep; int ldap_timeout; /* This is initialised in init_globals */ + int ldap_connection_timeout; int ldap_page_size; bool ldap_delete_dn; bool bMsAddPrinterWizard; @@ -3561,6 +3562,15 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, + { + .label = "ldap connection timeout", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.ldap_connection_timeout, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, { .label = "ldap page size", .type = P_INTEGER, @@ -4755,7 +4765,8 @@ static void init_globals(bool first_time_only) 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; + Globals.ldap_timeout = LDAP_DEFAULT_TIMEOUT; + Globals.ldap_connection_timeout = LDAP_CONNECTION_DEFAULT_TIMEOUT; Globals.ldap_page_size = LDAP_PAGE_SIZE; Globals.ldap_debug_level = 0; @@ -5074,6 +5085,7 @@ 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_INTEGER(lp_ldap_connection_timeout, &Globals.ldap_connection_timeout) FN_GLOBAL_INTEGER(lp_ldap_page_size, &Globals.ldap_page_size) FN_GLOBAL_INTEGER(lp_ldap_debug_level, &Globals.ldap_debug_level) FN_GLOBAL_INTEGER(lp_ldap_debug_threshold, &Globals.ldap_debug_threshold) -- cgit From 2cfacbaacbef88ca8901f1c667336688bb45e4b1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Jun 2008 20:51:42 +0200 Subject: Always set "registry shares = yes" for "include = registry" This fixes the case where "include = registry" is set in the smb.conf text file and *only* shares (no [global] settings) are present in the registry. Michael, please check! Thanks, Volker (This used to be commit 6c80362e291d8c5e748b987a583e8e32acc36354) --- source3/param/loadparm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ef6648aec1..1ce88df400 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6558,6 +6558,11 @@ static bool process_registry_globals(void) goto done; } + ret = do_parameter("registry shares", "yes", NULL); + if (!ret) { + goto done; + } + if (!smbconf_share_exists(conf_ctx, GLOBAL_NAME)) { /* nothing to read from the registry yet but make sure lp_load * doesn't return false */ @@ -6575,7 +6580,6 @@ static bool process_registry_globals(void) goto done; } - ret = do_parameter("registry shares", "yes", NULL); /* store the csn */ smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL); -- cgit From 09d769057effce3a229517a08ad73be4f1fc4bd9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 19 Jun 2008 17:20:22 +0200 Subject: loadparm: don't treat a missing include file as an error in handle_include(). Michael (This used to be commit a8ef8870beb91fcd2745aa59de6c59b49ea00e39) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1ce88df400..ad0605d70b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6843,7 +6843,7 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr) DEBUG(2, ("Can't find include file %s\n", fname)); SAFE_FREE(fname); - return false; + return true; } /*************************************************************************** -- cgit From 769646efc6d334976e75cf6476acfe1089e986dd Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 19 Jun 2008 17:21:04 +0200 Subject: loadparm: use the return value of the special handlers in lp_load(). Up to now, the bool return value was silently ignored. Michael (This used to be commit c65d425fec964bc0b8778b596615a8bcce0378aa) --- source3/param/loadparm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ad0605d70b..8f6af68325 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7208,8 +7208,8 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue /* if it is a special case then go ahead */ if (parm_table[parmnum].special) { - parm_table[parmnum].special(snum, pszParmValue, (char **)parm_ptr); - return (True); + return parm_table[parmnum].special(snum, pszParmValue, + (char **)parm_ptr); } /* now switch on the type of variable it is */ -- cgit From 927621ba122d9c451bfaac4f2c8ba0e5acbfead3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 25 Jun 2008 21:27:17 +1000 Subject: make parametic options case insensitive This is needed as some options are uppercased internally in Samba, such as the idmap config option Without this change it is not possible to set these options via net conf which lowercases options (This used to be commit c10aad9f136b7c2ef4809fd8558013ab2ee40cf6) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 8f6af68325..9698feb060 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5380,7 +5380,7 @@ static param_opt_struct *get_parametrics(int snum, const char *type, const char } while (data) { - if (strcmp(data->key, param_key) == 0) { + if (strcasecmp(data->key, param_key) == 0) { string_free(¶m_key); return data; } -- cgit From 335e3b11971ebbec415620d42512479b16c952fc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 25 Jun 2008 16:24:33 +0200 Subject: Fix the build (This used to be commit 3bfeae651ff4bd0d777e7bc5980008960d8e5a44) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9698feb060..b679b79fea 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5380,7 +5380,7 @@ static param_opt_struct *get_parametrics(int snum, const char *type, const char } while (data) { - if (strcasecmp(data->key, param_key) == 0) { + if (StrCaseCmp(data->key, param_key) == 0) { string_free(¶m_key); return data; } -- cgit From 1fb1c67fb9392364887ba8963f18d10b27d1cfa0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 Jul 2008 10:24:12 -0700 Subject: Patch from SATOH Fumiyasu for bug #5202. Re-activate "acl group control" parameter and make it only apply to owning group. Also added man page fix. Jeremy. (This used to be commit e98e080bad2c8b9f038a8f2dffcfeba1d5f392ce) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b679b79fea..b2cbbf1671 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1507,7 +1507,7 @@ static struct parm_struct parm_table[] = { .ptr = &sDefault.bAclGroupControl, .special = NULL, .enum_list = NULL, - .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED, + .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, }, { .label = "acl map full control", -- cgit From 5515c0e81c064863c7c56d12b4ae82b8f3455f34 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 3 Jul 2008 21:03:58 +0200 Subject: Slightly increase the default idmap cache time (This used to be commit 448836d44d0468a74b962ba3c0b7d51de236374f) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b2cbbf1671..c529948cc9 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4827,7 +4827,7 @@ static void init_globals(bool first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.iIdmapCacheTime = 900; /* 15 minutes by default */ + Globals.iIdmapCacheTime = 7 * 24 * 3600; /* 1 week by default */ Globals.iIdmapNegativeCacheTime = 120; /* 2 minutes by default */ Globals.bPassdbExpandExplicit = False; -- cgit From d5ccdcce0b5627e082cf0cade2fc369a7611bcd5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 11 Jul 2008 17:43:07 +0200 Subject: Revert "Slightly increase the default idmap cache time" This reverts commit 448836d44d0468a74b962ba3c0b7d51de236374f. (This used to be commit a9b29ab6b7503d6d30553a17219603a4f4cd3df9) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c529948cc9..b2cbbf1671 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4827,7 +4827,7 @@ static void init_globals(bool first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.iIdmapCacheTime = 7 * 24 * 3600; /* 1 week by default */ + Globals.iIdmapCacheTime = 900; /* 15 minutes by default */ Globals.iIdmapNegativeCacheTime = 120; /* 2 minutes by default */ Globals.bPassdbExpandExplicit = False; -- cgit From 24eec914c0d5a2ff6b6e8b0ee0bc000a9af13d4f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Jul 2008 14:37:48 -0700 Subject: Fix swat. Bug #5613. Jeremy (This used to be commit 15920f838835f5dbbac8712202267c2a99237686) --- source3/param/loadparm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b2cbbf1671..18ca495cea 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8902,15 +8902,6 @@ bool lp_load_with_registry_shares(const char *pszFname, true); } -/*************************************************************************** - Reset the max number of services. -***************************************************************************/ - -void lp_resetnumservices(void) -{ - iNumServices = 0; -} - /*************************************************************************** Return the max number of services. ***************************************************************************/ -- cgit From ed5e6b3244c9ea0752999b24c793ba1bdffe67e9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jul 2008 15:49:28 +0200 Subject: Remove a silly "typedef struct _param_opt_struct param_opt_struct" (This used to be commit 78801431c896f1e2007d652b611c2ce1108e1023) --- source3/param/loadparm.c | 54 +++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 18ca495cea..5cc373586c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -97,9 +97,8 @@ extern int extra_time_offset; static bool defaults_saved = False; -typedef struct _param_opt_struct param_opt_struct; -struct _param_opt_struct { - param_opt_struct *prev, *next; +struct param_opt_struct { + struct param_opt_struct *prev, *next; char *key; char *value; char **list; @@ -338,7 +337,7 @@ struct global { bool bResetOnZeroVC; int iKeepalive; int iminreceivefile; - param_opt_struct *param_opt; + struct param_opt_struct *param_opt; }; static struct global Globals; @@ -482,7 +481,7 @@ struct service { int iMap_readonly; int iDirectoryNameCacheSize; int ismb_encrypt; - param_opt_struct *param_opt; + struct param_opt_struct *param_opt; char dummy[3]; /* for alignment */ }; @@ -5356,14 +5355,17 @@ static char * canonicalize_servicename(const char *name); static void show_parameter(int parmIndex); static bool is_synonym_of(int parm1, int parm2, bool *inverse); -/* This is a helper function for parametrical options support. */ -/* It returns a pointer to parametrical option value if it exists or NULL otherwise */ -/* Actual parametrical functions are quite simple */ -static param_opt_struct *get_parametrics(int snum, const char *type, const char *option) +/* + * This is a helper function for parametrical options support. It returns a + * pointer to parametrical option value if it exists or NULL otherwise. Actual + * parametrical functions are quite simple + */ +static struct param_opt_struct *get_parametrics(int snum, const char *type, + const char *option) { bool global_section = False; char* param_key; - param_opt_struct *data; + struct param_opt_struct *data; if (snum >= iNumServices) return NULL; @@ -5497,7 +5499,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum) /* the returned value is talloced on the talloc_tos() */ char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data == NULL||data->value==NULL) { if (def) { @@ -5514,7 +5516,7 @@ char *lp_parm_talloc_string(int snum, const char *type, const char *option, cons /* Parametric option has following syntax: 'Type: option = value' */ const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data == NULL||data->value==NULL) return def; @@ -5527,7 +5529,7 @@ const char *lp_parm_const_string(int snum, const char *type, const char *option, const char **lp_parm_string_list(int snum, const char *type, const char *option, const char **def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data == NULL||data->value==NULL) return (const char **)def; @@ -5544,7 +5546,7 @@ const char **lp_parm_string_list(int snum, const char *type, const char *option, int lp_parm_int(int snum, const char *type, const char *option, int def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data && data->value && *data->value) return lp_int(data->value); @@ -5557,7 +5559,7 @@ int lp_parm_int(int snum, const char *type, const char *option, int def) unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data && data->value && *data->value) return lp_ulong(data->value); @@ -5570,7 +5572,7 @@ unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsi bool lp_parm_bool(int snum, const char *type, const char *option, bool def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data && data->value && *data->value) return lp_bool(data->value); @@ -5584,7 +5586,7 @@ bool lp_parm_bool(int snum, const char *type, const char *option, bool def) int lp_parm_enum(int snum, const char *type, const char *option, const struct enum_list *_enum, int def) { - param_opt_struct *data = get_parametrics(snum, type, option); + struct param_opt_struct *data = get_parametrics(snum, type, option); if (data && data->value && *data->value && _enum) return lp_enum(data->value, _enum); @@ -5610,7 +5612,7 @@ static void init_service(struct service *pservice) static void free_service(struct service *pservice) { int i; - param_opt_struct *data, *pdata; + struct param_opt_struct *data, *pdata; if (!pservice) return; @@ -5689,7 +5691,7 @@ static int add_a_service(const struct service *pservice, const char *name) int i; struct service tservice; int num_to_alloc = iNumServices + 1; - param_opt_struct *data, *pdata; + struct param_opt_struct *data, *pdata; tservice = *pservice; @@ -6372,7 +6374,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS { int i; bool bcopyall = (pcopymapDest == NULL); - param_opt_struct *data, *pdata, *paramo; + struct param_opt_struct *data, *pdata, *paramo; bool not_added; for (i = 0; parm_table[i].label; i++) @@ -6446,7 +6448,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS pdata = pdata->next; } if (not_added) { - paramo = SMB_XMALLOC_P(param_opt_struct); + paramo = SMB_XMALLOC_P(struct param_opt_struct); paramo->key = SMB_STRDUP(data->key); paramo->value = SMB_STRDUP(data->value); paramo->list = NULL; @@ -7116,7 +7118,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue void *def_ptr = NULL; char *param_key = NULL; char *sep; - param_opt_struct *paramo, *data; + struct param_opt_struct *paramo, *data; bool not_added; parmnum = map_parameter(pszParmName); @@ -7154,7 +7156,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue data = data->next; } if (not_added) { - paramo = SMB_XMALLOC_P(param_opt_struct); + paramo = SMB_XMALLOC_P(struct param_opt_struct); paramo->key = SMB_STRDUP(param_key); paramo->value = SMB_STRDUP(pszParmValue); paramo->list = NULL; @@ -7485,7 +7487,7 @@ Display the contents of the global structure. static void dump_globals(FILE *f) { int i; - param_opt_struct *data; + struct param_opt_struct *data; fprintf(f, "[global]\n"); @@ -7529,7 +7531,7 @@ bool lp_is_default(int snum, struct parm_struct *parm) static void dump_a_service(struct service *pService, FILE * f) { int i; - param_opt_struct *data; + struct param_opt_struct *data; if (pService != &sDefault) fprintf(f, "[%s]\n", pService->szService); @@ -8746,7 +8748,7 @@ bool lp_load_ex(const char *pszFname, { char *n2 = NULL; bool bRetval; - param_opt_struct *data, *pdata; + struct param_opt_struct *data, *pdata; bRetval = False; -- cgit From d11796d392d3bcc7a1aba8ef0046ad497f00035a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jul 2008 16:05:46 +0200 Subject: Tiny logic simplification: Remove an indentation by using an early return; (This used to be commit 37dba0c192ec7d4105465beae0d6e8598c7dbb7a) --- source3/param/loadparm.c | 102 ++++++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 46 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5cc373586c..b77a0488c2 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7117,61 +7117,71 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue void *parm_ptr = NULL; /* where we are going to store the result */ void *def_ptr = NULL; char *param_key = NULL; - char *sep; struct param_opt_struct *paramo, *data; bool not_added; parmnum = map_parameter(pszParmName); if (parmnum < 0) { - if ((sep=strchr(pszParmName, ':')) != NULL) { - TALLOC_CTX *frame = talloc_stackframe(); - - *sep = '\0'; - param_key = talloc_asprintf(frame, "%s:", pszParmName); - if (!param_key) { - TALLOC_FREE(frame); - return false; - } - slen = strlen(param_key); - param_key = talloc_asprintf_append(param_key, sep+1); - if (!param_key) { - TALLOC_FREE(frame); - return false; - } - trim_char(param_key+slen, ' ', ' '); - not_added = True; - data = (snum < 0) ? Globals.param_opt : - ServicePtrs[snum]->param_opt; - /* Traverse destination */ - while (data) { - /* If we already have same option, override it */ - if (strcmp(data->key, param_key) == 0) { - string_free(&data->value); - TALLOC_FREE(data->list); - data->value = SMB_STRDUP(pszParmValue); - not_added = False; - break; - } - data = data->next; - } - if (not_added) { - paramo = SMB_XMALLOC_P(struct 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); - } else { - DLIST_ADD(ServicePtrs[snum]->param_opt, paramo); - } - } + char *sep; + TALLOC_CTX *frame; - *sep = ':'; - TALLOC_FREE(frame); + sep = strchr(pszParmName, ':'); + if (sep == NULL) { + DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", + pszParmName)); return (True); } - DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); + + /* + * We've got a parametric option + */ + + frame = talloc_stackframe(); + + *sep = '\0'; + param_key = talloc_asprintf(frame, "%s:", pszParmName); + if (!param_key) { + TALLOC_FREE(frame); + return false; + } + slen = strlen(param_key); + param_key = talloc_asprintf_append(param_key, sep+1); + if (!param_key) { + TALLOC_FREE(frame); + return false; + } + trim_char(param_key+slen, ' ', ' '); + not_added = True; + data = (snum < 0) + ? Globals.param_opt : ServicePtrs[snum]->param_opt; + /* Traverse destination */ + while (data) { + /* If we already have same option, override it */ + if (strcmp(data->key, param_key) == 0) { + string_free(&data->value); + TALLOC_FREE(data->list); + data->value = SMB_STRDUP(pszParmValue); + not_added = False; + break; + } + data = data->next; + } + if (not_added) { + paramo = SMB_XMALLOC_P(struct 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); + } else { + DLIST_ADD(ServicePtrs[snum]->param_opt, + paramo); + } + } + + *sep = ':'; + TALLOC_FREE(frame); return (True); } -- cgit From 065fb506a27f9a15884d5c3526ae1ae608da308b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jul 2008 16:08:28 +0200 Subject: Sequel to c10aad9f13: Ignore whitespaces in parametric options It's a bit difficult to explain why idmap config backend:FOO = rid should work while idmap config backend : FOO = rid should not. And I doubt we will ever see domain names with whitespaces... (This used to be commit 0207f99d3f02bd8ff5dadc1574fe13b46c3e09a3) --- source3/param/loadparm.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b77a0488c2..0935181e09 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5382,7 +5382,7 @@ static struct param_opt_struct *get_parametrics(int snum, const char *type, } while (data) { - if (StrCaseCmp(data->key, param_key) == 0) { + if (strwicmp(data->key, param_key) == 0) { string_free(¶m_key); return data; } @@ -5394,7 +5394,7 @@ static struct param_opt_struct *get_parametrics(int snum, const char *type, /* but only if we are not already working with Globals */ data = Globals.param_opt; while (data) { - if (strcmp(data->key, param_key) == 0) { + if (strwicmp(data->key, param_key) == 0) { string_free(¶m_key); return data; } @@ -6438,7 +6438,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS /* Traverse destination */ while (pdata) { /* If we already have same option, override it */ - if (strcmp(pdata->key, data->key) == 0) { + if (strwicmp(pdata->key, data->key) == 0) { string_free(&pdata->value); TALLOC_FREE(data->list); pdata->value = SMB_STRDUP(data->value); @@ -7113,21 +7113,18 @@ void *lp_local_ptr(int snum, void *ptr) bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue) { - int parmnum, i, slen; + int parmnum, i; void *parm_ptr = NULL; /* where we are going to store the result */ void *def_ptr = NULL; - char *param_key = NULL; struct param_opt_struct *paramo, *data; bool not_added; parmnum = map_parameter(pszParmName); if (parmnum < 0) { - char *sep; TALLOC_CTX *frame; - sep = strchr(pszParmName, ':'); - if (sep == NULL) { + if (strchr(pszParmName, ':') == NULL) { DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); return (True); @@ -7139,26 +7136,13 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue frame = talloc_stackframe(); - *sep = '\0'; - param_key = talloc_asprintf(frame, "%s:", pszParmName); - if (!param_key) { - TALLOC_FREE(frame); - return false; - } - slen = strlen(param_key); - param_key = talloc_asprintf_append(param_key, sep+1); - if (!param_key) { - TALLOC_FREE(frame); - return false; - } - trim_char(param_key+slen, ' ', ' '); not_added = True; data = (snum < 0) ? Globals.param_opt : ServicePtrs[snum]->param_opt; /* Traverse destination */ while (data) { /* If we already have same option, override it */ - if (strcmp(data->key, param_key) == 0) { + if (strwicmp(data->key, pszParmName) == 0) { string_free(&data->value); TALLOC_FREE(data->list); data->value = SMB_STRDUP(pszParmValue); @@ -7169,7 +7153,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue } if (not_added) { paramo = SMB_XMALLOC_P(struct param_opt_struct); - paramo->key = SMB_STRDUP(param_key); + paramo->key = SMB_STRDUP(pszParmName); paramo->value = SMB_STRDUP(pszParmValue); paramo->list = NULL; if (snum < 0) { @@ -7180,7 +7164,6 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue } } - *sep = ':'; TALLOC_FREE(frame); return (True); } -- cgit From 1a6aecaea81a06602e2d216a766ab9f7c21f6a77 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 30 Jul 2008 16:24:20 +0200 Subject: testparm: Display warning if invalid values are used. This one came up while using "csc policy = disabled" instead of "disable"... ;-) (This used to be commit d01da44de77abbf724389bce924771f2975867f4) --- source3/param/loadparm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0935181e09..6902bb0437 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7047,9 +7047,11 @@ static void lp_set_enum_parm( struct parm_struct *parm, const char *pszParmValue for (i = 0; parm->enum_list[i].name; i++) { if ( strequal(pszParmValue, parm->enum_list[i].name)) { *ptr = parm->enum_list[i].value; - break; + return; } } + DEBUG(0, ("WARNING: Ignoring invalid value '%s' for parameter '%s'\n", + pszParmValue, parm->label)); } /*************************************************************************** -- cgit From bf291c95bceda9e8181999f3dc524589fd82814c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 9 Aug 2008 00:31:48 +0200 Subject: loadparm: add two parameters "init logon delay hosts" and "init logon delay" "init logon delays hosts" takes a list of hosts names or addresses or networks for which the initial SAMLOGON reply should be delayed (so other DCs get preferred by XP workstations if there are any). This option takes the same type of list as "hosts allow" does. "init logon delay" allows one to configure the delay for the hosts configured for delayed initial samlogon with "init logon delayed hosts". The value is interpreted as milliseconds. The default value is 100. This commit only introduces the parameters. They will be activated in a subsequent commit. Michael (This used to be commit f7c1f85438f7e0da2a96e3fc8f774f8c6936370e) --- source3/param/loadparm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6902bb0437..7882b37c2c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -273,6 +273,8 @@ struct global { int iPreferredMaster; int iDomainMaster; bool bDomainLogons; + char **szInitLogonDelayedHosts; + int InitLogonDelay; bool bEncryptPasswords; bool bUpdateEncrypt; int clientSchannel; @@ -3190,6 +3192,23 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED, }, + { + .label = "init logon delayed hosts", + .type = P_LIST, + .p_class = P_GLOBAL, + .ptr = &Globals.szInitLogonDelayedHosts, + .flags = FLAG_ADVANCED, + }, + + { + .label = "init logon delay", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.InitLogonDelay, + .flags = FLAG_ADVANCED, + + }, + {N_("Browse Options"), P_SEP, P_SEPARATOR}, { @@ -4797,6 +4816,9 @@ static void init_globals(bool first_time_only) Globals.bWINSsupport = False; Globals.bWINSproxy = False; + TALLOC_FREE(Globals.szInitLogonDelayedHosts); + Globals.InitLogonDelay = 100; /* 100 ms default delay */ + Globals.bDNSproxy = True; /* this just means to use them if they exist */ @@ -5109,6 +5131,8 @@ FN_GLOBAL_BOOL(lp_we_are_a_wins_server, &Globals.bWINSsupport) FN_GLOBAL_BOOL(lp_wins_proxy, &Globals.bWINSproxy) FN_GLOBAL_BOOL(lp_local_master, &Globals.bLocalMaster) FN_GLOBAL_BOOL(lp_domain_logons, &Globals.bDomainLogons) +FN_GLOBAL_LIST(lp_init_logon_delayed_hosts, &Globals.szInitLogonDelayedHosts) +FN_GLOBAL_INTEGER(lp_init_logon_delay, &Globals.InitLogonDelay) FN_GLOBAL_BOOL(lp_load_printers, &Globals.bLoadPrinters) FN_GLOBAL_BOOL(lp_readraw, &Globals.bReadRaw) FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite) -- cgit From 340ab6a256802a22c11b7f707748397249075b65 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 13 Jul 2008 12:07:40 +0200 Subject: idmap rewrite (This used to be commit 30a180f2fce8cf6a3e5548f6bba453272ba70b33) --- source3/param/loadparm.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7882b37c2c..7fd7bb2bf4 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -194,8 +194,7 @@ struct global { bool bWinbindOfflineLogon; bool bWinbindNormalizeNames; bool bWinbindRpcOnly; - char **szIdmapDomains; - char **szIdmapBackend; /* deprecated */ + char *szIdmapBackend; char *szIdmapAllocBackend; char *szAddShareCommand; char *szChangeShareCommand; @@ -4255,18 +4254,9 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, - { - .label = "idmap domains", - .type = P_LIST, - .p_class = P_GLOBAL, - .ptr = &Globals.szIdmapDomains, - .special = NULL, - .enum_list = NULL, - .flags = FLAG_ADVANCED, - }, { .label = "idmap backend", - .type = P_LIST, + .type = P_STRING, .p_class = P_GLOBAL, .ptr = &Globals.szIdmapBackend, .special = NULL, @@ -4825,6 +4815,7 @@ static void init_globals(bool first_time_only) Globals.bKernelOplocks = True; Globals.bAllowTrustedDomains = True; + string_set(&Globals.szIdmapBackend, "tdb"); string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); @@ -5091,8 +5082,7 @@ FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) FN_GLOBAL_BOOL(lp_winbind_rpc_only, &Globals.bWinbindRpcOnly) -FN_GLOBAL_LIST(lp_idmap_domains, &Globals.szIdmapDomains) -FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ +FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend) FN_GLOBAL_INTEGER(lp_idmap_cache_time, &Globals.iIdmapCacheTime) FN_GLOBAL_INTEGER(lp_idmap_negative_cache_time, &Globals.iIdmapNegativeCacheTime) -- cgit From 03991ab0734ecbb87a75238d1356fbe0e5b1d38d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 Aug 2008 13:35:15 -0700 Subject: Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX. Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (This used to be commit 8c630efd25cf17aff59448ca05c1b44a41964b16) --- source3/param/loadparm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7fd7bb2bf4..bc111df4e1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -8693,6 +8693,7 @@ void gfree_loadparm(void) SAFE_FREE( f ); f = next; } + file_lists = NULL; /* Free resources allocated to services */ -- cgit From 79150da70bbfddea3dc4013212fc7314b1004534 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 20 Aug 2008 16:24:22 -0700 Subject: Here is a re-working of the winbindd reconnect code to cope with rebooting a DC. This replaces the code I asked Volker to revert. The logic is pretty simple. It adds a new parameter, "winbind reconnect delay", set to 30 seconds by default, which determines how long to wait between connection attempts. To avoid overwhelming the box with DC-probe forked children, the code now keeps track of the DC probe child per winbindd_domain struct and only starts a new one if the existing one has died. I also added a little logic to make sure the dc probe child always sends a message whatever the reason for exit so we will always reschedule another connect attempt. Also added documentation. Jeremy. (This used to be commit 8027197635b988b3dcf9d3d00126a024e768fa62) --- source3/param/loadparm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index bc111df4e1..6817eca1d1 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -240,6 +240,7 @@ struct global { int map_to_guest; int oplock_break_wait_time; int winbind_cache_time; + int winbind_reconnect_delay; int winbind_max_idle_children; char **szWinbindNssInfo; int iLockSpinTime; @@ -4362,6 +4363,15 @@ static struct parm_struct parm_table[] = { .enum_list = NULL, .flags = FLAG_ADVANCED, }, + { + .label = "winbind reconnect delay", + .type = P_INTEGER, + .p_class = P_GLOBAL, + .ptr = &Globals.winbind_reconnect_delay, + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED, + }, { .label = "winbind enum users", .type = P_BOOL, @@ -4829,6 +4839,7 @@ static void init_globals(bool first_time_only) Globals.clustering = False; Globals.winbind_cache_time = 300; /* 5 minutes */ + Globals.winbind_reconnect_delay = 30; /* 30 seconds */ Globals.bWinbindEnumUsers = False; Globals.bWinbindEnumGroups = False; Globals.bWinbindUseDefaultDomain = False; @@ -5341,6 +5352,7 @@ FN_LOCAL_INTEGER(lp_directory_name_cache_size, iDirectoryNameCacheSize) FN_LOCAL_INTEGER(lp_smb_encrypt, ismb_encrypt) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) +FN_GLOBAL_INTEGER(lp_winbind_reconnect_delay, &Globals.winbind_reconnect_delay) FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) FN_GLOBAL_INTEGER(lp_name_cache_timeout, &Globals.name_cache_timeout) -- cgit From b90607e6e8092fcd396ca9022e6bc108f58a80a2 Mon Sep 17 00:00:00 2001 From: Karolin Seeger Date: Fri, 22 Aug 2008 10:05:42 +0200 Subject: loadparm: idmap backend is not depracated any longer. Karolin (This used to be commit fcfab4703628e19902c140a7ad9531d4be0de01d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 6817eca1d1..84c2c7fc59 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5093,7 +5093,7 @@ FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon) FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames) FN_GLOBAL_BOOL(lp_winbind_rpc_only, &Globals.bWinbindRpcOnly) -FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend) /* deprecated */ +FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend) FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend) FN_GLOBAL_INTEGER(lp_idmap_cache_time, &Globals.iIdmapCacheTime) FN_GLOBAL_INTEGER(lp_idmap_negative_cache_time, &Globals.iIdmapNegativeCacheTime) -- cgit From c529cd153fe7eaffa194362cf338cfa2e8d3af0d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 15 Aug 2008 18:24:09 +0200 Subject: Increase the default positive idmap cache time to a week (This used to be commit 60af63675063ad62c0169b9f2094ecfdaa7ca16d) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 84c2c7fc59..fbcc26a81d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4850,7 +4850,7 @@ static void init_globals(bool first_time_only) Globals.bWinbindRefreshTickets = False; Globals.bWinbindOfflineLogon = False; - Globals.iIdmapCacheTime = 900; /* 15 minutes by default */ + Globals.iIdmapCacheTime = 86400 * 7; /* a week by default */ Globals.iIdmapNegativeCacheTime = 120; /* 2 minutes by default */ Globals.bPassdbExpandExplicit = False; -- cgit From c16f2907c5f7a66b3e5d58af8f87ad35c5f77670 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Sep 2008 13:06:36 -0700 Subject: Fix bug #5729. Explicitly allow "-valid". Jeremy (This used to be commit 4f2de29723bb7e588e6c9440649b57d56d10b587) --- source3/param/loadparm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index fbcc26a81d..60a1fa4858 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6102,7 +6102,7 @@ static int map_parameter(const char *pszParmName) { int iIndex; - if (*pszParmName == '-') + if (*pszParmName == '-' && !strequal(pszParmName, "-valid")) return (-1); for (iIndex = 0; parm_table[iIndex].label; iIndex++) -- cgit