summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa/ipa_id.c
diff options
context:
space:
mode:
authorMichal Židek <mzidek@redhat.com>2015-06-24 18:03:49 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-07-02 13:37:38 +0200
commit9ac2a33f4cdc4941fa63118dcffe8058854f33c4 (patch)
tree1bd6b931f0f7938dddb78cf43a93efca41a7fe6a /src/providers/ipa/ipa_id.c
parentb08b6a994dcca108bb571458da092e0e320ce9c2 (diff)
downloadsssd-9ac2a33f4cdc4941fa63118dcffe8058854f33c4.tar.gz
sssd-9ac2a33f4cdc4941fa63118dcffe8058854f33c4.tar.xz
sssd-9ac2a33f4cdc4941fa63118dcffe8058854f33c4.zip
views: Add is_default_view helper function
Ticket: https://fedorahosted.org/sssd/ticket/2641 Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/providers/ipa/ipa_id.c')
-rw-r--r--src/providers/ipa/ipa_id.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 24dfe32b1..e81ccb34d 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -445,7 +445,7 @@ static void ipa_initgr_get_overrides_override_done(struct tevent_req *subreq)
return;
}
- if (strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
+ if (is_default_view(state->ipa_ctx->view_name)) {
ret = sysdb_apply_default_override(state->user_dom, override_attrs,
state->groups[state->group_idx]->dn);
} else {
@@ -634,10 +634,8 @@ ipa_id_get_account_info_send(TALLOC_CTX *memctx, struct tevent_context *ev,
* - there is no view set of it is the default view
* - if the EXTRA_INPUT_MAYBE_WITH_VIEW flag is not set
*/
- if (state->ipa_ctx->view_name == NULL
+ if (is_default_view(state->ipa_ctx->view_name)
|| state->ar->filter_type == BE_FILTER_SECID
- || strcmp(state->ipa_ctx->view_name,
- SYSDB_DEFAULT_VIEW_NAME) == 0
|| state->ar->extra_value == NULL
|| strcmp(state->ar->extra_value,
EXTRA_INPUT_MAYBE_WITH_VIEW) != 0 ) {
@@ -842,8 +840,7 @@ static void ipa_id_get_account_info_orig_done(struct tevent_req *subreq)
}
- if (state->ipa_ctx->view_name != NULL &&
- strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) != 0) {
+ if (!is_default_view(state->ipa_ctx->view_name)) {
if ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_GROUP
|| ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_BY_UUID