diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-05-22 18:31:42 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-08 13:27:16 +0200 |
commit | c77f4e7199ce05e597eadeb7419ba27a1d2930b1 (patch) | |
tree | 0d22c5738ac9fd8e58ab811fa2f189521312e70d /src/providers/ldap/sdap.c | |
parent | 6a4ffc65a356a15322bfc687ce6be94bfbf04780 (diff) | |
download | sssd-c77f4e7199ce05e597eadeb7419ba27a1d2930b1.tar.gz sssd-c77f4e7199ce05e597eadeb7419ba27a1d2930b1.tar.xz sssd-c77f4e7199ce05e597eadeb7419ba27a1d2930b1.zip |
SDAP: Add sdap_copy_map_entry
Reviewed-by: Pavel Reichl <preichl@redhat.com>
(cherry picked from commit 12089241f6a6eabf4f0c95669e5fc2bb3b503c06)
(cherry picked from commit 155e6c7223b732bfcb2984aa79462f60c092bba8)
Diffstat (limited to 'src/providers/ldap/sdap.c')
-rw-r--r-- | src/providers/ldap/sdap.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index bae7d02c5..2568bdd1f 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -28,6 +28,23 @@ /* =Retrieve-Options====================================================== */ +errno_t sdap_copy_map_entry(const struct sdap_attr_map *src_map, + struct sdap_attr_map *dst_map, + int entry_index) +{ + if (src_map[entry_index].name != NULL) { + dst_map[entry_index].name = talloc_strdup(dst_map, + src_map[entry_index].name); + if (dst_map[entry_index].name == NULL) { + return ENOMEM; + } + } else { + dst_map->name = NULL; + } + + return EOK; +} + int sdap_copy_map(TALLOC_CTX *memctx, struct sdap_attr_map *src_map, int num_entries, |