summaryrefslogtreecommitdiffstats
path: root/src/confdb
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-05-09 11:07:31 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-05-09 19:23:09 -0400
commitf6dbb235373b122ae15643ef5dbbe821ee1307d9 (patch)
tree4372f8a2e91c05a7437a278273d4f392ed29737f /src/confdb
parent163a17f00c42f2405d8fb0a2af3bc9d8b7309260 (diff)
downloadsssd-f6dbb235373b122ae15643ef5dbbe821ee1307d9.tar.gz
sssd-f6dbb235373b122ae15643ef5dbbe821ee1307d9.tar.xz
sssd-f6dbb235373b122ae15643ef5dbbe821ee1307d9.zip
NSS: Add fallback_homedir option
This option is similar to override_homedir, except that it will take effect only for users that do not have an explicit home directory specified in LDAP. https://fedorahosted.org/sssd/ticket/1250
Diffstat (limited to 'src/confdb')
-rw-r--r--src/confdb/confdb.c20
-rw-r--r--src/confdb/confdb.h2
2 files changed, 18 insertions, 4 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 427101e9b..1c5e40cd1 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -949,10 +949,22 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
tmp = ldb_msg_find_attr_as_string(res->msgs[0],
CONFDB_NSS_OVERRIDE_HOMEDIR, NULL);
- domain->override_homedir = talloc_strdup(domain, tmp);
- if (!domain->name) {
- ret = ENOMEM;
- goto done;
+ if (tmp != NULL) {
+ domain->override_homedir = talloc_strdup(domain, tmp);
+ if (!domain->override_homedir) {
+ ret = ENOMEM;
+ goto done;
+ }
+ }
+
+ tmp = ldb_msg_find_attr_as_string(res->msgs[0],
+ CONFDB_NSS_FALLBACK_HOMEDIR, NULL);
+ if (tmp != NULL) {
+ domain->fallback_homedir = talloc_strdup(domain, tmp);
+ if (!domain->fallback_homedir) {
+ ret = ENOMEM;
+ goto done;
+ }
}
tmp = ldb_msg_find_attr_as_string(res->msgs[0],
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 5ec9f721c..c816d5334 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -81,6 +81,7 @@
#define CONFDB_NSS_FILTER_GROUPS "filter_groups"
#define CONFDB_NSS_PWFIELD "pwfield"
#define CONFDB_NSS_OVERRIDE_HOMEDIR "override_homedir"
+#define CONFDB_NSS_FALLBACK_HOMEDIR "fallback_homedir"
#define CONFDB_NSS_VETOED_SHELL "vetoed_shells"
#define CONFDB_NSS_ALLOWED_SHELL "allowed_shells"
#define CONFDB_NSS_SHELL_FALLBACK "shell_fallback"
@@ -192,6 +193,7 @@ struct sss_domain_info {
gid_t override_gid;
const char *override_homedir;
+ const char *fallback_homedir;
const char *subdomain_homedir;
uint32_t user_timeout;