Re: Net::LDAP with ldapi?

"Dieter Kluenter" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
Quanah Gibson-Mount <[email protected]> writes:

> I'm trying to make an ldapi:/// connection using Net::LDAP, and it
> doesn't seem to work right.
>
> 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?

use Net::LDAP;
$ldap = Net::LDAP->new ( 'ldapi://%2Fvar%2Frun%2Fslapd%2Fldapi',
                         async => 1,
                         version => 3 )
or die $!;

define the path to socket as ldap URL, if this doesn't work, check the
socket permissions, it has to be 777. 

-Dieter
-- 
Dieter Klünter | Systemberatung
http://www.dpunkt.de/buecher/2104.html
sip: +49.180.1555.7770535
GPG Key ID:8EF7B6C6
53°08'09,95"N
10°08'02,42"E
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.