From 1b4bd7e378deda73a18d86e4b2998bff45883e7b Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 1 Dec 2014 23:00:06 +0100 Subject: IFP: Return group names with the right case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IFP code wasn't honoring the case settings of the domain. Reviewed-by: Pavel Březina --- src/responder/ifp/ifpsrv_cmd.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/responder/ifp/ifpsrv_cmd.c b/src/responder/ifp/ifpsrv_cmd.c index 3b744223..49792f53 100644 --- a/src/responder/ifp/ifpsrv_cmd.c +++ b/src/responder/ifp/ifpsrv_cmd.c @@ -370,6 +370,7 @@ ifp_user_get_groups_reply(struct sss_domain_info *domain, int i, num; const char *name; const char **groupnames; + const char *tmpstr; /* one less, the first one is the user entry */ num = res->count - 1; @@ -388,15 +389,24 @@ ifp_user_get_groups_reply(struct sss_domain_info *domain, } if (ireq->ifp_ctx->rctx->override_space != '\0') { - groupnames[i] = sss_replace_space(groupnames, name, - ireq->ifp_ctx->rctx->override_space); - if (groupnames[i] == NULL) { + tmpstr = sss_replace_space(ireq, name, + ireq->ifp_ctx->rctx->override_space); + if (tmpstr == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, "Cannot normalize %s\n", name); continue; } } else { - groupnames[i] = name; + tmpstr = name; } + + groupnames[i] = sss_get_cased_name(groupnames, tmpstr, + domain->case_preserve); + if (groupnames[i] == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, + "sss_get_cased_name failed, skipping\n"); + continue; + } + DEBUG(SSSDBG_TRACE_FUNC, "Adding group %s\n", groupnames[i]); } -- cgit