summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv_cmd.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-05-09 12:43:06 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-05-09 19:23:09 -0400
commit312818233ce48471c56d1a7589579892d9726e3b (patch)
treed080a3d6d90cda4305b779ffcd2ba6a4bc79ff89 /src/responder/nss/nsssrv_cmd.c
parentf6dbb235373b122ae15643ef5dbbe821ee1307d9 (diff)
downloadsssd-312818233ce48471c56d1a7589579892d9726e3b.tar.gz
sssd-312818233ce48471c56d1a7589579892d9726e3b.tar.xz
sssd-312818233ce48471c56d1a7589579892d9726e3b.zip
NSS: Add default_shell option
This option will allow administrators to set a default shell to be used if a user does not have one set in the identity provider. https://fedorahosted.org/sssd/ticket/1289
Diffstat (limited to 'src/responder/nss/nsssrv_cmd.c')
-rw-r--r--src/responder/nss/nsssrv_cmd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index d448fa859..263499bfe 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -161,7 +161,13 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx,
int i;
user_shell = ldb_msg_find_attr_as_string(msg, SYSDB_SHELL, NULL);
- if (!user_shell) return NULL;
+ if (!user_shell) {
+ /* Check whether there is a default shell specified */
+ if (nctx->default_shell) {
+ return talloc_strdup(mem_ctx, nctx->default_shell);
+ }
+ return NULL;
+ }
if (!nctx->allowed_shells && !nctx->vetoed_shells) return talloc_strdup(mem_ctx, user_shell);
if (nctx->vetoed_shells) {