char *szPasswordServer;
char *szSocketOptions;
char *szRealm;
+ char *szRealmUpper;
+ char *szDnsDomain;
char *szAfsUsernameMap;
int iAfsTokenLifetime;
char *szLogNtTokenCommand;
/* 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_backend(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_realm( 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_dos_charset( int snum, const char *pszParmValue, char **ptr );
static bool handle_printing( int snum, const char *pszParmValue, char **ptr);
.type = P_USTRING,
.p_class = P_GLOBAL,
.ptr = &Globals.szWorkgroup,
- .special = handle_workgroup,
+ .special = NULL,
.enum_list = NULL,
.flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
},
-#ifdef WITH_ADS
{
.label = "realm",
.type = P_USTRING,
.p_class = P_GLOBAL,
.ptr = &Globals.szRealm,
- .special = NULL,
+ .special = handle_realm,
.enum_list = NULL,
.flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
},
-#endif
{
.label = "netbios name",
.type = P_USTRING,
.p_class = P_GLOBAL,
.ptr = &Globals.szNetbiosName,
- .special = handle_netbios_name,
+ .special = NULL,
.enum_list = NULL,
.flags = FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD,
},
.type = P_USTRING,
.p_class = P_GLOBAL,
.ptr = &Globals.szNetbiosScope,
- .special = handle_netbios_scope,
+ .special = NULL,
.enum_list = NULL,
.flags = FLAG_ADVANCED,
},
}
}
+
string_set(&sDefault.fstype, FSTYPE_STRING);
string_set(&sDefault.szPrintjobUsername, "%U");
DEBUG(3, ("Initialising global parameters\n"));
+ /* Must manually force to upper case here, as this does not go via the handler */
+ string_set(&Globals.szNetbiosName, myhostname_upper());
+
string_set(&Globals.szSMBPasswdFile, get_dyn_SMB_PASSWD_FILE());
string_set(&Globals.szPrivateDir, get_dyn_PRIVATE_DIR());
*/
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.szWorkgroup, WORKGROUP);
string_set(&Globals.szPasswdProgram, "");
string_set(&Globals.szLockDir, get_dyn_LOCKDIR());
FN_GLOBAL_STRING(lp_passwd_chat, &Globals.szPasswdChat)
FN_GLOBAL_CONST_STRING(lp_passwordserver, &Globals.szPasswordServer)
FN_GLOBAL_CONST_STRING(lp_name_resolve_order, &Globals.szNameResolveOrder)
-FN_GLOBAL_CONST_STRING(lp_realm, &Globals.szRealm)
+FN_GLOBAL_CONST_STRING(lp_workgroup, &Globals.szWorkgroup)
+FN_GLOBAL_CONST_STRING(lp_netbios_name, &Globals.szNetbiosName)
+FN_GLOBAL_CONST_STRING(lp_netbios_scope, &Globals.szNetbiosScope)
+FN_GLOBAL_CONST_STRING(lp_realm, &Globals.szRealmUpper)
+FN_GLOBAL_CONST_STRING(lp_dnsdomain, &Globals.szDnsDomain)
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)
}
-/***************************************************************************
- 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(int snum, const char *pszParmValue, char **ptr)
-{
- bool ret;
- char *netbios_name = talloc_sub_basic(
- talloc_tos(), get_current_username(), current_user_info.domain,
- pszParmValue);
-
- ret = set_global_myname(netbios_name);
- TALLOC_FREE(netbios_name);
- string_set(&Globals.szNetbiosName,global_myname());
-
- DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n",
- global_myname()));
-
- return ret;
-}
-
/**
* Initialize iconv conversion descriptors.
*
return true;
}
-
-
-static bool handle_workgroup(int snum, const char *pszParmValue, char **ptr)
-{
- bool ret;
-
- ret = set_global_myworkgroup(pszParmValue);
- string_set(&Globals.szWorkgroup,lp_workgroup());
-
- return ret;
-}
-
-static bool handle_netbios_scope(int snum, const char *pszParmValue, char **ptr)
+static bool handle_realm(int snum, const char *pszParmValue, char **ptr)
{
- bool ret;
+ bool ret = true;
+ char *realm = strupper_talloc(talloc_tos(), pszParmValue);
+ char *dnsdomain = strlower_talloc(talloc_tos(), pszParmValue);
- ret = set_global_scope(pszParmValue);
- string_set(&Globals.szNetbiosScope,global_scope());
+ ret &= string_set(&Globals.szRealm, pszParmValue);
+ ret &= string_set(&Globals.szRealmUpper, realm);
+ ret &= string_set(&Globals.szDnsDomain, dnsdomain);
+ TALLOC_FREE(realm);
+ TALLOC_FREE(dnsdomain);
return ret;
}