summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-12-01 23:00:06 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-12-08 10:46:38 +0100
commit1b4bd7e378deda73a18d86e4b2998bff45883e7b (patch)
tree1eb9859909b02536ffd11cc09e2fc3584adf7f22
parentb02eda90e9c6d6666af55041b1b12f5ac2f47b73 (diff)
downloadsssd-1b4bd7e378deda73a18d86e4b2998bff45883e7b.tar.gz
sssd-1b4bd7e378deda73a18d86e4b2998bff45883e7b.tar.xz
sssd-1b4bd7e378deda73a18d86e4b2998bff45883e7b.zip
IFP: Return group names with the right case
The IFP code wasn't honoring the case settings of the domain. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/responder/ifp/ifpsrv_cmd.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/responder/ifp/ifpsrv_cmd.c b/src/responder/ifp/ifpsrv_cmd.c
index 3b7442233..49792f53c 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]);
}