| Newsgroups |
perl.ldap |
| Message-ID |
<[email protected]> |
Hi All,
I'm a beginner in Unix and LDAP and I have to create a LDAP directory to store information. I have a ldap server on a
machine which works (I can make queries, adding entries on the LDAP, ...) Now, I try to connect another machine to this
LDAP server via a script Perl. Here is my script (very basic to begin)
-----------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use Net::LDAP;
my $ldapHost = "XXXX";
my $user = "XXXX";
my $pw = "XXXX";
my $ldap = Net::LDAP->new($ldapHost, timeout=>240) or die "Can't bind to ldap: $!\n$@\n";
print "NEW\n";
$ldap->bind(dn=>$user, password=>$pw);
print "BIND\n";
$ldap->unbind;
print "---------end-----------\n";
-----------------------------------------------------------------------------------------------------------------------------
My ldapHost is reachable from the client (A ping gives an answer)
In this state, the answer of the script is :
Can't bind to ldap: Connection timed out
IO::Socket::INET: connect: Connection timed out
without timeout specified on Net::LDAP->new, the answer is :
Can't bind to ldap: Operation now in progress
IO::Socket::INET: connect: timeout
I also noticed that a query on the LDAP server takes a long time (Almost one minute for a simple ldapsearch query) Is
it normal? or is it linked with my problem?
As I said before, I'm a really beginner. Feel free to ask if you need more information.
I hope somebody will have a solution or help for me
Thank you
Noemie