diff options
author | Günther Deschner <gd@samba.org> | 2007-01-18 09:58:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:16 -0500 |
commit | e9c294b926c0b831fd936194342ec0564f935798 (patch) | |
tree | 3a418a506576d1dbfc12438608293a1e7b708989 /source3/libads/ldap.c | |
parent | fd37f98158161406229b728a7c767121a30e254f (diff) | |
download | samba-e9c294b926c0b831fd936194342ec0564f935798.tar.gz samba-e9c294b926c0b831fd936194342ec0564f935798.tar.bz2 samba-e9c294b926c0b831fd936194342ec0564f935798.zip |
r20874: We need to distinguish client sitenames per realm. We were overwriting
the stored client sitename with the sitename from each sucessfull CLDAP
connection.
Guenther
(This used to be commit 6a13e878b5d299cb3b3d7cb33ee0d51089d9228d)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r-- | source3/libads/ldap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 2ceae4d957..4802f79d3e 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -230,7 +230,7 @@ BOOL ads_try_connect(ADS_STRUCT *ads, const char *server ) SAFE_FREE(srv); /* Store our site name. */ - sitename_store( cldap_reply.client_site_name ); + sitename_store( cldap_reply.domain, cldap_reply.client_site_name ); return True; } @@ -249,7 +249,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) pstring realm; BOOL got_realm = False; BOOL use_own_domain = False; - char *sitename = sitename_fetch(); + char *sitename; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; /* if the realm and workgroup are both empty, assume they are ours */ @@ -268,7 +268,6 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) if (c_realm && *c_realm) got_realm = True; -again: /* we need to try once with the realm name and fallback to the netbios domain name if we fail (if netbios has not been disabled */ @@ -280,7 +279,6 @@ again: } if ( !c_realm || !*c_realm ) { - SAFE_FREE(sitename); DEBUG(0,("ads_find_dc: no realm or workgroup! Don't know what to do\n")); return NT_STATUS_INVALID_PARAMETER; /* rather need MISSING_PARAMETER ... */ } @@ -288,6 +286,10 @@ again: pstrcpy( realm, c_realm ); + sitename = sitename_fetch(realm); + + again: + DEBUG(6,("ads_find_dc: looking for %s '%s'\n", (got_realm ? "realm" : "domain"), realm)); |