[SSSD] [PATCH] IPA: use sysdb_attrs_add_string_safe to add group member

Sumit Bose sbose at redhat.com
Thu Apr 23 11:39:30 UTC 2015


Hi,

this patch should make the IPA client less error prone if the server
returns the same member multiple times. sysdb_attrs_add_string_safe()
already used for ghost members and should be used for plain members as
well.

bye,
Sumit
-------------- next part --------------
From 9ce61b6a8dbd4044f9532dbcfcf83321b43b8e81 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 3 Apr 2015 12:12:34 +0200
Subject: [PATCH] IPA: use sysdb_attrs_add_string_safe to add group member

The member list returned by the extdom plugin might contain some entries
more than once. Although this is an issue on the server side to avoid
ldb errors duplicates should be filtered out on the client as well.
---
 src/providers/ipa/ipa_s2n_exop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index b9de88984ea36d5010d5544258d7d0cc68bfa669..688fdefe8eefe29a0cd13010bb3998527f3111f4 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -1300,10 +1300,11 @@ static errno_t process_members(struct sss_domain_info *domain,
                 DEBUG(SSSDBG_TRACE_ALL, "Adding member [%s][%s]\n",
                                         members[c], dn_str);
 
-                ret = sysdb_attrs_add_string(group_attrs, SYSDB_MEMBER, dn_str);
+                ret = sysdb_attrs_add_string_safe(group_attrs, SYSDB_MEMBER,
+                                                  dn_str);
                 if (ret != EOK) {
                     DEBUG(SSSDBG_OP_FAILURE,
-                          "sysdb_attrs_add_string failed.\n");
+                          "sysdb_attrs_add_string_safe failed.\n");
                     goto done;
                 }
             }
-- 
2.1.0



More information about the sssd-devel mailing list