diff options
author | Sumit Bose <sbose@redhat.com> | 2014-03-03 12:40:43 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-03-03 21:52:52 +0100 |
commit | dd89da0ff1601e95c12c000e5c37e5883784e032 (patch) | |
tree | 5c4428c32765e762529c069d548feba0040b2022 /src | |
parent | 77cb1c56f13a41d1920efb2946db10a00ed63c9c (diff) | |
download | sssd-dd89da0ff1601e95c12c000e5c37e5883784e032.tar.gz sssd-dd89da0ff1601e95c12c000e5c37e5883784e032.tar.xz sssd-dd89da0ff1601e95c12c000e5c37e5883784e032.zip |
ipa-server-mode: use lower-case user name for home dir
In older IPA server versions where the AD users where looked up by
winbind the user name component of the home directory path was always
lower case. This still holds for IPA clients as well. To avoid
regression this patch makes the user name component lower case as well.
Fixes https://fedorahosted.org/sssd/ticket/2263
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 48b1db73639135dd4a15ee153f958c912836c621)
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ipa/ipa_subdomains_id.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c index 637dd61f9..00993c496 100644 --- a/src/providers/ipa/ipa_subdomains_id.c +++ b/src/providers/ipa/ipa_subdomains_id.c @@ -358,6 +358,7 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom, { errno_t ret; char *name; + char *lc_name; const char *homedir; TALLOC_CTX *tmp_ctx; @@ -372,7 +373,15 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom, goto done; } - homedir = expand_homedir_template(tmp_ctx, dom->subdomain_homedir, name, + /* To be compatible with the old winbind based user lookups and IPA + * clients the user name in the home directory path will be lower-case. */ + lc_name = sss_tc_utf8_str_tolower(tmp_ctx, name); + if (lc_name == NULL) { + ret =ENOMEM; + goto done; + } + + homedir = expand_homedir_template(tmp_ctx, dom->subdomain_homedir, lc_name, uid, NULL, dom->name, dom->flat_name); if (homedir == NULL) { |