summaryrefslogtreecommitdiff
path: root/src/confdb
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-07-19 15:50:52 -0400
committerJakub Hrozek <jhrozek@redhat.com>2012-07-20 20:21:19 +0200
commit695bca9d2f73096254308e0883fcc74b2631850e (patch)
treec3f6e7dae7c8e96bc2ae5b380e1946f9bad3b2ef /src/confdb
parent5f879ab8b6c1cefbc63e1c2303f79b09b6246ca3 (diff)
downloadsssd-695bca9d2f73096254308e0883fcc74b2631850e.tar.gz
sssd-695bca9d2f73096254308e0883fcc74b2631850e.tar.bz2
sssd-695bca9d2f73096254308e0883fcc74b2631850e.zip
NSS: Add override_shell option
If override_shell is specified in the [nss] section, all users managed by SSSD will have their shell set to this value. If it is specified in the [domain/DOMAINNAME] section, it will apply to only that domain (and override the [nss] value, if any). https://fedorahosted.org/sssd/ticket/1087
Diffstat (limited to 'src/confdb')
-rw-r--r--src/confdb/confdb.c10
-rw-r--r--src/confdb/confdb.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index ab0d0048..37a5758c 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -1064,6 +1064,16 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
}
}
+ tmp = ldb_msg_find_attr_as_string(res->msgs[0],
+ CONFDB_NSS_OVERRIDE_SHELL, NULL);
+ if (tmp != NULL) {
+ domain->override_shell = talloc_strdup(domain, tmp);
+ if (!domain->override_shell) {
+ ret = ENOMEM;
+ goto done;
+ }
+ }
+
ret = get_entry_as_bool(res->msgs[0], &domain->case_sensitive,
CONFDB_DOMAIN_CASE_SENSITIVE, true);
if(ret != EOK) {
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 6f6b730a..d06ec7a3 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -87,6 +87,7 @@
#define CONFDB_NSS_PWFIELD "pwfield"
#define CONFDB_NSS_OVERRIDE_HOMEDIR "override_homedir"
#define CONFDB_NSS_FALLBACK_HOMEDIR "fallback_homedir"
+#define CONFDB_NSS_OVERRIDE_SHELL "override_shell"
#define CONFDB_NSS_VETOED_SHELL "vetoed_shells"
#define CONFDB_NSS_ALLOWED_SHELL "allowed_shells"
#define CONFDB_NSS_SHELL_FALLBACK "shell_fallback"
@@ -207,6 +208,7 @@ struct sss_domain_info {
const char *override_homedir;
const char *fallback_homedir;
const char *subdomain_homedir;
+ const char *override_shell;
uint32_t user_timeout;
uint32_t group_timeout;