From db4d659f52009e24d082f1f8b8a9fe526ce0dac6 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 1 Aug 2014 06:49:59 +0200 Subject: PAM: Use the override_space option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://fedorahosted.org/sssd/ticket/2397 When using the override_default_space option, this patch allows to log in using both the original name (space user) as well as the normalized name (space_user). Reviewed-by: Pavel Březina Reviewed-by: Lukáš Slebodník (cherry picked from commit 0fcc9ed1c66bed7ef3a0bcd6c517280a82391d2b) --- src/responder/pam/pamsrv_cmd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index b0ba6222a..9562ab78b 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -947,6 +947,14 @@ static int pam_check_user_search(struct pam_auth_req *preq) return ENOMEM; } + name = sss_reverse_replace_space(preq, name, + pctx->rctx->override_space); + if (name == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, + "sss_reverse_replace_space failed\n"); + return ENOMEM; + } + /* Refresh the user's cache entry on any PAM query * We put a timeout in the client context so that we limit * the number of updates within a reasonable timeout -- cgit