Skip to content
Snippets Groups Projects
Verified Commit 203751c3 authored by Fredrik Roubert's avatar Fredrik Roubert
Browse files

ITS#9838 Add decoding of the RFC 4517 Postal Address format.

No software connecting to an LDAP database through JDBC can be expected
to know anything at all about LDAP, so no such software can be expected
to be able to decode the RFC 4517 Postal Address format.
parent e8848f1d
No related branches found
No related tags found
1 merge request!5ITS#9838 Add decoding of the RFC 4517 Postal Address format.
......@@ -134,6 +134,8 @@ public class JndiLdapConnection implements java.sql.Connection {
/** LDAP connection */
LDAPConnection con;
/** LDAP schema */
LDAPSchema schema;
/**Stores properties for initialization */
Hashtable env;
......@@ -438,7 +440,7 @@ public class JndiLdapConnection implements java.sql.Connection {
try {
if (startTLS) con.startTLS();
if (user != null && pass != null) con.bind(3,user,pass.getBytes());
schema = con.fetchSchema(con.getSchemaDN());
} catch (LDAPException e) {
throw new SQLNamingException(e);
}
......
......@@ -351,6 +351,15 @@ public class UnpackResults {
}
if (Base64.isValidUTF8(bval, /*isUCS2Only=*/false)) {
svals = attrib.getStringValueArray();
if ("1.3.6.1.4.1.1466.115.121.1.41".equals(
con.schema.getAttributeSchema(attrib.getName()).getSyntaxString())) {
for (int i=0;i<svals.length;i++) {
svals[i] = svals[i]
.replaceAll("\\$", "\n")
.replaceAll("\\\\24", "\\$")
.replaceAll("(?i)(?<=\\\\)5C", "");
}
}
} else {
byteVals = attrib.getByteValueArray();
svals = new String[byteVals.length];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment