On 30 Nov 2007, at 19:53, Chris Ridd wrote:
On 30 Nov 2007, at 17:37, Michael Chiles wrote:
Perl LDAP Folk,
Tracking down an issue with a business process, I've run into a
problem with an audit using Net::LDAP. There are some string
attributes in
one of our LDAP servers that were written to the directory as base 64
encoded strings. The strings in question have a trailing space
( which
caused the input system to encode them as base64 ). Fixed the input
problem, but trying to use Net::LDAP to locate these attributes has
failed, as the base64 decoding of the string appears to result in
the
trailing space being removed. When I call get_value method on an
entry
object, none of them have the trailing string.
I verified the results using openldap seaches to confirm the
data I'm
seeing does have a trailing space in the directory.
Does anyone have suggestions on how to address this using
Net::LDAP?
Is this a bug?
I've not seen Net::LDAP do this before.
Are the values being sent over the network actually base-64-encoded
strings, or are they just getting encoded as base-64 when your
client app is displaying them?
To see what Net::LDAP's actually sending/receiving over the network,
call $ldap->debug(12) and all subsequent packets will be dumped to
stderr. The perldoc for Net::LDAP explains why "12" is used.
One other possibility has occurred to me. Recent versions of Net::LDAP
will try to convert values of all attributes into UTF-8 strings, so
something may be going awry there. You can prevent that conversion
using the 'raw' option to the constructor, passing it a regex of
attribute types you don't want to convert. See the docs for details
and a little example.
<http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP.pod>
Cheers,
Chris