summaryrefslogtreecommitdiffstats
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-16 12:25:35 -0800
committerJeremy Allison <jra@samba.org>2009-01-16 12:25:35 -0800
commitd03133e696aea45e0843f4d72d2d1449366ac4e2 (patch)
tree4e0765b2d9f7f65b0697e29e9cd35184abb22cde /source3/libads/ldap.c
parentfb904194c9f696b72d862e51e7ba688decdda192 (diff)
parent073e9f42f0c5f5de5d736ec7843d80a274c891ce (diff)
downloadsamba-d03133e696aea45e0843f4d72d2d1449366ac4e2.tar.gz
samba-d03133e696aea45e0843f4d72d2d1449366ac4e2.tar.xz
samba-d03133e696aea45e0843f4d72d2d1449366ac4e2.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index a598580941b..f6da54f35ba 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -581,9 +581,20 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
TALLOC_FREE(s);
}
- if (ads->server.ldap_server &&
- ads_try_connect(ads, ads->server.ldap_server, ads->server.gc)) {
- goto got_connection;
+ if (ads->server.ldap_server)
+ {
+ if (ads_try_connect(ads, ads->server.ldap_server, ads->server.gc)) {
+ goto got_connection;
+ }
+
+ /* The choice of which GC use is handled one level up in
+ ads_connect_gc(). If we continue on from here with
+ ads_find_dc() we will get GC searches on port 389 which
+ doesn't work. --jerry */
+
+ if (ads->server.gc == true) {
+ return ADS_ERROR(LDAP_OPERATIONS_ERROR);
+ }
}
ntstatus = ads_find_dc(ads);