diff options
author | Gerald Carter <jerry@samba.org> | 2005-06-10 03:26:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:09 -0500 |
commit | 1dfe111a09ea269d84b10743ad9c2a4e335d7c88 (patch) | |
tree | 8ba6696814a25aaf1dfc838d91dfc8ca06273abb /source3/nsswitch/winbindd_cm.c | |
parent | 6d39f3bdce5ba8ed7d88a430a2de9f96d4b2c513 (diff) | |
download | samba-1dfe111a09ea269d84b10743ad9c2a4e335d7c88.tar.gz samba-1dfe111a09ea269d84b10743ad9c2a4e335d7c88.tar.bz2 samba-1dfe111a09ea269d84b10743ad9c2a4e335d7c88.zip |
r7454: couple of winbindd fixes
* make sure to use our domain as the account name in the net_req_auth2()
request when running on a Samba DC
* make sure to lookup the correct domain (not default to ours) when getting an async
getpwnam() call
(This used to be commit c9c3e3c122a6a04847c448d298b6f1adb4f35a60)
Diffstat (limited to 'source3/nsswitch/winbindd_cm.c')
-rw-r--r-- | source3/nsswitch/winbindd_cm.c | 14 |
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; |