summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2013-08-12 15:06:18 +0000
committerJakub Hrozek <jhrozek@redhat.com>2014-05-02 13:34:54 +0200
commitd2969c6b23c722445bd699c830adb7601ba1cdc6 (patch)
tree935605bec262b85d85565d0076a954ca3ae865e2 /src/providers/ldap/sdap.c
parent4dd38025efda88f123eac672f87d3cda12f050c8 (diff)
downloadsssd-d2969c6b23c722445bd699c830adb7601ba1cdc6.tar.gz
sssd-d2969c6b23c722445bd699c830adb7601ba1cdc6.tar.xz
sssd-d2969c6b23c722445bd699c830adb7601ba1cdc6.zip
Make LDAP extra attributes available to IPA and AD
https://fedorahosted.org/sssd/ticket/2073 Reviewed-by: Simo Sorce <simo@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/providers/ldap/sdap.c')
-rw-r--r--src/providers/ldap/sdap.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 37a187436..e8d23c9dc 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -187,6 +187,45 @@ int sdap_extend_map(TALLOC_CTX *memctx,
return EOK;
}
+int sdap_extend_map_with_list(TALLOC_CTX *mem_ctx,
+ struct sdap_options *opts,
+ int extra_attr_index,
+ struct sdap_attr_map *src_map,
+ size_t num_entries,
+ struct sdap_attr_map **_map,
+ size_t *_new_size)
+{
+ const char *extra_attrs;
+ char **extra_attrs_list;
+ errno_t ret;
+
+ extra_attrs = dp_opt_get_string(opts->basic, extra_attr_index);
+ if (extra_attrs == NULL) {
+ *_map = src_map;
+ *_new_size = num_entries;
+ return EOK;
+ }
+
+ /* split server parm into a list */
+ ret = split_on_separator(mem_ctx, extra_attrs, ',', true, true,
+ &extra_attrs_list, NULL);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE, ("Failed to parse server list!\n"));
+ return ret;
+ }
+
+
+ ret = sdap_extend_map(mem_ctx, src_map,
+ num_entries, extra_attrs_list,
+ _map, _new_size);
+ talloc_free(extra_attrs_list);
+ if (ret != EOK) {
+ return ret;
+ }
+
+ return EOK;
+}
+
int sdap_get_map(TALLOC_CTX *memctx,
struct confdb_ctx *cdb,
const char *conf_path,