BOOL bDebugHiresTimestamp;
BOOL bDebugPid;
BOOL bDebugUid;
+ BOOL bDebugClass;
BOOL bEnableCoreFiles;
BOOL bHostMSDfs;
BOOL bUseMmap;
char **szHostsdeny;
char *szMagicScript;
char *szMagicOutput;
- char *szMangledMap;
char *szVetoFiles;
char *szHideFiles;
char *szVetoOplockFiles;
char *fstype;
char **szVfsObjects;
char *szMSDfsProxy;
+ char *szAioWriteBehind;
char *szDfree;
int iMinPrintSpace;
int iMaxPrintJobs;
NULL, /* szHostsdeny */
NULL, /* szMagicScript */
NULL, /* szMagicOutput */
- NULL, /* szMangledMap */
NULL, /* szVetoFiles */
NULL, /* szHideFiles */
NULL, /* szVetoOplockFiles */
NULL, /* fstype */
NULL, /* vfs objects */
NULL, /* szMSDfsProxy */
+ NULL, /* szAioWriteBehind */
NULL, /* szDfree */
0, /* iMinPrintSpace */
1000, /* iMaxPrintJobs */
{"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},
{"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},
{"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 },
{"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},
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. */
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 */
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;
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
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, '\"', '\"')) {
current_user_info.domain, s);
}
}
- ret = talloc_strdup(lp_talloc, tmpstr);
+ ret = talloc_strdup(talloc_tos(), tmpstr);
SAFE_FREE(tmpstr);
return (ret);
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)
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)
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)
/* 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);
}
/***************************************************************************
- Canonicalize by converting to lowercase.
+ Convert a string to uppercase and remove whitespaces.
***************************************************************************/
static char *canonicalize_servicename(const char *src)
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)));
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) {
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 "";
parm_ptr =
((char *)ServicePtrs[snum]) + PTR_DIFF(def_ptr,
&sDefault);
+ }
+ if (snum >= 0) {
if (!ServicePtrs[snum]->copymap)
init_copymap(ServicePtrs[snum]);
/* 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);
}
}
struct file_lists *next;
int i;
- lp_TALLOC_FREE();
-
/* Free the file lists */
f = file_lists;
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. */
}
/* 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 "";
}