summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-01-23 16:21:43 +0100
committerKarolin Seeger <kseeger@samba.org>2020-02-11 11:49:17 +0000
commit58d1613609cc4358e822adbe484e8c7d0da770c7 (patch)
treea05d4221e84a91aa0cc4b484fbb6ef192f6ca7da
parentf8e11e6ca9ace9c1abf2eaa7dd7038852591ea07 (diff)
downloadsamba-58d1613609cc4358e822adbe484e8c7d0da770c7.tar.gz
s3:auth_sam: introduce effective_domain helper variables
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14247 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit a63e2a312c761093fedb09bd234b6736485a930a)
-rw-r--r--source3/auth/auth_sam.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index e2c62f94d48..2948c18df0c 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -77,6 +77,7 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
const struct auth_usersupplied_info *user_info,
struct auth_serversupplied_info **server_info)
{
+ const char *effective_domain = user_info->mapped.domain_name;
bool is_local_name, is_my_domain;
if (!user_info || !auth_context) {
@@ -90,11 +91,11 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
}
DBG_DEBUG("Check auth for: [%s]\\[%s]\n",
- user_info->mapped.domain_name,
+ effective_domain,
user_info->mapped.account_name);
- is_local_name = is_myname(user_info->mapped.domain_name);
- is_my_domain = strequal(user_info->mapped.domain_name, lp_workgroup());
+ is_local_name = is_myname(effective_domain);
+ is_my_domain = strequal(effective_domain, lp_workgroup());
/* check whether or not we service this domain/workgroup name */
@@ -103,7 +104,7 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
case ROLE_DOMAIN_MEMBER:
if ( !is_local_name ) {
DEBUG(6,("check_samstrict_security: %s is not one of my local names (%s)\n",
- user_info->mapped.domain_name, (lp_server_role() == ROLE_DOMAIN_MEMBER
+ effective_domain, (lp_server_role() == ROLE_DOMAIN_MEMBER
? "ROLE_DOMAIN_MEMBER" : "ROLE_STANDALONE") ));
return NT_STATUS_NOT_IMPLEMENTED;
}
@@ -113,7 +114,7 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
case ROLE_DOMAIN_BDC:
if ( !is_local_name && !is_my_domain ) {
DEBUG(6,("check_samstrict_security: %s is not one of my local names or domain name (DC)\n",
- user_info->mapped.domain_name));
+ effective_domain));
return NT_STATUS_NOT_IMPLEMENTED;
}
@@ -154,6 +155,7 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context,
const struct auth_usersupplied_info *user_info,
struct auth_serversupplied_info **server_info)
{
+ const char *effective_domain = user_info->mapped.domain_name;
bool is_my_domain;
if (!user_info || !auth_context) {
@@ -167,7 +169,7 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context,
}
DBG_DEBUG("Check auth for: [%s]\\[%s]\n",
- user_info->mapped.domain_name,
+ effective_domain,
user_info->mapped.account_name);
/* check whether or not we service this domain/workgroup name */
@@ -184,7 +186,7 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context,
is_my_domain = strequal(user_info->mapped.domain_name, lp_workgroup());
if (!is_my_domain) {
DBG_INFO("%s is not our domain name (DC for %s)\n",
- user_info->mapped.domain_name, lp_workgroup());
+ effective_domain, lp_workgroup());
return NT_STATUS_NOT_IMPLEMENTED;
}