Blame SOURCES/0104-ipa-server-mode-use-lower-case-user-name-for-home-di.patch

2fc102
From 3b8640e8ef5cbcf934cdd6f42e9f6d956ca47395 Mon Sep 17 00:00:00 2001
2fc102
From: Sumit Bose <sbose@redhat.com>
2fc102
Date: Mon, 3 Mar 2014 12:40:43 +0100
2fc102
Subject: [PATCH 104/104] ipa-server-mode: use lower-case user name for home
2fc102
 dir
2fc102
2fc102
In older IPA server versions where the AD users where looked up by
2fc102
winbind the user name component of the home directory path was always
2fc102
lower case.  This still holds for IPA clients as well. To avoid
2fc102
regression this patch makes the user name component lower case as well.
2fc102
2fc102
Fixes https://fedorahosted.org/sssd/ticket/2263
2fc102
2fc102
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
2fc102
(cherry picked from commit 48b1db73639135dd4a15ee153f958c912836c621)
2fc102
---
2fc102
 src/providers/ipa/ipa_subdomains_id.c | 11 ++++++++++-
2fc102
 1 file changed, 10 insertions(+), 1 deletion(-)
2fc102
2fc102
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
2fc102
index 637dd61f9f272eb4ac4ecb8368d2210801bb0373..00993c496c1d100b37a780828c81492c2fac6157 100644
2fc102
--- a/src/providers/ipa/ipa_subdomains_id.c
2fc102
+++ b/src/providers/ipa/ipa_subdomains_id.c
2fc102
@@ -358,6 +358,7 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom,
2fc102
 {
2fc102
     errno_t ret;
2fc102
     char *name;
2fc102
+    char *lc_name;
2fc102
     const char *homedir;
2fc102
     TALLOC_CTX *tmp_ctx;
2fc102
 
2fc102
@@ -372,7 +373,15 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom,
2fc102
         goto done;
2fc102
     }
2fc102
 
2fc102
-    homedir = expand_homedir_template(tmp_ctx, dom->subdomain_homedir, name,
2fc102
+    /* To be compatible with the old winbind based user lookups and IPA
2fc102
+     * clients the user name in the home directory path will be lower-case. */
2fc102
+    lc_name = sss_tc_utf8_str_tolower(tmp_ctx, name);
2fc102
+    if (lc_name == NULL) {
2fc102
+        ret =ENOMEM;
2fc102
+        goto done;
2fc102
+    }
2fc102
+
2fc102
+    homedir = expand_homedir_template(tmp_ctx, dom->subdomain_homedir, lc_name,
2fc102
                                       uid, NULL, dom->name, dom->flat_name);
2fc102
 
2fc102
     if (homedir == NULL) {
2fc102
-- 
2fc102
1.8.5.3
2fc102