summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/winbindd_cm.c')
-rw-r--r--source3/nsswitch/winbindd_cm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index a6f09f4bf2..6400b23f9f 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -1158,9 +1158,17 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
generate_random_buffer(clnt_chal.data, 8);
server_name = talloc_asprintf(mem_ctx, "\\\\%s", domain->dcname);
- account_name = talloc_asprintf(mem_ctx, "%s$",
- domain->primary ?
- global_myname() : domain->name);
+
+ /* if we are a DC and this is a trusted domain, then we need to use our
+ domain name in the net_req_auth2() request */
+
+ if ( IS_DC ) {
+ account_name = talloc_asprintf( mem_ctx, "%s$", lp_workgroup() );
+ }
+ else {
+ account_name = talloc_asprintf(mem_ctx, "%s$",
+ domain->primary ? global_myname() : domain->name);
+ }
if ((server_name == NULL) || (account_name == NULL))
return NT_STATUS_NO_MEMORY;