diff options
author | Sumit Bose <sbose@redhat.com> | 2013-08-13 17:59:42 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-19 12:36:07 +0200 |
commit | 83b5a69a90dd74aaef01d48846a5504789a28317 (patch) | |
tree | 6861667d0db1b37233ac3e08cba2894dc5efc768 /src/providers/ipa | |
parent | a9a619a4adb00ee60973050297b1b1c57e275016 (diff) | |
download | sssd-83b5a69a90dd74aaef01d48846a5504789a28317.tar.gz sssd-83b5a69a90dd74aaef01d48846a5504789a28317.tar.bz2 sssd-83b5a69a90dd74aaef01d48846a5504789a28317.zip |
ipa_s2n_get_user_done: make sure ALIAS name is lower case
Fixes https://fedorahosted.org/sssd/ticket/1630
Diffstat (limited to 'src/providers/ipa')
-rw-r--r-- | src/providers/ipa/ipa_s2n_exop.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c index 53746ca9..d8506aaa 100644 --- a/src/providers/ipa/ipa_s2n_exop.c +++ b/src/providers/ipa/ipa_s2n_exop.c @@ -651,6 +651,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) struct sysdb_attrs *user_attrs = NULL; struct sysdb_attrs *group_attrs = NULL; char *name; + char *lc_name; char *realm; char *upn; struct berval *bv_req = NULL; @@ -766,7 +767,14 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) goto done; } - ret = sysdb_attrs_add_string(user_attrs, SYSDB_NAME_ALIAS, name); + lc_name = sss_tc_utf8_str_tolower(user_attrs, name); + if (lc_name == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n")); + ret = ENOMEM; + goto done; + } + + ret = sysdb_attrs_add_string(user_attrs, SYSDB_NAME_ALIAS, lc_name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); goto done; @@ -844,8 +852,16 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) goto done; } + lc_name = sss_tc_utf8_str_tolower(group_attrs, name); + if (lc_name == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, + ("Cannot convert name to lowercase\n")); + ret = ENOMEM; + goto done; + } + ret = sysdb_attrs_add_string(group_attrs, SYSDB_NAME_ALIAS, - name); + lc_name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); goto done; |