develooper Front page | perl.ldap | Postings from April 2014

Net::LDAP fails with latest ActiveState Perl, can be worked round byrenoving INET6.pm

Thread Next
From:
k.brown@mail.bbk.ac.uk
Date:
April 2, 2014 17:38
Subject:
Net::LDAP fails with latest ActiveState Perl, can be worked round byrenoving INET6.pm
Message ID:
CAJ0hfotR9SUhFv1xuKtjgNNiB==OCXaXF9PLzY2_mvpj5rdiOA@mail.gmail.com
Similar error to that described by Glen Tanner a few weeks ago.

Recently installed a new PC with updated version of Perl::

D:\temp>perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for
MSWin32-x64-multi-thread
[...]
Binary build 1603 [296746] provided by ActiveState http://www.ActiveState.com
Built Mar 13 2013 13:31:10

A Perl Net::LDAP application that binds to Active Directory failed
with error messages like these:
    Return code: 82
    Error code:  Bad file descriptor
    Error name:  LDAP_LOCAL_ERROR
    Error text:  An error occurred in C<Net::LDAP>

The error can be reproduced with this code:

#===============
use Net::LDAP;
use strict;
my $filter = "cn=$target\x2a";
my $ldap = Net::LDAP->new ($lhost, onerror => "die");
my $bindmesg = $ldap->bind($luser,password=>$lpass);
my $searchresult = $ldap->search( base=>$lbase, filter=>$filter, attrs=>["dn"]);
#===============

Which on older Perls finds the DNs of all AD users with names starting
with string $target, but fails on current version of Perl.
($lbase = Root path of AD directory, $lhost = AD directory server
hostname, $luser = DN of known user, $lpass = that users password)


Following some hints on other mailing lists referring to Strawberry
Perl rather than ActiveState, I renamed
C:\Perl64\site\lib\IO\Socket\INET6.pm  and it worked.

So somewhere there is a bug.

-- 
Ken Brown

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About