From 605032d9978c6d44f6570418c8d66af0fe705a35 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 1 Nov 2007 22:01:48 +0100 Subject: r25786: Add function required by linked_attributes module (We need a list of all linked attributes in the schema, so we can try and find them). Andrew Bartlett (This used to be commit 9cc706e06079899e58d4806ec27f86ae019cff60) --- source4/dsdb/schema/schema_init.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source4/dsdb') diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 5ca0e6d47e..ff853018a2 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -1014,6 +1014,26 @@ const char *dsdb_lDAPDisplayName_by_id(const struct dsdb_schema *schema, return NULL; } +WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *schema, TALLOC_CTX *mem_ctx, const char ***attr_list_ret) +{ + const char **attr_list = NULL; + struct dsdb_attribute *cur; + int i = 0; + for (cur = schema->attributes; cur; cur = cur->next) { + if (cur->linkID == 0) continue; + + attr_list = talloc_realloc(mem_ctx, attr_list, const char *, i+2); + if (!attr_list) { + return WERR_NOMEM; + } + attr_list[i] = cur->lDAPDisplayName; + i++; + } + attr_list[i] = NULL; + *attr_list_ret = attr_list; + return WERR_OK; +} + int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema) { int ret; -- cgit