summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2013-02-07 13:04:24 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 19:36:12 +0100
commit2cbb879c517f2c756a2eb3962527979bac01ddab (patch)
tree882adf430f134d30d4c34a8368a47e19f229f3f3 /src/responder
parentfa551077410019fb34460dc730950e93b62b2963 (diff)
downloadsssd-2cbb879c517f2c756a2eb3962527979bac01ddab.tar.gz
sssd-2cbb879c517f2c756a2eb3962527979bac01ddab.tar.bz2
sssd-2cbb879c517f2c756a2eb3962527979bac01ddab.zip
NSS: Add original homedir to home directory template options
https://fedorahosted.org/sssd/ticket/1805
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv_cmd.c11
-rw-r--r--src/responder/pac/pacsrv_utils.c2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index b2dae4a3..5ac1bacc 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -176,28 +176,29 @@ static const char *get_homedir_override(TALLOC_CTX *mem_ctx,
{
const char *homedir;
+ homedir = ldb_msg_find_attr_as_string(msg, SYSDB_HOMEDIR, NULL);
+
/* Check whether we are unconditionally overriding the server
* for home directory locations.
*/
if (dom->override_homedir) {
return expand_homedir_template(mem_ctx, dom->override_homedir,
- name, uid, dom->name);
+ name, uid, homedir, dom->name);
} else if (nctx->override_homedir) {
return expand_homedir_template(mem_ctx, nctx->override_homedir,
- name, uid, dom->name);
+ name, uid, homedir, dom->name);
}
- homedir = ldb_msg_find_attr_as_string(msg, SYSDB_HOMEDIR, NULL);
if (!homedir || *homedir == '\0') {
/* In the case of a NULL or empty homedir, check to see if
* we have a fallback homedir to use.
*/
if (dom->fallback_homedir) {
return expand_homedir_template(mem_ctx, dom->fallback_homedir,
- name, uid, dom->name);
+ name, uid, homedir, dom->name);
} else if (nctx->fallback_homedir) {
return expand_homedir_template(mem_ctx, nctx->fallback_homedir,
- name, uid, dom->name);
+ name, uid, homedir, dom->name);
}
}
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c
index 202f7ba3..f5649724 100644
--- a/src/responder/pac/pacsrv_utils.c
+++ b/src/responder/pac/pacsrv_utils.c
@@ -808,7 +808,7 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx,
if (dom->subdomain_homedir) {
pwd->pw_dir = expand_homedir_template(pwd, dom->subdomain_homedir,
- lname, pwd->pw_uid,
+ lname, pwd->pw_uid, NULL,
dom->name);
if (pwd->pw_dir == NULL) {
ret = ENOMEM;