summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_accounts.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-03-22 17:42:55 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-03-23 05:05:31 -0400
commit201ab94ecdf62e68928f90c30e9eb28a1800e3dd (patch)
tree7d27a4793a372b5dd242bbe0094f14d548312e12 /src/providers/ldap/sdap_async_accounts.c
parente46e4f3e5fe568b660ed54d2862d31bc243b4278 (diff)
downloadsssd-201ab94ecdf62e68928f90c30e9eb28a1800e3dd.tar.gz
sssd-201ab94ecdf62e68928f90c30e9eb28a1800e3dd.tar.xz
sssd-201ab94ecdf62e68928f90c30e9eb28a1800e3dd.zip
Add sysdb_attrs_primary_name_list() routine
This routine will replace the use of sysdb_attrs_to_list() for any case where we're trying to get the name of the entry. It's a necessary precaution in case the name is multi-valued.
Diffstat (limited to 'src/providers/ldap/sdap_async_accounts.c')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 28d667c9a..71112b5f8 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -2006,12 +2006,13 @@ static int sdap_initgr_common_store(struct sysdb_ctx *sysdb,
*/
ldap_grouplist = NULL;
} else {
- ret = sysdb_attrs_to_list(tmp_ctx, ldap_groups,
- ldap_groups_count,
- SYSDB_NAME,
- &ldap_grouplist);
+ ret = sysdb_attrs_primary_name_list(
+ sysdb, tmp_ctx,
+ ldap_groups, ldap_groups_count,
+ opts->group_map[SDAP_AT_GROUP_NAME].name,
+ &ldap_grouplist);
if (ret != EOK) {
- DEBUG(1, ("sysdb_attrs_to_list failed [%d]: %s\n",
+ DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n",
ret, strerror(ret)));
goto done;
}
@@ -2538,12 +2539,13 @@ static void sdap_initgr_nested_store(struct tevent_req *req)
/* Not all indirect groups may be cached.
* Add fake entries for those that are not */
- ret = sysdb_attrs_to_list(state, state->groups,
- state->groups_cur,
- SYSDB_NAME,
- &ldap_grouplist);
+ ret = sysdb_attrs_primary_name_list(
+ state->sysdb, state,
+ state->groups, state->groups_cur,
+ state->opts->group_map[SDAP_AT_GROUP_NAME].name,
+ &ldap_grouplist);
if (ret != EOK) {
- DEBUG(1, ("sysdb_attrs_to_list failed [%d]: %s\n",
+ DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n",
ret, strerror(ret)));
goto done;
}
@@ -3965,10 +3967,11 @@ errno_t save_rfc2307bis_user_memberships(
ldap_grouplist = NULL;
}
else {
- ret = sysdb_attrs_to_list(tmp_ctx,
- state->ldap_groups, state->ldap_groups_count,
- SYSDB_NAME,
- &ldap_grouplist);
+ ret = sysdb_attrs_primary_name_list(
+ state->sysdb, tmp_ctx,
+ state->ldap_groups, state->ldap_groups_count,
+ state->opts->group_map[SDAP_AT_GROUP_NAME].name,
+ &ldap_grouplist);
if (ret != EOK) {
goto error;
}
@@ -4454,10 +4457,11 @@ static errno_t rfc2307bis_nested_groups_update_sysdb(
ldap_grouplist = NULL;
}
else {
- ret = sysdb_attrs_to_list(tmp_ctx,
- state->ldap_groups, state->ldap_groups_count,
- SYSDB_NAME,
- &ldap_grouplist);
+ ret = sysdb_attrs_primary_name_list(
+ state->sysdb, tmp_ctx,
+ state->ldap_groups, state->ldap_groups_count,
+ state->opts->group_map[SDAP_AT_GROUP_NAME].name,
+ &ldap_grouplist);
if (ret != EOK) {
goto error;
}