]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: let authenticate_ldap_simple_bind() pass down the mapped nt4names
authorStefan Metzmacher <metze@samba.org>
Thu, 3 Mar 2022 10:10:00 +0000 (11:10 +0100)
committerJule Anger <janger@samba.org>
Wed, 16 Mar 2022 15:37:02 +0000 (15:37 +0000)
authenticate_ldap_simple_bind*() needs to pass the
result of the cracknames operation into the auth stack
as user_info->client.{account,domain}_name, because
user_info->client.{account,domain}_name is also used
when forwarding the request via netrLogonSamLogon*
to a remote server, for exactly that the values are
also used in order to map a AUTH_PASSWORD_PLAIN into
AUTH_PASSWORD_RESPONSE, where the NTLMv2 response
contains the account and domain names passed in the
netr_IdentityInfo value.

Otherwise it would not be possible to forward the
LDAP simple bind authentication request to a remote
DC.

Currently this only applies to an RODC that forwards
the request to an RWDC.

But note that LDAP simple binds (as on Windows) only
work for users in the DCs forest, as the DsCrackNames
need to work and it can't work for users of remote
forests. I tested that in a DC of a forest root domain,
if rejected the LDAP simple bind against a different forest,
but allowed it for a users of a child domain in the
same forest. The NTLMSSP bind worked in both cases.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13879

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar 10 04:10:54 UTC 2022 on sn-devel-184

(cherry picked from commit 40f2070d3b2b1b13cc08f7844bfe4945e9f0cd86)

Autobuild-User(v4-14-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-14-test): Wed Mar 16 15:37:02 UTC 2022 on sn-devel-184

selftest/knownfail.d/rodc_rwdc [deleted file]
source4/auth/ntlm/auth_simple.c

diff --git a/selftest/knownfail.d/rodc_rwdc b/selftest/knownfail.d/rodc_rwdc
deleted file mode 100644 (file)
index c148d03..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba4.ldap.rodc_rwdc.*test_ldap_change_password_simple_bind
index 4f8267e92857c3eb0ee93772794eda98e88ee824..006e4d8279aebe024948508164939b5f7c5e9699 100644 (file)
@@ -121,8 +121,9 @@ _PUBLIC_ struct tevent_req *authenticate_ldap_simple_bind_send(TALLOC_CTX *mem_c
                return tevent_req_post(req, ev);
        }
 
-       user_info->mapped.account_name = nt4_username;
-       user_info->mapped.domain_name = nt4_domain;
+       user_info->orig_client = user_info->client;
+       user_info->client.account_name = nt4_username;
+       user_info->client.domain_name = nt4_domain;
        user_info->cracknames_called = true;
 
        subreq = auth_check_password_send(state, ev,