From: Jason H. <gl...@LU...> - 2000-05-28 05:12:04
|
Hi, I'm new to LDAP and I'm trying to get a simple search to a new LDAP server happening and I'm getting nowhere fast. Any help/advice would be wonderful. SITUATION: - I've installed: perl-ldap-0.16 and Convert-ASN1-0.06 onto a Digital Unix box running Perl 5.004_04. - I'm connecting to a new PABX phone database which uses LDAPv2 (I believe). HOST: pe-pabx-dna.stservices.latrobe.edu.au BASE: o=Latrobe University, c=AU LOGIN: Not required I've been able to query this server using the "Directory Services" window in Eudora. (Note: "o=Latrobe University" may change to "o=La Trobe University" soon) - I've grabbed a copy of the "simplesearch.pl" code from Mark Wilcox's article in PerlMonth to test things out with. WHAT HAPPENS: - When I run simplesearch.pl, I get the error message "failed to bind with 1", so it's not even getting to make an anonymous bind to the server. WHAT NOW? - I'm at a loss to know what to try from here. Any suggestions? (grovel... grovel..) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SIMPLESEARCH.PL #!/usr/local/bin/perl use strict; use Net::LDAP; my $host = 'pe-pabx-dna.stservices.latrobe.edu.au'; my $ldap = new Net::LDAP($host); #authenticate to the LDAP server anonymously my $mesg = $ldap->bind(); die ("failed to bind with ",$mesg->code(),"\n") if $mesg->code(); #now perform a simple search $mesg = $ldap->search( base => 'o=Latrobe University, c=AU', scope => 'sub', filter => '(objectclass=*)', ); die ("search failed with ",$mesg->code(),"\n") if $mesg->code(); #display results and disconnect from the server while (my $entry = $mesg->shift_entry()) { $entry->dump(); } $ldap->unbind(); =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The only other info that I have is that during the install of Convert-ASN1 "make test" reported some failed tests (and the Unix admin fella isn't around for me to query about what this means, sorry): t/00prim............FAILED tests 43, 55, 59, 86, 132, 136 Failed 6/137 tests, 95.62% okay t/01tag.............ok t/02seq.............ok t/03seqof...........ok t/04opt.............ok t/07io..............ok Failed Test Status Wstat Total Fail Failed List of failed ------------------------------------------------------------------ t/00prim.t 137 6 4.38% 43, 55, 59, 86, 132, 136 Failed 1/6 test scripts, 83.33% okay. 6/208 subtests failed, 97.12% okay. *** Exit 2 Stop. "make test" for the install of perl-ldap-0.16 also reported some failures: t/53schema..........Can't emulate - on #! line at t/53schema.t line 1. dubious Test returned status 2 (wstat 512, 0x200) Failed Test Status Wstat Total Fail Failed List of failed ------------------------------------------------------------------ t/53schema.t 2 512 ?? ?? % ?? Failed 1/7 test scripts, 85.71% okay. 0/143 subtests failed, 100.00% okay. *** Exit 2 Stop. -- __________________________________________________________________ Jason Hellwege J.H...@la... Webmaster - Information Technology Services La Trobe University Melbourne, Australia __________________________________________________________________ |
From: Mark W. <mew...@un...> - 2000-05-28 17:00:34
|
Hi, I can bind, but the search fails with "protocol error (e.g. error code 1)". I can also verify that the search works fine in Netscape Messenger. I'm using Convert::ASN.1 and Net::LDAP .18 . My NT box at home won't let me capture the output of debug. Jason can you upgrade to NEt::LDAP .18 and send us a copy of $ldap->debug(3) (put this after you connect to server but before the bind). thanks, Mark Jason Hellwege wrote: > Hi, I'm new to LDAP and I'm trying to get a simple search to a new > LDAP server happening and I'm getting nowhere fast. Any help/advice > would be wonderful. > > SITUATION: > - I've installed: perl-ldap-0.16 and Convert-ASN1-0.06 onto a Digital > Unix box running Perl 5.004_04. > > - I'm connecting to a new PABX phone database which uses LDAPv2 (I believe). > HOST: pe-pabx-dna.stservices.latrobe.edu.au > BASE: o=Latrobe University, c=AU > LOGIN: Not required > I've been able to query this server using the "Directory Services" > window in Eudora. (Note: "o=Latrobe University" may change to "o=La > Trobe University" soon) > > - I've grabbed a copy of the "simplesearch.pl" code from Mark > Wilcox's article in PerlMonth to test things out with. > > WHAT HAPPENS: > - When I run simplesearch.pl, I get the error message "failed to bind > with 1", so it's not even getting to make an anonymous bind to the > server. > > WHAT NOW? > - I'm at a loss to know what to try from here. Any suggestions? > (grovel... grovel..) > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > SIMPLESEARCH.PL > > #!/usr/local/bin/perl > use strict; > use Net::LDAP; > > my $host = 'pe-pabx-dna.stservices.latrobe.edu.au'; > my $ldap = new Net::LDAP($host); > > #authenticate to the LDAP server anonymously > my $mesg = $ldap->bind(); > die ("failed to bind with ",$mesg->code(),"\n") if $mesg->code(); > > #now perform a simple search > $mesg = $ldap->search( > base => 'o=Latrobe University, c=AU', > scope => 'sub', > filter => '(objectclass=*)', > ); > > die ("search failed with ",$mesg->code(),"\n") if $mesg->code(); > > #display results and disconnect from the server > while (my $entry = $mesg->shift_entry()) { $entry->dump(); } > $ldap->unbind(); > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > The only other info that I have is that during the install of > Convert-ASN1 "make test" reported some failed tests (and the Unix > admin fella isn't around for me to query about what this means, > sorry): > > t/00prim............FAILED tests 43, 55, 59, 86, 132, 136 > Failed 6/137 tests, 95.62% okay > t/01tag.............ok > t/02seq.............ok > t/03seqof...........ok > t/04opt.............ok > t/07io..............ok > Failed Test Status Wstat Total Fail Failed List of failed > ------------------------------------------------------------------ > t/00prim.t 137 6 4.38% 43, 55, 59, 86, 132, 136 > Failed 1/6 test scripts, 83.33% okay. 6/208 subtests failed, 97.12% okay. > *** Exit 2 > Stop. > > "make test" for the install of perl-ldap-0.16 also reported some failures: > > t/53schema..........Can't emulate - > on #! line at t/53schema.t line 1. > dubious > Test returned status 2 (wstat 512, 0x200) > Failed Test Status Wstat Total Fail Failed List of failed > ------------------------------------------------------------------ > t/53schema.t 2 512 ?? ?? % ?? > Failed 1/7 test scripts, 85.71% okay. 0/143 subtests failed, 100.00% okay. > *** Exit 2 > Stop. > -- > > __________________________________________________________________ > Jason Hellwege J.H...@la... > Webmaster - Information Technology Services > La Trobe University Melbourne, Australia > __________________________________________________________________ |
From: Pythagoras W. <py...@ec...> - 2000-05-28 21:00:42
|
On Sun, May 28, 2000 at 03:10:04PM +1000, Jason Hellwege wrote: :- I'm connecting to a new PABX phone database which uses LDAPv2 (I believe). : HOST: pe-pabx-dna.stservices.latrobe.edu.au : BASE: o=Latrobe University, c=AU : LOGIN: Not required :I've been able to query this server using the "Directory Services" :window in Eudora. (Note: "o=Latrobe University" may change to "o=La :Trobe University" soon) Are you really getting ALL the entries that you would expect? My testing below indicates that some entries are returned, but not necessarily all. Perhaps Eudora is not bothering to inform you of a problem, preferring to not confuse users instead? :WHAT HAPPENS: :- When I run simplesearch.pl, I get the error message "failed to bind :with 1", so it's not even getting to make an anonymous bind to the :server. Trying it under Solaris with Net::LDAP version 0.18 and ASN1 version 0.06, I find that the server unceremoniously closes the connection after sending 46 entries with the '(objectclass=*)' filter. This causes an operations error (i.e. a code of 1) to be reported by Net::LDAP. By changing the "die" in the line: die ("search failed with ",$mesg->code(),"\n") if $mesg->code(); to a "warn", I was able to get the 46 entries printed out. This is exactly the same results as I get from using OpenLDAP's ldapsearch, so I would say that there is a problem with your LDAP server. What server are you using? Note that this behavior of the server dropping the connection is not consistent. While the server does drop while searching with a filter of '(title=Mr)' (although after returning 22 entries), the server completes successfully when using a filter of '(organizationalunitname=BOUVERIE FAMILY CENTRE)' which returns 23 entries. -- Py (Amateur Radio: KF6WFP) -- 3.141592653589793238462643383... Pythagoras Watson -- "Live long and may all your kernels pop." === py...@cs... ==== http://www.ecst.csuchico.edu/~py/ === |
From: Jason H. <web...@la...> - 2000-05-29 02:01:51
|
Mark and Pythagoras - Many thanks for the help! It's now looking as though your suspicions are correct and there's something "odd" about the LDAP server which I'm trying to connect to. Some things want to connect to it, some things don't. I repointed my code to ldap.bigfoot.com and it worked fine, so I at least know that perl-ldap has installed and runs OK on my Digital Unix box. Pythagoras Said: >Perhaps Eudora is not bothering to inform you of a problem, >preferring to not >confuse users instead? Further testing is leading me to agree with this. >This is exactly the same results as I get from using OpenLDAP's >ldapsearch, so I would say that there is a problem with your LDAP >server. What server are you using? I haven't been able to find out yet, it came with our new PABX system and was installed by the phone company. I do know that it isn't one of the usual suspects (Netscape, Innosoft). Mark said: >Jason can you upgrade to NEt::LDAP .18 and send us a copy of >$ldap->debug(3) (put this after you connect to server but before the bind). I've done the upgrade to perl-ldap-0.18 (with Convert-ASN1-0.06), however the debug code is generating: syntax error at /usr/local/lib/perl5/site_perl/Convert/ASN1/Debug.pm line 175 All the Best, Jason -- ___________________________________________________________________________ Jason Hellwege "One can never have too La Trobe University, Melbourne, many giant robots.." Australia. Ja...@la... |
From: Pythagoras W. <py...@ec...> - 2000-05-29 03:09:59
|
On Mon, May 29, 2000 at 11:59:45AM +1000, Jason Hellwege wrote: :>This is exactly the same results as I get from using OpenLDAP's :>ldapsearch, so I would say that there is a problem with your LDAP :>server. What server are you using? : :I haven't been able to find out yet, it came with our new PABX system :and was installed by the phone company. I do know that it isn't one :of the usual suspects (Netscape, Innosoft). I wish you luck, an LDAP server that cannot be reliably searched is not much use. :Mark said: :>Jason can you upgrade to NEt::LDAP .18 and send us a copy of :>$ldap->debug(3) (put this after you connect to server but before the bind). : :I've done the upgrade to perl-ldap-0.18 (with Convert-ASN1-0.06), :however the debug code is generating: : syntax error at /usr/local/lib/perl5/site_perl/Convert/ASN1/Debug.pm line 175 In v0.18, line 175 of Debug.pm is: dump_op($_,"",{},1) for @{$self->{script}}; This is definitely syntatically invalid before perl version 5.005, so perhaps you are using an earlier perl. In any case, I note that Graham is shooting for 5.004 and later compliance, and as it happens has already updated the CVS copy of Debug.pm to fix this, which is available at: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/~checkout~/asn/lib/Convert/ASN1/Debug.pm?rev=1.2&cvsroot=perl-ldap -- Py (Amateur Radio: KF6WFP) -- 3.141592653589793238462643383... Pythagoras Watson -- "Live long and may all your kernels pop." === py...@cs... ==== http://www.ecst.csuchico.edu/~py/ === |