summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-10-24 11:03:32 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-25 15:37:56 +0200
commit3a3fd60043234038c6ff6584a5b92fb757c4afe1 (patch)
tree1ac168d861907b5f4555a965a4c470ea5d8e2276 /src/providers
parentdc0ae0f9f516d947b1f3369235f50284e6c0540f (diff)
downloadsssd-3a3fd60043234038c6ff6584a5b92fb757c4afe1.tar.gz
sssd-3a3fd60043234038c6ff6584a5b92fb757c4afe1.tar.xz
sssd-3a3fd60043234038c6ff6584a5b92fb757c4afe1.zip
AD: Prefer GC port from SRV record
We had a hard coded value of Global Catalog port (3268). Informations from SRV record was ignored. This patch prefer port number from SRV record and hard coded value is used only as a fall back if port number was not initialized.
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ad/ad_common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
index ab62d64a9..f679c11ad 100644
--- a/src/providers/ad/ad_common.c
+++ b/src/providers/ad/ad_common.c
@@ -661,6 +661,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
char *address;
const char *safe_address;
char *new_uri;
+ int new_port;
const char *srv_name;
struct ad_server_data *sdata = NULL;
@@ -729,12 +730,15 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
talloc_zfree(service->gc->uri);
talloc_zfree(service->gc->sockaddr);
if (sdata && sdata->gc) {
+ new_port = fo_get_server_port(server);
+ new_port = (new_port == 0) ? AD_GC_PORT : new_port;
+
service->gc->uri = talloc_asprintf(service->gc, "%s:%d",
- new_uri, AD_GC_PORT);
+ new_uri, new_port);
service->gc->sockaddr = resolv_get_sockaddr_address(service->gc,
srvaddr,
- AD_GC_PORT);
+ new_port);
} else {
/* Make sure there always is an URI even if we know that this
* server doesn't support GC. That way the lookup would go through