[SSSD] [PATCH] ipa-server-mode: use lower-case user name for home dir

Sumit Bose sbose at redhat.com
Mon Mar 3 12:30:21 UTC 2014


Hi,

this patch fixes a regression in ipa-server-mode.

bye,
Sumit
-------------- next part --------------
From aa4d822ddaa0318d8cea80781d231cd88ca07e93 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Mon, 3 Mar 2014 12:40:43 +0100
Subject: [PATCH] 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
---
 src/providers/ipa/ipa_subdomains_id.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
index 84ea853..0adf806 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) {
-- 
1.8.3.1



More information about the sssd-devel mailing list