ads_connect: Return immediately on a failed GC connection.
commit45e4ab067b74ba31388d39aec80496b1217ada67
authorGerald (Jerry) Carter <jerry@samba.org>
Fri, 16 Jan 2009 18:06:49 +0000 (16 12:06 -0600)
committerKarolin Seeger <kseeger@samba.org>
Tue, 20 Jan 2009 13:16:47 +0000 (20 14:16 +0100)
tree2b754f5a0d3230dc36e683927e0a8bd7f2bae35e
parentfde962def114e51e536719c2a6dd54727d7aaff1
ads_connect: Return immediately on a failed GC connection.

ads_connect_gc() feeds an explicit server to ads_connect().  However, if the
resulting connection fails, the latter function was attempting to find a DC
on its own and continuing the connection.  This resulting in GC searches being
sent over a connection using port 389 which would fail when using the base
search suffix outside of the domain naming context.

The fix is to fail immediately in ads_connect() since the GC lookup ordering
is handled already in ads_connect_gc().

(was commit 073e9f42f0c5f5de5d736ec7843d80a274c891ce in master)
(cherry picked from commit 2d0fd7543d0543ce59cb84db64afb99aa1f304b4)
source/libads/ldap.c