Hi,
I'm trying to make sense of the use of "binary" in misc client API's.
Some API's (like perl Net::LDAPapi) seem to offer a "b" option do add/modify operations which controls whether the ";binary" AttributeOption is set on an attribute. For Net::LDAPapi this translates (from what I see in the libldap source) to LDAP_MOD_BVALUES
But when reading the sources and RFC it seems to me that LDAP_MOD_BVALUES and ";binary" is two completely different things. (Also ";binary" has been removd from RFC4511).
Am I right in concluding that LDAP_MOD_BVALUES (and thus "b" in Net::LDAPapi) only controls which BER type is used and as such is completely orthogonal to whether one chooses to set the ";binary" attributedescription options?
";binary" use often used with jpegPhoto, but does it have any influence on which BER type the server uses to send data to the client?
I would assume that it would be completely safe to ignore ";binary" and the only reason to set LDAP_MOD_BVALUES would be if the attribute value data contained "\0" bytes. (which would prevent using a string) Is this correct?
/Peter
Peter Mogensen wrote:
Hi,
I'm trying to make sense of the use of "binary" in misc client API's.
Some API's (like perl Net::LDAPapi) seem to offer a "b" option do add/modify operations which controls whether the ";binary" AttributeOption is set on an attribute. For Net::LDAPapi this translates (from what I see in the libldap source) to LDAP_MOD_BVALUES
But when reading the sources and RFC it seems to me that LDAP_MOD_BVALUES and ";binary" is two completely different things. (Also ";binary" has been removd from RFC4511).
Am I right in concluding that LDAP_MOD_BVALUES (and thus "b" in Net::LDAPapi) only controls which BER type is used and as such is completely orthogonal to whether one chooses to set the ";binary" attributedescription options?
";binary" use often used with jpegPhoto, but does it have any influence on which BER type the server uses to send data to the client?
I would assume that it would be completely safe to ignore ";binary" and the only reason to set LDAP_MOD_BVALUES would be if the attribute value data contained "\0" bytes. (which would prevent using a string) Is this correct?
None of what you've discussed means what you have said.
The LDAP_MOD_BVALUES flag indicates whether the accompanying modifications are provided in the form of struct bervals, or in the form of regular C strings. That's all.
As a best practice for C programmers, you should always use struct bervals. For languages like perl, which don't give you access to the raw structures, the choice is moot.
Howard Chu wrote:
None of what you've discussed means what you have said.
The LDAP_MOD_BVALUES flag indicates whether the accompanying modifications are provided in the form of struct bervals, or in the form of regular C strings. That's all.
Hmm... I thought that was roughly what I said. At least thats what I could read from the libldap/liblber source.
My question was if this flag had any connection at all with the ";binary" attribute description option.
/Peter
Peter Mogensen wrote:
Howard Chu wrote:
None of what you've discussed means what you have said.
The LDAP_MOD_BVALUES flag indicates whether the accompanying modifications are provided in the form of struct bervals, or in the form of regular C strings. That's all.
Hmm... I thought that was roughly what I said. At least thats what I could read from the libldap/liblber source.
My question was if this flag had any connection at all with the ";binary" attribute description option.
No, it doesn't.
openldap-technical@openldap.org