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


Reply via email to