summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-08-01 06:49:59 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-08-14 16:04:24 +0200
commitdb4d659f52009e24d082f1f8b8a9fe526ce0dac6 (patch)
treea79eff3786b65df12148e1b379afe26973a2008f
parent0cf7a46067e6cd48d1084e7ec695c2fa46cc3233 (diff)
downloadsssd-db4d659f52009e24d082f1f8b8a9fe526ce0dac6.tar.gz
sssd-db4d659f52009e24d082f1f8b8a9fe526ce0dac6.tar.xz
sssd-db4d659f52009e24d082f1f8b8a9fe526ce0dac6.zip
PAM: Use the override_space option
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 <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 0fcc9ed1c66bed7ef3a0bcd6c517280a82391d2b)
-rw-r--r--src/responder/pam/pamsrv_cmd.c8
1 files changed, 8 insertions, 0 deletions
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