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

Getting attributeTypes from a particular objectclass

I'm trying to getting the attributeTypes from a particular
objectClass in a C program.

Rigth now, I can get all objectClasses with their attributes
    char *schema_attrs[] = { "objectClasses", NULL  };
    result =
        ldap_search_s (ldap, "cn=Subschema", LDAP_SCOPE_BASE,
	"(objectclass=*)", schema_attrs, 0, &res);

processing each attibute with ldap_first_entry,
ldap_next_entry, ldap_first_attribute and ldap_next_attribute,
ldap_get_values and, finally, with:

    oc = ldap_str2objectclass(vals[i], &retcode, &errp, 0x03);

accesing oc->oc_names[0].

However, I get all objectclasses with their attributes
(MUST and MAY), but I would like to get only one

I think it could be changing the query to search (filter
on ldap_search_s), but I can find the rigth way.

One way could get all attributes and search on this list,
but I like to avoid get all values just for get only one.

On a database (SQL) it can be do it with "show columns from table"
or "show fields from table", PostgreSQL and MySQL respectively.
I know LDAP is not an SQL database, just I write the example
for a better understanding of what is I want to get with:
"show me the attributeTypes for this objectclass".

Thanks in advances for any pointer.

German Poo Caaman~o
«Hay 10 tipos de personas: las que entienden binario y las que no.»