[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: attribute type in libldap ?



At 12:24 PM 8/8/00 +0200, Helge Hess wrote:
>Hi,
>
>is it possible to find out the type of an attribute value (binary or
>text) with LDAPv2 in libldap ?

The LDAPv2 protocol does not provide any schema discovery mechanism.
Clients are expected to a priori knowledge of value syntaxes that
they use and not make use of any value they don't know the syntax
of.

>From the API it doesn't seem so, but the
>LDAP-Browser/Editor Java application seems to be able to do that.

Likely either hardcoded... or configurable...  some clients have
been known to read server configuration files as a means of client
configuration.


>Can I distinguish between binary and text values after an
>ldap_first_attribute/ldap_next_attribute, so that I know whether an
>attribute value is printable ?

Well, you can just check the octets to see if they are printable
and escape those which are not.  This is basically what ldapsearch(1)
does.

Kurt