cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Ldap URL and binary entries

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 31 May 2005 11:15:21 +0200 (CEST)

On Tue, 31 May 2005, Jean-Marc Desperrier wrote:

Thanks for your work!

> The current version does not work properly with binary entries in LDAP.

In general, I think the LDAP support is in a poor state... But I know very
little about LDAP in general, so this is not something I work on myself.

> My simple version encodes the attribute value in base64 only when there's a
> binary zero inside. But RFC 2849 says you must encode as base64 as soon as
> there is any unsafe character, both for the value and the dn/rdn.

What is a "unsafe character" in this sense? Can't we just write a function
that scans for them and encode the data accordingly if any such is found?

> Another point is that LDAP Browser/Editor finds a ";binary" option for the
> entries I'm working with, but I don't where he extracts that info from. I
> thought about systematically adding it when the entries have a binary
> content, but I finally commented it out, and only use the double colon to
> indicate base64 encoding. It would be better to find the way to extract all
> the option values, and include them in the output.

I know nothing about things like this.

> Also I would like to add an option not to output as ldif, but to get
> directly the raw value of an attribute (it would be left to the user to
> properly set the URL so that it matches only one attribute). base64 encoding
> of unsafe values wouldn't be required for that case. Together with that
> there would an optional parameter to get only the n-th value of a
> multi-valued attribute (and either an empty or error result if it doesn't
> exist).

... and I don't understand this either! ;-)

> But I wonder what would be the recommended way of adding such options ?

Are you talking about options added to curl_easy_setopt() ?

> Would it be to add new elements to the connectdata structure ? That's the
> only one element available from Curl_ldap.

connectdata holds connection-oriented data, and the SessionHandle struct keeps
data associated with the easy handle (like options set with curl_easy_setopt).
You can reach the SessionHandle by reading the 'data' field in the connectdata
struct.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-05-31