summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-10-28 21:08:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:14 -0500
commitdf1ab2639d6d94d004fa73b1bd1be0983d17d65d (patch)
treec57cf66225e2efc38f9bebedca91c61073f9e624
parenta04dd5f4ad14b58664060411dcaeef8a935d3bd8 (diff)
downloadsamba-df1ab2639d6d94d004fa73b1bd1be0983d17d65d.tar.gz
samba-df1ab2639d6d94d004fa73b1bd1be0983d17d65d.tar.bz2
samba-df1ab2639d6d94d004fa73b1bd1be0983d17d65d.zip
r11381: Correctly connect to 445 and 139 after a successful getdcname.
Volker (This used to be commit 440e7b3342e6b7b12208b789853962de72a9cac2)
-rw-r--r--source3/nsswitch/winbindd_cm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index e38d4cc426..baef9c71ab 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -766,10 +766,17 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
if ((strlen(domain->dcname) > 0) &&
- NT_STATUS_IS_OK(check_negative_conn_cache(domain->name,
- domain->dcname))) {
+ NT_STATUS_IS_OK(check_negative_conn_cache(
+ domain->name, domain->dcname)) &&
+ (resolve_name(domain->dcname, &domain->dcaddr.sin_addr,
+ 0x20))) {
int dummy;
- if (!open_any_socket_out(&domain->dcaddr, 1, 10000,
+ struct sockaddr_in addrs[2];
+ addrs[0] = domain->dcaddr;
+ addrs[0].sin_port = htons(445);
+ addrs[1] = domain->dcaddr;
+ addrs[1].sin_port = htons(139);
+ if (!open_any_socket_out(addrs, 2, 10000,
&dummy, &fd)) {
fd = -1;
}