summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-08-28 12:33:13 +0200
committerKarolin Seeger <kseeger@samba.org>2015-10-05 09:41:29 +0200
commit26baf7ff19cebb062432b4772e10cb7d50178ebe (patch)
tree40cb57c351bdc7e939ce065a61693c5b89c46864 /source3
parent51eacb5d78793f8b7de7b9f573da636091d6aaf1 (diff)
downloadsamba-26baf7ff19cebb062432b4772e10cb7d50178ebe.tar.gz
winbind: Fix 100% loop
Thanks to "L.P.H. van Belle" <belle@bazuin.nl> for help in reproducing the issue. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11038 From the bug report: "With e551cdb37d3e re-applied the problem is gone with and without kerberos. Moreover, if correctly configured, sshd requests you to change your password at logon time, which then succeeds. The problem why I had this reverted was because I had not gone through the pain to correctly configure all the PAM services (in particular the "account" section), leading to sshd letting the user in when the password had to be changed." Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e551cdb37d3e8cfb155bc33f9b162761c8d60889) Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 2 00:16:29 CEST 2015 on sn-devel-104 (cherry picked from commit e524ab9f7ee9f4aff50dd5bc42312f9000bf1c6e)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/kerberos.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index e4bad749286..7fe864bf96e 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -48,6 +48,22 @@ kerb_prompter(krb5_context ctx, void *data,
{
if (num_prompts == 0) return 0;
+ if ((num_prompts == 2) &&
+ (prompts[0].type == KRB5_PROMPT_TYPE_NEW_PASSWORD) &&
+ (prompts[1].type == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN)) {
+ /*
+ * We don't want to change passwords here. We're
+ * called from heimal when the KDC returns
+ * KRB5KDC_ERR_KEY_EXPIRED, but at this point we don't
+ * have the chance to ask the user for a new
+ * password. If we return 0 (i.e. success), we will be
+ * spinning in the endless for-loop in
+ * change_password() in
+ * source4/heimdal/lib/krb5/init_creds_pw.c:526ff
+ */
+ return KRB5KDC_ERR_KEY_EXPIRED;
+ }
+
memset(prompts[0].reply->data, '\0', prompts[0].reply->length);
if (prompts[0].reply->length > 0) {
if (data) {