summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-19 12:47:34 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-20 13:37:28 -0500
commit13308d6c9e30ca6835c38fbdedcb47dfc343d8b3 (patch)
treef85be7b07e78ca0030b3a8a81203a3fb7dc2bf3e
parentb8ecc581cdd8c7d097bf9db67a4cb220fbbcff6d (diff)
downloadsssd-13308d6c9e30ca6835c38fbdedcb47dfc343d8b3.tar.gz
sssd-13308d6c9e30ca6835c38fbdedcb47dfc343d8b3.tar.xz
sssd-13308d6c9e30ca6835c38fbdedcb47dfc343d8b3.zip
Save original memberof, not memberof
-rw-r--r--src/providers/ldap/sdap_async_users.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c
index cccf75b8c..ac856a642 100644
--- a/src/providers/ldap/sdap_async_users.c
+++ b/src/providers/ldap/sdap_async_users.c
@@ -154,12 +154,24 @@ int sdap_save_user(TALLOC_CTX *memctx,
goto fail;
}
- ret = sdap_attrs_add_list(attrs, SYSDB_MEMBEROF,
- "original memberOf",
- name, user_attrs);
- if (ret != EOK) {
+ ret = sysdb_attrs_get_el(attrs, SYSDB_MEMBEROF, &el);
+ if (ret) {
goto fail;
}
+ if (el->num_values == 0) {
+ DEBUG(7, ("Original memberOf is not available for [%s].\n",
+ name));
+ } else {
+ DEBUG(7, ("Adding original memberOf attributes to [%s].\n",
+ name));
+ for (i = 0; i < el->num_values; i++) {
+ ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF,
+ (const char *) el->values[i].data);
+ if (ret) {
+ goto fail;
+ }
+ }
+ }
ret = sdap_attrs_add_string(attrs,
opts->user_map[SDAP_AT_USER_MODSTAMP].sys_name,