From b29d129ce75dc4d1fd0faf457558fbd3a4084b29 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 30 Dec 2006 09:48:05 +0000 Subject: r20415: add a function to get the lDAPDisplayName for an objectClass or attribute metze (This used to be commit 437db390795be8d6a375f2d44240b66d4406e148) --- source4/dsdb/schema/schema_init.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source4/dsdb/schema') diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 0d1f51881a..2ab4c956be 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -718,3 +718,23 @@ const struct dsdb_class *dsdb_class_by_lDAPDisplayName(const struct dsdb_schema return NULL; } + +const char *dsdb_lDAPDisplayName_by_id(const struct dsdb_schema *schema, + uint32_t id) +{ + struct dsdb_class *a; + struct dsdb_class *c; + + /* TODO: add binary search */ + a = dsdb_attribute_by_attributeID_id(schema, id); + if (a) { + return a->lDAPDisplayName; + } + + c = dsdb_class_by_governsID_id(schema, id); + if (c) { + return c->lDAPDisplayName; + } + + return NULL; +} -- cgit