Closed jkbremer closed 4 years ago
Yes, this is explicitly documented in the man page:
This option is only supported when pam-krb5 is built with MIT
Kerberos. If built against Heimdal, this option does nothing and
normal expired password change handling still happens. (Heimdal is
missing the required API to implement this option, at least as of
version 1.6.)
defer_pwchange
cannot currently be implemented with Heimdal because Heimdal is missing a required API. This has been fixed in Heimdal master, but has not yet been included in a release. See https://github.com/heimdal/heimdal/issues/322.
The last time I looked at this, I didn't see a good workaround, so I decided to wait for a new Heimdal release. I'm not sure if there is some variation of your patch that might work, but the patch as proposed doesn't; see all of the test failures shown below.
I rebuilt heimdal with the patch you mentioned and it works like a charm. :) Thank your for your help and your fast reply.
Hello,
We noticed that authenticating with libpam-krb5 prompts for changing the passwords of users with expired passwords, when it should not prompt. This happens in auth.c when password_auth() calls krb5_get_init_creds_password(). Because "pamk5_prompter_krb5" is passed with krb5_get_init_creds_password(), heimdal will prompt for a password change.
The case "retval == KRB5KDC_ERR_KEY_EXP" is never reached, because heimdal returns 0 if the password is expired and reset successfully.
By consequence, pamret can never be PAM_NEW_AUTHTOK_REQD.
As a result, this breaks the options "defer_pwchange" and "force_pwchange" since this code path is not reached:
If "NULL" instead of "pamk5_prompter_krb5" is passed, the expired password is not reset and KRB5KDC_ERR_KEY_EXP is returned by heimdal.