OID 10g ldapsearch With -X Flag Returns Incorrect And/Or Inconsistent Results For Attributes With Base64 Encoded Values

(Doc ID 1407515.1)

Last updated on OCTOBER 03, 2016

Applies to:

Oracle Internet Directory - Version: 10.1.4 to - Release: 10gR3 to 10gR3
Information in this document applies to any platform.


Oracle Internet Directory (OID) 10g.

Running ldapsearch with -X flag (print entries in XML format) where a attribute is stored with base64 encoding, results are incorrect and/or not consistent.

This affects scripts that make use of ldapsearch -X, such xmlparserv2.jar for xml file parsing, which returns error:
Invalid UTF8 encoding.ERROR while executing java

For example, for attribute "a" with a base64 encoded value, an ldapsearch without -X shows correctly:
ldapsearch -h myoidhost -p 389 -D cn=orcladmin -w mypwd -b "cn=myuser,cn=users,dc=mycompany,dc=com" -L -s base "objectclass=*" a

dn: cn=myuser,cn=users,dc=mycompany,dc=com
a:: QWRhIE38aGVuZGlzbGlrIHZlIFlhemlsaW0gSGl6bWV0bGVyaSBUaWMuTHRkLlN0aQ==

But ldapsearch with -X, the "a" attribute value shows differently and can change every time the ldapsearch is rerun:
ldapsearch -h myoidhost -p 389 -D cn=orcladmin -w mypwd -b "cn=myuser,cn=users,dc=mycompany,dc=com" -X -s base "objectclass=*" a

<dsml xmlns:dsml="http://www.dsml.org/DSML">
<entry dn="cn=myuser,cn=users,dc=mycompany,dc=com">
<attr name="a">
<value encoding="base64">


The difference may be noticeable or it may be subtle such as an extra non-printable character at the end of the value.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms