Thanks Chris. But the patch didn't fix the problem. In fact, as soon as I applied the patch absolutely no output was generated. So what I did was commented out all the "die" statements and that seemed to have fixed the problem. Your patch gave me insights to where to look. Thanks again

From: Chris Ridd <[EMAIL PROTECTED]>
To: Julius Squeezer <[EMAIL PROTECTED]>, <perl-ldap@perl.org>
Subject: Re: printMembers.pl returns 30 members, where ldap browser returns 217!
Date: Sat, 15 Sep 2007 15:07:08 +0100

On 14/9/07 7:09, "Julius Squeezer" <[EMAIL PROTECTED]> wrote:

>
> I think I figured out the problem. See, when I browse for a group using an > ldap browser, it lists all the DNs of that group. Now some of the entry is > broken, as in there's a listing for a DN but upon clicking that DN it takes
> me nowhere (broken link). The perl script (printMembers.pl) doesn't take
> this into account. So when it encounters a broken link, instead of skipping
> to the next good member in that group, it skips the next available group
> ignoring the rest of the members of the previous group it found a broken
> link for. Now how do I handle this exception in the perl script, so it loops > through all the group members from beginning to end and skips bad links even
> if an entry is there?

Good analysis.

Does this patch change the behaviour appropriately?

Index: printMembers.pl
===================================================================
--- printMembers.pl     (revision 537)
+++ printMembers.pl     (working copy)
@@ -124,7 +124,7 @@
               attrs => @entryAttrs
              );

-      die $mesg->error if $mesg->code;
+      return if $mesg->code;

       eval
      {

Using evals and recursion like that's a bit... well, I wouldn't write it
that way :-)

It also looks like it'll recurse infinitely if you get a group member DN of
a parent group, but then again so may your LDAP server...

Cheers.

Chris



_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Reply via email to