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

AW: How to check if attribute exists?



Hmmm, what I want to do is to decide wether
one entry is a CA (cACertificate) or a user (userCertificate).
Your search will also be succesfull so I have to try to get the
attribute.

Thanks for your effort.

Ciao!
Matthias


> -----Ursprüngliche Nachricht-----
> Von:	Pierangelo Masarati [SMTP:masarati@aero.polimi.it]
> Gesendet am:	Mittwoch, 17. Januar 2001 14:28
> An:	Wald, Matthias
> Cc:	openldap-software@openldap.org
> Betreff:	Re: How to check if attribute exists?
> 
> "Wald, Matthias" wrote:
> 
> > Is there a direkt way to check if an entry has a specific attribute (for
> > example
> > cACertificate or userCertificate) and not via search and get attribute?
> 
> Yes: use a filter of '(cACertificate=*)' and do not require attribute
> retrieval;
> e.g., with the C API:
> 
> 
>     char *attrs[] = { LDAP_NO_ATTRS, NULL };
>     ldap_search(ld, NULL, LDAP_SCOPE_SUBTREE, '(cACertificate=*)', attrs,
> 1);
> 
> retrieves all the entries that have the attribute cACertificate, but no
> values.
> Note: LDAP_NO_ATTRS="1.1" as per draft-ietf-ldapext-ldap-c-api-xx.txt
> It is defined in ldap.h.
> 
> Pierangelo Masarati.
> 
> --
> Dr. Pierangelo Masarati               | voice: +39 02 2399 8365
> Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
> Politecnico di Milano                 | mailto:masarati@aero.polimi.it
> via La Masa 34, 20156 Milano, Italy   |
> http://www.aero.polimi.it/~masarati
> 
>