s4:auth: let authenticate_ldap_simple_bind() pass down the mapped nt4names
commit40f2070d3b2b1b13cc08f7844bfe4945e9f0cd86
authorStefan Metzmacher <metze@samba.org>
Thu, 3 Mar 2022 10:10:00 +0000 (3 11:10 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 10 Mar 2022 04:10:54 +0000 (10 04:10 +0000)
tree05ef831a6b1c02e71ad428ea071b2bf68f38d283
parent24b580cae23860a0fe6c9d3a285d60564057043d
s4:auth: let authenticate_ldap_simple_bind() pass down the mapped nt4names

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
selftest/knownfail.d/rodc_rwdc [deleted file]
source4/auth/ntlm/auth_simple.c