[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: checking for bound user



> That's a big help. I was only looking at the bind.c code, and didn't
> notice the op->o_conn->c_dn being set. Thanks.

Howard's note is that you should use op->o_ndn; in fact,
in some cases backend search routines are called out of
context for internal purposes; in this case, they might
have a null or fake connection, so op->o_ndn should be
guaranteed to be set to the identity the operation is
supposed to run as.  During regular operations, op->o_ndn
and op->o_conn->c_ndn should be exactly the same.

p.

>
> - DAP
>
>> -----Original Message-----
>> From: Pierangelo Masarati [mailto:ando@sys-net.it]
>> Sent: Wednesday, March 24, 2004 5:25 PM
>> To: David Parker
>> Cc: openldap-devel@OpenLDAP.org
>> Subject: Re: checking for bound user
>>
>>
>>
>> > In an overlay I am working on, when I get a search request I need to
>> know if the user is bound or not. From the list archives
>> and from bind.c
>> > it looks like op->o_req_dn gets set only if the bind succeeds. Is it
>> sufficient/safe to only check for NULL on this member to
>> determine if
>> > the user is bound? op->o_req_ndn gets set, too - does it
>> matter which
>> > one of these pointers I check?
>>
>> you should check op->o_conn->c_dn or op->o_conn->c_ndn
>> AFTER a bind takes place; op->o_req_ndn contains the
>> DN to be bound during a bind operation.  During other
>> operations it contains the DN the operation refers to
>> (e.g. the entry's DN during add,modify, modrdn, delete,
>> compare; the search base during search; and so on).
>>
>> p.
>>
>> --
>> Pierangelo Masarati
>> mailto:pierangelo.masarati@sys-net.it
>>
>>
>>
>>


-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it