summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-01-14 11:10:25 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-01-15 17:15:44 +0100
commitd57529a867940e83ed27f8c2326bde7f07db7b9a (patch)
tree50990150d9cb6946f23332a11ef56fb6b7d5092c /src/responder
parentc373732505c9a73a9a8b17533dafc618c95ea331 (diff)
downloadsssd-d57529a867940e83ed27f8c2326bde7f07db7b9a.tar.gz
sssd-d57529a867940e83ed27f8c2326bde7f07db7b9a.tar.xz
sssd-d57529a867940e83ed27f8c2326bde7f07db7b9a.zip
NSS: Use plain user name when expanding homedir
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv_cmd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 0b02bf6e8..2e2d7c86a 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -172,13 +172,24 @@ static const char *get_homedir_override(TALLOC_CTX *mem_ctx,
struct ldb_message *msg,
struct nss_ctx *nctx,
struct sss_domain_info *dom,
- const char *name,
+ const char *orig_name,
uint32_t uid)
{
const char *homedir;
+ char *name;
+ char *domname;
+ errno_t ret;
homedir = ldb_msg_find_attr_as_string(msg, SYSDB_HOMEDIR, NULL);
+ /* Subdomain users store FQDN in their name attribute */
+ ret = sss_parse_name(mem_ctx, dom->names, orig_name, &domname, &name);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("Could not parse [%s] into "
+ "name-value components.\n", orig_name));
+ return NULL;
+ }
+
/* Check whether we are unconditionally overriding the server
* for home directory locations.
*/