summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-01-23 16:21:43 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-02-05 16:30:42 +0000
commita63e2a312c761093fedb09bd234b6736485a930a (patch)
treef3f9f30d422daea98f82fdf577239938bb0e3cd4
parent01b8374e7942141e7f6cbdec7623c981a008e4c1 (diff)
downloadsamba-a63e2a312c761093fedb09bd234b6736485a930a.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>
-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 da38bf4caed..fa40a5c8f3e 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -80,6 +80,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) {
@@ -93,11 +94,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 */
@@ -106,7 +107,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;
}
@@ -116,7 +117,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;
}
@@ -160,6 +161,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) {
@@ -173,7 +175,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 */
@@ -190,7 +192,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;
}