summaryrefslogtreecommitdiff
path: root/source3/auth
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
commit590df382bea44eec2dbfd2a28c659b0a29188bca (patch)
treee49d732d83f0db51013daae96ac3aef16c9145ff /source3/auth
parenta9eeea6ef78cc44c8423c7125fa1376921060018 (diff)
downloadsamba-590df382bea44eec2dbfd2a28c659b0a29188bca.tar.gz
s3:auth_sam: map an empty domain or '.' to the local SAM name
When a domain member gets an empty domain name or '.', it should not forward the authentication to domain controllers of the primary domain. But we need to keep passing UPN account names with an empty domain to the DCs as a domain member. 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>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_sam.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index fa40a5c8f3e..c6357c696ea 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -93,10 +93,36 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context,
return NT_STATUS_NOT_IMPLEMENTED;
}
+ if (lp_server_role() == ROLE_DOMAIN_MEMBER) {
+ const char *p = NULL;
+
+ p = strchr_m(user_info->mapped.account_name, '@');
+ if (p != NULL) {
+ /*
+ * This needs to go to the DC,
+ * even if @ is the last character
+ */
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ }
+
+ if (effective_domain == NULL) {
+ effective_domain = "";
+ }
+
DBG_DEBUG("Check auth for: [%s]\\[%s]\n",
effective_domain,
user_info->mapped.account_name);
+
+ if (strequal(effective_domain, "") || strequal(effective_domain, ".")) {
+ /*
+ * An empty domain name or '.' should be handled
+ * as the local SAM name.
+ */
+ effective_domain = lp_netbios_name();
+ }
+
is_local_name = is_myname(effective_domain);
is_my_domain = strequal(effective_domain, lp_workgroup());
@@ -174,6 +200,10 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context,
return NT_STATUS_NOT_IMPLEMENTED;
}
+ if (effective_domain == NULL) {
+ effective_domain = "";
+ }
+
DBG_DEBUG("Check auth for: [%s]\\[%s]\n",
effective_domain,
user_info->mapped.account_name);
@@ -189,6 +219,14 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context,
return NT_STATUS_INVALID_SERVER_STATE;
}
+ if (strequal(effective_domain, "") || strequal(effective_domain, ".")) {
+ /*
+ * An empty domain name or '.' should be handled
+ * as the local SAM name.
+ */
+ effective_domain = lp_workgroup();
+ }
+
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",