summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2012-08-22 15:16:26 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-08-23 18:33:39 +0200
commitb096321a5a02dda0b6b71ba0f9c4d8feacd979e4 (patch)
tree2c540d0dfdf7a4f84d052f85d9b8e519bf8ebc6a /src/providers
parent21d485184df986e1a123f70c689517386e51a5ce (diff)
downloadsssd-b096321a5a02dda0b6b71ba0f9c4d8feacd979e4.tar.gz
sssd-b096321a5a02dda0b6b71ba0f9c4d8feacd979e4.tar.xz
sssd-b096321a5a02dda0b6b71ba0f9c4d8feacd979e4.zip
Fix: IPv6 address with square brackets doesn't work.
https://fedorahosted.org/sssd/ticket/1365
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ad/ad_common.c7
-rw-r--r--src/providers/ipa/ipa_common.c7
-rw-r--r--src/providers/krb5/krb5_common.c15
-rw-r--r--src/providers/ldap/ldap_common.c7
4 files changed, 35 insertions, 1 deletions
diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
index d1589c26a..2749a96e7 100644
--- a/src/providers/ad/ad_common.c
+++ b/src/providers/ad/ad_common.c
@@ -189,6 +189,13 @@ ad_servers_init(TALLOC_CTX *mem_ctx,
continue;
}
+ /* It could be ipv6 address in square brackets. Remove
+ * the brackets if needed. */
+ ret = remove_ipv6_brackets(list[i]);
+ if (ret != EOK) {
+ goto done;
+ }
+
ret = be_fo_add_server(bectx, AD_SERVICE_NAME, list[i], 0, NULL, primary);
if (ret && ret != EEXIST) {
DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n"));
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 2e5047381..fe7ac91cb 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -841,6 +841,13 @@ errno_t ipa_servers_init(struct be_ctx *ctx,
continue;
}
+ /* It could be ipv6 address in square brackets. Remove
+ * the brackets if needed. */
+ ret = remove_ipv6_brackets(list[i]);
+ if (ret != EOK) {
+ goto done;
+ }
+
ret = be_fo_add_server(ctx, "IPA", list[i], 0, NULL, primary);
if (ret && ret != EEXIST) {
DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n"));
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index bd7a30210..0e96b806c 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -520,7 +520,13 @@ errno_t krb5_servers_init(struct be_ctx *ctx,
continue;
}
- port_str = strrchr(server_spec, ':');
+ /* Do not try to get port number if last character is ']' */
+ if (server_spec[strlen(server_spec) - 1] != ']') {
+ port_str = strrchr(server_spec, ':');
+ } else {
+ port_str = NULL;
+ }
+
if (port_str == NULL) {
port = 0;
} else {
@@ -564,6 +570,13 @@ errno_t krb5_servers_init(struct be_ctx *ctx,
}
}
+ /* It could be ipv6 address in square brackets. Remove
+ * the brackets if needed. */
+ ret = remove_ipv6_brackets(server_spec);
+ if (ret != EOK) {
+ goto done;
+ }
+
ret = be_fo_add_server(ctx, service_name, server_spec, (int) port,
list[i], primary);
if (ret && ret != EEXIST) {
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index ce758755f..c11d036a1 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -1185,6 +1185,13 @@ errno_t sdap_urls_init(struct be_ctx *ctx,
talloc_steal(service, list[i]);
+ /* It could be ipv6 address in square brackets. Remove
+ * the brackets if needed. */
+ ret = remove_ipv6_brackets(lud->lud_host);
+ if (ret != EOK) {
+ goto done;
+ }
+
ret = be_fo_add_server(ctx, service->name, lud->lud_host,
lud->lud_port, list[i], primary);
ldap_free_urldesc(lud);