summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-30 09:48:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:30 -0500
commitb29d129ce75dc4d1fd0faf457558fbd3a4084b29 (patch)
treec6dc514ea9c183788b6add7704b5fead0028ba2b
parent1170417ceeb8c49a46cda522a38eaa71c9cae30c (diff)
downloadsamba-b29d129ce75dc4d1fd0faf457558fbd3a4084b29.tar.gz
samba-b29d129ce75dc4d1fd0faf457558fbd3a4084b29.tar.bz2
samba-b29d129ce75dc4d1fd0faf457558fbd3a4084b29.zip
r20415: add a function to get the lDAPDisplayName for an objectClass
or attribute metze (This used to be commit 437db390795be8d6a375f2d44240b66d4406e148)
-rw-r--r--source4/dsdb/schema/schema_init.c20
1 files changed, 20 insertions, 0 deletions
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;
+}