From e88d426def412c0dde83e15fe17cdf374ee70166 Mon Sep 17 00:00:00 2001 From: Denis Kutin Date: Sat, 16 Nov 2013 16:48:21 +0400 Subject: NSS: Possibility to use any shells in 'allowed_shells' Resolves: https://fedorahosted.org/sssd/ticket/2219 Signed-off-by: Pavel Reichl Reviewed-by: Jakub Hrozek Reviewed-by: Pavel Reichl --- src/responder/nss/nsssrv_cmd.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/responder/nss') diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 616f83dda..4ec99c153 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -284,12 +284,19 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, } if (nctx->allowed_shells) { - for (i=0; nctx->allowed_shells[i]; i++) { - if (strcmp(nctx->allowed_shells[i], user_shell) == 0) { - DEBUG(SSSDBG_FUNC_DATA, - "The shell '%s' is allowed but does not exist. " - "Using fallback\n", user_shell); - return talloc_strdup(mem_ctx, nctx->shell_fallback); + if (strcmp(nctx->allowed_shells[0], "*") == 0) { + DEBUG(SSSDBG_FUNC_DATA, + "The shell '%s' is allowed but does not exist. " + "Using fallback\n", user_shell); + return talloc_strdup(mem_ctx, nctx->shell_fallback); + } else { + for (i=0; nctx->allowed_shells[i]; i++) { + if (strcmp(nctx->allowed_shells[i], user_shell) == 0) { + DEBUG(SSSDBG_FUNC_DATA, + "The shell '%s' is allowed but does not exist. " + "Using fallback\n", user_shell); + return talloc_strdup(mem_ctx, nctx->shell_fallback); + } } } } -- cgit