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

Re: [openldap 2.1.12] about use of ldap_add_s(...)



Helene.Lastennet@alcatel.fr wrote:

Hy,

I would like to add in my database this following attribute
'optionvalues' with the base64 encoded string 'AABCDAA' and according to
this format:
optionvalues:: AABCDAA

'optionvalues' is a string (SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{100})

I use for that the C ldap librairies and the function :
int ldap_add_s(LDAP *ld, const char *dn, LDAPMod *attrs[]);
To complete LDAPMod structure, I use "struct berval **modv_bvals" and
"LDAP_MOD_BVALUES"

but the result is always the same:
optionvalues: AABCDAA

only one ':' ??

so How can I do to obtain 2 ':' ?



The value you store in the member modv_bvals of the LDAPMod structure
must not be base64 encoded. It doesn't matter how you declare your value
in the LDAPMod structure; its representation when displaying search results
is decided at the client's level (e.g. by ldapsearch) based on the chars contained
in the berval that's returned (and on its judjement about their printability).
Also, note that 'AABCDAA' is not a valid base64 string; I assume you mean
'AABCDAA='.


Pierangelo.