summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-23 20:10:25 +0000
committerGerald Carter <jerry@samba.org>2003-07-23 20:10:25 +0000
commit7efce478976e2ac71bcaf4e4d1049bb263634711 (patch)
tree85806bffd7271899c69c886e3156229e5a3eae02
parentc39c02e1aeeb74e8c45b32d99d9354eb66040171 (diff)
downloadsamba-7efce478976e2ac71bcaf4e4d1049bb263634711.tar.gz
samba-7efce478976e2ac71bcaf4e4d1049bb263634711.tar.bz2
samba-7efce478976e2ac71bcaf4e4d1049bb263634711.zip
connect to the right realm or domain for trusted AD domains
(This used to be commit ae14f8364398f07fc3e7c7861cd39fe528f3fe7a)
-rw-r--r--source3/libads/ldap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 92f7f7645a..cf6f9375f8 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -109,12 +109,8 @@ static BOOL ads_find_dc(ADS_STRUCT *ads)
/* realm */
c_realm = ads->server.realm;
- if (!c_realm || !*c_realm) {
- c_realm = lp_realm();
- }
- if ( c_realm )
+ if (c_realm && *c_realm)
got_realm = True;
-
again:
/* we need to try once with the realm name and fallback to the
@@ -122,10 +118,10 @@ again:
if ( !got_realm && !lp_disable_netbios() ) {
c_realm = ads->server.workgroup;
- if (!c_realm || !*c_realm)
- c_realm = lp_workgroup();
- if (!c_realm)
+ if (!c_realm || !*c_realm) {
+ DEBUG(0,("ads_find_dc: no realm or workgroup! Was the structure initialized?\n"));
return False;
+ }
}
pstrcpy( realm, c_realm );