For Programmers: Free Programming Magazines  


Home > Archive > LDAP > February 2008 > ->sync on an uninitialized/unbound connection can cause an









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ->sync on an uninitialized/unbound connection can cause an
Michael Alan Dorman

2008-02-06, 7:29 pm

On a host that has an LDAP server running, try:

perl -MNet::LDAP -e 'my $ldap = Net::LDAP->new ('localhost'); $ldap->sync'

You'll get a failure like:

Can't use an undefined value as a HASH reference
at /usr/share/perl5/Net/LDAP.pm line 742, <DATA> line 228.

I've attached a patch that guards against this situation arising; it
would be nice if it could be included in a future version of the module.

Thanks for developing Net::LDAP!

Mike.
Michael Alan Dorman

2008-02-07, 8:26 am

On Thu, 7 Feb 2008 07:27:34 +0000
Chris Ridd <chrisridd@mac.com> wrote:

> I simplified it slightly, and revision 542 contains this change:
>
> [patch elided]
>
> Can you check that still fixes your problem?


What you did is actually what I was more initially inclined to do, but
there seemed to be an impulse towards a single-exit-point style so I
went with that. Dijkstra style, I guess you could call it. :)

Anyway, yes, your version works great.

Thanks, Chris.

Mike.
Pojo

2008-02-14, 6:01 pm

http://www.CheapVideoBlog.com/watch?watch=148803
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com