summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/auth/auth_util.c14
-rw-r--r--source3/passdb/passdb.c25
2 files changed, 28 insertions, 11 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 5185f876c6..ab08a28ff6 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -214,20 +214,16 @@ NTSTATUS make_user_info_map(auth_usersupplied_info **user_info,
domain = lp_workgroup();
/* do what win2k does. Always map unknown domains to our own
- and let the "passdb backend" handle unknown users */
+ and let the "passdb backend" handle unknown users. */
if ( !is_trusted_domain(domain) )
- domain = get_global_sam_name();
+ domain = get_default_sam_name();
/* we know that it is a trusted domain (and we are allowing them) or it is our domain */
- return make_user_info(user_info,
- smb_name, internal_username,
- client_domain, domain,
- wksta_name,
- lm_pwd, nt_pwd,
- plaintext,
- ntlmssp_flags, encrypted);
+ return make_user_info(user_info, smb_name, internal_username,
+ client_domain, domain, wksta_name, lm_pwd, nt_pwd,
+ plaintext, ntlmssp_flags, encrypted);
}
/****************************************************************************
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index ee8ce64cf5..ece4a1e057 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -27,17 +27,38 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
-const char *get_global_sam_name(void)
+/******************************************************************
+ get the default domain/netbios name to be used when
+ testing authentication. For example, if you connect
+ to a Windows member server using a bogus domain name, the
+ Windows box will map the BOGUS\user to DOMAIN\user. A
+ standalone box will map to WKS\user.
+******************************************************************/
+
+const char *get_default_sam_name(void)
{
/* standalone servers can only use the local netbios name */
if ( lp_server_role() == ROLE_STANDALONE )
return global_myname();
- /* Windows domain members default to the DOMAIN
+ /* Windows domain members default to the DOMAIN
name when not specified */
return lp_workgroup();
}
+/******************************************************************
+ get the default domain/netbios name to be used when dealing
+ with our passdb list of accounts
+******************************************************************/
+
+const char *get_global_sam_name(void)
+{
+ if ((lp_server_role() == ROLE_DOMAIN_PDC) || (lp_server_role() == ROLE_DOMAIN_BDC)) {
+ return lp_workgroup();
+ }
+ return global_myname();
+}
+
/************************************************************
Fill the SAM_ACCOUNT with default values.
***********************************************************/