]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: a simple bind uses the DCs name as workstation
authorStefan Metzmacher <metze@samba.org>
Wed, 2 Mar 2022 13:32:41 +0000 (14:32 +0100)
committerJule Anger <janger@samba.org>
Wed, 16 Mar 2022 14:27:11 +0000 (14:27 +0000)
I've seen that in LogonSamLogonEx request triggered
by a simple bind with a user of a trusted domain
within the same forest. Note simple binds don't
work with users for another forest/external domain,
as the DsCrackNames call on the bind_dn fails.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 31db704882bbcd569c2abb764ac1d3691ee0a267)

source4/auth/ntlm/auth_simple.c

index b2e76381395393aa12b8192ec20ea967532f3081..f767adb36960e0b6c509759d775badff714fbc65 100644 (file)
@@ -26,6 +26,7 @@
 #include "lib/util/tevent_ntstatus.h"
 #include "auth/auth.h"
 #include "dsdb/samdb/samdb.h"
+#include "lib/param/param.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
@@ -80,7 +81,7 @@ _PUBLIC_ struct tevent_req *authenticate_ldap_simple_bind_send(TALLOC_CTX *mem_c
        /* No client.domain_name, use account_name instead */
        /* user_info->mapped.* will be filled below */
 
-       user_info->workstation_name = NULL;
+       user_info->workstation_name = lpcfg_netbios_name(lp_ctx);
 
        user_info->remote_host = remote_address;
        user_info->local_host = local_address;