dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0194-IPA-idviews-check-if-view-name-is-set.patch

b725e7
From 4127df0800a5d4be30fa28ee01df6e68aedc5aa4 Mon Sep 17 00:00:00 2001
b725e7
From: Sumit Bose <sbose@redhat.com>
b725e7
Date: Tue, 17 Mar 2015 11:08:05 +0100
b725e7
Subject: [PATCH 194/194] IPA idviews: check if view name is set
b725e7
b725e7
When working with older FreeIPA releases the view name might not always
b725e7
been set. This patch add checks to might sure it is only dereferenced
b725e7
when set.
b725e7
b725e7
Resolves https://fedorahosted.org/sssd/ticket/2604
b725e7
b725e7
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
b725e7
(cherry picked from commit 8be0cf3eea892e13410c13abb030322599ca1b4f)
b725e7
---
b725e7
 src/providers/ipa/ipa_s2n_exop.c | 5 ++++-
b725e7
 1 file changed, 4 insertions(+), 1 deletion(-)
b725e7
b725e7
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
b725e7
index 18f2a867df3ad705008537843ea94e38dab0006e..f546067fae4ff45f976885f3b650866b292a3b8a 100644
b725e7
--- a/src/providers/ipa/ipa_s2n_exop.c
b725e7
+++ b/src/providers/ipa/ipa_s2n_exop.c
b725e7
@@ -1027,7 +1027,8 @@ static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq)
b725e7
         goto fail;
b725e7
     }
b725e7
 
b725e7
-    if (strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
b725e7
+    if (state->ipa_ctx->view_name == NULL ||
b725e7
+            strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
b725e7
         ret = ipa_s2n_get_fqlist_save_step(req);
b725e7
         if (ret == EOK) {
b725e7
             tevent_req_done(req);
b725e7
@@ -1602,6 +1603,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
b725e7
     }
b725e7
 
b725e7
     if (ret == ENOENT
b725e7
+            || state->ipa_ctx->view_name == NULL
b725e7
             || strcmp(state->ipa_ctx->view_name,
b725e7
                       SYSDB_DEFAULT_VIEW_NAME) == 0) {
b725e7
         ret = ipa_s2n_save_objects(state->dom, state->req_input, state->attrs,
b725e7
@@ -2211,6 +2213,7 @@ static void ipa_s2n_get_fqlist_done(struct tevent_req  *subreq)
b725e7
     }
b725e7
 
b725e7
     if (state->override_attrs == NULL
b725e7
+            && state->ipa_ctx->view_name != NULL
b725e7
             && strcmp(state->ipa_ctx->view_name,
b725e7
                       SYSDB_DEFAULT_VIEW_NAME) != 0) {
b725e7
         subreq = ipa_get_ad_override_send(state, state->ev,
b725e7
-- 
b725e7
2.1.0
b725e7