Hi Andy,
On Thursday, 12. January 2006 02:15, Webb, Andy wrote:
> 1. canonical_dn takes an option parameter casefold, but it doesn't
> pass casefold to ldap_explode_dn, which it uses internally, so
> casefold=none is impossible. Casefold=upper works, because the case is
> assertively changed to upper. Casefold=lower works, because the case is
> assertively changed to lower. Casefold=none fails because by the time
> you get to the point of declaring "no change to the case of the
> attributes" the case has already been changed by ldap_explode_dn. E.g.
>
> a. Original: $dn = "cn=blr,infocus1,OU=resources,DC=foo,DC=com"
>
> b. Code: $dnc = canonical_dn($dn, casefold => 'none')
>
> c. Expected: cn=blr\,infocus1,OU=resources,DC=foo,DC=com
>
> d. Returned: CN=blr\,infocus1,OU=resources,DC=foo,DC=com
>
> [ ... ]
>
> This is perl-ldap 0.33 with ldap.pm version 0.16.
>
> On the first issue, simply changing the call to ldap_explode_dn in
> canonical_dn from "ldap_explode_dn( $dn )" to "ldap_explode_dn( $dn,
> %opt )" appears to fix the casefold issue.
Would you mind to try the attached patch ?
It only passes the option casefold to ldap_explode_dn().
(Passing 'reverse => 1' might hurt ;-))
Please report any problems.
Regards
Peter
--
Peter Marschall
eMail: [EMAIL PROTECTED]
--- Util.pm (revision 473)
+++ Util.pm (working copy)
@@ -280,7 +280,7 @@
# create array of hash representation
my $rdns = ref($dn) eq 'ARRAY'
? $dn
- : ldap_explode_dn( $dn )
+ : ldap_explode_dn( $dn, casefold => $opt{casefold} || 'upper')
or return undef; #error condition
# assign specified or default separator value