[SSSD] [PATCH] IPA: check ghosts in groups found by uuid as well

Sumit Bose sbose at redhat.com
Mon Apr 27 10:28:24 UTC 2015


On Mon, Apr 27, 2015 at 12:27:48PM +0200, Sumit Bose wrote:
> Hi,
> 
> another idview/idoverride fix.

and now with patch ...
> 
> bye,
> Sumit
-------------- next part --------------
From 1f10f18ae5000d284325f35f85a9daedaf253c8c Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 24 Apr 2015 17:07:22 +0200
Subject: [PATCH] IPA: check ghosts in groups found by uuid as well

With views and overrides groups are not allowed to have ghost members
anymore because the name of a member might be overridden. To achieve
this ghost members are looked up and resolved later during group
lookups. Currently this is only done for group lookups by name but
should happen as well if the group is looked up by uuid.

Resolves https://fedorahosted.org/sssd/ticket/2631
---
 src/providers/ipa/ipa_id.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index dcfa2b64876848fcb064a3caf3da4f31976a600b..125a17ca6f29077cbb93e0444e395d0de8b23d63 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -788,10 +788,21 @@ static void ipa_id_get_account_info_orig_done(struct tevent_req *subreq)
         goto fail;
     }
 
+    class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCLASS,
+                                        NULL);
+    if (class == NULL) {
+        DEBUG(SSSDBG_CRIT_FAILURE, "Cannot find an objectclass.\n");
+        ret = EINVAL;
+        goto fail;
+    }
+
+
     if (state->ipa_ctx->view_name != NULL &&
             strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) != 0) {
 
-        if ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_GROUP) {
+        if ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_GROUP
+                || ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_BY_UUID
+                        && strcmp(class, SYSDB_GROUP_CLASS) == 0)) {
             /* check for ghost members because ghost members are not allowed
              * if a view other than the default view is applied.*/
             state->ghosts = ldb_msg_find_element(state->obj_msg, SYSDB_GHOST);
@@ -838,14 +849,6 @@ static void ipa_id_get_account_info_orig_done(struct tevent_req *subreq)
         tevent_req_set_callback(subreq, ipa_id_get_account_info_done, req);
         return;
     } else {
-        class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCLASS,
-                                            NULL);
-        if (class == NULL) {
-            DEBUG(SSSDBG_CRIT_FAILURE, "Cannot find an objectclass.\n");
-            ret = EINVAL;
-            goto fail;
-        }
-
         if (strcmp(class, SYSDB_USER_CLASS) == 0) {
             type = SYSDB_MEMBER_USER;
         } else {
-- 
2.1.0



More information about the sssd-devel mailing list