diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-09 12:43:06 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-09 19:23:09 -0400 |
commit | 312818233ce48471c56d1a7589579892d9726e3b (patch) | |
tree | d080a3d6d90cda4305b779ffcd2ba6a4bc79ff89 /src/responder/nss/nsssrv_cmd.c | |
parent | f6dbb235373b122ae15643ef5dbbe821ee1307d9 (diff) | |
download | sssd-312818233ce48471c56d1a7589579892d9726e3b.tar.gz sssd-312818233ce48471c56d1a7589579892d9726e3b.tar.bz2 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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index d448fa85..263499bf 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) { |