[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-ldap-dev
Subject:    Re: get_dn
From:       Peter Marschall <peter.marschall () mayn ! de>
Date:       2002-07-02 20:39:06
[Download RAW message or body]

Hi

On Tuesday 02 July 2002 20:22, you wrote:
> #check for search error
>      if ($error == $results->code()){
> 	 	  die "Critical LDAP search failed:$error,$results->filter(0)";
> 		  }
here, you compare the result code with the variable error,
and if they match, you bail out. Is this intended ? I doubt it.
May be = instead of == would serve better

> 	 if ($results->count()) {
>               die"User entry not found for filter:&results->filter";
>      }
The condition here is fulfilled if you have atleast one entry.
It should be reversed !

> #get DN
> 	 $ent = $results -> shift_entry();
> 	 $dn = $ent -> dn();     #line 39

dn() has to fail here, because you only arrive here in case of errors.


Yours
Peter
-- 
Peter Marschall     |   eMail: peter.marschall@mayn.de
Scheffelstraße 15   |          peter.marschall@is-energy.de
97072 Würzburg      |   Tel:   0931/14721
PGP:  D7 FF 20 FE E6 6B 31 74  D1 10 88 E0 3C FE 28 35


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic