Re: Net::LDAP with ldapi?

Graham Barr <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
On Dec 12, 2008, at 1:15 PM, Quanah Gibson-Mount wrote:

> I'm trying to make an ldapi:/// connection using Net::LDAP, and it  
> doesn't seem to work right.

Net::LDAP is going to default to connect to /var/run/ldapi if that is  
not where your socket is
the you can either set $ENV{LDAPI_SOCK} or put the path in the uri  
passed.

ldapi: uri's are strange that the path to the socket needs to be  
encoded as the hostname, for
example the uri to specify "/var/run/ldapi" is ldapi://%26var%26run 
%26ldapi/

Graham.

>
>
> First, I verified that my ldapi connection works just fine using the  
> command line tools:
>
> [zimbra@freelancer tmp]$ ldapsearch -x -H ldapi:///
> # extended LDIF
> #
> # LDAPv3
> # base <> (default) with scope subtree
> # filter: (objectclass=*)
> # requesting: ALL
> #
>
> # search result
> search: 2
> result: 0 Success
>
> # numResponses: 1
>
>
> Now, I try and connect using Net::LDAP:
>
> [zimbra@freelancer tmp]$ /tmp/access.pl -e
> connect: No such file or directory at /tmp/access.pl line 70, <DATA>  
> line 275.
>
>
> Line 70 is:
>
> my $ldap = Net::LDAP->new("ldapi:///") or die "$@";
>
>
> Based on the documentation, I also tried
>
> my $ldap = Net::LDAP->new("ldapi://") or die "$@";
>
> But neither works.  Is this a known issue with Net::LDAP?
>
> --Quanah
>
> --
>
> Quanah Gibson-Mount
> Principal Software Engineer
> Zimbra, Inc
> --------------------
> Zimbra ::  the leader in open source messaging and collaboration
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.