From: Stefan Metzmacher Date: Thu, 23 Jan 2020 15:21:43 +0000 (+0100) Subject: s3:auth_sam: introduce effective_domain helper variables X-Git-Tag: ldb-2.1.1~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63e2a312c761093fedb09bd234b6736485a930a;p=thirdparty%2Fsamba.git s3:auth_sam: introduce effective_domain helper variables BUG: https://bugzilla.samba.org/show_bug.cgi?id=14247 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- 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; }