diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2016-06-19 07:19:15 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-07-07 10:25:46 +0200 |
commit | accff8ebe158251b1d25a95b3b035fe7e08fd1ee (patch) | |
tree | 08537756662bcfd378ab00d4f6e926bf76bcaf6e /src/providers/ipa/ipa_subdomains_id.c | |
parent | 78f9a9d4a2725f1b2cb6e582c965b5e6f7bdff7d (diff) | |
download | sssd-accff8ebe158251b1d25a95b3b035fe7e08fd1ee.tar.gz sssd-accff8ebe158251b1d25a95b3b035fe7e08fd1ee.tar.xz sssd-accff8ebe158251b1d25a95b3b035fe7e08fd1ee.zip |
UTIL: expand_homedir_template manages usernames internally
expand_homedir_template() can be considered an outward-facing interface,
therefore the function and its input structure will accept the internal
name format and parse it internally into a username and domain
component.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/providers/ipa/ipa_subdomains_id.c')
-rw-r--r-- | src/providers/ipa/ipa_subdomains_id.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c index f06eff7a7..7e53dd8dd 100644 --- a/src/providers/ipa/ipa_subdomains_id.c +++ b/src/providers/ipa/ipa_subdomains_id.c @@ -742,7 +742,6 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom, const char *original, const char **_homedir) { errno_t ret; - const char *name; const char *homedir; TALLOC_CTX *tmp_ctx; struct sss_nss_homedir_ctx homedir_ctx; @@ -767,22 +766,11 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom, homedir_ctx.flatname = dom->flat_name; homedir_ctx.config_homedir_substr = dom->homedir_substr; homedir_ctx.original = original; - ret = sss_parse_name_const(tmp_ctx, dom->names, fqname, - NULL, &name); - if (ret != EOK) { - goto done; - } /* 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. */ - homedir_ctx.username = sss_tc_utf8_str_tolower(tmp_ctx, name); - if (homedir_ctx.username == NULL) { - ret = ENOMEM; - goto done; - } - homedir = expand_homedir_template(tmp_ctx, dom->subdomain_homedir, - &homedir_ctx); + false, &homedir_ctx); if (homedir == NULL) { DEBUG(SSSDBG_OP_FAILURE, "expand_homedir_template failed\n"); ret = ENOMEM; @@ -795,6 +783,7 @@ get_subdomain_homedir_of_user(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom, } *_homedir = talloc_steal(mem_ctx, homedir); + ret = EOK; done: talloc_free(tmp_ctx); return ret; |