summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-03-17 11:08:05 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-17 15:48:35 +0100
commit4127df0800a5d4be30fa28ee01df6e68aedc5aa4 (patch)
treec181cdc078f15cf33e1bd3de47d4589427739c1b /src
parent1a04637d4c07762c44889963eb25a405d24397cf (diff)
downloadsssd-4127df0800a5d4be30fa28ee01df6e68aedc5aa4.tar.gz
sssd-4127df0800a5d4be30fa28ee01df6e68aedc5aa4.tar.xz
sssd-4127df0800a5d4be30fa28ee01df6e68aedc5aa4.zip
IPA idviews: check if view name is set
When working with older FreeIPA releases the view name might not always been set. This patch add checks to might sure it is only dereferenced when set. Resolves https://fedorahosted.org/sssd/ticket/2604 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 8be0cf3eea892e13410c13abb030322599ca1b4f)
Diffstat (limited to 'src')
-rw-r--r--src/providers/ipa/ipa_s2n_exop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index 18f2a867d..f546067fa 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -1027,7 +1027,8 @@ static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq)
goto fail;
}
- if (strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
+ if (state->ipa_ctx->view_name == NULL ||
+ strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
ret = ipa_s2n_get_fqlist_save_step(req);
if (ret == EOK) {
tevent_req_done(req);
@@ -1602,6 +1603,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
}
if (ret == ENOENT
+ || state->ipa_ctx->view_name == NULL
|| strcmp(state->ipa_ctx->view_name,
SYSDB_DEFAULT_VIEW_NAME) == 0) {
ret = ipa_s2n_save_objects(state->dom, state->req_input, state->attrs,
@@ -2211,6 +2213,7 @@ static void ipa_s2n_get_fqlist_done(struct tevent_req *subreq)
}
if (state->override_attrs == NULL
+ && state->ipa_ctx->view_name != NULL
&& strcmp(state->ipa_ctx->view_name,
SYSDB_DEFAULT_VIEW_NAME) != 0) {
subreq = ipa_get_ad_override_send(state, state->ev,