diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-11-01 22:01:48 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:43:58 +0100 |
commit | 605032d9978c6d44f6570418c8d66af0fe705a35 (patch) | |
tree | afc3e5e0cf86232a3c3e9ebad936d698daf3e7d3 /source4 | |
parent | cac3a42998caff84067b564e582bb3eaae5e7221 (diff) | |
download | samba-605032d9978c6d44f6570418c8d66af0fe705a35.tar.gz samba-605032d9978c6d44f6570418c8d66af0fe705a35.tar.bz2 samba-605032d9978c6d44f6570418c8d66af0fe705a35.zip |
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)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 20 |
1 files changed, 20 insertions, 0 deletions
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; |