Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.0.0-M21
-
None
-
None
-
Patch
Description
From ee47e87b6d3e88d411220ccce43d8feecf4e5dec Mon Sep 17 00:00:00 2001
From: Ciprian Ciubotariu <cheepeero@gmx.net>
Date: Sat, 27 Feb 2016 01:35:22 +0200
Subject: [PATCH] Use a better IPv6 address parser
Don't rely on sun.net.util since it is not visible in OSGi.
—
ldap/model/pom.xml | 5 +++++
.../main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java | 3 ++-
2 files changed, 7 insertions, 1 deletion
diff --git a/ldap/model/pom.xml b/ldap/model/pom.xml
index fc4c4a9..a370828 100644
— a/ldap/model/pom.xml
+++ b/ldap/model/pom.xml
@@ -96,6 +96,11 @@
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.5.0</version>
+ </dependency>
</dependencies>
<build>
diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
index 8811139..716e862 100644
— a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.commons.validator.routines.InetAddressValidator;
import org.apache.directory.api.i18n.I18n;
import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
@@ -507,7 +508,7 @@ public class LdapUrl
{
String hostString = new String( chars, start, pos - start );
- if ( sun.net.util.IPAddressUtil.isIPv6LiteralAddress( hostString ) )
+ if ( InetAddressValidator.getInstance().isValidInet6Address( hostString ) )
{
host = hostString;
–
2.4.10