gbarr / perl-Convert-ASN1

encode/decode data using ASN.1 description
http://search.cpan.org/dist/Convert-ASN1/
13 stars 21 forks source link

Regression in 0.25: Can't use string ("cn") as an ARRAY ref while "strict refs" in use at Convert/ASN1/_encode.pm line 269 #12

Closed moritz closed 11 years ago

moritz commented 11 years ago

The following short script:

use strict;
use warnings;
use Net::LDAP;
my $ldap_con = Net::LDAP->new(
        'ldap.office.noris.de:389',
        onerror => 'die',
        version => 3
        );

$ldap_con->search(
        base    => 'ou=People,dc=noris,dc=de',
        filter  => '(&(objectClass=norisPerson) (!(NSAccountLock=*)))',
        scope   =>  "sub",
        attrs   =>  'cn'
        );

works fine with Convert::ASN1 up to version 0.24, but dies with

$ perl ldap.pl
Can't use string ("cn") as an ARRAY ref while "strict refs" in use at /home/mlenz/perl5/lib/perl5/Convert/ASN1/_encode.pm line 269, <DATA> line 581.
 at ldap.pl line 10.

with versions 0.25 and newer.

I'm having a hard time trying to find out how exactly Net::LDAP calls Convert::ASN1, but all attempts to squeeze backtraces out of Net::LDAP have failed me so far.

Please let me know if and how I can provide more context for you to debug this.

gbarr commented 11 years ago

Not sure why it would work, if it it really generated the right packet data, with 0.24 but the issue is that attrs should be passed as an array reference.

attrs => ['cn'],

moritz commented 11 years ago

Ok, thank you very much. Then it wasn't a regression at all.