diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-10-27 19:36:25 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-12-15 08:36:53 +0100 |
commit | 91cf9a3cb068b9ccc31e7e7ea659e0d467277398 (patch) | |
tree | dc1a327b8e239e05917b54f28085f79521540da4 | |
parent | be06858f9174c0b97506ee85c40848a57aeaaca7 (diff) | |
download | samba-91cf9a3cb068b9ccc31e7e7ea659e0d467277398.tar.gz |
s3:libads/ldap.c: pass the real workgroup name to get_dc_name()
metze
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit c2d4a84abe1b6cbf68d6e9f1bb1f8974d0b628fc)
(cherry picked from commit 2f27ffc4a2ba745341a5961b8f04e62da3fb089a)
(cherry picked from commit 132911954715bfa6df8566c0fb382ef07a7da96e)
-rw-r--r-- | source/libads/ldap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 92436070713..8cc9f052e61 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -267,10 +267,12 @@ static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc) static NTSTATUS ads_find_dc(ADS_STRUCT *ads) { + const char *c_domain; const char *c_realm; int count, i=0; struct ip_service *ip_list; const char *realm; + const char *domain; bool got_realm = False; bool use_own_domain = False; char *sitename; @@ -308,7 +310,14 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) return NT_STATUS_INVALID_PARAMETER; /* rather need MISSING_PARAMETER ... */ } + if ( use_own_domain ) { + c_domain = lp_workgroup(); + } else { + c_domain = ads->server.workgroup; + } + realm = c_realm; + domain = c_domain; /* * In case of LDAP we use get_dc_name() as that @@ -321,7 +330,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads) DEBUG(6,("ads_find_dc: (ldap) looking for %s '%s'\n", (got_realm ? "realm" : "domain"), realm)); - if (get_dc_name(realm, realm, srv_name, &ip_out)) { + if (get_dc_name(domain, realm, srv_name, &ip_out)) { /* * we call ads_try_connect() to fill in the * ads->config details |